2021-09-03 12:59:44 +02:00
|
|
|
import { Box, Container, SimpleGrid } from '@chakra-ui/react';
|
2021-08-20 17:06:26 +02:00
|
|
|
import { GlobalHeader } from '../../components/global-header';
|
2021-08-15 10:39:46 +02:00
|
|
|
import { LinksList } from '../../components/links-list';
|
|
|
|
import { LinksListItem } from '../../components/links-list-item';
|
|
|
|
import { OpensourceBanner } from '../../components/opensource-banner';
|
|
|
|
import { Footer } from '../../components/footer';
|
2021-09-05 17:26:54 +02:00
|
|
|
import { GuideGridItem } from '../../components/guide/guide-grid-item';
|
2021-08-15 16:07:05 +02:00
|
|
|
import { PageHeader } from '../../components/page-header';
|
2021-09-03 12:59:44 +02:00
|
|
|
import { getAllGuides, GuideType } from '../../lib/guide';
|
2021-09-04 22:58:58 +02:00
|
|
|
import Helmet from '../../components/helmet';
|
2022-10-10 16:19:33 +04:00
|
|
|
import { TeamsBanner } from '../../components/teams-banner';
|
2021-09-03 10:11:33 +02:00
|
|
|
|
|
|
|
type GuidesProps = {
|
|
|
|
guides: GuideType[]
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function Guides(props: GuidesProps) {
|
|
|
|
const { guides = [] } = props;
|
|
|
|
|
|
|
|
const recentGuides = guides.slice(0, 2);
|
|
|
|
const oldGuides = guides.slice(2);
|
2021-08-15 10:39:46 +02:00
|
|
|
|
2021-08-14 20:29:05 +02:00
|
|
|
return (
|
2021-08-15 10:39:46 +02:00
|
|
|
<Box bg='white' minH='100vh'>
|
2021-08-20 17:06:26 +02:00
|
|
|
<GlobalHeader />
|
2021-09-04 22:58:58 +02:00
|
|
|
<Helmet
|
|
|
|
title={'Visual Guides'}
|
|
|
|
description={'Succinct graphical explanations to engineering topics.'}
|
|
|
|
/>
|
2021-08-15 10:39:46 +02:00
|
|
|
<Box mb='60px'>
|
2021-08-15 16:07:05 +02:00
|
|
|
<PageHeader
|
|
|
|
title={'Visual Guides'}
|
2021-09-03 10:52:43 +02:00
|
|
|
subtitle={'Succinct graphical explanations to engineering topics.'}
|
2021-08-15 16:07:05 +02:00
|
|
|
/>
|
|
|
|
<Container maxW='container.md' position='relative'>
|
2021-08-28 15:28:20 +02:00
|
|
|
<SimpleGrid columns={[1, 1, 2]} mb='30px' spacing={['10px', '10px', '15px']}>
|
2021-09-03 10:11:33 +02:00
|
|
|
{recentGuides.map((recentGuide, counter) => (
|
|
|
|
<GuideGridItem
|
|
|
|
key={recentGuide.id}
|
2021-09-03 16:27:30 +02:00
|
|
|
href={`/guides/${recentGuide.id}`}
|
2021-09-03 10:11:33 +02:00
|
|
|
title={recentGuide.title}
|
|
|
|
subtitle={recentGuide.description}
|
2021-09-03 12:59:44 +02:00
|
|
|
date={recentGuide.formattedUpdatedAt!}
|
2022-09-21 15:18:02 +04:00
|
|
|
isNew={recentGuide.isNew}
|
2022-09-19 15:33:12 +04:00
|
|
|
type={recentGuide.type}
|
2021-09-03 10:11:33 +02:00
|
|
|
colorIndex={counter}
|
|
|
|
/>
|
|
|
|
))}
|
2021-08-28 15:28:20 +02:00
|
|
|
</SimpleGrid>
|
2021-08-15 10:39:46 +02:00
|
|
|
|
|
|
|
<LinksList>
|
2021-09-03 10:11:33 +02:00
|
|
|
{oldGuides.map(oldGuide => (
|
|
|
|
<LinksListItem
|
2021-09-03 16:27:30 +02:00
|
|
|
href={`/guides/${oldGuide.id}`}
|
2021-09-03 10:11:33 +02:00
|
|
|
key={oldGuide.id}
|
|
|
|
title={oldGuide.title}
|
2022-08-13 23:32:07 +04:00
|
|
|
badgeText={oldGuide.isNew ? 'NEW' : ''}
|
2022-09-19 15:33:12 +04:00
|
|
|
subtitle={`${oldGuide?.type?.charAt(0).toUpperCase()}${oldGuide?.type?.slice(1)}`}
|
2021-09-03 10:11:33 +02:00
|
|
|
/>
|
|
|
|
))}
|
2021-08-15 10:39:46 +02:00
|
|
|
</LinksList>
|
|
|
|
</Container>
|
|
|
|
</Box>
|
|
|
|
|
|
|
|
<OpensourceBanner />
|
2022-10-10 16:19:33 +04:00
|
|
|
<TeamsBanner />
|
2021-08-15 10:39:46 +02:00
|
|
|
<Footer />
|
|
|
|
</Box>
|
2021-08-14 20:29:05 +02:00
|
|
|
);
|
|
|
|
}
|
2021-09-03 10:11:33 +02:00
|
|
|
|
|
|
|
export async function getStaticProps() {
|
|
|
|
return {
|
|
|
|
props: {
|
|
|
|
guides: getAllGuides()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|