Skip to content

Commit 09b5fe3

Browse files
committed
Stepped Solutions
1 parent 051f9d7 commit 09b5fe3

File tree

2 files changed

+76
-8
lines changed

2 files changed

+76
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,60 @@
1+
import Link from 'next/link';
2+
import styled from 'styled-components';
13
import Nav from './Nav';
24

5+
const Logo = styled.h1`
6+
font-size: 4rem;
7+
margin-left: 2rem;
8+
position: relative;
9+
z-index: 2;
10+
transform: skew(-7deg);
11+
a {
12+
padding: 0.5rem 1rem;
13+
background: ${props => props.theme.red};
14+
color: white;
15+
text-transform: uppercase;
16+
text-decoration: none;
17+
}
18+
@media (max-width: 1300px) {
19+
margin: 0;
20+
text-align: center;
21+
}
22+
`;
23+
24+
const StyledHeader = styled.header`
25+
.bar {
26+
border-bottom: 10px solid ${props => props.theme.black};
27+
display: grid;
28+
grid-template-columns: auto 1fr;
29+
justify-content: space-between;
30+
align-items: stretch;
31+
@media (max-width: 1300px) {
32+
grid-template-columns: 1fr;
33+
justify-content: center;
34+
}
35+
}
36+
.sub-bar {
37+
display: grid;
38+
grid-template-columns: 1fr auto;
39+
border-bottom: 1px solid ${props => props.theme.lightgrey};
40+
}
41+
`;
42+
343
const Header = () => (
4-
<div>
44+
<StyledHeader>
545
<div className="bar">
6-
<a href="">Sick Fits</a>
46+
<Logo>
47+
<Link href="/">
48+
<a>Sick Fits</a>
49+
</Link>
50+
</Logo>
751
<Nav />
852
</div>
953
<div className="sub-bar">
1054
<p>Search</p>
1155
</div>
1256
<div>Cart</div>
13-
</div>
57+
</StyledHeader>
1458
);
1559

1660
export default Header;

stepped-solutions/07/frontend/components/Page.js

+29-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,39 @@
11
import React, { Component } from 'react';
2+
import styled, { ThemeProvider, injectGlobal } from 'styled-components';
23
import Header from './Header';
34
import Meta from './Meta';
45

6+
const theme = {
7+
red: '#FF0000',
8+
black: '#393939',
9+
grey: '#3A3A3A',
10+
lightgrey: '#E1E1E1',
11+
offWhite: '#EDEDED',
12+
maxWidth: '1000px',
13+
bs: '0 12px 24px 0 rgba(0, 0, 0, 0.09)',
14+
};
15+
16+
const StyledPage = styled.div`
17+
background: white;
18+
color: ${props => props.theme.black};
19+
`;
20+
21+
const Inner = styled.div`
22+
max-width: ${props => props.theme.maxWidth};
23+
margin: 0 auto;
24+
padding: 2rem;
25+
`;
26+
527
class Page extends Component {
628
render() {
729
return (
8-
<div>
9-
<Meta />
10-
<Header />
11-
{this.props.children}
12-
</div>
30+
<ThemeProvider theme={theme}>
31+
<StyledPage>
32+
<Meta />
33+
<Header />
34+
<Inner>{this.props.children}</Inner>
35+
</StyledPage>
36+
</ThemeProvider>
1337
);
1438
}
1539
}

0 commit comments

Comments
 (0)