Skip to content

Commit

Permalink
fix: highlight info icon when info popover is open
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardo committed Nov 21, 2024
1 parent 60a7a6e commit a0893ad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/DataDimension/ItemSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ const ItemSelector = ({
/* eslint-disable react/prop-types */
{...props}
active={isActive(props.value)}
showingInfo={currentDataItem?.id === props.value}
icon={getIcon(getItemType(props.value))}
dimensionType={getDimensionType({
type: getItemType(props.value),
Expand Down
5 changes: 4 additions & 1 deletion src/components/DataDimension/TransferOption.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const TransferOption = ({
dimensionType,
dataTest,
itemsRef,
showingInfo,

Check failure on line 20 in src/components/DataDimension/TransferOption.js

View workflow job for this annotation

GitHub Actions / unit

'showingInfo' is missing in props validation
onEditClick,
onInfoClick,
}) => {
Expand Down Expand Up @@ -63,7 +64,9 @@ export const TransferOption = ({
<div className={cx('group', 'nowrap', 'typeGroup')}>
<span className="type">{dimensionType}</span>
<span
className="info"
className={cx('info', {
active: showingInfo,
})}
ref={(node) => {
node
? itemsRef.current.set(value, node)
Expand Down
3 changes: 3 additions & 0 deletions src/components/DataDimension/styles/TransferOption.style.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export default css`
display: flex;
align-items: center;
}
.info.active {
background-color: ${colors.grey200};
}
.highlighted {
background: ${theme.secondary700};
Expand Down

0 comments on commit a0893ad

Please sign in to comment.