forked from deriv-com/deriv-app
-
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.
[TRAH] Sergei / TRAH - 2832 / Password setting modal (deriv-com#13703)
* feat: create useClientCountry hook * feat: intermediate result * feat: done with citizenship modal * feat: move changes back for AppContent * fix: sonarcloud issue * feat: implement review comments * feat: implement review comments #2 * feat: create PasswordSettingModal component * chore: delete unused import * feat: add custom style * feat: set text by center
- Loading branch information
1 parent
5905a61
commit 7e5fad7
Showing
5 changed files
with
60 additions
and
14 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
packages/tradershub/src/flows/Signup/PasswordSettingModal/PasswordSettingModal.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,42 @@ | ||
import React, { ChangeEvent } from 'react'; | ||
import { useFormikContext } from 'formik'; | ||
import { validPassword } from '@/utils'; | ||
import { Button, PasswordInput, Text } from '@deriv-com/ui'; | ||
import { TSignupFormValues } from '../SignupWrapper/SignupWrapper'; | ||
|
||
const PasswordSettingModal = () => { | ||
const { values, setFieldValue } = useFormikContext<TSignupFormValues>(); | ||
|
||
const onPasswordChange = (e: ChangeEvent<HTMLInputElement>) => { | ||
setFieldValue('password', e.target.value); | ||
}; | ||
|
||
return ( | ||
<div className='h-full rounded-default max-w-[328px] lg:max-w-[440px] bg-system-light-primary-background'> | ||
<div className='flex flex-col p-16 space-y-16 lg:space-y-24 lg:p-24'> | ||
<Text align='center' weight='bold'> | ||
Keep your account secure with a password | ||
</Text> | ||
<PasswordInput | ||
isFullWidth | ||
label='Create a password' | ||
onChange={onPasswordChange} | ||
value={values.password} | ||
/> | ||
<Text align='center' size='xs'> | ||
Strong passwords contain at least 8 characters. combine uppercase and lowercase letters, numbers, | ||
and symbols. | ||
</Text> | ||
<Button | ||
className='w-full lg:self-end lg:w-fit' | ||
disabled={!validPassword(values.password)} | ||
type='submit' | ||
> | ||
Start trading | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PasswordSettingModal; |
1 change: 1 addition & 0 deletions
1
packages/tradershub/src/flows/Signup/PasswordSettingModal/index.ts
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 @@ | ||
export { default as PasswordSettingModal } from './PasswordSettingModal'; |
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