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 editing = this.props.editing || false;
|
||||
const className = classNames("programSequence", { editing });
|
||||
let addButton: React.ReactNode = null;
|
||||
if (editing) {
|
||||
addButton = (
|
||||
<Button onClick={this.addItem}>
|
||||
<Icon name="add"/>
|
||||
Add item
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<ProgramSequenceList
|
||||
@ -133,10 +142,7 @@ class ProgramSequenceView extends React.Component<{
|
||||
onRemove={this.removeItem}
|
||||
onSortEnd={this.onSortEnd}
|
||||
/>
|
||||
<Button onClick={this.addItem}>
|
||||
<Icon name="add"/>
|
||||
Add item
|
||||
</Button>
|
||||
{addButton}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user