From 531c83a944d012c4052204eac5ce0b71ff28da61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Wed, 22 Mar 2017 14:41:53 +0000 Subject: [PATCH] fix tooltipShadow import --- frontend/src/index.js | 9 ++++++--- ui/src/components/tooltip/index.js | 10 ++++++---- ui/src/shared/constants/boxes.js | 1 + 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/frontend/src/index.js b/frontend/src/index.js index eb34d78c..0012bfdb 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -19,10 +19,13 @@ if (process.env.NODE_ENV !== 'production') { }); } +const states = { + all: MockState, + testing: MockStateTesting +} + const query = qs.parse(window.location.search.replace(/^\?/, '')); -const mockState = query.mock !== 'all' - ? MockStateTesting - : MockState; +const mockState = states[query.mock || 'testing']; // node_memory_rss_bytes // node_memory_heap_total_bytes diff --git a/ui/src/components/tooltip/index.js b/ui/src/components/tooltip/index.js index e2f15cf7..bc23751e 100644 --- a/ui/src/components/tooltip/index.js +++ b/ui/src/components/tooltip/index.js @@ -1,4 +1,8 @@ import { remcalc, unitcalc } from '../../shared/functions'; +import { boxes, colors } from '../../shared/constants'; +import styled from 'styled-components'; +import React from 'react'; + import { absolutePosition, baseBox, @@ -7,9 +11,7 @@ import { moveZ, getMeasurement } from '../../shared/composers'; -import { boxes, colors, tooltipShadow } from '../../shared/constants'; -import styled from 'styled-components'; -import React from 'react'; + const ItemPadder = 9; const WrapperPadder = 24; @@ -41,7 +43,7 @@ const StyledList = styled.ul` ${props => props.styles} ${baseBox({ - shadow: tooltipShadow + shadow: boxes.tooltipShadow })} ${moveZ({ diff --git a/ui/src/shared/constants/boxes.js b/ui/src/shared/constants/boxes.js index 3d97c578..b1f42b6a 100644 --- a/ui/src/shared/constants/boxes.js +++ b/ui/src/shared/constants/boxes.js @@ -5,6 +5,7 @@ export const borderRadius = remcalc(4); export const bottomShaddow = `0 ${remcalc(2)} 0 0 rgba(0, 0, 0, 0.05)`; export const bottomShaddowDarker = `0 ${remcalc(2)} 0 0 rgba(0, 0, 0, 0.1)`; export const insetShaddow = `inset 0 ${remcalc(3)} 0 0 rgba(0, 0, 0, 0.05)`; + export const tooltipShadow = `0 ${remcalc(2)} ${remcalc(6)} ${remcalc(1)} rgba(0, 0, 0, 0.1)`;