aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/ui
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-06-22 03:09:38 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-06-22 03:09:38 +0800
commiteb494f78fa04bb4e6eece27a810e17e665d3a31e (patch)
tree27c7814e4d7fcffc7207603775d813c5cb1f6154 /packages/website/ts/components/ui
parentd963941be03596d9030dca8788ad26c09b98822d (diff)
downloaddexon-0x-contracts-eb494f78fa04bb4e6eece27a810e17e665d3a31e.tar
dexon-0x-contracts-eb494f78fa04bb4e6eece27a810e17e665d3a31e.tar.gz
dexon-0x-contracts-eb494f78fa04bb4e6eece27a810e17e665d3a31e.tar.bz2
dexon-0x-contracts-eb494f78fa04bb4e6eece27a810e17e665d3a31e.tar.lz
dexon-0x-contracts-eb494f78fa04bb4e6eece27a810e17e665d3a31e.tar.xz
dexon-0x-contracts-eb494f78fa04bb4e6eece27a810e17e665d3a31e.tar.zst
dexon-0x-contracts-eb494f78fa04bb4e6eece27a810e17e665d3a31e.zip
Buttons look hella disabled now
Diffstat (limited to 'packages/website/ts/components/ui')
-rw-r--r--packages/website/ts/components/ui/button.tsx16
1 files changed, 12 insertions, 4 deletions
diff --git a/packages/website/ts/components/ui/button.tsx b/packages/website/ts/components/ui/button.tsx
index cb542a386..02fa47480 100644
--- a/packages/website/ts/components/ui/button.tsx
+++ b/packages/website/ts/components/ui/button.tsx
@@ -1,5 +1,5 @@
import { colors } from '@0xproject/react-shared';
-import { darken, grayscale } from 'polished';
+import { darken, saturate } from 'polished';
import * as React from 'react';
import { styled } from 'ts/style/theme';
@@ -17,7 +17,7 @@ export interface ButtonProps {
}
const PlainButton: React.StatelessComponent<ButtonProps> = ({ children, isDisabled, onClick, type, className }) => (
- <button type={type} className={className} onClick={isDisabled ? undefined : onClick}>
+ <button type={type} className={className} onClick={isDisabled ? undefined : onClick} disabled={isDisabled}>
{children}
</button>
);
@@ -26,14 +26,15 @@ export const Button = styled(PlainButton)`
cursor: ${props => (props.isDisabled ? 'default' : 'pointer')};
font-size: ${props => props.fontSize};
color: ${props => props.fontColor};
- transition: background-color 0.5s ease;
+ transition: background-color, opacity 0.5s ease;
padding: 0.8em 2.2em;
border-radius: 6px;
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.25);
font-weight: 500;
+ outline: none;
font-family: ${props => props.fontFamily};
width: ${props => props.width};
- background-color: ${props => (props.isDisabled ? grayscale(props.backgroundColor) : props.backgroundColor)};
+ background-color: ${props => props.backgroundColor};
border: ${props => (props.borderColor ? `1px solid ${props.borderColor}` : 'none')};
&:hover {
background-color: ${props => (!props.isDisabled ? darken(0.1, props.backgroundColor) : '')};
@@ -41,6 +42,13 @@ export const Button = styled(PlainButton)`
&:active {
background-color: ${props => (!props.isDisabled ? darken(0.2, props.backgroundColor) : '')};
}
+ &:disabled {
+ opacity: 0.5;
+ box-shadow: none;
+ }
+ &:focus {
+ background-color: ${props => saturate(0.2, props.backgroundColor)};
+ }
`;
Button.defaultProps = {