Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 90a278d

Browse files
feat: added error/loading states for viewing a snippet
1 parent e1273c3 commit 90a278d

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { Flex, Link } from '@chakra-ui/react';
2+
import { EmptyState } from '@codiga/components';
3+
import { Link as RouterLink } from 'react-router-dom';
4+
import { APP_URL } from 'renderer/lib/config';
5+
6+
export default function ViewSnippetError() {
7+
return (
8+
<EmptyState
9+
title="Oops! An error occurred."
10+
description="We couldn't find that snippet."
11+
illustration="empty"
12+
py="space_64"
13+
>
14+
<Flex gridGap="space_16">
15+
<Link as={RouterLink} to="/" variant="secondary" size="sm">
16+
Go Home
17+
</Link>
18+
<Link
19+
isExternal
20+
href={`${APP_URL}/support`}
21+
variant="primary"
22+
size="sm"
23+
>
24+
Contact Support
25+
</Link>
26+
</Flex>
27+
</EmptyState>
28+
);
29+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { HStack, Skeleton } from '@chakra-ui/react';
2+
3+
export default function ViewSnippetLoading() {
4+
return (
5+
<HStack
6+
alignItems="center"
7+
bg="neutral.25"
8+
_dark={{ bg: 'base.dark' }}
9+
h="74px"
10+
w="full"
11+
spacing="space_16"
12+
>
13+
<Skeleton h="28px" w="28px" />
14+
<Skeleton h="26px" w="26px" />
15+
<Skeleton h="26px" w="200px" />
16+
<Skeleton h="28px" w="100px" />
17+
<Skeleton h="28px" w="100px" />
18+
<Skeleton h="28px" w="100px" />
19+
</HStack>
20+
);
21+
}

0 commit comments

Comments
 (0)