-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Navigation): Adding Basic Navigation
- Loading branch information
1 parent
e90da75
commit 4c4f489
Showing
3 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
|
||
import Layout from './Layout'; | ||
import { FitzyHeader, FitzyNavigation } from './Navigation.styled'; | ||
|
||
const Navigation = ({ children }) => ( | ||
<FitzyHeader>{children(Layout)}</FitzyHeader> | ||
const Navigation = ({ children, isFixed }) => ( | ||
<FitzyHeader isFixed={isFixed}>{children(Layout)}</FitzyHeader> | ||
); | ||
|
||
Navigation.propTypes = { | ||
isFixed: PropTypes.bool | ||
}; | ||
|
||
Navigation.defaultProps = { | ||
isFixed: false | ||
}; | ||
|
||
export default Navigation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const FitzyHeader = styled.header` | ||
position: ${p => (p.isFixed ? 'fixed' : 'relative')}; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
display: grid; | ||
grid-template: | ||
'↩ 👾 ↪' / | ||
auto 1fr auto; | ||
grid-template: 'left 👾 right' / auto 1fr auto; | ||
width: 100%; | ||
border: 1px solid; | ||
`; | ||
|
||
export const FitzyNavigation = styled.nav``; | ||
|
||
export const FitzyRight = styled.div` | ||
grid-area: ↪; | ||
grid-area: right; | ||
display: flex; | ||
align-items: center; | ||
`; | ||
|
||
export const FitzyLeft = styled.div` | ||
grid-area: ↩; | ||
grid-area: left; | ||
display: flex; | ||
align-items: center; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters