iconoir/iconoir.com/pages/docs/changelog.tsx

91 lines
2.5 KiB
TypeScript
Raw Normal View History

2023-01-11 19:08:14 +01:00
import { serialize } from 'next-mdx-remote/serialize';
import remarkGfm from 'remark-gfm';
import {
ChangelogEntry,
ChangelogEntryProps,
} from '../../components/ChangelogEntry';
2023-01-11 19:08:14 +01:00
import { REPO } from '../../lib/constants';
import {
DocumentationNavigation,
DocumentationNavigationProps,
} from '../../components/DocumentationNavigation';
import { Footer } from '../../components/Footer';
import { Header, HeaderProps } from '../../components/Header';
import { Layout } from '../../components/Layout';
2023-01-11 19:08:14 +01:00
import { ReadOnGitHub } from '../../components/ReadOnGitHub';
import { SEO } from '../../components/SEO';
import { H1 } from '../../components/Typography';
import { getHeaderProps } from '../../lib/getHeaderProps';
2023-01-11 19:08:14 +01:00
import { octokit } from '../../lib/octokit';
import {
Container,
ContentContainer,
getDocumentationStructure,
InnerContentContainer,
NavigationContainer,
} from './[...slug]';
export interface ChangelogProps extends HeaderProps {
documentationProps: DocumentationNavigationProps;
entries: ChangelogEntryProps[];
}
export default function Changelog({
documentationProps,
entries,
...headerProps
}: ChangelogProps) {
return (
<Layout>
<SEO title={'Changelog'} />
feat: new website (#261) * add: website redesign and optimization * fix: additional improvements in home, support, and doc * fix: typography and spacing * fix: moved praise to support page * fix: redesigned support page * feat: added new pillars and paragraphs * fix: changed table colors * fix: shortened home * fix: small improvements to support page * fix: optimized mobile version * feat: added Ad on mobile * Remove outdated color prop from CurrentVersion * Small format fixes * fix: removed prefixes in Slider.tsx Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> * fix: removed prefixes in Button.tsx Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> * fix: removed unused const Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> * fix: correctly renamed const Overlay Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> * fix: applied same button style to the Copy button Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> * fix: Removed unnecessary prefix properties, fixed transition Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> * fix: Added non prefixed property in Stats.tsx Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> * fix: Added transition effect on mouse out as well Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> * fix: Removed a repeated property in Input.tsx Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> * fix: Changed home title Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> * fix: Changed icons to icon Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> --------- Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-03-19 21:23:43 +01:00
<Header {...headerProps} />
<Container>
<NavigationContainer>
<DocumentationNavigation {...documentationProps} />
</NavigationContainer>
<ContentContainer>
<InnerContentContainer>
<H1 style={{ marginBottom: 72 }}>Changelog</H1>
{entries.map((entry) => (
<ChangelogEntry key={entry.name} {...entry} />
))}
2023-01-11 19:08:14 +01:00
<ReadOnGitHub path={'../../releases'} resource="the releases" />
</InnerContentContainer>
</ContentContainer>
</Container>
<Footer />
</Layout>
);
}
export async function getStaticProps() {
const { data: releases } = await octokit.rest.repos.listReleases({
...REPO,
});
const entries: ChangelogEntryProps[] = [];
2023-10-29 00:33:17 +02:00
for (const release of releases) {
entries.push({
name: release.name || release.tag_name,
2023-01-11 19:08:14 +01:00
url: release.html_url,
created_at: release.created_at,
2023-01-11 19:08:14 +01:00
...(release.body && {
body: await serialize(release.body, {
mdxOptions: {
remarkPlugins: [require('remark-prism'), remarkGfm],
},
}),
}),
});
}
2023-10-29 00:33:17 +02:00
const items = getDocumentationStructure();
2023-10-29 00:33:17 +02:00
return {
props: {
entries,
...getHeaderProps(),
documentationProps: { documentationItems: items },
},
};
}