Skip to content

Commit

Permalink
fix(Navigation): Adding Basic Navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenfitzpatrick committed Apr 28, 2018
1 parent e90da75 commit 4c4f489
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
13 changes: 11 additions & 2 deletions src/components/Navigation/Navigation.js
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;
17 changes: 12 additions & 5 deletions src/components/Navigation/Navigation.styled.js
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;
`;
3 changes: 3 additions & 0 deletions src/fitzy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export { default as Dropdown } from './components/Dropdown/Dropdown';
export { default as RadioGroup } from './components/RadioGroup/RadioGroup';
export { default as RadioOption } from './components/RadioGroup/RadioOption';

// Layout
export { default as Navigation } from './components/Navigation/Navigation';

// Components
export { default as Alert } from './components/Alert/Alert';

Expand Down

0 comments on commit 4c4f489

Please sign in to comment.