Skip to content

Commit

Permalink
Fix button type typescript (#473)
Browse files Browse the repository at this point in the history
* Fix button type typescript

* Fix theme not apply on button
  • Loading branch information
0xycvv authored Mar 19, 2019
1 parent 886f894 commit 3a9bb90
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/button/src/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@ export interface ButtonProps extends BoxProps {
}

export const Button = styled('button').attrs(props => ({
type: 'button',
className: cn('vital__button', props.className),
theme: defaultTheme,
nature: 'default' as Nature,
size: 'medium' as ButtonSize,
selected: false,
disabled: false,
}))<ButtonProps>`
position: relative;
Expand Down Expand Up @@ -76,3 +73,8 @@ export const Button = styled('button').attrs(props => ({
${boxStyle};
${props => props.theme.button.buttonStyle};
`;

Button.defaultProps = {
type: 'button',
theme: defaultTheme,
};

0 comments on commit 3a9bb90

Please sign in to comment.