From 0cfddf51b0329b78f3ae857493d95d59ad967cca Mon Sep 17 00:00:00 2001 From: Ka-wai Wong Date: Wed, 6 Feb 2019 09:57:10 -0800 Subject: [PATCH 1/3] Address font size, font weight, and margin issues from design review --- src/devpanel/components/App.css | 2 +- .../components/CaptureCycle/CaptureCycle.css | 26 +- .../components/CaptureCycle/CaptureCycle.js | 36 +- .../__snapshots__/CaptureCycle.test.js.snap | 366 +++++++++--------- .../CaptureCycleSection.css | 8 +- .../ComponentTiming/ComponentTiming.css | 14 +- .../ComponentTiming/ComponentTiming.js | 6 +- .../ComponentTiming.test.js.snap | 18 +- src/devpanel/components/Footer/Footer.css | 12 +- src/devpanel/components/Footer/Footer.js | 4 +- src/devpanel/components/Footer/GithubMark.js | 2 +- .../Footer/__snapshots__/Footer.test.js.snap | 24 +- .../__snapshots__/GithubMark.test.js.snap | 2 +- src/devpanel/components/Header/Header.css | 5 +- src/devpanel/components/Header/Logo.css | 2 +- .../components/HelpDialog/HelpDialog.css | 2 +- src/devpanel/components/Main/Main.css | 13 +- src/devpanel/components/Main/Main.js | 12 +- src/devpanel/components/Main/MainLoading.css | 2 +- .../Main/__snapshots__/Main.test.js.snap | 124 +++--- src/devpanel/index.css | 3 +- 21 files changed, 319 insertions(+), 364 deletions(-) diff --git a/src/devpanel/components/App.css b/src/devpanel/components/App.css index 8d50c16..084db27 100644 --- a/src/devpanel/components/App.css +++ b/src/devpanel/components/App.css @@ -30,7 +30,7 @@ } } -@media only screen and (min-width: 540px) { +@media only screen and (min-width: 640px) { .modal { height: auto; } diff --git a/src/devpanel/components/CaptureCycle/CaptureCycle.css b/src/devpanel/components/CaptureCycle/CaptureCycle.css index c3e3b3f..eb3b11d 100644 --- a/src/devpanel/components/CaptureCycle/CaptureCycle.css +++ b/src/devpanel/components/CaptureCycle/CaptureCycle.css @@ -1,24 +1,28 @@ @media only screen { .capture-cycle--card { background-color: var(--color-white); - border-radius: 4px; - margin: 0 16px 12px; + border-radius: 3px; + -webkit-box-shadow: var(--box-shadow); + -moz-box-shadow: var(--box-shadow); + box-shadow: var(--box-shadow); + margin: 8px 16px; + overflow: auto; + } + + .capture-cycle--header { + font-size: 17px; + font-weight: 400; + margin: 16px; + text-align: center; } .capture-cycle--statistic { font-weight: 500; } - - .capture-cycle--timestamp { - font-weight: 400; - margin: 0; - padding: 8px 16px; - text-align: center; - } } -@media only screen and (min-width: 540px) { - .capture-cycle--timestamp { +@media only screen and (min-width: 640px) { + .capture-cycle--header { text-align: start; } } diff --git a/src/devpanel/components/CaptureCycle/CaptureCycle.js b/src/devpanel/components/CaptureCycle/CaptureCycle.js index f59e0b1..b5cb835 100644 --- a/src/devpanel/components/CaptureCycle/CaptureCycle.js +++ b/src/devpanel/components/CaptureCycle/CaptureCycle.js @@ -5,7 +5,7 @@ import './CaptureCycle.css'; import CaptureCycleSection from '../CaptureCycleSection/CaptureCycleSection'; const CaptureCycle = (props) => { - const captureCycleHeader =

+ const captureCycleHeader =

{props.routeUrl == null ? 'Capture Cycle' : props.routeUrl} {props.timestamp != null && at {props.timestamp}:}

; @@ -19,23 +19,25 @@ const CaptureCycle = (props) => { return ( props != null && (shouldRenderInsideViewportComponents || shouldRenderOutsideViewportComponents) && -
+
{captureCycleHeader} - {shouldRenderInsideViewportComponents && - - } - {shouldRenderOutsideViewportComponents && - - } +
+ {shouldRenderInsideViewportComponents && + + } + {shouldRenderOutsideViewportComponents && + + } +
); }; diff --git a/src/devpanel/components/CaptureCycle/__snapshots__/CaptureCycle.test.js.snap b/src/devpanel/components/CaptureCycle/__snapshots__/CaptureCycle.test.js.snap index 1babe28..a193d20 100644 --- a/src/devpanel/components/CaptureCycle/__snapshots__/CaptureCycle.test.js.snap +++ b/src/devpanel/components/CaptureCycle/__snapshots__/CaptureCycle.test.js.snap @@ -1,128 +1,134 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`CaptureCycle.js should render when there are both insideViewportComponents and outsideViewportComponents 1`] = ` -
+

Capture Cycle

- - +
+ + +
`; exports[`CaptureCycle.js should render when there are only insideViewportComponents 1`] = ` -
+

Capture Cycle

- +
+ +
`; exports[`CaptureCycle.js should render when there are only outsideViewportComponents 1`] = ` -
+

Capture Cycle

- +
+ +
`; exports[`CaptureCycle.js should render with a routeUrl 1`] = ` -
+

routeUrl

- - +
+ + +
`; exports[`CaptureCycle.js should render with a timestamp 1`] = ` -
+

Capture Cycle @@ -131,83 +137,87 @@ exports[`CaptureCycle.js should render with a timestamp 1`] = ` :

- - +
+ + +
`; exports[`CaptureCycle.js should render with a viewportLoadTime 1`] = ` -
+

Capture Cycle

- - Viewport Load Time: - - 15.4 - - ms - - } - /> - +
+ + Viewport Load Time: + + 15.4 + + ms + + } + /> + +
`; exports[`CaptureCycle.js should render with both a routeUrl and timestamp 1`] = ` -
+

routeUrl @@ -216,28 +226,32 @@ exports[`CaptureCycle.js should render with both a routeUrl and timestamp 1`] = :

- - +
+ + +
`; diff --git a/src/devpanel/components/CaptureCycleSection/CaptureCycleSection.css b/src/devpanel/components/CaptureCycleSection/CaptureCycleSection.css index d8774ef..2d6826a 100644 --- a/src/devpanel/components/CaptureCycleSection/CaptureCycleSection.css +++ b/src/devpanel/components/CaptureCycleSection/CaptureCycleSection.css @@ -8,9 +8,9 @@ } .capture-cycle--section-header { - font-size: 20px; - font-weight: 500; - margin: 12px 16px 0; + font-size: 17px; + font-weight: 600; + margin: 16px; text-align: center; } @@ -22,7 +22,7 @@ } } -@media only screen and (min-width: 540px) { +@media only screen and (min-width: 640px) { .capture-cycle--section-header, .capture-cycle--section-sub-header { text-align: left; diff --git a/src/devpanel/components/ComponentTiming/ComponentTiming.css b/src/devpanel/components/ComponentTiming/ComponentTiming.css index c2da4ef..53f594c 100644 --- a/src/devpanel/components/ComponentTiming/ComponentTiming.css +++ b/src/devpanel/components/ComponentTiming/ComponentTiming.css @@ -13,24 +13,22 @@ .component-timing--detail { display: flex; - margin: 12px; + font-size: 15px; + font-weight: 500; + margin: 16px; } .component-timing--name { - font-size: 14px; + font-size: 15px; font-weight: 500; line-height: 18px; - margin: 12px; + margin: 16px; overflow: hidden; text-overflow: ellipsis; } - - .component-timing--statistic { - font-weight: 700; - } } -@media only screen and (min-width: 540px) { +@media only screen and (min-width: 640px) { .component-timing--card { margin-bottom: 8px; margin-right: 2px; diff --git a/src/devpanel/components/ComponentTiming/ComponentTiming.js b/src/devpanel/components/ComponentTiming/ComponentTiming.js index bf8d87f..d9390a5 100644 --- a/src/devpanel/components/ComponentTiming/ComponentTiming.js +++ b/src/devpanel/components/ComponentTiming/ComponentTiming.js @@ -7,11 +7,7 @@ const ComponentTiming = (props) => ( props != null && (props.name != null || props.loadTime != null) &&
  • {props.name != null &&

    {props.name}

    } {props.loadTime != null && -

    - Load time: - {props.loadTime.toFixed(1)} - ms -

    } +

    Load time: {props.loadTime.toFixed(1)} ms

    }
  • ); diff --git a/src/devpanel/components/ComponentTiming/__snapshots__/ComponentTiming.test.js.snap b/src/devpanel/components/ComponentTiming/__snapshots__/ComponentTiming.test.js.snap index 4c50b90..3a78973 100644 --- a/src/devpanel/components/ComponentTiming/__snapshots__/ComponentTiming.test.js.snap +++ b/src/devpanel/components/ComponentTiming/__snapshots__/ComponentTiming.test.js.snap @@ -17,12 +17,9 @@ exports[`ComponentTiming.js should render the componentTiming 1`] = ` > Load time: - - 14.2 - - ms + + 14.2 + ms

    `; @@ -39,12 +36,9 @@ exports[`ComponentTiming.js should render the componentTiming with only a loadTi > Load time: - - 14.2 - - ms + + 14.2 + ms

    `; diff --git a/src/devpanel/components/Footer/Footer.css b/src/devpanel/components/Footer/Footer.css index 0a4ba83..f346b06 100644 --- a/src/devpanel/components/Footer/Footer.css +++ b/src/devpanel/components/Footer/Footer.css @@ -7,10 +7,6 @@ flex-direction: column; } - .github-information { - padding: 8px 0 4px; - } - .github-information--link, .github-information--package { align-items: center; @@ -31,6 +27,12 @@ text-decoration: underline; } + .github-mark { + height: 28px; + margin: 8px 8px 8px 16px; + width: 28px; + } + .package-information { display: block; margin-right: 8px; @@ -69,7 +71,7 @@ } } -@media only screen and (min-width: 540px) { +@media only screen and (min-width: 640px) { .footer--content { flex-direction: row; justify-content: space-between; diff --git a/src/devpanel/components/Footer/Footer.js b/src/devpanel/components/Footer/Footer.js index 0ae6774..c6236bd 100644 --- a/src/devpanel/components/Footer/Footer.js +++ b/src/devpanel/components/Footer/Footer.js @@ -7,7 +7,7 @@ import GithubMark from './GithubMark'; const Footer = (props) => (