From 93882a47ddc2e543e9523885fe6414e6d918099a Mon Sep 17 00:00:00 2001 From: Carol Sachdeva Date: Tue, 19 Jul 2022 15:21:35 +0800 Subject: [PATCH 1/8] add: icons --- .../icon/common/ic-email-verification-link-blocked.svg | 1 + .../icon/common/ic-email-verification-link-invalid.svg | 1 + .../icon/common/ic-email-verification-link-valid.svg | 1 + packages/components/src/components/icon/icons.js | 3 +++ packages/components/stories/icon/icons.js | 3 +++ 5 files changed, 9 insertions(+) create mode 100644 packages/components/src/components/icon/common/ic-email-verification-link-blocked.svg create mode 100644 packages/components/src/components/icon/common/ic-email-verification-link-invalid.svg create mode 100644 packages/components/src/components/icon/common/ic-email-verification-link-valid.svg diff --git a/packages/components/src/components/icon/common/ic-email-verification-link-blocked.svg b/packages/components/src/components/icon/common/ic-email-verification-link-blocked.svg new file mode 100644 index 000000000000..6da1da0ce86a --- /dev/null +++ b/packages/components/src/components/icon/common/ic-email-verification-link-blocked.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/components/src/components/icon/common/ic-email-verification-link-invalid.svg b/packages/components/src/components/icon/common/ic-email-verification-link-invalid.svg new file mode 100644 index 000000000000..6edf85f052d5 --- /dev/null +++ b/packages/components/src/components/icon/common/ic-email-verification-link-invalid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/components/src/components/icon/common/ic-email-verification-link-valid.svg b/packages/components/src/components/icon/common/ic-email-verification-link-valid.svg new file mode 100644 index 000000000000..c7f5bcb37d46 --- /dev/null +++ b/packages/components/src/components/icon/common/ic-email-verification-link-valid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/components/src/components/icon/icons.js b/packages/components/src/components/icon/icons.js index 030c472ff96f..5f9888cc9777 100644 --- a/packages/components/src/components/icon/icons.js +++ b/packages/components/src/components/icon/icons.js @@ -236,6 +236,9 @@ import './common/ic-email-sent-dashboard.svg'; import './common/ic-email-sent.svg'; import './common/ic-email-spam.svg'; import './common/ic-email-typo.svg'; +import './common/ic-email-verification-link-blocked.svg'; +import './common/ic-email-verification-link-invalid.svg'; +import './common/ic-email-verification-link-valid.svg'; import './common/ic-email-verified.svg'; import './common/ic-email.svg'; import './common/ic-empty-folder.svg'; diff --git a/packages/components/stories/icon/icons.js b/packages/components/stories/icon/icons.js index 8822362e7c83..abf4f2c52dfe 100644 --- a/packages/components/stories/icon/icons.js +++ b/packages/components/stories/icon/icons.js @@ -243,6 +243,9 @@ export const icons = 'IcEmailSent', 'IcEmailSpam', 'IcEmailTypo', + 'IcEmailVerificationLinkBlocked', + 'IcEmailVerificationLinkInvalid', + 'IcEmailVerificationLinkValid', 'IcEmailVerified', 'IcEmail', 'IcEmptyFolder', From a5f98bc8882ad151c176fa2229306e1585aea137 Mon Sep 17 00:00:00 2001 From: Carol Sachdeva Date: Tue, 19 Jul 2022 15:48:25 +0800 Subject: [PATCH 2/8] add: one more icon --- .../components/src/components/icon/common/ic-email-sent-p2p.svg | 1 + packages/components/src/components/icon/icons.js | 1 + packages/components/stories/icon/icons.js | 1 + 3 files changed, 3 insertions(+) create mode 100644 packages/components/src/components/icon/common/ic-email-sent-p2p.svg diff --git a/packages/components/src/components/icon/common/ic-email-sent-p2p.svg b/packages/components/src/components/icon/common/ic-email-sent-p2p.svg new file mode 100644 index 000000000000..ac6603322838 --- /dev/null +++ b/packages/components/src/components/icon/common/ic-email-sent-p2p.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/components/src/components/icon/icons.js b/packages/components/src/components/icon/icons.js index 5f9888cc9777..34640f14674f 100644 --- a/packages/components/src/components/icon/icons.js +++ b/packages/components/src/components/icon/icons.js @@ -233,6 +233,7 @@ import './common/ic-edit.svg'; import './common/ic-email-firewall.svg'; import './common/ic-email-outline.svg'; import './common/ic-email-sent-dashboard.svg'; +import './common/ic-email-sent-p2p.svg'; import './common/ic-email-sent.svg'; import './common/ic-email-spam.svg'; import './common/ic-email-typo.svg'; diff --git a/packages/components/stories/icon/icons.js b/packages/components/stories/icon/icons.js index abf4f2c52dfe..5d11c880b8e2 100644 --- a/packages/components/stories/icon/icons.js +++ b/packages/components/stories/icon/icons.js @@ -240,6 +240,7 @@ export const icons = 'IcEmailFirewall', 'IcEmailOutline', 'IcEmailSentDashboard', + 'IcEmailSentP2p', 'IcEmailSent', 'IcEmailSpam', 'IcEmailTypo', From c7187ec8e3782de4a632fa691424d3df794c6aff Mon Sep 17 00:00:00 2001 From: Carol Sachdeva Date: Wed, 10 Aug 2022 22:02:05 +0800 Subject: [PATCH 3/8] add email verification modal --- .../email-verification-modal.jsx | 108 ++++++++++++++++++ .../email-verification-modal.scss | 26 +++++ .../email-verification-modal/index.js | 4 + 3 files changed, 138 insertions(+) create mode 100644 packages/p2p/src/components/email-verification-modal/email-verification-modal.jsx create mode 100644 packages/p2p/src/components/email-verification-modal/email-verification-modal.scss create mode 100644 packages/p2p/src/components/email-verification-modal/index.js diff --git a/packages/p2p/src/components/email-verification-modal/email-verification-modal.jsx b/packages/p2p/src/components/email-verification-modal/email-verification-modal.jsx new file mode 100644 index 000000000000..0a9ba6446c2b --- /dev/null +++ b/packages/p2p/src/components/email-verification-modal/email-verification-modal.jsx @@ -0,0 +1,108 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { Button, Icon, Loading, 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, +}) => { + const [should_show_reasons_if_no_email, setShouldShowReasonsIfNoEmail] = React.useState(false); + + if (is_verifying) { + return ( + + + + ); + } + + return ( + setIsEmailVerificationModalOpen(false)} + width='440px' + > + + + + ]} + values={{ email_address }} + /> + + + + + setShouldShowReasonsIfNoEmail(true)} + size='xs' + weight='bold' + > + + + {should_show_reasons_if_no_email && ( + +
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ )} +
+ {should_show_resend_email_button && ( + + + + )} +
+ ); +}; + +EmailVerificationModal.propTypes = { + email_address: PropTypes.string, + is_email_verification_modal_open: PropTypes.bool, + is_verifying: PropTypes.bool, + onClickResendEmailButton: PropTypes.func, + remaining_time: PropTypes.string, + setIsEmailVerificationModalOpen: PropTypes.func, + should_show_resend_email_button: PropTypes.bool, + verification_link_expiry_time: PropTypes.number, +}; + +export default EmailVerificationModal; diff --git a/packages/p2p/src/components/email-verification-modal/email-verification-modal.scss b/packages/p2p/src/components/email-verification-modal/email-verification-modal.scss new file mode 100644 index 000000000000..25dd32372ff3 --- /dev/null +++ b/packages/p2p/src/components/email-verification-modal/email-verification-modal.scss @@ -0,0 +1,26 @@ +.email-verification-modal { + align-items: center; + display: flex; + flex-direction: column; + + &--email_text { + margin: 2.4rem 0; + text-align: center; + } + + &--reason { + display: flex; + flex-direction: row; + gap: 1.6rem; + margin: 2.4rem 0; + + &__text { + max-width: 34rem; + } + } + + &--receive_email_text { + cursor: pointer; + margin: 3rem 0 0.6rem; + } +} diff --git a/packages/p2p/src/components/email-verification-modal/index.js b/packages/p2p/src/components/email-verification-modal/index.js new file mode 100644 index 000000000000..6101a5043db1 --- /dev/null +++ b/packages/p2p/src/components/email-verification-modal/index.js @@ -0,0 +1,4 @@ +import EmailVerificationModal from './email-verification-modal.jsx'; +import './email-verification-modal.scss'; + +export default EmailVerificationModal; From 4a32b6fd29fc789ea00aba53915efb006696ee8b Mon Sep 17 00:00:00 2001 From: Carol Sachdeva Date: Wed, 10 Aug 2022 22:25:56 +0800 Subject: [PATCH 4/8] add invalid verification link modal --- .../invalid-verification-link-modal/index.js | 4 ++ .../invalid-verification-link-modal.jsx | 47 +++++++++++++++++++ .../invalid-verification-link-modal.scss | 17 +++++++ 3 files changed, 68 insertions(+) create mode 100644 packages/p2p/src/components/invalid-verification-link-modal/index.js create mode 100644 packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.jsx create mode 100644 packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.scss diff --git a/packages/p2p/src/components/invalid-verification-link-modal/index.js b/packages/p2p/src/components/invalid-verification-link-modal/index.js new file mode 100644 index 000000000000..bf5d817dfe0e --- /dev/null +++ b/packages/p2p/src/components/invalid-verification-link-modal/index.js @@ -0,0 +1,4 @@ +import InvalidVerificationLinkModal from './invalid-verification-link-modal.jsx'; +import './invalid-verification-link-modal.scss'; + +export default InvalidVerificationLinkModal; diff --git a/packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.jsx b/packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.jsx new file mode 100644 index 000000000000..541ea48bb12d --- /dev/null +++ b/packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.jsx @@ -0,0 +1,47 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { Button, Icon, Modal, Text } from '@deriv/components'; +import { Localize } from 'Components/i18next'; + +const InvalidVerificationLinkModal = ({ + is_invalid_verification_link_modal_open, + onClickGetNewLinkButton, + setIsInvalidVerificationLinkModalOpen, + verification_link_expiry_time, +}) => { + return ( + setIsInvalidVerificationLinkModalOpen(false)} + width='440px' + > + + + + + + + + + + + + + + ); +}; + +InvalidVerificationLinkModal.propTypes = { + is_invalid_verification_link_modal_open: PropTypes.bool, + onClickGetNewLinkButton: PropTypes.func, + setIsInvalidVerificationLinkModalOpen: PropTypes.func, + verification_link_expiry_time: PropTypes.number, +}; + +export default InvalidVerificationLinkModal; diff --git a/packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.scss b/packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.scss new file mode 100644 index 000000000000..a2003de3d7dd --- /dev/null +++ b/packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.scss @@ -0,0 +1,17 @@ +.invalid-verification-link-modal { + align-items: center; + display: flex; + flex-direction: column; + + &--footer { + align-self: center; + } + + &--text { + margin: 2.4rem 0; + } + + &--verification_text { + text-align: center; + } +} From 91c86c53d88da980a84b5d3fb9ba6dfed9f6dde4 Mon Sep 17 00:00:00 2001 From: Carol Sachdeva Date: Wed, 10 Aug 2022 22:50:43 +0800 Subject: [PATCH 5/8] add email verified --- .../email-link-verified-modal.jsx | 49 +++++++++++++++++++ .../email-link-verified-modal.scss | 17 +++++++ .../email-link-verified-modal/index.js | 4 ++ 3 files changed, 70 insertions(+) create mode 100644 packages/p2p/src/components/email-link-verified-modal/email-link-verified-modal.jsx create mode 100644 packages/p2p/src/components/email-link-verified-modal/email-link-verified-modal.scss create mode 100644 packages/p2p/src/components/email-link-verified-modal/index.js diff --git a/packages/p2p/src/components/email-link-verified-modal/email-link-verified-modal.jsx b/packages/p2p/src/components/email-link-verified-modal/email-link-verified-modal.jsx new file mode 100644 index 000000000000..347c0b4fb72a --- /dev/null +++ b/packages/p2p/src/components/email-link-verified-modal/email-link-verified-modal.jsx @@ -0,0 +1,49 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { Button, Icon, Modal, Text } from '@deriv/components'; +import { Localize } from 'Components/i18next'; + +const EmailLinkVerifiedModal = ({ + amount, + currency, + is_email_verified_modal_open, + onClickConfirm, + setIsEmailLinkVerifiedModalOpen, +}) => { + return ( + setIsEmailLinkVerifiedModalOpen(false)} + width='440px' + > + + + + + + + + + + + + + + ); +}; + +EmailLinkVerifiedModal.propTypes = { + amount: PropTypes.number, + currency: PropTypes.string, + is_email_verified_modal_open: PropTypes.bool, + onClickConfirm: PropTypes.func, + setIsEmailLinkVerifiedModalOpen: PropTypes.func, +}; + +export default EmailLinkVerifiedModal; diff --git a/packages/p2p/src/components/email-link-verified-modal/email-link-verified-modal.scss b/packages/p2p/src/components/email-link-verified-modal/email-link-verified-modal.scss new file mode 100644 index 000000000000..118b45673909 --- /dev/null +++ b/packages/p2p/src/components/email-link-verified-modal/email-link-verified-modal.scss @@ -0,0 +1,17 @@ +.email-verified-modal { + align-items: center; + display: flex; + flex-direction: column; + + &--confirmation_text { + text-align: center; + } + + &--footer { + align-self: center; + } + + &--text { + margin: 2.4rem 0; + } +} diff --git a/packages/p2p/src/components/email-link-verified-modal/index.js b/packages/p2p/src/components/email-link-verified-modal/index.js new file mode 100644 index 000000000000..35446e1c3a44 --- /dev/null +++ b/packages/p2p/src/components/email-link-verified-modal/index.js @@ -0,0 +1,4 @@ +import EmailLinkVerifiedModal from './email-link-verified-modal.jsx'; +import './email-link-verified-modal.scss'; + +export default EmailLinkVerifiedModal; From c551d7f0af8fcb89162900eb5dddaa2c0b24a4a4 Mon Sep 17 00:00:00 2001 From: Carol Sachdeva Date: Wed, 10 Aug 2022 23:36:46 +0800 Subject: [PATCH 6/8] add email blocked modal --- .../email-link-blocked-modal.jsx | 41 +++++++++++++++++++ .../email-link-blocked-modal.scss | 13 ++++++ .../email-link-blocked-modal/index.js | 4 ++ .../email-link-verified-modal.jsx | 1 + .../email-verification-modal.jsx | 1 + .../invalid-verification-link-modal.jsx | 1 + 6 files changed, 61 insertions(+) create mode 100644 packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.jsx create mode 100644 packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.scss create mode 100644 packages/p2p/src/components/email-link-blocked-modal/index.js diff --git a/packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.jsx b/packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.jsx new file mode 100644 index 000000000000..a3517c7beda1 --- /dev/null +++ b/packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.jsx @@ -0,0 +1,41 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { Icon, Modal, Text } from '@deriv/components'; +import { Localize } from 'Components/i18next'; + +const EmailLinkBlockedModal = ({ + blocked_for_minutes = 30, + is_email_link_blocked_modal_open = true, + setIsEmailLinkBlockedModalOpen = () => {}, +}) => { + return ( + setIsEmailLinkBlockedModalOpen(false)} + width='440px' + > + + + + + + + + + + + ); +}; + +EmailLinkBlockedModal.propTypes = { + blocked_for_minutes: PropTypes.number, + is_email_link_blocked_modal_open: PropTypes.bool, + setIsEmailLinkBlockedModalOpen: PropTypes.func, +}; + +export default EmailLinkBlockedModal; diff --git a/packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.scss b/packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.scss new file mode 100644 index 000000000000..693b23f6adf8 --- /dev/null +++ b/packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.scss @@ -0,0 +1,13 @@ +.email-link-blocked-modal { + align-items: center; + display: flex; + flex-direction: column; + + &--blocked_text { + text-align: center; + } + + &--text { + margin: 2.4rem 0; + } +} diff --git a/packages/p2p/src/components/email-link-blocked-modal/index.js b/packages/p2p/src/components/email-link-blocked-modal/index.js new file mode 100644 index 000000000000..356741ec4cc6 --- /dev/null +++ b/packages/p2p/src/components/email-link-blocked-modal/index.js @@ -0,0 +1,4 @@ +import EmailLinkBlockedModal from './email-link-blocked-modal.jsx'; +import './email-link-blocked-modal.scss'; + +export default EmailLinkBlockedModal; diff --git a/packages/p2p/src/components/email-link-verified-modal/email-link-verified-modal.jsx b/packages/p2p/src/components/email-link-verified-modal/email-link-verified-modal.jsx index 347c0b4fb72a..54b0e4cfb19e 100644 --- a/packages/p2p/src/components/email-link-verified-modal/email-link-verified-modal.jsx +++ b/packages/p2p/src/components/email-link-verified-modal/email-link-verified-modal.jsx @@ -14,6 +14,7 @@ const EmailLinkVerifiedModal = ({ setIsEmailLinkVerifiedModalOpen(false)} width='440px' > diff --git a/packages/p2p/src/components/email-verification-modal/email-verification-modal.jsx b/packages/p2p/src/components/email-verification-modal/email-verification-modal.jsx index 0a9ba6446c2b..194ebf20235d 100644 --- a/packages/p2p/src/components/email-verification-modal/email-verification-modal.jsx +++ b/packages/p2p/src/components/email-verification-modal/email-verification-modal.jsx @@ -27,6 +27,7 @@ const EmailVerificationModal = ({ setIsEmailVerificationModalOpen(false)} width='440px' > diff --git a/packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.jsx b/packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.jsx index 541ea48bb12d..88978358ef13 100644 --- a/packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.jsx +++ b/packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.jsx @@ -13,6 +13,7 @@ const InvalidVerificationLinkModal = ({ setIsInvalidVerificationLinkModalOpen(false)} width='440px' > From 368e044328923449ccf17836a53483880473758b Mon Sep 17 00:00:00 2001 From: Carol Sachdeva Date: Wed, 10 Aug 2022 23:37:30 +0800 Subject: [PATCH 7/8] add email blocked modal --- .../email-link-blocked-modal/email-link-blocked-modal.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.jsx b/packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.jsx index a3517c7beda1..ca2baa015879 100644 --- a/packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.jsx +++ b/packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.jsx @@ -4,9 +4,9 @@ import { Icon, Modal, Text } from '@deriv/components'; import { Localize } from 'Components/i18next'; const EmailLinkBlockedModal = ({ - blocked_for_minutes = 30, - is_email_link_blocked_modal_open = true, - setIsEmailLinkBlockedModalOpen = () => {}, + blocked_for_minutes, + is_email_link_blocked_modal_open, + setIsEmailLinkBlockedModalOpen, }) => { return ( Date: Fri, 12 Aug 2022 14:52:21 +0800 Subject: [PATCH 8/8] use align prop instead --- .../email-link-blocked-modal/email-link-blocked-modal.jsx | 2 +- .../email-link-blocked-modal.scss | 4 ---- .../email-link-verified-modal.jsx | 2 +- .../email-link-verified-modal.scss | 4 ---- .../email-verification-modal/email-verification-modal.jsx | 8 +++++++- .../email-verification-modal.scss | 1 - .../invalid-verification-link-modal.jsx | 2 +- .../invalid-verification-link-modal.scss | 4 ---- 8 files changed, 10 insertions(+), 17 deletions(-) diff --git a/packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.jsx b/packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.jsx index ca2baa015879..a16c7bc8ce21 100644 --- a/packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.jsx +++ b/packages/p2p/src/components/email-link-blocked-modal/email-link-blocked-modal.jsx @@ -21,7 +21,7 @@ const EmailLinkBlockedModal = ({ - + - + - + ]} diff --git a/packages/p2p/src/components/email-verification-modal/email-verification-modal.scss b/packages/p2p/src/components/email-verification-modal/email-verification-modal.scss index 25dd32372ff3..3338036b5a80 100644 --- a/packages/p2p/src/components/email-verification-modal/email-verification-modal.scss +++ b/packages/p2p/src/components/email-verification-modal/email-verification-modal.scss @@ -5,7 +5,6 @@ &--email_text { margin: 2.4rem 0; - text-align: center; } &--reason { diff --git a/packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.jsx b/packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.jsx index 88978358ef13..77fafcfa0b46 100644 --- a/packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.jsx +++ b/packages/p2p/src/components/invalid-verification-link-modal/invalid-verification-link-modal.jsx @@ -22,7 +22,7 @@ const InvalidVerificationLinkModal = ({ - +