|
1 |
| -import { useCallback, useContext, useEffect, useState } from 'react' |
2 | 1 | import { useMutation } from '@apollo/client'
|
3 |
| -import { Box, Layer, Text } from 'grommet' |
4 |
| -import { |
5 |
| - CloseIcon, |
6 |
| - ErrorIcon, |
7 |
| - IconFrame, |
8 |
| - ReloadIcon, |
9 |
| -} from '@pluralsh/design-system' |
10 |
| -import moment from 'moment' |
| 2 | +import { Button, Flex, SendMessageIcon, Toast } from '@pluralsh/design-system' |
| 3 | +import { Box } from 'grommet' |
| 4 | +import { useCallback, useContext, useEffect, useState } from 'react' |
11 | 5 | import { useParams } from 'react-router-dom'
|
12 | 6 |
|
13 | 7 | import { useTheme } from 'styled-components'
|
14 | 8 |
|
15 |
| -import { useIsCurrentlyOnboarding } from '../shell/hooks/useOnboarded' |
16 | 9 | import CurrentUserContext from '../../contexts/CurrentUserContext'
|
| 10 | +import { useIsCurrentlyOnboarding } from '../shell/hooks/useOnboarded' |
17 | 11 | import { Alert, AlertStatus, GqlError } from '../utils/Alert'
|
18 | 12 | import LoadingIndicator from '../utils/LoadingIndicator'
|
19 | 13 |
|
| 14 | +import { LoginPortal } from './LoginPortal' |
20 | 15 | import { CREATE_RESET_TOKEN, REALIZE_TOKEN } from './queries'
|
21 | 16 | import { ResetTokenType } from './types'
|
22 |
| -import { LoginPortal } from './LoginPortal' |
23 | 17 |
|
24 | 18 | export function EmailConfirmed() {
|
25 | 19 | const { id } = useParams()
|
@@ -77,74 +71,31 @@ export function VerifyEmailConfirmed() {
|
77 | 71 | return null
|
78 | 72 |
|
79 | 73 | return (
|
80 |
| - <Layer |
81 |
| - plain |
82 |
| - modal={false} |
| 74 | + <Toast |
| 75 | + heading="Email not confirmed" |
| 76 | + show={open} |
| 77 | + onClose={close} |
83 | 78 | position="top"
|
84 |
| - margin={{ top: 'medium' }} |
85 |
| - onEsc={close} |
86 |
| - onClickOutside={close} |
| 79 | + severity="danger" |
| 80 | + css={{ marginTop: theme.spacing.medium }} |
87 | 81 | >
|
88 |
| - <Box |
89 |
| - round="xsmall" |
90 |
| - direction="row" |
| 82 | + <Flex |
91 | 83 | gap="small"
|
92 |
| - background={theme.colors['fill-two']} |
93 |
| - color={theme.colors.text} |
94 |
| - border={{ color: theme.colors['fill-three'] }} |
95 |
| - pad="small" |
96 |
| - align="center" |
| 84 | + direction="column" |
97 | 85 | >
|
98 |
| - <Box |
99 |
| - flex={false} |
100 |
| - align="center" |
| 86 | + <span> |
| 87 | + Please confirm your email address to continue using your Plural |
| 88 | + account. |
| 89 | + </span> |
| 90 | + <Button |
| 91 | + secondary |
| 92 | + startIcon={<SendMessageIcon />} |
| 93 | + onClick={() => mutation()} |
| 94 | + css={{ width: 'fit-content' }} |
101 | 95 | >
|
102 |
| - <ErrorIcon |
103 |
| - size={24} |
104 |
| - color="error" |
105 |
| - /> |
106 |
| - </Box> |
107 |
| - <Box |
108 |
| - fill="horizontal" |
109 |
| - align="center" |
110 |
| - > |
111 |
| - <Text |
112 |
| - size="small" |
113 |
| - weight={500} |
114 |
| - > |
115 |
| - Your email is not confirmed |
116 |
| - </Text> |
117 |
| - {me.emailConfirmBy && ( |
118 |
| - <Text size="small"> |
119 |
| - you have {moment(me.emailConfirmBy).fromNow(true)} to confirm your |
120 |
| - email |
121 |
| - </Text> |
122 |
| - )} |
123 |
| - </Box> |
124 |
| - <Box |
125 |
| - flex={false} |
126 |
| - gap="xsmall" |
127 |
| - direction="row" |
128 |
| - align="center" |
129 |
| - > |
130 |
| - <IconFrame |
131 |
| - icon={<ReloadIcon />} |
132 |
| - clickable |
133 |
| - textValue="Resend" |
134 |
| - tooltip |
135 |
| - tooltipProps={{ placement: 'bottom' }} |
136 |
| - onClick={() => mutation()} |
137 |
| - /> |
138 |
| - <IconFrame |
139 |
| - icon={<CloseIcon />} |
140 |
| - clickable |
141 |
| - textValue="Close" |
142 |
| - tooltip |
143 |
| - tooltipProps={{ placement: 'bottom' }} |
144 |
| - onClick={() => setOpen(false)} |
145 |
| - /> |
146 |
| - </Box> |
147 |
| - </Box> |
148 |
| - </Layer> |
| 96 | + Resend confirmation email |
| 97 | + </Button> |
| 98 | + </Flex> |
| 99 | + </Toast> |
149 | 100 | )
|
150 | 101 | }
|
0 commit comments