forked from jaredpalmer/tsdx
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathrelease.js
More file actions
37 lines (33 loc) · 828 Bytes
/
release.js
File metadata and controls
37 lines (33 loc) · 828 Bytes
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
import { Box, Text } from '@chakra-ui/react';
import Markdown from 'markdown-to-jsx';
const Release = (props) => {
const { url, name, date, body } = props;
return (
<Box>
<Text fontWeight="bold" fontSize="3xl">
#{' '}
<a href={url} target="_blank" rel="noopener noreferrer">
{name}
</a>
</Text>
<Text>
Published on{' '}
<Text as="span" color="blue.500">{`${new Date(
date
).toDateString()}.`}</Text>
</Text>
<Markdown>{body}</Markdown>
</Box>
);
};
const ReleasesRenderer = ({ releases }) => {
return releases.map((release) => (
<Release
date={release.published_at}
name={release.tag_name}
body={release.body}
url={release.html_url}
/>
));
};
export default ReleasesRenderer;