-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
5 changed files
with
69 additions
and
9 deletions.
There are no files selected for viewing
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/views/CreateAccountSuccess/CreateAccountSuccess.stories.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 { Meta } from '@storybook/react'; | ||
|
||
import { CreateAccountSuccess } from './CreateAccountSuccess'; | ||
|
||
export default { | ||
title: 'Views/CreateAccountSuccess', | ||
component: CreateAccountSuccess, | ||
} as Meta; | ||
|
||
export function Create(): JSX.Element { | ||
return <CreateAccountSuccess />; | ||
} | ||
|
||
export function Import(): JSX.Element { | ||
return <CreateAccountSuccess type="import" />; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
import { browser } from 'webextension-polyfill-ts'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
export function CreateAccountSuccess(): JSX.Element { | ||
interface Props { | ||
type?: 'create' | 'import'; | ||
} | ||
|
||
export function CreateAccountSuccess({ type = 'create' }: Props): JSX.Element { | ||
const t = browser.i18n.getMessage; | ||
return ( | ||
<main> | ||
<h1>{t('view_CreateAccountSuccess_heading')}</h1> | ||
<p>{t('view_CreateAccountSuccess_message')}</p> | ||
|
||
<p> | ||
{type === 'create' && t('view_CreateAccountSuccess_message_create')} | ||
{type === 'import' && t('view_CreateAccountSuccess_message_import')} | ||
</p> | ||
|
||
<Link to="/">{t('view_CreateAccountSuccess_CTA')}</Link> | ||
</main> | ||
); | ||
} |
29 changes: 26 additions & 3 deletions
29
src/views/CreateAccountSuccess/__snapshots__/CreateAccountSuccess.test.tsx.snap
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 |
---|---|---|
@@ -1,14 +1,37 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`CreateAccountSuccess should render 1`] = ` | ||
exports[`CreateAccountSuccess should render for create 1`] = ` | ||
<div> | ||
<main> | ||
<h1> | ||
Congratulations | ||
Congratulations! | ||
</h1> | ||
<p> | ||
You have successfully created a KILT-Wallet | ||
You have successfully created a KILT Wallet | ||
</p> | ||
<a | ||
href="/" | ||
> | ||
See the wallet | ||
</a> | ||
</main> | ||
</div> | ||
`; | ||
|
||
exports[`CreateAccountSuccess should render for import 1`] = ` | ||
<div> | ||
<main> | ||
<h1> | ||
Congratulations! | ||
</h1> | ||
<p> | ||
You have successfully imported your KILT Wallet | ||
</p> | ||
<a | ||
href="/" | ||
> | ||
See the wallet | ||
</a> | ||
</main> | ||
</div> | ||
`; |