Fixed "add program item" button showing while not editing
This commit is contained in:
parent
8fc64824c9
commit
5d3b633f52
@ -120,6 +120,15 @@ class ProgramSequenceView extends React.Component<{
|
|||||||
const { sequence, sections } = this.props;
|
const { sequence, sections } = this.props;
|
||||||
const editing = this.props.editing || false;
|
const editing = this.props.editing || false;
|
||||||
const className = classNames("programSequence", { editing });
|
const className = classNames("programSequence", { editing });
|
||||||
|
let addButton: React.ReactNode = null;
|
||||||
|
if (editing) {
|
||||||
|
addButton = (
|
||||||
|
<Button onClick={this.addItem}>
|
||||||
|
<Icon name="add"/>
|
||||||
|
Add item
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<ProgramSequenceList
|
<ProgramSequenceList
|
||||||
@ -133,10 +142,7 @@ class ProgramSequenceView extends React.Component<{
|
|||||||
onRemove={this.removeItem}
|
onRemove={this.removeItem}
|
||||||
onSortEnd={this.onSortEnd}
|
onSortEnd={this.onSortEnd}
|
||||||
/>
|
/>
|
||||||
<Button onClick={this.addItem}>
|
{addButton}
|
||||||
<Icon name="add"/>
|
|
||||||
Add item
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user