-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathBuy.js
110 lines (100 loc) · 2.39 KB
/
Buy.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
99
100
101
102
103
104
105
106
107
108
109
110
import styled, { css, cx } from "react-emotion";
import React from "react";
import HorizontalList from "./HorizontalList";
import HorizontalListItem from "./HorizontalListItem";
import VisuallyHidden from "./VisuallyHidden";
import theme from "../styles/theme";
const Title = VisuallyHidden.withComponent("h4");
const Book = styled(HorizontalListItem)`
margin-bottom: ${theme.space.l};
`;
const Cover = styled.img`
display: block;
max-width: 100%;
height: auto;
margin-bottom: ${theme.space.m};
`;
const button = css`
display: block;
margin-bottom: ${theme.space.s};
text-align: center;
`;
const Button = ({ href, children }) => (
<a
className={cx("btn", "btn--normal", button)}
href={href}
>
{children}
</a>
);
const Buy = () => {
return (
<HorizontalList aria-label="Other Juho's books">
<BuyMaintenance />
<BuyReact />
<BuyWebpack />
</HorizontalList>
);
};
const BuyMaintenance = () => (
<Book>
<a href="/maintenance/introduction">
<Title>
SurviveJS - Maintenance: Streamline JavaScript
Workflow
</Title>
<Cover
alt="Maintenance book cover"
src={require("assets/img/covers/maintenance-cover.svg")}
width="255"
height="329"
/>
</a>
<Button href="https://leanpub.com/survivejs-maintenance">
Buy at Leanpub
</Button>
</Book>
);
const BuyReact = () => (
<Book>
<a href="/react/introduction">
<Title>
SurviveJS - React: From apprentice to master
</Title>
<Cover
alt="React book cover"
src={require("assets/img/covers/react-cover.svg")}
width="255"
height="329"
/>
</a>
<Button href="https://leanpub.com/survivejs-react">
Buy at Leanpub
</Button>
</Book>
);
const BuyWebpack = () => (
<Book>
<a href="/webpack/foreword">
<Title>
SurviveJS - Webpack 5: From apprentice to master
</Title>
<Cover
alt="Webpack book cover"
src={require("assets/img/covers/webpack-cover.svg")}
width="255"
height="329"
/>
</a>
<Button href="https://leanpub.com/survivejs-webpack">
Buy at Leanpub
</Button>
<Button href="https://www.amazon.com/dp/B08P2C69PR">
Buy at Amazon
</Button>
<Button href="https://www.amazon.com/dp/B08P3S2G66">
Buy for Kindle
</Button>
</Book>
);
export default Buy;