diff options
author | Steve Klebanoff <steve@0xproject.com> | 2018-11-08 09:40:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-08 09:40:35 +0800 |
commit | 771f8a6a6cff935631e8c6ebcdc012cdd3533de6 (patch) | |
tree | 2666ceb3a5868242d13c33a6f7b96eb52172593c /packages/instant/src/components/ui/flex.tsx | |
parent | 95b2898b9c0898c7e2d98ee603bff0604bf2a829 (diff) | |
parent | c6e7ad5a53a267dfe1ca6ecf2b9d2252fbad18ea (diff) | |
download | dexon-0x-contracts-771f8a6a6cff935631e8c6ebcdc012cdd3533de6.tar dexon-0x-contracts-771f8a6a6cff935631e8c6ebcdc012cdd3533de6.tar.gz dexon-0x-contracts-771f8a6a6cff935631e8c6ebcdc012cdd3533de6.tar.bz2 dexon-0x-contracts-771f8a6a6cff935631e8c6ebcdc012cdd3533de6.tar.lz dexon-0x-contracts-771f8a6a6cff935631e8c6ebcdc012cdd3533de6.tar.xz dexon-0x-contracts-771f8a6a6cff935631e8c6ebcdc012cdd3533de6.tar.zst dexon-0x-contracts-771f8a6a6cff935631e8c6ebcdc012cdd3533de6.zip |
Merge pull request #1219 from 0xProject/feature/instant/mobile-full-bleed
[instant] Mobile full view
Diffstat (limited to 'packages/instant/src/components/ui/flex.tsx')
-rw-r--r-- | packages/instant/src/components/ui/flex.tsx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/instant/src/components/ui/flex.tsx b/packages/instant/src/components/ui/flex.tsx index 29c6511bb..fd218b0cd 100644 --- a/packages/instant/src/components/ui/flex.tsx +++ b/packages/instant/src/components/ui/flex.tsx @@ -1,3 +1,4 @@ +import { MediaChoice, stylesForMedia } from '../../style/media'; import { ColorOption, styled } from '../../style/theme'; import { cssRuleIfExists } from '../../style/util'; @@ -6,10 +7,11 @@ export interface FlexProps { flexWrap?: 'wrap' | 'nowrap'; 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; + width?: MediaChoice; + height?: MediaChoice; backgroundColor?: ColorOption; inline?: boolean; + flexGrow?: number | string; } export const Flex = @@ -19,11 +21,12 @@ export const Flex = display: ${props => (props.inline ? 'inline-flex' : 'flex')}; flex-direction: ${props => props.direction}; flex-wrap: ${props => props.flexWrap}; + ${props => cssRuleIfExists(props, 'flexGrow')} 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')}; + ${props => stylesForMedia('width', props.width || 'auto')} + ${props => stylesForMedia('height', props.height || 'auto')} `; Flex.defaultProps = { |