Skip to content

Commit

Permalink
Merge pull request #725 from jembi/fix/CU-86c0h813z-channels_action_menu
Browse files Browse the repository at this point in the history
fix: don't render empty menu items.
  • Loading branch information
drizzentic authored Dec 10, 2024
2 parents aff48fe + 15a2285 commit dc2fe8f
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions packages/channels-app/src/screens/manage.channels.screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,22 +275,18 @@ const ManageChannelsScreen: React.FC = () => {
<SearchIcon className={classes.actionsIcon} />
View Logs
</MenuItem>
<MenuItem onClick={onActionDisableChannel}>
{selectedChannel.status === 'enabled' && (
<>
<CancelIcon className={classes.actionsIcon} />
Disable Channel
</>
)}
</MenuItem>
<MenuItem onClick={onActionDisableChannel}>
{selectedChannel.status !== 'enabled' && (
<>
<EnableIcon className={classes.actionsIcon} />
Enable Channel
</>
)}
</MenuItem>
{selectedChannel.status === 'enabled' && (
<MenuItem onClick={onActionDisableChannel}>
<CancelIcon className={classes.actionsIcon} />
Disable Channel
</MenuItem>
)}
{selectedChannel.status !== 'enabled' && (
<MenuItem onClick={onActionDisableChannel}>
<EnableIcon className={classes.actionsIcon} />
Enable Channel
</MenuItem>
)}
</Menu>
)}
</BasePageTemplate>
Expand Down

0 comments on commit dc2fe8f

Please sign in to comment.