Skip to content

Commit

Permalink
Should apply level hierarchy #64
Browse files Browse the repository at this point in the history
  • Loading branch information
CAndresH committed Apr 13, 2020
1 parent 77dd450 commit 1803ff0
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 11 deletions.
36 changes: 31 additions & 5 deletions SELI-Platform/imports/components/course/items/TextItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import MenuItem from './MenuItem';
import Code from '../../tools/Code';
import DragItem from './DragItem'
import Divider from '@material-ui/core/Divider';

export default class TextItem extends React.Component {
constructor(props) {
super(props);
Expand All @@ -19,13 +20,38 @@ export default class TextItem extends React.Component {
return(
<div className="content-box">
<div className="text-content-item">

{console.log(" this.props.item.attributes", this.props.item.attributes)}
{
this.props.item.attributes.type === 'title' ?
<h2 className="text-item-title" style={{textAlign: this.props.item.attributes.alignment, fontSize: this.props.item.attributes.size}}>
{this.props.item.attributes.content}
</h2>
:
undefined
<div>
{
this.props.item.attributes.size==="1.5em"?
<h2 className="text-item-title" style={{textAlign: this.props.item.attributes.alignment, fontSize: this.props.item.attributes.size}}>
{this.props.item.attributes.content}
</h2>
:
undefined
}
{
this.props.item.attributes.size==="1.15em"?
<h3 className="text-item-title" style={{textAlign: this.props.item.attributes.alignment, fontSize: this.props.item.attributes.size}}>
{this.props.item.attributes.content}
</h3>
:
undefined
}
{
this.props.item.attributes.size==="0.9em"?
<h4 className="text-item-title" style={{textAlign: this.props.item.attributes.alignment, fontSize: this.props.item.attributes.size}}>
{this.props.item.attributes.content}
</h4>
:
undefined
}
</div>
:
undefined
}
{
this.props.item.attributes.type === 'section' ?
Expand Down
35 changes: 29 additions & 6 deletions SELI-Platform/imports/components/student/items/TextItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,36 @@ export default class TextItem extends React.Component {


<div className="text-content-item">
{
{
this.props.item.attributes.type === 'title' ?
<h2 className="text-item-title" style={{textAlign: this.props.item.attributes.alignment, fontSize: this.props.item.attributes.size}}>
{this.props.item.attributes.content}
</h2>
:
undefined
<div>
{
this.props.item.attributes.size==="1.5em"?
<h2 className="text-item-title" style={{textAlign: this.props.item.attributes.alignment, fontSize: this.props.item.attributes.size}}>
{this.props.item.attributes.content}
</h2>
:
undefined
}
{
this.props.item.attributes.size==="1.15em"?
<h3 className="text-item-title" style={{textAlign: this.props.item.attributes.alignment, fontSize: this.props.item.attributes.size}}>
{this.props.item.attributes.content}
</h3>
:
undefined
}
{
this.props.item.attributes.size==="0.9em"?
<h4 className="text-item-title" style={{textAlign: this.props.item.attributes.alignment, fontSize: this.props.item.attributes.size}}>
{this.props.item.attributes.content}
</h4>
:
undefined
}
</div>
:
undefined
}

{
Expand Down

0 comments on commit 1803ff0

Please sign in to comment.