From b6dca4d6b28fe0eddc1d18e7ef0984218819fd5d Mon Sep 17 00:00:00 2001 From: samgildea Date: Fri, 26 Mar 2021 13:06:34 -0400 Subject: [PATCH] #26 extracting mobile styles to separate file --- src/components/header/header-styles.js | 48 +++++++++++++++++++++ src/components/header/header.jsx | 60 +++++--------------------- 2 files changed, 59 insertions(+), 49 deletions(-) create mode 100644 src/components/header/header-styles.js diff --git a/src/components/header/header-styles.js b/src/components/header/header-styles.js new file mode 100644 index 0000000..76ca335 --- /dev/null +++ b/src/components/header/header-styles.js @@ -0,0 +1,48 @@ +import styled from 'styled-components' +import dimensions from "../../style/dimensions" + + +export const NavContainer = styled.div`` + +export const Logo = styled.div` + font-weight: bold; + font-size: 24px; + padding-top: 32px; + + @media (max-width: ${dimensions.maxwidthTablet}px) { + text-align: center; + font-size: 20px; + padding-top: 24px; + } +` + +export const NavLinks = styled.div` + position: absolute; + right: 80px; + top: 40px; + display: flex; + + @media (max-width: ${dimensions.maxwidthTablet}px) { + display: none; + } +` + +export const NavLink = styled.a` + font-weight: bold; + font-size: 16px; + padding-left: 100px; + text-decoration: none; + color: #000000; +` + +export const MobileIcon = styled.div` + @media (min-width: ${dimensions.maxwidthTablet}px) { + display: none; + } + + @media (max-width: ${dimensions.maxwidthTablet}px) { + left: 24px; + top: 32px; + position: absolute; + } +` \ No newline at end of file diff --git a/src/components/header/header.jsx b/src/components/header/header.jsx index 549f3b7..66beb22 100644 --- a/src/components/header/header.jsx +++ b/src/components/header/header.jsx @@ -1,50 +1,12 @@ import React, { useState } from "react" -import styled from "styled-components" -import dimensions from "../../style/dimensions" import Hamburger from "../../vectors/hamburger.svg" - -const NavContainer = styled.div`` - -const Logo = styled.div` - font-weight: bold; - font-size: 24px; - padding-top: 32px; - - @media (max-width: ${dimensions.maxwidthTablet}px) { - text-align: center; - font-size: 20px; - padding-top: 24px; - } -` - -const NavLinks = styled.div` - position: absolute; - right: 80px; - top: 40px; - display: flex; - - @media (max-width: ${dimensions.maxwidthTablet}px) { - display: none; - } -` - -const NavLink = styled.div` - font-weight: bold; - font-size: 16px; - padding-left: 100px; -` - -const MobileIcon = styled.div` - @media (min-width: ${dimensions.maxwidthTablet}px) { - display: none; - } - - @media (max-width: ${dimensions.maxwidthTablet}px) { - left: 24px; - top: 32px; - position: absolute; - } -` +import { + NavContainer, + Logo, + MobileIcon, + NavLinks, + NavLink, +} from "./header-styles" export const Header = () => { const [open, setOpen] = useState(false) @@ -57,10 +19,10 @@ export const Header = () => { - ABOUT - PROCESS - PRODUCTS - SOLUTIONS + ABOUT + PROCESS + PRODUCTS + SOLUTIONS )