Skip to content

Commit

Permalink
move variant to commonStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
SebiVPS committed Jun 11, 2024
1 parent 43e8231 commit d70faf1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions site/src/components/common/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const disabledButtonVariantStyle: Record<ButtonVariant, ReturnType<typeof css>>
`,
};

const commonButtonStyle = css`
const commonButtonStyle = css<{ $variant: ButtonVariant }>`
display: inline-flex;
padding: ${({ theme }) => `${theme.spacing.S400} ${theme.spacing.S500}`};
border-radius: 4px;
Expand All @@ -95,11 +95,12 @@ const commonButtonStyle = css`
font-size: 16px;
font-weight: 700;
line-height: 110%;
${({ $variant }) => buttonVariantStyle[$variant]};
`;

const StyledAnchor = styled.a<{ $variant: ButtonVariant; $disabled: boolean }>`
${commonButtonStyle};
${({ $variant }) => buttonVariantStyle[$variant]};
${({ $variant, $disabled }) =>
$disabled &&
Expand All @@ -111,7 +112,6 @@ const StyledAnchor = styled.a<{ $variant: ButtonVariant; $disabled: boolean }>`

const StyledButton = styled.button<{ $variant: ButtonVariant }>`
${commonButtonStyle};
${({ $variant }) => buttonVariantStyle[$variant]};
&:disabled {
pointer-events: none;
Expand Down

0 comments on commit d70faf1

Please sign in to comment.