-
Notifications
You must be signed in to change notification settings - Fork 214
Expand file tree
/
Copy pathindex.jsx
More file actions
93 lines (89 loc) · 3.63 KB
/
index.jsx
File metadata and controls
93 lines (89 loc) · 3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
* Copyright (c) 2024, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import React from 'react'
import PropTypes from 'prop-types'
import {FormattedMessage} from 'react-intl'
import {
Button,
Stack,
Text,
Alert,
AlertIcon
} from '@salesforce/retail-react-app/app/components/shared/ui'
import {BrandLogo} from '@salesforce/retail-react-app/app/components/icons'
const PasswordlessEmailConfirmation = ({form, submitForm, email = ''}) => {
return (
<form
onSubmit={form.handleSubmit(submitForm)}
data-testid="sf-form-resend-passwordless-email"
>
<Stack spacing={6}>
<Stack
justify="center"
align="center"
spacing={6}
role="alert"
aria-live="polite"
aria-labelledby="email-confirmation-title"
aria-describedby="email-confirmation-desc email-confirmation-spam"
tabIndex="-1"
>
<BrandLogo width="60px" height="auto" aria-hidden={true} />
<Text
align="center"
fontSize="xl"
fontWeight="semibold"
id="email-confirmation-title"
>
<FormattedMessage
defaultMessage="Check Your Email"
id="auth_modal.check_email.title.check_your_email"
/>
</Text>
{form.formState.errors?.global && (
<Alert status="error">
<AlertIcon color="red.500" boxSize={4} />
<Text fontSize="sm" ml={3}>
{form.formState.errors.global.message}
</Text>
</Alert>
)}
<Stack spacing={10}>
<Text align="center" fontSize="md" id="email-confirmation-desc">
<FormattedMessage
defaultMessage="We just sent a login link to <b>{email}</b>"
id="auth_modal.check_email.description.just_sent"
values={{
email: email,
b: (chunks) => <b>{chunks}</b>
}}
/>
</Text>
<Text align="center" fontSize="sm" id="email-confirmation-spam">
<FormattedMessage
defaultMessage="The link may take a few minutes to arrive, check your spam folder if you're having trouble finding it"
id="auth_modal.check_email.description.check_spam_folder"
/>
</Text>
</Stack>
</Stack>
<Button type="submit">
<FormattedMessage
defaultMessage="Resend Link"
id="auth_modal.check_email.button.resend_link"
/>
</Button>
</Stack>
</form>
)
}
PasswordlessEmailConfirmation.propTypes = {
form: PropTypes.object,
submitForm: PropTypes.func,
email: PropTypes.string
}
export default PasswordlessEmailConfirmation