diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-10-05 08:47:32 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-10-05 08:48:10 +0800 |
commit | 98f8c7749433e63d7fea3c4e932db1f251607e4d (patch) | |
tree | 7118d4d967079a1768539ae19d35b30f6ab42c26 /packages/instant/src/components/ui/button.tsx | |
parent | d9b7aa2e4ba088b4dda1b1d2956de5d267a0674e (diff) | |
download | dexon-0x-contracts-98f8c7749433e63d7fea3c4e932db1f251607e4d.tar.gz dexon-0x-contracts-98f8c7749433e63d7fea3c4e932db1f251607e4d.tar.zst dexon-0x-contracts-98f8c7749433e63d7fea3c4e932db1f251607e4d.zip |
Add BuyButton and other small improvement
Diffstat (limited to 'packages/instant/src/components/ui/button.tsx')
-rw-r--r-- | packages/instant/src/components/ui/button.tsx | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/packages/instant/src/components/ui/button.tsx b/packages/instant/src/components/ui/button.tsx index ec0a87345..1fcb2591c 100644 --- a/packages/instant/src/components/ui/button.tsx +++ b/packages/instant/src/components/ui/button.tsx @@ -4,11 +4,8 @@ import * as React from 'react'; import { ColorOption, styled } from '../../style/theme'; export interface ButtonProps { - fontColor: ColorOption; - backgroundColor: ColorOption; + backgroundColor?: ColorOption; borderColor?: ColorOption; - fontSize?: string; - fontFamily?: string; width?: string; padding?: string; type?: string; @@ -28,41 +25,36 @@ const darkenOnActiveAmount = 0.2; const saturateOnFocusAmount = 0.2; export const Button = styled(PlainButton)` cursor: ${props => (props.isDisabled ? 'default' : 'pointer')}; - font-size: ${props => props.fontSize}; - color: ${props => props.fontColor}; transition: background-color, opacity 0.5s ease; padding: ${props => props.padding}; - border-radius: 6px; - font-weight: 500; + border-radius: 3px; outline: none; - font-family: ${props => props.fontFamily}; width: ${props => props.width}; - background-color: ${props => props.backgroundColor}; + background-color: ${props => (props.backgroundColor ? props.theme[props.backgroundColor] : 'none')}; border: ${props => (props.borderColor ? `1px solid ${props.theme[props.borderColor]}` : 'none')}; &:hover { background-color: ${props => - !props.isDisabled ? darken(darkenOnHoverAmount, props.theme[props.backgroundColor]) : ''} !important; + !props.isDisabled + ? darken(darkenOnHoverAmount, props.theme[props.backgroundColor || 'white']) + : ''} !important; } &:active { background-color: ${props => - !props.isDisabled ? darken(darkenOnActiveAmount, props.theme[props.backgroundColor]) : ''}; + !props.isDisabled ? darken(darkenOnActiveAmount, props.theme[props.backgroundColor || 'white']) : ''}; } &:disabled { opacity: 0.5; } &:focus { - background-color: ${props => saturate(saturateOnFocusAmount, props.theme[props.backgroundColor])}; + background-color: ${props => saturate(saturateOnFocusAmount, props.theme[props.backgroundColor || 'white'])}; } `; Button.defaultProps = { - fontSize: '12px', - fontColor: ColorOption.white, backgroundColor: ColorOption.primaryColor, width: 'auto', - fontFamily: 'Inter UI', isDisabled: false, - padding: '0.8em 2.2em', + padding: '1em 2.2em', }; Button.displayName = 'Button'; |