From 8ea89c5f5d30a2aa0dacab2bf25816243346c205 Mon Sep 17 00:00:00 2001 From: Joshua <62268199+minimalsm@users.noreply.github.com> Date: Tue, 6 Sep 2022 16:53:16 +0100 Subject: [PATCH 1/3] Refactor VisuallyHidden component to use ChakraUI --- src/components/VisuallyHidden.tsx | 39 ++++++------------------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/src/components/VisuallyHidden.tsx b/src/components/VisuallyHidden.tsx index b1307c85dba..0b398f9ac89 100644 --- a/src/components/VisuallyHidden.tsx +++ b/src/components/VisuallyHidden.tsx @@ -1,36 +1,7 @@ import React from "react" -import styled from "@emotion/styled" +import { VisuallyHidden as VisuallyHiddenSpan } from "@chakra-ui/react" -// "Accessibility/SEO Friendly CSS Hiding" -// Source: https://css-tricks.com/snippets/css/accessibilityseo-friendly-css-hiding/ -const Container = styled.span` - border: 0; - clip: rect(1px, 1px, 1px, 1px); - clip-path: inset(50%); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; - word-wrap: normal !important; - &:focus { - background-color: #eeeeee; - clip: auto !important; - clip-path: none; - color: #444444; - display: block; - font-size: 1em; - height: auto; - left: 5px; - line-height: normal; - padding: 15px 23px 14px; - text-decoration: none; - top: 5px; - width: auto; - z-index: 100000; - } -` +// Todo: Refactor to from isHidden boolean export interface IProps { children?: React.ReactNode @@ -38,6 +9,10 @@ export interface IProps { } const VisuallyHidden: React.FC = ({ isHidden = false, children }) => - isHidden ? {children} : <>{children} + isHidden ? ( + {children} + ) : ( + <>{children} + ) export default VisuallyHidden From df2f9b170d34aebc8ebfc4eb3870b64496013b78 Mon Sep 17 00:00:00 2001 From: Corwin Smith Date: Thu, 3 Nov 2022 11:52:40 -0600 Subject: [PATCH 2/3] change requests and cleanup --- src/components/Layout.tsx | 70 +++++++++++++++---------------- src/components/VisuallyHidden.tsx | 16 ++++--- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index b86297affd9..aedbfeebde0 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -149,43 +149,41 @@ const Layout: React.FC = ({ - - - - - -