Skip to content

Commit

Permalink
fix: action prop warning (#3304)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzmp authored Feb 16, 2022
1 parent 79bdc0c commit da8884d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/components/ActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ const actionCss = css`
}
`

export const Overlay = styled(Row)<{ action?: boolean }>`
export const Overlay = styled(Row)<{ hasAction: boolean }>`
border-radius: ${({ theme }) => theme.borderRadius}em;
flex-direction: row-reverse;
min-height: 3.5em;
transition: padding 0.25s ease-out;
${({ action }) => action && actionCss}
${({ hasAction }) => hasAction && actionCss}
`

export interface Action {
Expand All @@ -72,7 +72,7 @@ export interface ActionButtonProps {
export default function ActionButton({ color = 'accent', disabled, action, onClick, children }: ActionButtonProps) {
const textColor = useMemo(() => (color === 'accent' && !disabled ? 'onAccent' : 'currentColor'), [color, disabled])
return (
<Overlay action={Boolean(action)} flex align="stretch">
<Overlay hasAction={Boolean(action)} flex align="stretch">
<StyledButton color={color} disabled={disabled} onClick={action ? action.onClick : onClick}>
<ThemedText.TransitionButton buttonSize={action ? 'medium' : 'large'} color={textColor}>
{action ? action.children : children}
Expand Down

0 comments on commit da8884d

Please sign in to comment.