on df0c310 help sign in
bridge/src/views/Activate/ActivateButton.tsx
45 lines 991 B history raw
1import { Button } from '@tlon/indigo-react';
2import { MouseEventHandler } from 'react';
3import withFadeable from './withFadeable';
5interface ActivateButtonProps {
6 children: React.ReactNode | string;
7 onClick: MouseEventHandler;
8 disabled?: boolean;
9 success?: boolean;
12const ActivateButton = ({
13 children,
14 onClick,
15 disabled = false,
16 success = false,
17 ...rest
18}: ActivateButtonProps & React.ComponentPropsWithoutRef<'button'>) => {
19 const backgroundColor = disabled
20 ? 'rgba(0,0,0,0.2)'
21 : success
22 ? '#009F65'
23 : 'black';
25 return (
26 <Button
27 onClick={onClick}
28 backgroundColor={backgroundColor}
29 color={'white'}
30 padding={'16px'}
31 fontFamily="Inter"
32 height={'40px'}
33 fontWeight={'400'}
34 fontSize={'14px'}
35 borderRadius={'4px'}
36 disabled={disabled}
37 {...rest}>
38 {children}
39 </Button>
40 );
41};
43export default ActivateButton;
45export const FadeableActivateButton = withFadeable(ActivateButton);