Skip to content

Commit

Permalink
feat: Add tooltip/title so function of icon buttons will be clear (#3154
Browse files Browse the repository at this point in the history
)

feat: Add tooltip/title for icon buttons
  • Loading branch information
devchenyan authored Jun 6, 2024
1 parent f6b48b8 commit 24624ee
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@
}

.actions {
display: flex;
gap: 16px;
& > svg {
cursor: pointer;
&[data-disabled='true'] {
cursor: not-allowed;
opacity: 50%;
}
margin-right: 16px;
}
}

Expand Down
44 changes: 26 additions & 18 deletions packages/neuron-ui/src/components/CellManagement/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,28 +186,36 @@ const getColumns = ({
const { locked, lockedReason } = item
return (
<div className={styles.actions}>
<DetailIcon onClick={onAction} data-action={Actions.View} data-index={index} />
<Tooltip tip={t('history.detail')} showTriangle placement="top">
<DetailIcon onClick={onAction} data-action={Actions.View} data-index={index} />
</Tooltip>
{locked ? (
<UnLock
data-disabled={!!lockedReason}
onClick={onAction}
data-action={Actions.Unlock}
data-index={index}
/>
<Tooltip tip={t('cell-manage.unlock')} showTriangle placement="top">
<UnLock
data-disabled={!!lockedReason}
onClick={onAction}
data-action={Actions.Unlock}
data-index={index}
/>
</Tooltip>
) : (
<LockCell
data-disabled={!!lockedReason}
onClick={onAction}
data-action={Actions.Lock}
<Tooltip tip={t('cell-manage.lock')} showTriangle placement="top">
<LockCell
data-disabled={!!lockedReason}
onClick={onAction}
data-action={Actions.Lock}
data-index={index}
/>
</Tooltip>
)}
<Tooltip tip={t('cell-manage.consume')} showTriangle placement="top">
<Consume
data-disabled={!!locked}
onClick={locked ? undefined : onAction}
data-action={Actions.Consume}
data-index={index}
/>
)}
<Consume
data-disabled={!!locked}
onClick={locked ? undefined : onAction}
data-action={Actions.Consume}
data-index={index}
/>
</Tooltip>
</div>
)
},
Expand Down

2 comments on commit 24624ee

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packaging for test is done in 9394235331

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packaging for test is done in 9394236342

Please sign in to comment.