Skip to content

Commit

Permalink
Merge pull request #2803 from asashour/code-editor-enable/disable
Browse files Browse the repository at this point in the history
fix(code-editor): only one of enabled or disabled
  • Loading branch information
allardy committed Jan 13, 2020
2 parents ab15850 + f5ace23 commit a177992
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions modules/code-editor/src/views/full/FileNavigator.tsx
Expand Up @@ -190,20 +190,11 @@ class FileNavigator extends React.Component<Props, State> {
<MenuDivider />
<MenuItem id="btn-duplicate" icon="duplicate" text="Duplicate" onClick={() => this.props.duplicateFile(file)} />
<MenuDivider />
<MenuItem
id="btn-enable"
icon="endorsed"
text="Enable"
disabled={!isDisabled}
onClick={() => this.props.enableFile(file)}
/>
<MenuItem
id="btn-disable"
icon="disable"
text="Disable"
disabled={isDisabled}
onClick={() => this.props.disableFile(file)}
/>
{isDisabled ? (
<MenuItem id="btn-enable" icon="endorsed" text="Enable" onClick={() => this.props.enableFile(file)} />
) : (
<MenuItem id="btn-disable" icon="disable" text="Disable" onClick={() => this.props.disableFile(file)} />
)}
</Menu>,
{ left: e.clientX, top: e.clientY }
)
Expand Down

0 comments on commit a177992

Please sign in to comment.