aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/ui/container.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-12-01 03:58:05 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-12-01 03:58:05 +0800
commitea11e8c62dac9ff6352bc983efc707d855b8e881 (patch)
treecdfc9ad01c2a4e56c560809cb7e01895987ef442 /packages/instant/src/components/ui/container.tsx
parent7479a7db58f5504416a88450c92b092899bf3df3 (diff)
parenta1d4aa66bc6b3de041ec6e4eb4fe40383945510b (diff)
downloaddexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar
dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.gz
dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.bz2
dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.lz
dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.xz
dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.zst
dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.zip
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into fix/instant/instant-bounces-on-error
Diffstat (limited to 'packages/instant/src/components/ui/container.tsx')
-rw-r--r--packages/instant/src/components/ui/container.tsx13
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/instant/src/components/ui/container.tsx b/packages/instant/src/components/ui/container.tsx
index 2143b0503..e7d909d92 100644
--- a/packages/instant/src/components/ui/container.tsx
+++ b/packages/instant/src/components/ui/container.tsx
@@ -27,6 +27,7 @@ export interface ContainerProps {
borderBottom?: string;
className?: string;
backgroundColor?: ColorOption;
+ rawBackgroundColor?: string;
hasBoxShadow?: boolean;
isHidden?: boolean;
zIndex?: number;
@@ -39,6 +40,16 @@ export interface ContainerProps {
flexGrow?: string | number;
}
+const getBackgroundColor = (theme: any, backgroundColor?: ColorOption, rawBackgroundColor?: string): string => {
+ if (backgroundColor) {
+ return theme[backgroundColor] as string;
+ }
+ if (rawBackgroundColor) {
+ return rawBackgroundColor;
+ }
+ return 'none';
+};
+
export const Container =
styled.div <
ContainerProps >
@@ -72,7 +83,7 @@ export const Container =
${props => props.height && stylesForMedia<string>('height', props.height)}
${props => props.borderRadius && stylesForMedia<string>('border-radius', props.borderRadius)}
${props => (props.isHidden ? 'visibility: hidden;' : '')}
- background-color: ${props => (props.backgroundColor ? props.theme[props.backgroundColor] : 'none')};
+ background-color: ${props => getBackgroundColor(props.theme, props.backgroundColor, props.rawBackgroundColor)};
border-color: ${props => (props.borderColor ? props.theme[props.borderColor] : 'none')};
&:hover {
${props =>