Skip to content

Commit

Permalink
Update error state
Browse files Browse the repository at this point in the history
  • Loading branch information
Atatakai authored and Atatakai committed May 24, 2024
1 parent 251a8bd commit 79a408a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
23 changes: 18 additions & 5 deletions frontend/components/Setup/Create/SetupCreateSafe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { useEffect, useState } from 'react';

import { Chain } from '@/client';
import { CardSection } from '@/components/styled/CardSection';
import { SUPPORT_URL } from '@/constants';
import { UNICODE_SYMBOLS } from '@/constants/unicode';
import { PageState } from '@/enums';
import { usePageState, useSetup } from '@/hooks';
import { useWallet } from '@/hooks/useWallet';
Expand All @@ -15,7 +17,7 @@ export const SetupCreateSafe = () => {
const { goto } = usePageState();

const [isCreatingSafe, setIsCreatingSafe] = useState(false);
const [isError, setIsError] = useState(true);
const [isError, setIsError] = useState(false);

useEffect(() => {
if (isCreatingSafe) return;
Expand All @@ -41,13 +43,24 @@ export const SetupCreateSafe = () => {
padding="80px 24px"
gap={12}
>
<Image src="/onboarding-robot.svg" alt="logo" width={80} height={80} />
{isError ? (
<Typography.Text type="secondary">
Error, please contact support
</Typography.Text>
<>
<Image src="/broken-robot.svg" alt="logo" width={80} height={80} />
<Typography.Text type="secondary" className="mt-12">
Error, please contact{' '}
<a target="_blank" href={SUPPORT_URL}>
Olas community {UNICODE_SYMBOLS.EXTERNAL_LINK}
</a>
</Typography.Text>
</>
) : (
<>
<Image
src="/onboarding-robot.svg"
alt="logo"
width={80}
height={80}
/>
<Typography.Title
level={4}
className="m-0 mt-12 loading-ellipses"
Expand Down
2 changes: 2 additions & 0 deletions frontend/constants/urls.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const BACKEND_URL: string = `http://localhost:${process.env.NEXT_PUBLIC_BACKEND_PORT || 8000}/api`;
export const COW_SWAP_GNOSIS_XDAI_OLAS_URL: string =
'https://swap.cow.fi/#/100/swap/WXDAI/OLAS';
export const SUPPORT_URL =
'https://discord.com/channels/899649805582737479/1169275451089367131';
9 changes: 9 additions & 0 deletions frontend/public/broken-robot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 79a408a

Please sign in to comment.