Skip to content

Commit

Permalink
Stepped Solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
jm35g committed Sep 20, 2018
1 parent 051f9d7 commit 09b5fe3
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 8 deletions.
50 changes: 47 additions & 3 deletions stepped-solutions/07/frontend/components/Header.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,60 @@
import Link from 'next/link';
import styled from 'styled-components';
import Nav from './Nav';

const Logo = styled.h1`
font-size: 4rem;
margin-left: 2rem;
position: relative;
z-index: 2;
transform: skew(-7deg);
a {
padding: 0.5rem 1rem;
background: ${props => props.theme.red};
color: white;
text-transform: uppercase;
text-decoration: none;
}
@media (max-width: 1300px) {
margin: 0;
text-align: center;
}
`;

const StyledHeader = styled.header`
.bar {
border-bottom: 10px solid ${props => props.theme.black};
display: grid;
grid-template-columns: auto 1fr;
justify-content: space-between;
align-items: stretch;
@media (max-width: 1300px) {
grid-template-columns: 1fr;
justify-content: center;
}
}
.sub-bar {
display: grid;
grid-template-columns: 1fr auto;
border-bottom: 1px solid ${props => props.theme.lightgrey};
}
`;

const Header = () => (
<div>
<StyledHeader>
<div className="bar">
<a href="">Sick Fits</a>
<Logo>
<Link href="/">
<a>Sick Fits</a>
</Link>
</Logo>
<Nav />
</div>
<div className="sub-bar">
<p>Search</p>
</div>
<div>Cart</div>
</div>
</StyledHeader>
);

export default Header;
34 changes: 29 additions & 5 deletions stepped-solutions/07/frontend/components/Page.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
import React, { Component } from 'react';
import styled, { ThemeProvider, injectGlobal } from 'styled-components';
import Header from './Header';
import Meta from './Meta';

const theme = {
red: '#FF0000',
black: '#393939',
grey: '#3A3A3A',
lightgrey: '#E1E1E1',
offWhite: '#EDEDED',
maxWidth: '1000px',
bs: '0 12px 24px 0 rgba(0, 0, 0, 0.09)',
};

const StyledPage = styled.div`
background: white;
color: ${props => props.theme.black};
`;

const Inner = styled.div`
max-width: ${props => props.theme.maxWidth};
margin: 0 auto;
padding: 2rem;
`;

class Page extends Component {
render() {
return (
<div>
<Meta />
<Header />
{this.props.children}
</div>
<ThemeProvider theme={theme}>
<StyledPage>
<Meta />
<Header />
<Inner>{this.props.children}</Inner>
</StyledPage>
</ThemeProvider>
);
}
}
Expand Down

0 comments on commit 09b5fe3

Please sign in to comment.