Skip to content

Commit

Permalink
task: Update nav bar
Browse files Browse the repository at this point in the history
  • Loading branch information
ericcheatham committed Jan 24, 2020
1 parent 8b8e620 commit 07e9302
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
12 changes: 12 additions & 0 deletions src/components/Icons/SetupIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react'
import NavbarIcon from '~/components/NavbarIcon/navbarIcon'
import { IconType } from './types'
import { Monitor } from 'grommet-icons'

const Icon: IconType = ({ isFilled }) => (
<NavbarIcon xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
{isFilled ? <Monitor fill="red" /> : <Monitor fill="red" />}
</NavbarIcon>
)

export default Icon
18 changes: 15 additions & 3 deletions src/components/Layout/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@ const Container = styled.div`
position: relative;
@media (min-width: 750px) {
margin-top: 0;
margin-left: 45vw;
margin-left: ${props => props.theme.margin};
margin-bottom: 20px;
margin-top: ${props => props.theme.marginTop};
position: relative;
}
`

const theme = {
margin: '45vw',
marginTop: '15vh'
}

const themeCenter = {
margin: '20vw',
marginTop: '0'
}

// TODO: Move values to a constants file
export const Main = styled.main`
background: var(--background);
Expand Down Expand Up @@ -49,10 +59,12 @@ const Layout: React.FunctionComponent<{
imageBackgroundColor?: string
}> = ({ pathname, children, image, imageTitle, imageBackgroundColor }) => {
const [isApp, setIsApp] = React.useState(false)
const [hasImage, setHasImage] = React.useState(false)
React.useEffect(() => setIsApp('standalone' in window.navigator), [])
React.useEffect(() => setHasImage(!!image), [])

return (
<Container>
<Container theme={hasImage ? theme : themeCenter}>
{image && (
<Image
fluid={image}
Expand Down
2 changes: 1 addition & 1 deletion src/components/MainStyles/mainStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const MainStyles = createGlobalStyle`
body {
background: var(--background-color);
color: var(--lightGray);
color: var(--white);
font-family: var(--primaryFont);
font-feature-settings: 'calt' 1;
font-variant-ligatures: contextual;
Expand Down
3 changes: 2 additions & 1 deletion src/components/Navbar/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import NavbarLink from '~/components/NavbarLink/navbarLink'
import { IconProps } from '~/components/Icons/types'
import HomeIcon from '~/components/Icons/HomeIcon'
import ResumeIcon from '~/components/Icons/ResumeIcon'
import SetupIcon from '~/components/Icons/SetupIcon'

const NavbarWrapper = styled.nav`
position: fixed;
Expand Down Expand Up @@ -63,7 +64,7 @@ const Navbar: React.FunctionComponent<{
<NavbarLink
to="/using"
isActive={new RegExp('^/using').test(pathname)}
Icon={(props: IconProps) => <ResumeIcon {...props} />}
Icon={(props: IconProps) => <SetupIcon {...props} />}
label="My Setup"
/>
</InnerNavbarWrapper>
Expand Down

0 comments on commit 07e9302

Please sign in to comment.