1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-02-24 11:33:09 +01:00

130 lines
4.6 KiB
TypeScript
Raw Normal View History

2021-08-14 22:43:25 +02:00
import { Box, Container, Heading, Link, SimpleGrid, Text } from '@chakra-ui/react';
2021-08-20 17:06:26 +02:00
import { GlobalHeader } from '../components/global-header';
2021-08-14 14:01:42 +02:00
import { Footer } from '../components/footer';
import { UpdatesBanner } from '../components/updates-banner';
import { OpensourceBanner } from '../components/opensource-banner';
2021-08-14 20:29:05 +02:00
import { DimmedMore } from '../components/dimmed-more';
2021-08-14 22:43:25 +02:00
import { LinksListItem } from '../components/links-list-item';
import { VideoIcon } from '../icons/video-icon';
import { LinksList } from '../components/links-list';
2021-08-16 00:10:18 +02:00
import { HomeRoadmapItem } from './roadmaps/components/home-roadmap-item';
2021-08-29 16:05:19 +02:00
import { getFeaturedRoadmaps, RoadmapType } from '../lib/roadmap';
2021-08-29 16:34:00 +02:00
import { getAllGuides, GuideType } from '../lib/guide';
2021-08-29 18:57:23 +02:00
import { getAllVideos, VideoType } from '../lib/video';
2021-09-01 14:45:26 +02:00
import siteConfig from '../content/site.json';
2021-09-04 22:58:58 +02:00
import Helmet from '../components/helmet';
2021-08-29 16:05:19 +02:00
type HomeProps = {
2021-08-29 16:34:00 +02:00
roadmaps: RoadmapType[];
guides: GuideType[];
2021-08-29 18:57:23 +02:00
videos: VideoType[];
2021-08-29 16:05:19 +02:00
}
export default function Home(props: HomeProps) {
2021-08-29 18:57:23 +02:00
const { roadmaps, guides, videos } = props;
2021-08-01 13:08:35 +02:00
return (
2021-08-14 22:55:17 +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='Developer Roadmaps' />
2021-08-01 18:37:32 +02:00
<Box>
<Container maxW='container.md'>
2021-08-28 14:02:22 +02:00
<Box py={['23px', '23px', '35px']}>
<Heading fontSize={['22px', '22px', '28px']} mb={['8px', '8px', '15px']}>Hey there! 👋</Heading>
<Text fontSize={['14px', '14px', '16px']} mb='10px'>
2021-08-01 18:37:32 +02:00
<Text fontWeight={500} as='span'>roadmap.sh</Text> is a community effort to create roadmaps, guides and
other educational content
to help guide the developers in picking up the path and guide their learnings.
</Text>
2021-08-01 19:09:04 +02:00
2021-09-01 14:45:26 +02:00
<Text fontSize={['14px', '14px', '16px']}>We also have a <Link textDecoration={'underline'}
href={siteConfig.url.youtube}
target='_blank'
2021-08-28 14:02:22 +02:00
fontWeight={600}>YouTube
2021-08-14 22:57:40 +02:00
channel</Link> which we hope you are going to love.</Text>
2021-08-01 18:37:32 +02:00
</Box>
2021-08-28 14:02:22 +02:00
<SimpleGrid columns={[1, 2, 3]} spacing={['10px', '10px', '15px']}>
2021-08-29 16:05:19 +02:00
{roadmaps.map((roadmap: RoadmapType, counter: number) => (
<HomeRoadmapItem
2021-09-04 18:51:49 +02:00
url={`/${roadmap.id}`}
2021-08-29 21:31:29 +02:00
key={roadmap.id}
2021-08-29 16:05:19 +02:00
colorIndex={counter}
title={roadmap.featuredTitle}
isCommunity={roadmap.isCommunity}
subtitle={roadmap.featuredDescription}
/>
))}
2021-08-01 18:37:32 +02:00
</SimpleGrid>
</Container>
</Box>
2021-08-01 21:38:34 +02:00
<Box>
2021-08-02 18:15:42 +02:00
<Container maxW='container.md' position='relative'>
2021-08-28 14:02:22 +02:00
<Box pt='60px' mb={['10px', '15px', '20px']}>
<Heading color='green.500' fontSize={['20px', '20px', '25px']} mb='5px'>Visual Guides</Heading>
2021-08-01 21:38:34 +02:00
</Box>
2021-08-14 22:43:25 +02:00
<LinksList>
2021-08-29 16:34:00 +02:00
{guides.map(guide => (
<LinksListItem
2021-09-03 16:27:30 +02:00
key={guide.id}
href={`/guides/${guide.id}`}
2021-08-29 16:34:00 +02:00
title={guide.title}
badgeText={guide.isPro ? 'PRO' : ''}
2021-09-03 16:21:20 +02:00
subtitle={guide.formattedUpdatedAt!}
2021-08-29 16:34:00 +02:00
/>
))}
2021-09-01 14:45:26 +02:00
<DimmedMore href={'/guides'} text='View all Guides' />
2021-08-14 22:43:25 +02:00
</LinksList>
2021-08-01 21:38:34 +02:00
</Container>
</Box>
2021-08-02 18:15:42 +02:00
2021-08-15 10:39:46 +02:00
<Box mb='60px'>
2021-08-02 18:15:42 +02:00
<Container maxW='container.md'>
<Box pt='40px' mb='20px'>
<Heading color='green.500' fontSize='25px' mb='5px'>Video Explanations</Heading>
</Box>
2021-08-03 23:07:54 +02:00
2021-08-14 22:43:25 +02:00
<LinksList>
2021-08-29 18:57:23 +02:00
{videos.map(video => (
<LinksListItem
2021-09-03 15:59:03 +02:00
key={video.id}
2021-09-03 16:21:20 +02:00
href={`/watch/${video.id}`}
2021-08-29 21:29:14 +02:00
badgeText={video.isPro ? 'PRO' : ''}
2021-08-29 18:57:23 +02:00
hideSubtitleOnMobile
title={video.title}
subtitle={video.duration}
icon={
<VideoIcon
style={{
marginRight: '7px',
width: '18px',
height: '18px',
color: '#9c9c9c'
}}
/>
}
/>
))}
2021-09-01 14:45:26 +02:00
<DimmedMore href='/watch' text={'View all Videos'} />
2021-08-14 22:43:25 +02:00
</LinksList>
2021-08-02 18:15:42 +02:00
</Container>
</Box>
2021-08-12 17:09:15 +02:00
2021-08-14 14:01:42 +02:00
<OpensourceBanner />
<UpdatesBanner />
<Footer />
2021-08-01 18:37:32 +02:00
</Box>
);
2021-08-01 13:08:35 +02:00
}
2021-08-29 16:05:19 +02:00
export async function getStaticProps() {
return {
props: {
2021-08-29 16:34:00 +02:00
roadmaps: getFeaturedRoadmaps(),
2021-08-29 18:57:23 +02:00
guides: getAllGuides(10),
videos: getAllVideos(10)
2021-08-29 16:05:19 +02:00
}
};
}