-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPostLink.js
106 lines (91 loc) · 1.95 KB
/
PostLink.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
import React from 'react'
import styled from 'styled-components'
import { fonts } from 'styles/theme'
import { screen } from 'styles/screen'
import PostAuthor from './PostAuthor'
const Wrapper = styled.div`
border-bottom: 1px solid #bdc7d0;
margin-bottom: 30px;
`
const Block = styled.div`
display: inline-block;
vertical-align: top;
`
const Publication = styled(Block)`
display: inline-block;
width: 100%;
color: var(--text-primary);
font-family: ${fonts.title};
font-size: 14px;
letter-spacing: 0;
${screen.lg} {
width: 20%;
}
`
const Date = styled.div`
display: inline-block;
font-size: 12px;
font-weight: 500;
letter-spacing: 0;
line-height: 1.25em;
margin: 0 10px 5px 0;
${screen.lg} {
display: block;
margin: 0 10px 15px 0;
}
`
const Article = styled(Block)`
color: var(--text-primary);
display: inline-block;
width: 100%;
${screen.lg} {
width: 80%;
}
`
const Title = styled.h1`
font-family: ${fonts.title};
font-size: 24px;
font-weight: bold;
letter-spacing: 0;
line-height: 1.5em;
margin-bottom: 10px;
a {
text-decoration: none;
}
`
const Text = styled.p`
margin: 20px 0 10px 0;
font-family: ${fonts.text};
font-size: 17px;
font-weight: 400;
`
const ReadMore = styled.a`
color: var(--text-secondary);
display: block;
font-family: ${fonts.title};
font-size: 14px;
font-weight: bold;
letter-spacing: 0;
line-height: 18px;
margin-bottom: 15px;
text-align: right;
`
const PostLink = ({ post }) => (
<Wrapper>
<Publication>
<Date>{post.frontmatter.date}</Date>
<PostAuthor
author={post.frontmatter.author}
twitter={post.frontmatter.twitter}
/>
</Publication>
<Article>
<Title>
<a href={post.frontmatter.path}>{post.frontmatter.title}</a>
</Title>
<Text>{post.excerpt}</Text>
<ReadMore href={post.frontmatter.path}>read more</ReadMore>
</Article>
</Wrapper>
)
export default PostLink