-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathFooter.js
98 lines (88 loc) · 2.1 KB
/
Footer.js
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import React from "react";
import styled from "react-emotion";
import { Teaser } from "@survivejs/components";
import Buy from "./Buy";
import HorizontalList from "./HorizontalList";
import HorizontalListItem from "./HorizontalListItem";
import theme from "../styles/theme";
const socialLinks = [
{
caption: "@survivejs",
href: "https://twitter.com/survivejs",
},
{
caption: "Mailing List",
href: "https://buttondown.email/SurviveJS",
},
{
caption: "Gitter Chat",
href: "https://gitter.im/survivejs",
},
{
caption: "GitHub",
href: "https://github.com/survivejs",
},
{
caption: "Presentations",
href: "https://presentations.survivejs.com",
},
{
caption: "Contact",
href: "http://goo.gl/forms/OWdGIOdHm9",
},
{
caption: "Ask Me Anything",
href: "https://github.com/survivejs/ama/issues",
},
{
caption: "RSS",
href: "/atom.xml",
},
];
const Container = styled.footer`
padding: ${theme.space.l} ${theme.space.m};
background: ${theme.color.backgroundLight};
background-image: url("../assets/img/dust.png");
`;
const Section = styled.div`
margin-bottom: ${theme.space.m};
display: flex;
flex-direction: column;
align-items: center;
`;
const Heading = styled.h3`
margin-top: 0;
margin-bottom: ${theme.space.m};
`;
const Links = styled(HorizontalList)`
margin-bottom: ${theme.space.l};
`;
const LinkItemContainer = styled(HorizontalListItem)`
margin-bottom: ${theme.space.m};
`;
const LinkItem = ({ href, children }) => (
<LinkItemContainer>
<a href={href} target="_blank" rel="noopener noreferrer">
{children}
</a>
</LinkItemContainer>
);
const Footer = ({ section, pathname }) => (
<Container>
<Links>
{socialLinks.map(({ caption, href }) => (
<LinkItem key={href} href={href}>
{caption}
</LinkItem>
))}
</Links>
{pathname !== "/blog/" && (
<Section>
<Heading>From the Blog</Heading>
<Teaser pages={section.pages("blog").slice(0, 7)} />
</Section>
)}
{pathname !== "/" && <Buy />}
</Container>
);
export default Footer;