Add interactive roadmap error handling and loading
This commit is contained in:
26
components/roadmap/roadmap-error.tsx
Normal file
26
components/roadmap/roadmap-error.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
import { RoadmapType } from '../../lib/roadmap';
|
||||
import { Container, Heading, Link, Text } from '@chakra-ui/react';
|
||||
import siteConfig from '../../content/site.json';
|
||||
|
||||
type RoadmapProps = {
|
||||
roadmap: RoadmapType;
|
||||
};
|
||||
|
||||
export function RoadmapError(props: RoadmapProps) {
|
||||
const { roadmap } = props;
|
||||
|
||||
return (
|
||||
<Container
|
||||
bg={'red.600'}
|
||||
maxW={'container.md'}
|
||||
position="relative"
|
||||
mt="50px"
|
||||
p='20px'
|
||||
rounded='5px'
|
||||
color='white'
|
||||
>
|
||||
<Heading mb='4px' size='md'>Oops! There's an error</Heading>
|
||||
<Text>Try refreshing or <Link target='_blank' fontWeight={700} textDecoration={'underline'} fontSize='14px' href={siteConfig.url.issue}>report a bug</Link> and use the <Link fontWeight={700} textDecoration={'underline'} href={`/${roadmap.id}`}>non-interactive version</Link></Text>
|
||||
</Container>
|
||||
);
|
||||
}
|
20
components/roadmap/roadmap-loader.tsx
Normal file
20
components/roadmap/roadmap-loader.tsx
Normal file
@ -0,0 +1,20 @@
|
||||
import { Container, Spinner } from '@chakra-ui/react';
|
||||
|
||||
export function RoadmapLoader() {
|
||||
return (
|
||||
<Container
|
||||
maxW={'container.md'}
|
||||
position="relative"
|
||||
mt="60px"
|
||||
textAlign="center"
|
||||
>
|
||||
<Spinner
|
||||
thickness="7px"
|
||||
speed="0.65s"
|
||||
emptyColor="gray.200"
|
||||
color="gray.500"
|
||||
size="xl"
|
||||
/>
|
||||
</Container>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user