Refactor roadmap page logic

pull/936/head
Kamran Ahmed 3 years ago
parent 098303b78b
commit f500d49275
  1. 24
      pages/[roadmap]/index.tsx
  2. 4
      pages/roadmaps.tsx

@ -1,30 +1,12 @@
import { import React from 'react';
Box, import { Box, Container, Image } from '@chakra-ui/react';
Button,
Text,
Container,
Link,
Stack,
Badge,
} from '@chakra-ui/react';
import {
ArrowBackIcon,
AtSignIcon,
DownloadIcon,
ViewIcon,
} from '@chakra-ui/icons';
import { GlobalHeader } from '../../components/global-header'; import { GlobalHeader } from '../../components/global-header';
import { OpensourceBanner } from '../../components/opensource-banner'; import { OpensourceBanner } from '../../components/opensource-banner';
import { UpdatesBanner } from '../../components/updates-banner'; import { UpdatesBanner } from '../../components/updates-banner';
import { Footer } from '../../components/footer'; import { Footer } from '../../components/footer';
import { PageHeader } from '../../components/page-header';
import { getAllRoadmaps, getRoadmapById, RoadmapType } from '../../lib/roadmap'; import { getAllRoadmaps, getRoadmapById, RoadmapType } from '../../lib/roadmap';
import MdRenderer from '../../components/md-renderer'; import MdRenderer from '../../components/md-renderer';
import Helmet from '../../components/helmet'; import Helmet from '../../components/helmet';
import siteConfig from '../../content/site.json';
import React from 'react';
import { event } from '../../lib/gtag';
import { NewAlertBanner } from '../../components/roadmap/new-alert-banner';
import { RoadmapPageHeader } from '../../components/roadmap/roadmap-page-header'; import { RoadmapPageHeader } from '../../components/roadmap/roadmap-page-header';
type RoadmapProps = { type RoadmapProps = {
@ -40,7 +22,7 @@ function ImageRoadmap(props: RoadmapProps) {
return ( return (
<Container maxW={'900px'} position="relative"> <Container maxW={'900px'} position="relative">
<Box mb="30px"> <Box mb="30px">
<img alt="Frontend Roadmap" src={roadmap.imagePath} /> <Image alt={roadmap.title} src={roadmap.imagePath} />
</Box> </Box>
</Container> </Container>
); );

@ -7,7 +7,7 @@ import { PageHeader } from '../components/page-header';
import { RoadmapGridItem } from '../components/roadmap/roadmap-grid-item'; import { RoadmapGridItem } from '../components/roadmap/roadmap-grid-item';
import { getAllRoadmaps, RoadmapType } from '../lib/roadmap'; import { getAllRoadmaps, RoadmapType } from '../lib/roadmap';
import Helmet from '../components/helmet'; import Helmet from '../components/helmet';
import { NewBanner } from './[roadmap]'; import { NewAlertBanner } from '../components/roadmap/new-alert-banner';
type RoadmapsProps = { type RoadmapsProps = {
roadmaps: RoadmapType[]; roadmaps: RoadmapType[];
@ -25,7 +25,7 @@ export default function Roadmaps(props: RoadmapsProps) {
/> />
<Box mb='60px'> <Box mb='60px'>
<PageHeader <PageHeader
beforeTitle={<NewBanner />} beforeTitle={<NewAlertBanner />}
title={'Developer Roadmaps'} title={'Developer Roadmaps'}
subtitle={'Step by step guides and paths to learn different tools or technologies'} subtitle={'Step by step guides and paths to learn different tools or technologies'}
/> />

Loading…
Cancel
Save