diff options
author | Francesco Agosti <francesco.agosti93@gmail.com> | 2018-10-27 02:14:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-27 02:14:00 +0800 |
commit | 4c5b26db183f8f9163e043f5dd4bb0ce60e3aa7f (patch) | |
tree | dbfc6614e901c44d32775b1fe69bb957706c9cf0 /packages/instant/src/components/ui/flex.tsx | |
parent | d2bf23de71bc2bdfaca14bd7026daa59ca5ef386 (diff) | |
parent | 30809e646be02025d6f9e9ed0ff214d9ace681c8 (diff) | |
download | dexon-0x-contracts-4c5b26db183f8f9163e043f5dd4bb0ce60e3aa7f.tar dexon-0x-contracts-4c5b26db183f8f9163e043f5dd4bb0ce60e3aa7f.tar.gz dexon-0x-contracts-4c5b26db183f8f9163e043f5dd4bb0ce60e3aa7f.tar.bz2 dexon-0x-contracts-4c5b26db183f8f9163e043f5dd4bb0ce60e3aa7f.tar.lz dexon-0x-contracts-4c5b26db183f8f9163e043f5dd4bb0ce60e3aa7f.tar.xz dexon-0x-contracts-4c5b26db183f8f9163e043f5dd4bb0ce60e3aa7f.tar.zst dexon-0x-contracts-4c5b26db183f8f9163e043f5dd4bb0ce60e3aa7f.zip |
Merge pull request #1175 from 0xProject/feature/instant/input-fees-rounding
[instant] Create a ScalingInput component and use it in the amount input and upgrade to styled-components v4
Diffstat (limited to 'packages/instant/src/components/ui/flex.tsx')
-rw-r--r-- | packages/instant/src/components/ui/flex.tsx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/packages/instant/src/components/ui/flex.tsx b/packages/instant/src/components/ui/flex.tsx index 327e91926..5fa3fc95b 100644 --- a/packages/instant/src/components/ui/flex.tsx +++ b/packages/instant/src/components/ui/flex.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import { ColorOption, styled } from '../../style/theme'; import { cssRuleIfExists } from '../../style/util'; @@ -9,21 +7,22 @@ export interface FlexProps { justify?: 'flex-start' | 'center' | 'space-around' | 'space-between' | 'space-evenly' | 'flex-end'; align?: 'flex-start' | 'center' | 'space-around' | 'space-between' | 'space-evenly' | 'flex-end'; width?: string; + height?: string; backgroundColor?: ColorOption; className?: string; } -const PlainFlex: React.StatelessComponent<FlexProps> = ({ children, className }) => ( - <div className={className}>{children}</div> -); - -export const Flex = styled(PlainFlex)` +export const Flex = + styled.div < + FlexProps > + ` display: flex; flex-direction: ${props => props.direction}; flex-wrap: ${props => props.flexWrap}; justify-content: ${props => props.justify}; align-items: ${props => props.align}; ${props => cssRuleIfExists(props, 'width')} + ${props => cssRuleIfExists(props, 'height')} background-color: ${props => (props.backgroundColor ? props.theme[props.backgroundColor] : 'none')}; `; |