Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(explorer): fix selected network style #4550

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/explorer/src/components/network/NetworkSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,12 @@ export function NetworkSelector(): JSX.Element {
key={idx}
onClick={() => handleNetworkSwitch(network.id)}
hideBottomBorder
isHighlighted={network === selectedNetwork}
>
<div className="flex items-center gap-2">
<CheckmarkFilled
className={cx('flex-shrink-0', {
'text-success': network === selectedNetwork,
'text-primary-30': network === selectedNetwork,
'text-gray-45': network !== selectedNetwork,
})}
/>
Expand Down
10 changes: 9 additions & 1 deletion apps/ui-kit/src/lib/components/atoms/list-item/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export interface ListItemProps {
* The list item is disabled or not.
*/
isDisabled?: boolean;
/**
* The list item is highlighted.
*/
isHighlighted?: boolean;
}

export function ListItem({
Expand All @@ -31,6 +35,7 @@ export function ListItem({
onClick,
isDisabled,
children,
isHighlighted,
}: PropsWithChildren<ListItemProps>): React.JSX.Element {
function handleKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {
if ((event.key === 'Enter' || event.key === ' ') && !isDisabled && onClick) {
Expand Down Expand Up @@ -63,7 +68,10 @@ export function ListItem({
className={cx(
'relative flex flex-row items-center justify-between px-md py-sm text-neutral-10 dark:text-neutral-92',
!isDisabled && onClick ? 'cursor-pointer' : 'cursor-default',
{ 'state-layer': !isDisabled },
{
'bg-shader-primary-dark-16 dark:bg-shader-inverted-dark-16': isHighlighted,
'state-layer': !isDisabled,
},
)}
>
{children}
Expand Down
Loading