-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
carol/ P2P: Email verification for orders #6299
Merged
carolsachdeva
merged 60 commits into
binary-com:p2p-2fa-feature
from
carolsachdeva:email-verification
Sep 8, 2022
Merged
Changes from 23 commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
1eba58b
Merge branch 'master' of github.com:binary-com/deriv-app
086058c
Merge branch 'master' of github.com:binary-com/deriv-app
ba5e87e
Merge branch 'master' of github.com:binary-com/deriv-app
95b8ec8
Merge branch 'master' of github.com:binary-com/deriv-app
a12090f
Merge branch 'master' of github.com:binary-com/deriv-app
d7d17cc
Merge branch 'master' of github.com:binary-com/deriv-app
be7c7bb
Merge branch 'master' of github.com:binary-com/deriv-app
f60d6c2
Merge branch 'master' of github.com:binary-com/deriv-app
f28f08d
Merge branch 'master' of github.com:binary-com/deriv-app
da2aaf6
Merge branch 'master' of github.com:binary-com/deriv-app
6d9113c
Merge branch 'master' of github.com:binary-com/deriv-app
4244c91
Merge branch 'master' of github.com:binary-com/deriv-app
b3f8906
Merge branch 'master' of github.com:binary-com/deriv-app
6f3aea9
Merge branch 'master' of github.com:binary-com/deriv-app
cb70bf6
Merge branch 'master' of github.com:binary-com/deriv-app
b39bc60
Merge branch 'master' of github.com:binary-com/deriv-app
7947c41
pull master
47b96e9
Merge branch 'p2p-2fa-feature' of github.com:binary-com/deriv-app int…
aa2fa7a
fix: quotes
ee369b5
add: email verification
b1ec2e0
fix: conflicts (finalllyyyyyyyyy)
c6ab1d3
cleanup
a970958
don't kill me
ffbd0fb
add response checks
39e65a4
add comment
b71d0a1
add: amount + currency
258eed8
fixed loading of order details and chat
farrah-deriv 86a1edd
fixed design on responsive
farrah-deriv f876093
fix: conflicts
b61c49c
Merge pull request #60 from farrah-deriv/order-chat-fix
carolsachdeva 8b1eebb
Merge pull request #61 from farrah-deriv/verification-modal-responsive
carolsachdeva ae5fbe0
fixed verification modal in responsive
farrah-deriv b2e6e16
Merge pull request #62 from farrah-deriv/scrollable-verification-modal
carolsachdeva b00ea45
show modal if error
0d76901
Merge branch 'email-verification' of github.com:carol-binary/deriv-ap…
22c616f
fix
7b6a28a
fixed truncated modal in ios
farrah-deriv 59aa866
Merge pull request #63 from farrah-deriv/email-verification-modal
carolsachdeva d7fd8d0
fix time
78e1062
fix invalid verification modal
4c52cfc
Merge branch 'email-verification' of github.com:carol-binary/deriv-ap…
2fc9896
fix
e6d6f03
fix
feb224f
fixed verification modal in desktop
farrah-deriv 27b55a1
Merge pull request #64 from farrah-deriv/verification-modal-desktop
carolsachdeva 368d364
Merge branch 'email-verification' of github.com:carol-binary/deriv-ap…
d0c04c3
fix responsive +logged out user
531c055
fixed a lot of stuff that broke lol
8b6c4a6
fix: design for seller
3453a68
the solution to all my problems
2c117fc
fix: modal
0ebded0
fix logout + modal
04f4d0e
hide extra modal
28dfc51
i got 99 problems and 2fa is all of em
fb5cd3e
fix
1a23f9f
fix
0d3b576
fix: amount
9d48faa
fix: amount
0eeac0e
fix: add modal
1b106a4
fix: rating modal
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,33 +1,25 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Button, Icon, Loading, Modal, Text } from '@deriv/components'; | ||
import { Button, Icon, Modal, Text } from '@deriv/components'; | ||
import { Localize } from 'Components/i18next'; | ||
|
||
const EmailVerificationModal = ({ | ||
email_address, | ||
is_email_verification_modal_open, | ||
is_verifying = false, | ||
onClickResendEmailButton, | ||
remaining_time, | ||
setIsEmailVerificationModalOpen, | ||
should_show_resend_email_button = false, | ||
verification_link_expiry_time, | ||
should_show_resend_email_button = true, | ||
// TODO: Uncomment when time is available in BE response | ||
// remaining_time, | ||
// verification_link_expiry_time, | ||
}) => { | ||
const [should_show_reasons_if_no_email, setShouldShowReasonsIfNoEmail] = React.useState(false); | ||
|
||
if (is_verifying) { | ||
return ( | ||
<Modal has_close_icon={false} small width='440px'> | ||
<Loading is_fullscreen={false} /> | ||
</Modal> | ||
); | ||
} | ||
|
||
return ( | ||
<Modal | ||
has_close_icon | ||
is_open={is_email_verification_modal_open} | ||
title='' | ||
renderTitle={() => <></>} | ||
toggleModal={() => setIsEmailVerificationModalOpen(false)} | ||
width='440px' | ||
> | ||
|
@@ -47,10 +39,8 @@ const EmailVerificationModal = ({ | |
/> | ||
</Text> | ||
<Text color='prominent' size='s'> | ||
<Localize | ||
i18n_default_text='The verification link expires in {{verification_link_expiry_time}} minutes' | ||
values={{ verification_link_expiry_time }} | ||
/> | ||
{/* TODO: Uncomment when time is available in BE response */} | ||
<Localize i18n_default_text='The verification link expires in 10 minutes' /> | ||
</Text> | ||
<Text | ||
className='email-verification-modal--receive_email_text' | ||
|
@@ -84,16 +74,18 @@ const EmailVerificationModal = ({ | |
<div className='email-verification-modal--reason'> | ||
<Icon icon='IcEmailFirewall' size={36} /> | ||
<Text className='email-verification-modal--reason__text' color='prominent' size='xxs'> | ||
<Localize i18n_default_text='We can’t deliver the email to this address (usually because of firewalls or filtering).' /> | ||
<Localize i18n_default_text="We can't deliver the email to this address (usually because of firewalls or filtering)." /> | ||
</Text> | ||
</div> | ||
</React.Fragment> | ||
)} | ||
</Modal.Body> | ||
{should_show_resend_email_button && ( | ||
{should_show_resend_email_button && should_show_reasons_if_no_email && ( | ||
<Modal.Footer> | ||
<Button large primary onClick={onClickResendEmailButton}> | ||
<Localize i18n_default_text='Resend email {{remaining_time}}' values={{ remaining_time }} /> | ||
<Localize i18n_default_text='Resend email' /> | ||
{/* TODO: Uncomment when time is available in BE response | ||
<Localize i18n_default_text='Resend email {{remaining_time}}' values={{ remaining_time }} /> */} | ||
</Button> | ||
</Modal.Footer> | ||
)} | ||
|
@@ -106,10 +98,12 @@ EmailVerificationModal.propTypes = { | |
is_email_verification_modal_open: PropTypes.bool, | ||
is_verifying: PropTypes.bool, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please also remove |
||
onClickResendEmailButton: PropTypes.func, | ||
remaining_time: PropTypes.string, | ||
// TODO: Uncomment when time is available in BE response | ||
// remaining_time: PropTypes.string, | ||
setIsEmailVerificationModalOpen: PropTypes.func, | ||
should_show_resend_email_button: PropTypes.bool, | ||
verification_link_expiry_time: PropTypes.number, | ||
// TODO: Uncomment when time is available in BE response | ||
// verification_link_expiry_time: PropTypes.number, | ||
}; | ||
|
||
export default EmailVerificationModal; |
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,24 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Button, Modal } from '@deriv/components'; | ||
import { Localize } from 'Components/i18next'; | ||
|
||
const ErrorModal = ({ error_message, error_modal_title, is_error_modal_open, setIsErrorModalOpen }) => { | ||
return ( | ||
<Modal is_open={is_error_modal_open} title={error_modal_title}> | ||
<Modal.Body>{error_message}</Modal.Body> | ||
<Modal.Footer> | ||
<Button large primary onClick={() => setIsErrorModalOpen(false)}> | ||
<Localize i18n_default_text='Ok' /> | ||
</Button> | ||
</Modal.Footer> | ||
</Modal> | ||
); | ||
}; | ||
|
||
ErrorModal.propTypes = { | ||
error_message: PropTypes.string, | ||
error_modal_title: PropTypes.string, | ||
is_error_modal_open: PropTypes.bool, | ||
setIsErrorModalOpen: PropTypes.func, | ||
}; |
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,3 @@ | ||
import ErrorModal from './error-modal.jsx'; | ||
|
||
export default ErrorModal; |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import LoadingModal from './loading-modal.jsx'; | ||
|
||
export default LoadingModal; |
17 changes: 17 additions & 0 deletions
17
packages/p2p/src/components/loading-modal/loading-modal.jsx
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,17 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Loading, Modal } from '@deriv/components'; | ||
|
||
const LoadingModal = ({ is_loading_modal_open }) => { | ||
return ( | ||
<Modal has_close_icon={false} is_open={is_loading_modal_open} small width='440px'> | ||
<Loading is_fullscreen={false} /> | ||
</Modal> | ||
); | ||
}; | ||
|
||
LoadingModal.propTypes = { | ||
is_loading_modal_open: PropTypes.bool, | ||
}; | ||
|
||
export default LoadingModal; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What is the difference between
order
andorder_id
? 🤔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.
Different email links give us different verification_code, for this one it's order_id and it's what works for mobile.