From 03987da05bd1189841e0e7878a863565350af2de Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Fri, 11 Jun 2021 10:29:52 +0530 Subject: [PATCH] refactor: better ui + ux for email sign in --- components/firebase/Email.vue | 25 +++++++++++++++++++------ lang/en-US.json | 6 +++++- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/components/firebase/Email.vue b/components/firebase/Email.vue index 563f04dfa..5b1bbde75 100644 --- a/components/firebase/Email.vue +++ b/components/firebase/Email.vue @@ -10,7 +10,7 @@ -
+
-
+
+
+ + verified + +

+ {{ $t("we_sent_magic_link") }} +

+

+ {{ $t("we_sent_magic_link_description", { email: form.email }) }} +

+

{{ $t("check_your_inbox") }}

+
+
+
@@ -70,6 +84,7 @@ export default { signingInWithEmail: false, emailRegex: /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/, + mode: "sign-in", } }, mounted() { @@ -98,10 +113,7 @@ export default { await fb .signInWithEmail(this.form.email, actionCodeSettings) .then(() => { - this.$toast.success("Check your inbox", { - icon: "email", - duration: 0, - }) + this.mode = "email" window.localStorage.setItem("emailForSignIn", this.form.email) }) .catch((error) => { @@ -115,6 +127,7 @@ export default { }) }, hideModal() { + this.mode = "sign-in" this.$toast.clear() this.$emit("hide-modal") }, diff --git a/lang/en-US.json b/lang/en-US.json index 2d31176b3..34bac43bd 100644 --- a/lang/en-US.json +++ b/lang/en-US.json @@ -333,5 +333,9 @@ "user_removed": "User removed successfully", "import_from_my_collections": "Import from My Collections", "export_as_json": "Export as JSON", - "send_magic_link": "Send a magic link to sign in" + "send_magic_link": "Send a magic link to sign in", + "check_your_inbox": "Check your inbox.", + "you_can_dismiss_this_modal": "You can dismiss this ", + "we_sent_magic_link": "We sent you a magic link!", + "we_sent_magic_link_description": "We sent an email to {email}. It contains a magic link that’ll log you in." }