From c9de941f2990f60aff0632631f64c3c1511818f0 Mon Sep 17 00:00:00 2001 From: Kristen Cooke Date: Mon, 29 Jun 2020 16:50:01 -0700 Subject: [PATCH] refactor: Improve link accessibility in header --- app/components/Layout/Header.tsx | 30 +- .../__snapshots__/Storyshots.test.ts.snap | 366 ++++++------------ .../Layout/__snapshots__/Header.test.tsx.snap | 24 +- .../default-layout.test.tsx.snap | 2 - 4 files changed, 139 insertions(+), 283 deletions(-) diff --git a/app/components/Layout/Header.tsx b/app/components/Layout/Header.tsx index 416818ff81..5094e2388f 100644 --- a/app/components/Layout/Header.tsx +++ b/app/components/Layout/Header.tsx @@ -24,9 +24,7 @@ const HeaderLayout = ({isLoggedIn = false, isRegistered = false}) => ( {isRegistered ? ( - - - + Dashboard ) : null} @@ -35,11 +33,12 @@ const HeaderLayout = ({isLoggedIn = false, isRegistered = false}) => ( {isRegistered && ( -
- -
+ + Profile + )} @@ -114,21 +113,6 @@ const HeaderLayout = ({isLoggedIn = false, isRegistered = false}) => ( align-items: center; justify-content: flex-end; } - .btn { - font-weight: bolder; - } - .link { - color: white; - text-decoration: none; - } - a:link, - a:visited { - color: white; - } - a:hover, - a:active { - color: white; - } /* These are sample media queries only. Media queries are quite subjective diff --git a/app/tests/integration/__snapshots__/Storyshots.test.ts.snap b/app/tests/integration/__snapshots__/Storyshots.test.ts.snap index 4e22edfcd1..9be1dd9a0f 100644 --- a/app/tests/integration/__snapshots__/Storyshots.test.ts.snap +++ b/app/tests/integration/__snapshots__/Storyshots.test.ts.snap @@ -14,40 +14,40 @@ Array [ className="jsx-303545825 page-wrap" >
logo for Province of British Columbia CleanBC

CleanBC Industrial Incentive Program

- -
-
- + Dashboard +
-
- -
+ Profile +
logo for Province of British Columbia CleanBC

CleanBC Industrial Incentive Program

- -
-
- + Dashboard +
-
- -
+ Profile +
logo for Province of British Columbia CleanBC

CleanBC Industrial Incentive Program

- + Dashboard +
- -
-
-
- -
+ Profile +
logo for Province of British Columbia CleanBC

CleanBC Industrial Incentive Program

- -
-
- + Dashboard +
-
- -
+ Profile +
logo for Province of British Columbia CleanBC

CleanBC Industrial Incentive Program

- -
-
- + Dashboard +
-
- -
+ Profile +
logo for Province of British Columbia CleanBC

CleanBC Industrial Incentive Program

- + Dashboard +
- -
-
-
- -
+ Profile +
logo for Province of British Columbia CleanBC

CleanBC Industrial Incentive Program

@@ -69,9 +69,9 @@ exports[`It matches the last accepted Snapshot 1`] = `
- header.jsx-1526402762{background-color:#036;border-bottom:2px solid #fcba19;padding:10px 65px;color:#fff;height:65px;top:0px;width:100%;}header.jsx-1526402762 h1.jsx-1526402762{font-weight:normal;margin:8px 5px 5px 18px;}.header-left.jsx-1526402762 img.jsx-1526402762{height:46px;position:relative;top:-4px;}.header-right.jsx-1526402762{margin-right:-25px;}header.jsx-1526402762 .banner.jsx-1526402762{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0 10px 0 0;}header.jsx-1526402762 .other.jsx-1526402762{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}.buttons.jsx-1526402762{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;}.btn.jsx-1526402762{font-weight:bolder;}.link.jsx-1526402762{color:white;-webkit-text-decoration:none;text-decoration:none;}a.jsx-1526402762:link,a.jsx-1526402762:visited{color:white;}a.jsx-1526402762:hover,a.jsx-1526402762:active{color:white;}@media screen and (min-width:900px){header.jsx-1526402762 h1.jsx-1526402762{font-size:1.4em;visibility:visible;}}@media (max-width:899px){header.jsx-1526402762{padding:10px 0 !important;margin-bottom:58px;}header.jsx-1526402762 h1.jsx-1526402762{font-size:calc(6px + 2vw);visibility:visible;height:20px;}.full-width.container.jsx-1526402762{max-width:100%;padding:0;}.banner.jsx-1526402762{-webkit-flex-flow:wrap;-ms-flex-flow:wrap;flex-flow:wrap;margin:0 !important;}.header-right.jsx-1526402762{background:#004085;width:100%;padding:10px 10px 10px 35px;margin:14px 0;z-index:1;}.header-left.jsx-1526402762{padding:0 0 0 20px;}} + header.jsx-2453800556{background-color:#036;border-bottom:2px solid #fcba19;padding:10px 65px;color:#fff;height:65px;top:0px;width:100%;}header.jsx-2453800556 h1.jsx-2453800556{font-weight:normal;margin:8px 5px 5px 18px;}.header-left.jsx-2453800556 img.jsx-2453800556{height:46px;position:relative;top:-4px;}.header-right.jsx-2453800556{margin-right:-25px;}header.jsx-2453800556 .banner.jsx-2453800556{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0 10px 0 0;}header.jsx-2453800556 .other.jsx-2453800556{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}.buttons.jsx-2453800556{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;}@media screen and (min-width:900px){header.jsx-2453800556 h1.jsx-2453800556{font-size:1.4em;visibility:visible;}}@media (max-width:899px){header.jsx-2453800556{padding:10px 0 !important;margin-bottom:58px;}header.jsx-2453800556 h1.jsx-2453800556{font-size:calc(6px + 2vw);visibility:visible;height:20px;}.full-width.container.jsx-2453800556{max-width:100%;padding:0;}.banner.jsx-2453800556{-webkit-flex-flow:wrap;-ms-flex-flow:wrap;flex-flow:wrap;margin:0 !important;}.header-right.jsx-2453800556{background:#004085;width:100%;padding:10px 10px 10px 35px;margin:14px 0;z-index:1;}.header-left.jsx-2453800556{padding:0 0 0 20px;}}
`; diff --git a/app/tests/unit/layout/__snapshots__/default-layout.test.tsx.snap b/app/tests/unit/layout/__snapshots__/default-layout.test.tsx.snap index 6abc771f69..d43546f4b6 100644 --- a/app/tests/unit/layout/__snapshots__/default-layout.test.tsx.snap +++ b/app/tests/unit/layout/__snapshots__/default-layout.test.tsx.snap @@ -5,8 +5,6 @@ exports[`It matches the last accepted Snapshot 1`] = ` className="jsx-303545825 page-wrap" >