This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/server/pages/Changelog.js

79 lines
1.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// @flow
import * as React from 'react';
import format from 'date-fns/format';
import styled from 'styled-components';
import Grid from 'styled-components-grid';
import { Helmet } from 'react-helmet';
import Markdown from './components/Markdown';
import Header from './components/Header';
import Content from './components/Content';
type Release = {
id: string,
name: string,
body: string,
created_at: string,
};
function Changelog({ releases }: { releases: Release[] }) {
return (
<Grid>
<Helmet>
<title>Changelog</title>
</Helmet>
<Header background="#00ADFF">
<h1>Changelog</h1>
<p>
Were building in public. Heres what weve been changing recently.
</p>
</Header>
<Content>
{releases.map(release => (
<Article key={release.id}>
<Heading id={release.name}>
<a href={`#${release.name}`}>{release.name}</a>
</Heading>
<Time dateTime={release.created_at}>
{format(new Date(release.created_at), 'MMMM Do, YYYY')}
</Time>
<Markdown source={release.body} />
</Article>
))}
</Content>
</Grid>
);
}
const Heading = styled.h1`
a {
color: ${props => props.theme.text};
}
a:hover {
text-decoration: underline;
}
`;
const Time = styled.time`
color: ${props => props.theme.slateDark};
margin-top: -16px;
display: block;
`;
const Article = styled.div`
border-bottom: 1px solid ${props => props.theme.slateLight};
padding-bottom: 2em;
&:last-child {
border-bottom: 0;
}
img {
max-width: 100%;
zoom: 50%;
box-shadow: 0 10px 80px rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);
border-radius: 8px;
}
`;
export default Changelog;