-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a9771e
commit 228e9b7
Showing
11 changed files
with
148 additions
and
57 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { ReactNode } from 'react'; | ||
import { Box, Flex, Text, color, Button } from '@stacks/ui'; | ||
|
||
import { Title } from '@app/components/typography'; | ||
import GenericError from '@assets/images/generic-error.png'; | ||
|
||
interface ErrorProps { | ||
body: string; | ||
helpTextList: ReactNode[]; | ||
onClose(): void; | ||
title: string; | ||
} | ||
export function GenericErrorLayout(props: ErrorProps) { | ||
const { body, helpTextList, onClose, title } = props; | ||
|
||
return ( | ||
<Flex alignItems="center" flexDirection="column" px={['loose', 'unset']} width="100%"> | ||
<Box mt="loose"> | ||
<img src={GenericError} width="106px" /> | ||
</Box> | ||
<Title fontSize={4} mt="loose"> | ||
{title} | ||
</Title> | ||
<Text | ||
color={color('text-caption')} | ||
fontSize="16px" | ||
lineHeight="1.6" | ||
mt="base" | ||
textAlign="center" | ||
> | ||
{body} | ||
</Text> | ||
<Box | ||
as="ul" | ||
border="2px solid #EFEFF2" | ||
borderRadius="12px" | ||
color={color('text-caption')} | ||
fontSize="14px" | ||
lineHeight="1.6" | ||
mt="extra-loose" | ||
pb="loose" | ||
pl="40px" | ||
pr="loose" | ||
pt="tight" | ||
width="100%" | ||
> | ||
{helpTextList} | ||
<Box as="li" mt="base"> | ||
Still stuck? Reach out to{' '} | ||
<Text | ||
as="button" | ||
color={color('accent')} | ||
onClick={() => { | ||
window.open('mailto:[email protected]'); | ||
window.close(); | ||
}} | ||
> | ||
[email protected] | ||
</Text> | ||
</Box> | ||
</Box> | ||
<Button fontSize="14px" mt="base-tight" onClick={onClose} p="base" variant="link"> | ||
Close window | ||
</Button> | ||
</Flex> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ReactNode } from 'react'; | ||
|
||
import { Header } from '@app/components/header'; | ||
import { useRouteHeader } from '@app/common/hooks/use-route-header'; | ||
|
||
import { GenericErrorLayout } from './generic-error.layout'; | ||
|
||
interface ErrorProps { | ||
body: string; | ||
helpTextList: ReactNode[]; | ||
onClose?(): void; | ||
title: string; | ||
} | ||
export function GenericError(props: ErrorProps) { | ||
const { body, helpTextList, onClose = () => window.close(), title } = props; | ||
|
||
useRouteHeader(<Header hideActions />); | ||
|
||
return ( | ||
<GenericErrorLayout body={body} helpTextList={helpTextList} onClose={onClose} title={title} /> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/app/pages/unauthorized-request/unauthorized-request.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Box } from '@stacks/ui'; | ||
|
||
import { GenericError } from '@app/components/generic-error/generic-error'; | ||
|
||
const body = `The transaction request was not properly authorized by any of your Hiro Wallet accounts. This typically happens if you've logged into this app before using another account.`; | ||
const helpTextList = [ | ||
<Box as="li" mt="base"> | ||
Please sign out of the app and sign back in to re-authenticate into the application. This should | ||
help you successfully sign your transaction with the Hiro Wallet. | ||
</Box>, | ||
]; | ||
const title = 'Unauthorized request'; | ||
|
||
export function UnauthorizedRequest() { | ||
return <GenericError body={body} helpTextList={helpTextList} title={title} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters