fix buttons

This commit is contained in:
Steve Ruiz 2022-05-18 13:11:25 +01:00
parent fbb29c87b2
commit f281e123f8

View file

@ -10,6 +10,7 @@ export interface ToolButtonProps {
onDoubleClick?: () => void
disabled?: boolean
isActive?: boolean
isSponsor?: boolean
isToolLocked?: boolean
variant?: 'icon' | 'text' | 'circle' | 'primary'
children: React.ReactNode
@ -28,6 +29,7 @@ export const ToolButton = React.forwardRef<HTMLButtonElement, ToolButtonProps>(
isToolLocked = false,
disabled = false,
isActive = false,
isSponsor = false,
onKeyDown,
id,
...rest
@ -38,6 +40,7 @@ export const ToolButton = React.forwardRef<HTMLButtonElement, ToolButtonProps>(
<StyledToolButton
ref={ref}
isActive={isActive}
isSponsor={isSponsor}
variant={variant}
onClick={onClick}
disabled={disabled}
@ -208,6 +211,28 @@ export const StyledToolButton = styled('button', {
},
},
},
{
isActive: true,
css: {
[`${StyledToolButtonInner}`]: {
backgroundColor: '$selected',
color: '$selectedContrast',
},
},
},
{
isActive: false,
bp: 'small',
css: {
[`&:hover:not(:disabled) ${StyledToolButtonInner}`]: {
backgroundColor: '$hover',
border: '1px solid $panel',
},
[`&:focus:not(:disabled) ${StyledToolButtonInner}`]: {
backgroundColor: '$hover',
},
},
},
],
})