forked from binary-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.
Jim/wall 4000/too many attempts modal doesnt appear new (binary-com#1…
…5220) * chore: send email when forgot password is clicked * chore: add sendemail call to modal on mobile * chore: rename hook * docs: add tsdoc * chore: add sendemail to dependency array * chore: add error handling logic * chore: add error handling for sent email template * chore: add modal with lightbox in mobile Co-authored-by: adrienne-deriv <103016120+adrienne-deriv@users.noreply.github.com> * chore: add password limit modal * chore: remove prop causing re-rendering * chore: remove title from email modal * chore: move modal title from the body to the header * chore: rename classes --------- Co-authored-by: adrienne-deriv <103016120+adrienne-deriv@users.noreply.github.com>
- Loading branch information
1 parent
5fdf2bd
commit b88f5c4
Showing
6 changed files
with
159 additions
and
2 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
41 changes: 41 additions & 0 deletions
41
...allets/src/features/cfd/modals/PasswordLimitExceededModal/PasswordLimitExceededModal.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,41 @@ | ||
.wallets-password-limit-exceeded-modal { | ||
position: relative; | ||
display: flex; | ||
flex-direction: column; | ||
background: var(--system-light-8-primary-background, #fff); | ||
border-radius: 0.8rem; | ||
width: 44rem; | ||
height: 18rem; | ||
padding: 2.4rem; | ||
gap: 2.4rem; | ||
@include mobile { | ||
width: 100%; | ||
height: 100%; | ||
padding: 0; | ||
gap: 0; | ||
} | ||
&__title { | ||
display: flex; | ||
width: 100%; | ||
@include mobile { | ||
padding: 2rem; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
} | ||
&__content { | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: stretch; | ||
|
||
@include mobile { | ||
padding: 1rem; | ||
} | ||
} | ||
&__buttons { | ||
display: flex; | ||
gap: 0.8rem; | ||
justify-content: flex-end; | ||
} | ||
} |
87 changes: 87 additions & 0 deletions
87
...wallets/src/features/cfd/modals/PasswordLimitExceededModal/PasswordLimitExceededModal.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,87 @@ | ||
import React from 'react'; | ||
import { | ||
ModalStepWrapper, | ||
ModalWrapper, | ||
WalletButton, | ||
WalletButtonGroup, | ||
WalletText, | ||
} from '../../../../components/Base'; | ||
import useDevice from '../../../../hooks/useDevice'; | ||
import './PasswordLimitExceededModal.scss'; | ||
|
||
type TProps = { | ||
onPrimaryClick: () => void; | ||
onSecondaryClick: () => void; | ||
}; | ||
|
||
const PasswordLimitExceededModal: React.FC<TProps> = ({ onPrimaryClick, onSecondaryClick }) => { | ||
const { isMobile } = useDevice(); | ||
const textSize = isMobile ? 'md' : 'sm'; | ||
const alignment = isMobile ? 'center' : 'start'; | ||
if (isMobile) { | ||
return ( | ||
<ModalStepWrapper | ||
renderFooter={() => { | ||
return ( | ||
<WalletButtonGroup isFullWidth> | ||
<WalletButton | ||
borderWidth='md' | ||
isFullWidth | ||
onClick={onSecondaryClick} | ||
size='lg' | ||
textSize='md' | ||
variant='outlined' | ||
> | ||
Forgot password? | ||
</WalletButton> | ||
<WalletButton isFullWidth onClick={onPrimaryClick} size='lg' textSize='md'> | ||
Try later | ||
</WalletButton> | ||
</WalletButtonGroup> | ||
); | ||
}} | ||
title='Too many attempts' | ||
> | ||
<div className='wallets-password-limit-exceeded-modal'> | ||
<div className='wallets-password-limit-exceeded-modal__content'> | ||
<WalletText align={alignment} size={textSize}> | ||
Please try again in a minute. | ||
</WalletText> | ||
</div> | ||
</div> | ||
</ModalStepWrapper> | ||
); | ||
} | ||
return ( | ||
<ModalWrapper hideCloseButton> | ||
<div className='wallets-password-limit-exceeded-modal'> | ||
<div className='wallets-password-limit-exceeded-modal__title'> | ||
<WalletText align='start' weight='bold'> | ||
Too many attempts | ||
</WalletText> | ||
</div> | ||
<div className='wallets-password-limit-exceeded-modal__content'> | ||
<WalletText align={alignment} size={textSize}> | ||
Please try again in a minute. | ||
</WalletText> | ||
</div> | ||
<div className='wallets-password-limit-exceeded-modal__buttons'> | ||
<WalletButton | ||
borderWidth='md' | ||
onClick={onSecondaryClick} | ||
size='lg' | ||
textSize={textSize} | ||
variant='outlined' | ||
> | ||
Forgot password? | ||
</WalletButton> | ||
<WalletButton onClick={onPrimaryClick} size='lg' textSize={textSize}> | ||
Try later | ||
</WalletButton> | ||
</div> | ||
</div> | ||
</ModalWrapper> | ||
); | ||
}; | ||
|
||
export default PasswordLimitExceededModal; |
1 change: 1 addition & 0 deletions
1
packages/wallets/src/features/cfd/modals/PasswordLimitExceededModal/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 PasswordLimitExceededModal } from './PasswordLimitExceededModal'; |