-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2775a7f
commit 2da788b
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@import '@digitable-team/web-ui-components/src/scss/mixins'; | ||
|
||
.primary { | ||
border: 1px solid $color-white; | ||
border-radius: 6px; | ||
padding: 18px 40px; | ||
background: transparent; | ||
color: $color-base; | ||
} | ||
|
||
.success { | ||
border: 1px solid $color-base; | ||
border-radius: 50px; | ||
background: transparent; | ||
color: $color-base; | ||
|
||
&:hover { | ||
opacity: 0.9; | ||
} | ||
} | ||
|
||
.round { | ||
border-radius: 36px; | ||
} | ||
|
||
.disabled { | ||
color: $color-secondary; | ||
border-color: $color-secondary; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { ReactNode } from 'react' | ||
|
||
import cx from 'classnames' | ||
|
||
// eslint-disable-next-line css-modules/no-unused-class | ||
import css from './Button.styles.module.scss' | ||
|
||
export type ButtonProps = { | ||
isRounded?: boolean | ||
isDisabled?: boolean | ||
className?: string | ||
type: 'primary' | 'success' | ||
buttonType?: 'button' | 'submit' | 'reset' | ||
children?: ReactNode | string | ||
name?: string | ||
onClick?: () => void | ||
} | ||
|
||
export const Button = ({ | ||
isRounded, | ||
buttonType, | ||
type, | ||
name, | ||
children, | ||
isDisabled, | ||
className, | ||
onClick | ||
}: ButtonProps) => { | ||
return ( | ||
<button | ||
disabled={isDisabled} | ||
type={buttonType} | ||
role={name} | ||
name={name} | ||
onClick={onClick} | ||
className={cx(className, css[type], { | ||
[css.round]: isRounded, | ||
[css.disabled]: isDisabled | ||
})} | ||
> | ||
{children} | ||
</button> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Button' |