forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wallet-ext: import mnemonic flow step two (password)
- Loading branch information
1 parent
a3473ac
commit eb6a9cc
Showing
19 changed files
with
253 additions
and
132 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
.arrow-action-icon { | ||
font-size: 10px; | ||
color: #adcadd; | ||
margin-left: 12px; | ||
font-weight: 300; | ||
} | ||
|
||
|
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
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
32 changes: 32 additions & 0 deletions
32
apps/wallet/src/ui/app/pages/initialize/import/steps/StepTwo.module.scss
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,32 @@ | ||
@use '_values/colors'; | ||
|
||
.form { | ||
display: flex; | ||
flex-flow: column nowrap; | ||
align-self: stretch; | ||
flex: 1; | ||
} | ||
|
||
.fill { | ||
flex: 1; | ||
} | ||
|
||
.actions { | ||
display: flex; | ||
flex-flow: row nowrap; | ||
gap: 10px; | ||
} | ||
|
||
.btn { | ||
flex: 1; | ||
} | ||
|
||
.prev { | ||
font-size: 10px; | ||
font-weight: 500; | ||
} | ||
|
||
.next { | ||
font-size: 10px; | ||
font-weight: 300; | ||
} |
69 changes: 69 additions & 0 deletions
69
apps/wallet/src/ui/app/pages/initialize/import/steps/StepTwo.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,69 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { Form, Formik } from 'formik'; | ||
import { object } from 'yup'; | ||
|
||
import Button from '_app/shared/button'; | ||
import Icon, { SuiIcons } from '_components/icon'; | ||
import Loading from '_components/loading'; | ||
import PasswordFields from '_pages/initialize/shared/password-fields'; | ||
import { passwordFieldsValidation } from '_pages/initialize/shared/password-fields/validation'; | ||
|
||
import type { StepProps } from '.'; | ||
|
||
import st from './StepTwo.module.scss'; | ||
|
||
const validationSchema = object(passwordFieldsValidation); | ||
|
||
export default function StepTwo({ next, data }: StepProps) { | ||
return ( | ||
<Formik | ||
initialValues={data} | ||
validationSchema={validationSchema} | ||
validateOnMount={true} | ||
onSubmit={async (values) => { | ||
await next(values, 1); | ||
}} | ||
enableReinitialize={true} | ||
> | ||
{({ isSubmitting, isValid, values }) => ( | ||
<Form className={st.form}> | ||
<PasswordFields /> | ||
<div className={st.fill} /> | ||
<div className={st.actions}> | ||
<Button | ||
type="button" | ||
disabled={isSubmitting} | ||
className={st.btn} | ||
mode="neutral" | ||
size="large" | ||
onClick={() => next(values, -1)} | ||
> | ||
<Icon | ||
icon={SuiIcons.ArrowLeft} | ||
className={st.prev} | ||
/> | ||
Back | ||
</Button> | ||
<Button | ||
type="submit" | ||
disabled={isSubmitting || !isValid} | ||
mode="primary" | ||
className={st.btn} | ||
size="large" | ||
> | ||
<Loading loading={isSubmitting}> | ||
Import | ||
<Icon | ||
icon={SuiIcons.ArrowRight} | ||
className={st.next} | ||
/> | ||
</Loading> | ||
</Button> | ||
</div> | ||
</Form> | ||
)} | ||
</Formik> | ||
); | ||
} |
Oops, something went wrong.