-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathBlogLayout.jsx
More file actions
62 lines (54 loc) · 1.21 KB
/
BlogLayout.jsx
File metadata and controls
62 lines (54 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import Layout from '../Layout';
import Container from '../Container';
import BlogHero from './BlogHero';
import BlogTags from './BlogTags';
import BlogRecentPosts from './BlogRecentPosts';
const StyledContainer = styled(Container)`
margin-top: 2em;
${({ theme }) => theme.media.medLarge`
margin: 7em 0 0 0;
display: flex;
flex-direction: row-reverse;
justify-content: space-between;
`}
`;
const PostWrapper = styled.div`
margin: 0 2em;
${({ theme }) => theme.media.medLarge`
padding-right: 3em;
margin: 0;
width: 74%;
`}
`;
const Sidebar = styled.aside`
display: none;
${({ theme }) => theme.media.medLarge`
display: block;
width: 19%;
`}
`;
const BlogLayout = ({ children, seo }) => (
<Layout>
<BlogHero />
<StyledContainer>
<Sidebar>
<BlogTags />
<BlogRecentPosts />
</Sidebar>
<PostWrapper>
{children}
</PostWrapper>
</StyledContainer>
</Layout>
);
BlogLayout.defaultProps = {
seo: {},
};
BlogLayout.propTypes = {
children: PropTypes.node.isRequired,
seo: PropTypes.object,
};
export default BlogLayout;