123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import React from 'react';
- import {
- NormalButton,
- DisableButton,
- } from './styled';
- export type Props = {
- appearance?: 'default' | 'primary' | 'primary-hollow' | 'default-hollow' | 'link' | 'danger-link';
- id?: string;
- isDisabled?: boolean;
- onClick?: () => void;
- onBlur?: () => void;
- shouldFitContainer?: boolean;
- align?: 'left' | 'center' | 'right';
- children: React.ReactNode;
- style?: {};
- };
- const Button: React.FunctionComponent<Props> = ({
- children,
- isDisabled,
- ...rest
- }: Props): React.ReactElement => (
- isDisabled ? (
- <DisableButton>
- {children}
- </DisableButton>
- ) : (
- <NormalButton
- {...rest}
- >
- {children}
- </NormalButton>
- )
- );
- Button.defaultProps = {
- appearance: 'default',
- align: 'center',
- shouldFitContainer: false,
- isDisabled: false,
- };
- export default Button;
|