show email verification resend (#2492)

* always show users with unverified email address the prompt and resend option

* udpate snaps

* update snap
This commit is contained in:
Tessa Thornton
2019-08-23 14:16:08 -04:00
committed by Kim Gardner
parent 2edabf44c7
commit 07df7ac182
2 changed files with 47 additions and 3 deletions
@@ -70,7 +70,6 @@ const changeEmailContainer: FunctionComponent<Props> = ({
const updateEmail = useMutation(UpdateEmailMutation);
const [showEditForm, setShowEditForm] = useState(false);
const [emailUpdated, setEmailUpdated] = useState(false);
const [confirmationResent, setConfirmationResent] = useState(false);
const makeFetchCall = useFetch(fetcher);
const resend = useCallback(async () => {
@@ -100,7 +99,6 @@ const changeEmailContainer: FunctionComponent<Props> = ({
form.reset();
setShowEditForm(false);
setEmailUpdated(true);
return;
},
@@ -162,7 +160,7 @@ const changeEmailContainer: FunctionComponent<Props> = ({
)}
</Flex>
)}
{!viewer.emailVerified && emailUpdated && !showEditForm && (
{!viewer.emailVerified && !showEditForm && (
<CallOut>
<Flex itemGutter>
<div>
@@ -129,6 +129,52 @@ exports[`renders the empty settings pane 1`] = `
Edit
</button>
</div>
<div
className="CallOut-root CallOut-colorRegular"
>
<div>
<div
className="Box-root Flex-root Flex-flex Flex-itemGutter gutter"
>
<div>
<span
aria-hidden="true"
className="Icon-root Icon-lg"
>
email
</span>
</div>
<div>
<h1
className="Box-root Typography-root Typography-heading3 Typography-colorTextPrimary Typography-gutterBottom"
>
Verify your email address
</h1>
<p
className="Box-root Typography-root Typography-bodyCopy Typography-colorTextPrimary"
>
An email has been sent to $email to verify your account.
You must verify your new email address before it can be used for
signing into your account or for email notifications.
</p>
<button
className="BaseButton-root Button-root Button-sizeRegular Button-colorPrimary Button-variantRegular ChangeEmailContainer-resendButton"
data-color="primary"
data-variant="regular"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onMouseOut={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
type="button"
>
Resend verification
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<ul