-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WALL]/ Sergei / wall 2698 / create sketch of change investor passwor…
…d screens (#11684) * feat: add scetch of MT5ChangeInvestorPasswordScreens component * feat: change text size for emailSendContent * feat: change WalletButton size * feat: change some button styles * feat: complete scetch of change investor password screens
- Loading branch information
1 parent
befa74c
commit 9ffa897
Showing
7 changed files
with
142 additions
and
10 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
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
106 changes: 106 additions & 0 deletions
106
...ages/wallets/src/features/cfd/screens/ChangePassword/MT5ChangeInvestorPasswordScreens.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,106 @@ | ||
import React, { useState } from 'react'; | ||
import { | ||
SentEmailContent, | ||
WalletButton, | ||
WalletPasswordField, | ||
WalletsActionScreen, | ||
WalletText, | ||
} from '../../../../components'; | ||
import { useModal } from '../../../../components/ModalProvider'; | ||
import useDevice from '../../../../hooks/useDevice'; | ||
import MT5PasswordUpdatedIcon from '../../../../public/images/ic-mt5-password-updated.svg'; | ||
|
||
type TChangeInvestorPasswordScreenIndex = 'emailVerification' | 'introScreen' | 'savedScreen'; | ||
|
||
const MT5ChangeInvestorPasswordScreens = () => { | ||
const [currentInvestorPassword, setCurrentInvestorPassword] = useState(''); | ||
const [newInvestorPassword, setNewInvestorPassword] = useState(''); | ||
|
||
const [activeScreen, setActiveScreen] = useState<TChangeInvestorPasswordScreenIndex>('introScreen'); | ||
const handleClick = (nextScreen: TChangeInvestorPasswordScreenIndex) => setActiveScreen(nextScreen); | ||
|
||
const { isMobile } = useDevice(); | ||
const { hide } = useModal(); | ||
|
||
const ChangeInvestorPasswordScreens = { | ||
introScreen: { | ||
bodyText: ( | ||
<> | ||
<WalletText size='sm'> | ||
Use this password to grant viewing access to another user. While they may view your trading | ||
account, they will not be able to trade or take any other actions. | ||
</WalletText> | ||
<WalletText size='sm'> | ||
If this is the first time you try to create a password, or you have forgotten your password, | ||
please reset it. | ||
</WalletText> | ||
</> | ||
), | ||
button: ( | ||
<div className='wallets-change-password__investor-password'> | ||
<div className='wallets-change-password__investor-password-fields'> | ||
<WalletPasswordField | ||
key='current_password' | ||
label={`Current investor password`} | ||
onChange={e => setCurrentInvestorPassword(e.target.value)} | ||
password={currentInvestorPassword} | ||
/> | ||
<WalletPasswordField | ||
key='new_password' | ||
label={`New investor password`} | ||
onChange={e => setNewInvestorPassword(e.target.value)} | ||
password={newInvestorPassword} | ||
/> | ||
</div> | ||
<div className='wallets-change-password__investor-password-buttons'> | ||
<WalletButton | ||
disabled={currentInvestorPassword.length < 8 || newInvestorPassword.length < 8} | ||
onClick={() => handleClick('savedScreen')} | ||
size={isMobile ? 'lg' : 'md'} | ||
text='Change investor password' | ||
/> | ||
<WalletButton | ||
onClick={() => handleClick('emailVerification')} | ||
size={isMobile ? 'lg' : 'md'} | ||
text='Create or reset investor password' | ||
variant='ghost' | ||
/> | ||
</div> | ||
</div> | ||
), | ||
headingText: undefined, | ||
icon: undefined, | ||
}, | ||
savedScreen: { | ||
bodyText: ( | ||
<WalletText align='center' size='sm'> | ||
Your investor password has been changed. | ||
</WalletText> | ||
), | ||
button: <WalletButton onClick={() => hide()} size='lg' text='Okay' />, | ||
headingText: 'Password saved', | ||
icon: <MT5PasswordUpdatedIcon />, | ||
}, | ||
}; | ||
|
||
if (activeScreen === 'emailVerification') | ||
return ( | ||
<div className='wallets-change-password__sent-email-wrapper'> | ||
<SentEmailContent description='Please click on the link in the email to reset your password.' /> | ||
</div> | ||
); | ||
|
||
return ( | ||
<div className='wallets-change-password__content'> | ||
<WalletsActionScreen | ||
description={ChangeInvestorPasswordScreens[activeScreen].bodyText} | ||
descriptionSize='sm' | ||
icon={ChangeInvestorPasswordScreens[activeScreen].icon} | ||
renderButtons={() => ChangeInvestorPasswordScreens[activeScreen].button} | ||
title={ChangeInvestorPasswordScreens[activeScreen].headingText} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MT5ChangeInvestorPasswordScreens; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9ffa897
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
deriv-app – ./
deriv-app.vercel.app
deriv-app.binary.sx
binary.sx
deriv-app-git-master.binary.sx