diff --git a/extension/e2e-tests/helpers/login.ts b/extension/e2e-tests/helpers/login.ts index 5896445dd0..ae7b34574b 100644 --- a/extension/e2e-tests/helpers/login.ts +++ b/extension/e2e-tests/helpers/login.ts @@ -17,7 +17,7 @@ export const login = async ({ page, extensionId }) => { await page.locator("#confirm-password-input").fill(PASSWORD); await page.locator("#termsOfUse-input").check({ force: true }); await page.getByRole("button", { name: "Import" }).click(); - await expect(page.getByText("Wallet created successfully!")).toBeVisible({ + await expect(page.getByText("You’re all set!")).toBeVisible({ timeout: 20000, }); @@ -74,7 +74,7 @@ export const loginToTestAccount = async ({ page, extensionId }) => { await page.locator("#confirm-password-input").fill(PASSWORD); await page.locator("#termsOfUse-input").check({ force: true }); await page.getByRole("button", { name: "Import" }).click(); - await expect(page.getByText("Wallet created successfully!")).toBeVisible({ + await expect(page.getByText("You’re all set!")).toBeVisible({ timeout: 20000, }); diff --git a/extension/e2e-tests/onboarding.test.ts b/extension/e2e-tests/onboarding.test.ts index 3fcd802947..8abfb21dc3 100644 --- a/extension/e2e-tests/onboarding.test.ts +++ b/extension/e2e-tests/onboarding.test.ts @@ -7,16 +7,15 @@ test.beforeEach(async ({ page, extensionId }) => { test("Welcome page loads", async ({ page }) => { await page.locator(".Welcome__column").waitFor(); - await expect( - page.getByText("Welcome! Is this your first time using Freighter?"), - ).toBeVisible(); - await expect(page.getByText("I’m going to need a seed phrase")).toBeVisible(); - await expect(page.getByText("I’ve done this before")).toBeVisible(); + await expect(page.getByText("Welcome to Freighter")).toBeVisible(); + await expect(page.getByText("Your favorite Stellar wallet")).toBeVisible(); + await expect(page.getByText("Create new wallet")).toBeVisible(); + await expect(page.getByText("Import wallet")).toBeVisible(); await expectPageToHaveScreenshot({ page, screenshot: "welcome-page.png" }); }); test("Create new wallet", async ({ page }) => { - await page.getByText("Create Wallet").click(); + await page.getByText("Create new wallet").click(); await expect(page.getByText("Create a password")).toBeVisible(); await page.locator("#new-password-input").fill("My-password123"); @@ -24,7 +23,11 @@ test("Create new wallet", async ({ page }) => { await page.locator("#termsOfUse-input").check({ force: true }); await page.getByText("Confirm").click(); - await expect(page.getByText("Secret Recovery phrase")).toBeVisible(); + await expect(page.getByTestId("MnemonicPhrase__modal")).toBeVisible(); + await expectPageToHaveScreenshot({ page, screenshot: "recovery-modal.png" }); + + await page.getByText("Show recovery phrase").click(); + await expectPageToHaveScreenshot( { page, screenshot: "recovery-page.png" }, { @@ -56,9 +59,7 @@ test("Create new wallet", async ({ page }) => { await page.getByTestId(words[i]).check({ force: true }); } await page.getByTestId("display-mnemonic-phrase-confirm-btn").click(); - await expect( - page.getByText("Your Freighter install is complete"), - ).toBeVisible(); + await expect(page.getByText("You’re all set!")).toBeVisible(); await expectPageToHaveScreenshot({ page, screenshot: "wallet-create-complete-page.png", @@ -95,7 +96,7 @@ test("Import 12 word wallet", async ({ page }) => { await page.locator("#termsOfUse-input").check({ force: true }); await page.getByRole("button", { name: "Import" }).click(); - await expect(page.getByText("Wallet created successfully!")).toBeVisible(); + await expect(page.getByText("You’re all set!")).toBeVisible(); await expectPageToHaveScreenshot({ page, screenshot: "wallet-import-complete-page.png", @@ -145,7 +146,7 @@ test("Import 24 word wallet", async ({ page }) => { await page.locator("#termsOfUse-input").check({ force: true }); await page.getByRole("button", { name: "Import" }).click(); - await expect(page.getByText("Wallet created successfully!")).toBeVisible(); + await expect(page.getByText("You’re all set!")).toBeVisible(); await expectPageToHaveScreenshot({ page, screenshot: "wallet-import-complete-page.png", @@ -195,7 +196,7 @@ test("Import wallet with wrong password", async ({ page }) => { }); test("Incorrect mnemonic phrase", async ({ page }) => { - await page.getByText("Create Wallet").click(); + await page.getByText("Create new wallet").click(); await expect(page.getByText("Create a password")).toBeVisible(); await page.locator("#new-password-input").fill("My-password123"); @@ -203,7 +204,10 @@ test("Incorrect mnemonic phrase", async ({ page }) => { await page.locator("#termsOfUse-input").check({ force: true }); await page.getByText("Confirm").click(); - await expect(page.getByText("Secret Recovery phrase")).toBeVisible(); + await expect(page.getByTestId("MnemonicPhrase__modal")).toBeVisible(); + await expectPageToHaveScreenshot({ page, screenshot: "recovery-modal.png" }); + + await page.getByText("Show recovery phrase").click(); await expectPageToHaveScreenshot( { page, screenshot: "recovery-page.png" }, { @@ -229,9 +233,7 @@ test("Incorrect mnemonic phrase", async ({ page }) => { } await page.getByTestId("display-mnemonic-phrase-confirm-btn").click(); - await expect( - page.getByText("The secret phrase you entered is incorrect."), - ).toBeVisible(); + await expect(page.getByText("Order is incorrect, try again")).toBeVisible(); await expectPageToHaveScreenshot( { page, screenshot: "incorrect-recovery-phrase-page.png" }, { diff --git a/extension/e2e-tests/onboarding.test.ts-snapshots/confirm-recovery-page-chromium-darwin.png b/extension/e2e-tests/onboarding.test.ts-snapshots/confirm-recovery-page-chromium-darwin.png index 9962495afc..ea8fa3b072 100644 Binary files a/extension/e2e-tests/onboarding.test.ts-snapshots/confirm-recovery-page-chromium-darwin.png and b/extension/e2e-tests/onboarding.test.ts-snapshots/confirm-recovery-page-chromium-darwin.png differ diff --git a/extension/e2e-tests/onboarding.test.ts-snapshots/incorrect-recovery-phrase-page-chromium-darwin.png b/extension/e2e-tests/onboarding.test.ts-snapshots/incorrect-recovery-phrase-page-chromium-darwin.png index 8e324d5050..3d4be356cc 100644 Binary files a/extension/e2e-tests/onboarding.test.ts-snapshots/incorrect-recovery-phrase-page-chromium-darwin.png and b/extension/e2e-tests/onboarding.test.ts-snapshots/incorrect-recovery-phrase-page-chromium-darwin.png differ diff --git a/extension/e2e-tests/onboarding.test.ts-snapshots/recovery-bad-password-chromium-darwin.png b/extension/e2e-tests/onboarding.test.ts-snapshots/recovery-bad-password-chromium-darwin.png index d51d9009c7..e94f8f6d02 100644 Binary files a/extension/e2e-tests/onboarding.test.ts-snapshots/recovery-bad-password-chromium-darwin.png and b/extension/e2e-tests/onboarding.test.ts-snapshots/recovery-bad-password-chromium-darwin.png differ diff --git a/extension/e2e-tests/onboarding.test.ts-snapshots/recovery-modal-chromium-darwin.png b/extension/e2e-tests/onboarding.test.ts-snapshots/recovery-modal-chromium-darwin.png new file mode 100644 index 0000000000..b0a7478f7a Binary files /dev/null and b/extension/e2e-tests/onboarding.test.ts-snapshots/recovery-modal-chromium-darwin.png differ diff --git a/extension/e2e-tests/onboarding.test.ts-snapshots/recovery-page-chromium-darwin.png b/extension/e2e-tests/onboarding.test.ts-snapshots/recovery-page-chromium-darwin.png index eda2f14ecc..dd889a3b0f 100644 Binary files a/extension/e2e-tests/onboarding.test.ts-snapshots/recovery-page-chromium-darwin.png and b/extension/e2e-tests/onboarding.test.ts-snapshots/recovery-page-chromium-darwin.png differ diff --git a/extension/e2e-tests/onboarding.test.ts-snapshots/wallet-import-complete-page-chromium-darwin.png b/extension/e2e-tests/onboarding.test.ts-snapshots/wallet-import-complete-page-chromium-darwin.png index f3c882d8bd..8efeedccfe 100644 Binary files a/extension/e2e-tests/onboarding.test.ts-snapshots/wallet-import-complete-page-chromium-darwin.png and b/extension/e2e-tests/onboarding.test.ts-snapshots/wallet-import-complete-page-chromium-darwin.png differ diff --git a/extension/e2e-tests/onboarding.test.ts-snapshots/welcome-page-chromium-darwin.png b/extension/e2e-tests/onboarding.test.ts-snapshots/welcome-page-chromium-darwin.png index 99c3d66ed4..3d626a2005 100644 Binary files a/extension/e2e-tests/onboarding.test.ts-snapshots/welcome-page-chromium-darwin.png and b/extension/e2e-tests/onboarding.test.ts-snapshots/welcome-page-chromium-darwin.png differ diff --git a/extension/src/popup/Router.tsx b/extension/src/popup/Router.tsx index fa6739435d..49d7572819 100644 --- a/extension/src/popup/Router.tsx +++ b/extension/src/popup/Router.tsx @@ -65,7 +65,6 @@ import { ManageAssets } from "popup/views/ManageAssets"; import { VerifyAccount } from "popup/views/VerifyAccount"; import { Swap } from "popup/views/Swap"; import { ManageNetwork } from "popup/views/ManageNetwork"; -import { PinExtension } from "popup/views/PinExtension"; import { LeaveFeedback } from "popup/views/LeaveFeedback"; import { AccountMigration } from "popup/views/AccountMigration"; @@ -256,7 +255,6 @@ const NO_APP_LAYOUT_ROUTES = [ ROUTES.accountMigration, ROUTES.recoverAccount, ROUTES.recoverAccountSuccess, - ROUTES.pinExtension, ROUTES.welcome, ]; @@ -363,9 +361,6 @@ const Outlet = () => { - - - diff --git a/extension/src/popup/assets/illo-extension.png b/extension/src/popup/assets/illo-extension.png deleted file mode 100644 index e95e0372d1..0000000000 Binary files a/extension/src/popup/assets/illo-extension.png and /dev/null differ diff --git a/extension/src/popup/assets/logo-freighter-welcome.svg b/extension/src/popup/assets/logo-freighter-welcome.svg new file mode 100644 index 0000000000..c18df83e1a --- /dev/null +++ b/extension/src/popup/assets/logo-freighter-welcome.svg @@ -0,0 +1,12 @@ + + + diff --git a/extension/src/popup/components/Onboarding/index.tsx b/extension/src/popup/components/Onboarding/index.tsx index d306dc80c8..80361f7129 100644 --- a/extension/src/popup/components/Onboarding/index.tsx +++ b/extension/src/popup/components/Onboarding/index.tsx @@ -1,10 +1,11 @@ import React from "react"; import { useHistory } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import { Button, Heading } from "@stellar/design-system"; +import { Button, Heading, Card } from "@stellar/design-system"; import { BackButton } from "popup/basics/buttons/BackButton"; import { Box } from "popup/basics/layout/Box"; +import { View } from "popup/basics/layout/View"; import "./styles.scss"; @@ -51,7 +52,7 @@ export const OnboardingOneCol = ({ }: { children: React.ReactElement | React.ReactElement[]; }) => ( - + {children} ); @@ -92,12 +93,12 @@ export const OnboardingButtons = ({ if (children || showBackButton) { return ( - + <> {showBackButton ? ( + } @@ -113,3 +114,33 @@ export const OnboardingButtons = ({ return null; }; + +interface OnboardingModalProps { + children: React.ReactNode; + headerText: string; + bodyText: React.ReactNode; +} + +export const OnboardingModal = ({ + children, + headerText, + bodyText, +}: OnboardingModalProps) => ( + +
+ +
+ + {headerText} + +
{bodyText}
+
+ {children} +
+
+
+); diff --git a/extension/src/popup/components/Onboarding/styles.scss b/extension/src/popup/components/Onboarding/styles.scss index 545625fb04..eb6bcfd9b0 100644 --- a/extension/src/popup/components/Onboarding/styles.scss +++ b/extension/src/popup/components/Onboarding/styles.scss @@ -1,7 +1,8 @@ +@use "../../styles/utils.scss" as *; + .Onboarding { - --Onboarding-layout-width: auto; + --Onboarding-layout-width: #{pxToRem(448px)}; - margin-top: 4.5rem; display: flex; flex-direction: column; gap: 1.5rem; @@ -17,15 +18,26 @@ color: var(--sds-clr-gray-12); } - .Checkbox label { - color: var(--sds-clr-gray-12); - } - .Link--secondary { --Link-color-default: var(--sds-clr-gray-12); --Link-color-hover: var(--sds-clr-gray-12); --Link-color-disabled: var(--sds-clr-gray-12); } + + &__card { + display: flex; + flex-direction: column; + gap: #{pxToRem(8px)}; + + &__wrapper { + width: #{pxToRem(448px)}; + } + + &__text { + color: var(--sds-clr-gray-11); + margin-bottom: #{pxToRem(32px)}; + } + } } .OnboardingScreen { diff --git a/extension/src/popup/components/accountMigration/MnemonicPhrase/index.tsx b/extension/src/popup/components/accountMigration/MnemonicPhrase/index.tsx index 1914dea237..255e7c6ced 100644 --- a/extension/src/popup/components/accountMigration/MnemonicPhrase/index.tsx +++ b/extension/src/popup/components/accountMigration/MnemonicPhrase/index.tsx @@ -1,5 +1,4 @@ import React, { useEffect, useState } from "react"; -import shuffle from "lodash/shuffle"; import { getMigratedMnemonicPhrase } from "@shared/api/internal"; @@ -15,9 +14,8 @@ export const MnemonicPhrase = () => { useEffect(() => { const fetchMnemonicPhrase = async () => { - const { - mnemonicPhrase: migratedMnemonicPhrase, - } = await getMigratedMnemonicPhrase(); + const { mnemonicPhrase: migratedMnemonicPhrase } = + await getMigratedMnemonicPhrase(); setMnemonicPhrase(migratedMnemonicPhrase); }; @@ -27,10 +25,7 @@ export const MnemonicPhrase = () => { return isConfirmed ? (
- +
) : ( @@ -39,7 +34,6 @@ export const MnemonicPhrase = () => { diff --git a/extension/src/popup/components/mnemonicPhrase/CheckButton/index.tsx b/extension/src/popup/components/mnemonicPhrase/CheckButton/index.tsx index bb56c2ed1c..e67d5ca037 100644 --- a/extension/src/popup/components/mnemonicPhrase/CheckButton/index.tsx +++ b/extension/src/popup/components/mnemonicPhrase/CheckButton/index.tsx @@ -8,6 +8,7 @@ type CheckButtonProps = { onKeyDown?: (e: any) => void; wordKey: string; word: string; + wordNumber: () => string; }; export const CheckButton = ({ @@ -15,8 +16,9 @@ export const CheckButton = ({ onKeyDown, wordKey, word, + wordNumber, }: CheckButtonProps) => ( - +
- +
); diff --git a/extension/src/popup/components/mnemonicPhrase/CheckButton/styles.scss b/extension/src/popup/components/mnemonicPhrase/CheckButton/styles.scss index 3a4d9c3d66..b63e4fd5de 100644 --- a/extension/src/popup/components/mnemonicPhrase/CheckButton/styles.scss +++ b/extension/src/popup/components/mnemonicPhrase/CheckButton/styles.scss @@ -1,27 +1,42 @@ @use "../../../styles/utils.scss" as *; .ButtonLabel { - border: 1px solid var(--sds-clr-gray-01); - border-radius: 6.25rem; + border: 1px solid var(--sds-clr-gray-07); + border-radius: #{pxToRem(6px)}; color: var(--sds-clr-gray-12); cursor: pointer; - display: inline-block; - font-weight: var(--font-weight-medium); - font-size: 0.875rem; - margin: 3px; - padding: 0.25rem 1rem; + display: flex; + font-weight: var(--sds-fw-semi-bold); + font-size: #{pxToRem(14px)}; + line-height: #{pxToRem(20px)}; + padding: #{pxToRem(6px)} #{pxToRem(10px)}; text-transform: none; + width: 100%; + + &__number { + color: var(--sds-clr-gray-11); + position: absolute; + width: #{pxToRem(24px)}; + } + &__word { + text-align: center; + width: 100%; + } } .CheckButton { opacity: 0; + position: absolute; &:focus + label { @include native-like-outline; } &:checked + label { - background: var(--sds-clr-gray-01); - color: white; + background: var(--sds-clr-gray-04); + } + + &__wrapper { + width: 50%; } } diff --git a/extension/src/popup/components/mnemonicPhrase/ConfirmMnemonicPhrase/index.tsx b/extension/src/popup/components/mnemonicPhrase/ConfirmMnemonicPhrase/index.tsx index 56177dd7d1..a76f6fd86d 100644 --- a/extension/src/popup/components/mnemonicPhrase/ConfirmMnemonicPhrase/index.tsx +++ b/extension/src/popup/components/mnemonicPhrase/ConfirmMnemonicPhrase/index.tsx @@ -1,7 +1,8 @@ -import React, { useState } from "react"; +import React, { useEffect, useState } from "react"; +import shuffle from "lodash/shuffle"; import { Form, Formik, FormikHelpers, FormikValues } from "formik"; import { useSelector, useDispatch } from "react-redux"; -import { Button, Card } from "@stellar/design-system"; +import { Alert, Button, Card, Text } from "@stellar/design-system"; import { useTranslation } from "react-i18next"; import { AppDispatch } from "popup/App"; @@ -10,16 +11,12 @@ import { confirmMigratedMnemonicPhrase, authErrorSelector, } from "popup/ducks/accountServices"; -import { FormError } from "popup/basics/Forms"; import { navigateTo } from "popup/helpers/navigate"; import { ROUTES } from "popup/constants/routes"; +import { View } from "popup/basics/layout/View"; -import { - OnboardingHeader, - OnboardingButtons, -} from "popup/components/Onboarding"; -import { generateMnemonicPhraseDisplay } from "popup/components/mnemonicPhrase/MnemonicDisplay"; +import { OnboardingModal } from "popup/components/Onboarding"; import { CheckButton } from "../CheckButton"; @@ -28,18 +25,21 @@ import "./styles.scss"; const convertToWord = (wordKey: string) => wordKey.replace(/-.*/, ""); export const ConfirmMnemonicPhrase = ({ - words = [""], + mnemonicPhrase, isMigration, - customBackAction, - hasGoBackBtn, }: { - words: string[]; + mnemonicPhrase: string; isMigration?: boolean; - customBackAction?: () => void; - hasGoBackBtn?: boolean; }) => { const { t } = useTranslation(); const dispatch: AppDispatch = useDispatch(); + const [words, setWords] = useState([""]); + + useEffect(() => { + if (mnemonicPhrase) { + setWords(shuffle(mnemonicPhrase.split(" "))); + } + }, [mnemonicPhrase]); const initialWordState = words.reduce( (obj, current, i) => ({ @@ -84,79 +84,111 @@ export const ConfirmMnemonicPhrase = ({ formikHelpers.resetForm(); }; + const handleSkip = async () => { + // confirm the mnemonic phrase for the user + + await dispatch(confirmMnemonicPhrase(mnemonicPhrase)); + }; + const joinSelectedWords = () => selectedWords.map((word) => convertToWord(word)).join(" "); return ( -
- {t("Confirm your recovery phrase")} - -
-

{t("Please select each word in the same order you have")}

-

{t("them noted to confirm you got them right")}

-
- - - {({ dirty, isSubmitting, handleChange }) => ( -
-
- -
    e.preventDefault()} - > - {generateMnemonicPhraseDisplay({ - mnemonicPhrase: joinSelectedWords(), - })} -
-
-
- - {authError ? {authError} : null} - -
- {wordStateArr.map(([wordKey]) => ( - { - handleChange(e); - updatePhrase(e.target as HTMLInputElement); - }} - onKeyDown={(e) => { - if (e.key === "Enter") { - e.preventDefault(); - e.target.checked = e.target.value !== "true"; - handleChange(e); - updatePhrase(e.target as HTMLInputElement); - } - }} - wordKey={wordKey} - word={convertToWord(wordKey)} - /> - ))} -
- - - - -
- )} -
+
+ + + {t( + "Please select each word in the same order you have them noted to confirm you got them right.", + )} + + + } + > + + {({ dirty, isSubmitting, handleChange }) => ( +
+
+ +
+ {wordStateArr.map(([wordKey]) => ( + { + handleChange(e); + updatePhrase(e.target as HTMLInputElement); + }} + onKeyDown={(e) => { + if (e.key === "Enter") { + e.preventDefault(); + e.target.checked = e.target.value !== "true"; + handleChange(e); + updatePhrase(e.target as HTMLInputElement); + } + }} + wordKey={wordKey} + word={convertToWord(wordKey)} + wordNumber={() => { + const wordIndex = selectedWords.findIndex( + (selectedWord) => selectedWord === wordKey, + ); + + if (wordIndex > -1) { + return String(wordIndex + 1); + } + return ""; + }} + /> + ))} +
+
+
+
+
+ + +
+
+ {t( + "You can access this later in the app, but we strongly recommend saving this in a safe place.", + )} +
+
+
+ )} +
+
+ +
+ {authError ? ( + + {authError ? t("Order is incorrect, try again") : ""} + + ) : null} +
+
); }; diff --git a/extension/src/popup/components/mnemonicPhrase/ConfirmMnemonicPhrase/styles.scss b/extension/src/popup/components/mnemonicPhrase/ConfirmMnemonicPhrase/styles.scss index ec7b1e21cc..a238adbb7f 100644 --- a/extension/src/popup/components/mnemonicPhrase/ConfirmMnemonicPhrase/styles.scss +++ b/extension/src/popup/components/mnemonicPhrase/ConfirmMnemonicPhrase/styles.scss @@ -1,47 +1,43 @@ +@use "../../../styles/utils.scss" as *; + .ConfirmMnemonicPhrase { - &__screen { - display: flex; - flex-direction: column; - gap: 1rem; + margin-top: #{pxToRem(168px)}; + + &__card-wrapper { + margin-bottom: #{pxToRem(32px)}; } - &__header { - text-align: center; + &__word-bubble-wrapper { + display: flex; + flex-flow: column wrap; + align-content: start; + height: #{pxToRem(244px)}; + gap: #{pxToRem(8px)}; } - &__content { - font-size: 1rem; - line-height: 1.5rem; - font-weight: var(--font-weight-regular); - color: var(--sds-clr-gray-12); + &__footer { + color: var(--sds-clr-gray-11); + display: flex; + flex-direction: column; + font-size: #{pxToRem(14px)}; + gap: #{pxToRem(16px)}; + line-height: #{pxToRem(20px)}; + text-align: center; - p { - color: var(--sds-clr-gray-12); - margin-bottom: 0 !important; + &__buttons { + display: flex; + gap: #{pxToRem(12px)}; } } - &__selected-words-wrapper { - height: 7.5rem; - width: 100%; - } - - &__selected-words-text { - display: flex; - flex-wrap: wrap; - font-weight: var(--font-weight-medium); - font-size: 1rem; - line-height: 1.5rem; - color: var(--sds-clr-gray-12); - list-style-type: none; - padding: 0; - } + &__error { + height: #{pxToRem(74px)}; + margin: 0 auto; + padding: #{pxToRem(8px)}; + width: #{pxToRem(284px)}; - &__word-bubble-wrapper { - display: flex; - flex-flow: row wrap; - justify-content: center; - align-content: start; - padding: 1rem 0 1.5rem; + .Alert__content { + align-items: center; + } } } diff --git a/extension/src/popup/components/mnemonicPhrase/DisplayMnemonicPhrase/index.tsx b/extension/src/popup/components/mnemonicPhrase/DisplayMnemonicPhrase/index.tsx index 386f518802..ba3636a100 100644 --- a/extension/src/popup/components/mnemonicPhrase/DisplayMnemonicPhrase/index.tsx +++ b/extension/src/popup/components/mnemonicPhrase/DisplayMnemonicPhrase/index.tsx @@ -1,12 +1,8 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { Button, Icon, Notification } from "@stellar/design-system"; +import { Button, Text } from "@stellar/design-system"; -import { - OnboardingHeader, - OnboardingTwoCol, - OnboardingOneCol, -} from "popup/components/Onboarding"; +import { OnboardingModal } from "popup/components/Onboarding"; import { MnemonicDisplay } from "../MnemonicDisplay"; @@ -15,67 +11,38 @@ import "./styles.scss"; export const DisplayMnemonicPhrase = ({ mnemonicPhrase, setIsConfirmed, - isMigration, }: { mnemonicPhrase: string; setIsConfirmed: (confirmed: boolean) => void; - isMigration?: boolean; }) => { const { t } = useTranslation(); return ( - - - - {isMigration - ? t("Now, let’s create a new mnemonic phrase") - : t("Secret Recovery phrase")} - -
- {isMigration ? ( -

- {t("This new backup phrase will be used for your new accounts.")} -

- ) : ( - <> -

- {t( - "Your recovery phrase gives you access to your account and is the", - )}{" "} - {t("only way to access it in a new browser")}.{" "} - {t("Keep it in a safe place.")} -

-

- {t( - "For your security, we'll check if you got it right in the next step.", - )} -

- - )} -
-
- - - } - > - {t("Never disclose your recovery phrase")}! - - - - -
+ + + {t( + "Never disclose your recovery phrase! If you do, someone will be able to access your wallet.", + )} + + + } + > + + + ); }; diff --git a/extension/src/popup/components/mnemonicPhrase/MnemonicDisplay/index.tsx b/extension/src/popup/components/mnemonicPhrase/MnemonicDisplay/index.tsx index 7094c25558..b6e3ed3436 100644 --- a/extension/src/popup/components/mnemonicPhrase/MnemonicDisplay/index.tsx +++ b/extension/src/popup/components/mnemonicPhrase/MnemonicDisplay/index.tsx @@ -13,7 +13,7 @@ interface GenerateMnemonicPhraseDisplayProps { export const generateMnemonicPhraseDisplay = ({ mnemonicPhrase = "", }: GenerateMnemonicPhraseDisplayProps) => - mnemonicPhrase.split(" ").map((word: string) => { + mnemonicPhrase.split(" ").map((word: string, i: number) => { /* As a security measure, we want to prevent writing the mnemonic phrase to the DOM. The browser can leak this string into memory where a hacker could possibly access it. @@ -27,25 +27,18 @@ export const generateMnemonicPhraseDisplay = ({ const randomWord = randomWordArr[randomWordIndex]; return ( -
  • + // eslint-disable-next-line react/no-array-index-key +
  • {randomNumber % 2 === 0 ? ( <> - - {randomWord} - + {randomWord} - - {word} - + {word} ) : ( <> - - {word} - - - {randomWord} - + {word} + {randomWord} )}
  • @@ -62,7 +55,7 @@ export const MnemonicDisplay = ({ isPopupView, }: MnemonicDisplayProps) => (
    - +
      e.preventDefault()} className={`MnemonicDisplay__ordered-list ${ diff --git a/extension/src/popup/components/mnemonicPhrase/MnemonicDisplay/styles.scss b/extension/src/popup/components/mnemonicPhrase/MnemonicDisplay/styles.scss index 07cb3c8bae..4aa68735c7 100644 --- a/extension/src/popup/components/mnemonicPhrase/MnemonicDisplay/styles.scss +++ b/extension/src/popup/components/mnemonicPhrase/MnemonicDisplay/styles.scss @@ -1,16 +1,24 @@ +@use "../../../styles/utils.scss" as *; + .MnemonicDisplay { position: relative; text-align: center; + margin-bottom: #{pxToRem(32px)}; &__ordered-list { columns: 2; text-align: start; counter-reset: item; list-style-type: none; + padding: 0 #{pxToRem(8px)} !important; li::before { counter-increment: item; content: counter(item) !important; + display: inline-block; + width: #{pxToRem(24px)}; + position: relative !important; + left: 0 !important; } &--popup-view { @@ -20,12 +28,17 @@ } &__list-item { - padding-left: 1rem; + display: flex; + gap: #{pxToRem(8px)}; &::before { - color: var(--sds-clr-gray-12); + color: var(--sds-clr-gray-11); content: none !important; } + + span { + font-weight: var(--sds-fw-semi-bold); + } } &__random-word { diff --git a/extension/src/popup/constants/metricsNames.ts b/extension/src/popup/constants/metricsNames.ts index 35469411ef..187f3e95b6 100644 --- a/extension/src/popup/constants/metricsNames.ts +++ b/extension/src/popup/constants/metricsNames.ts @@ -15,7 +15,6 @@ export const METRIC_NAMES = { viewMnemonicPhrase: "loaded screen: mnemonic phrase", viewMnemonicPhraseConfirm: "loaded screen: confirm mnemonic phrase", viewMnemonicPhraseConfirmed: "loaded screen: account creator finished", - viewPinExtension: "loaded screen: pix extension", viewRecoverAccount: "loaded screen: recover account", viewRecoverAccountSuccess: "loaded screen: recover account: success", viewSignTransaction: "loaded screen: sign transaction", diff --git a/extension/src/popup/constants/routes.ts b/extension/src/popup/constants/routes.ts index a056b1d3c9..5076788c75 100644 --- a/extension/src/popup/constants/routes.ts +++ b/extension/src/popup/constants/routes.ts @@ -34,7 +34,6 @@ export enum ROUTES { mnemonicPhrase = "/mnemonic-phrase", mnemonicPhraseConfirm = "/mnemonic-phrase/confirm", mnemonicPhraseConfirmed = "/mnemonic-phrase-confirmed", - pinExtension = "/pin-extension", unlockAccount = "/unlock-account", verifyAccount = "/verify-account", accountCreator = "/account-creator", diff --git a/extension/src/popup/metrics/views.ts b/extension/src/popup/metrics/views.ts index 428d9e647b..71c10f42dc 100644 --- a/extension/src/popup/metrics/views.ts +++ b/extension/src/popup/metrics/views.ts @@ -27,7 +27,6 @@ const routeToEventName = { [ROUTES.unlockAccount]: METRIC_NAMES.viewUnlockAccount, [ROUTES.verifyAccount]: METRIC_NAMES.viewVerifyAccount, [ROUTES.mnemonicPhraseConfirmed]: METRIC_NAMES.viewMnemonicPhraseConfirmed, - [ROUTES.pinExtension]: METRIC_NAMES.viewPinExtension, [ROUTES.accountCreator]: METRIC_NAMES.viewAccountCreator, [ROUTES.recoverAccount]: METRIC_NAMES.viewRecoverAccount, [ROUTES.recoverAccountSuccess]: METRIC_NAMES.viewRecoverAccountSuccess, diff --git a/extension/src/popup/views/AccountCreator/index.tsx b/extension/src/popup/views/AccountCreator/index.tsx index 22f4e3b976..57f44fa8d0 100644 --- a/extension/src/popup/views/AccountCreator/index.tsx +++ b/extension/src/popup/views/AccountCreator/index.tsx @@ -1,6 +1,14 @@ import React, { useState } from "react"; import { useDispatch, useSelector } from "react-redux"; -import { Input, Checkbox, Link, Button } from "@stellar/design-system"; +import { + Input, + Checkbox, + Link, + Button, + Card, + Heading, + Icon, +} from "@stellar/design-system"; import { Field, FieldProps, Formik, Form } from "formik"; import { object as YupObject } from "yup"; import { useTranslation } from "react-i18next"; @@ -16,16 +24,13 @@ import { publicKeySelector, authErrorSelector, } from "popup/ducks/accountServices"; -import { FormRows } from "popup/basics/Forms"; import { View } from "popup/basics/layout/View"; import { Onboarding, OnboardingButtons, - OnboardingHeader, OnboardingOneCol, } from "popup/components/Onboarding"; -import { PasswordRequirements } from "popup/components/PasswordRequirements"; import { MnemonicPhrase } from "popup/views/MnemonicPhrase"; import "./styles.scss"; @@ -67,106 +72,127 @@ export const AccountCreator = () => { ) : ( - - + {({ isValid, dirty, isSubmitting, errors, touched }) => ( - - {t("Create a password")} -
      - - - - {({ field }: FieldProps) => ( - - )} - - - {({ field }: FieldProps) => ( - - )} - - - - +
      + + + + {t("Create a Password")} + +
      + {t("This will be used to unlock your wallet")} +
      + + +
      + + {({ field }: FieldProps) => ( + + )} + + + {({ field }: FieldProps) => ( + + )} + +
      - - {({ field, form }: FieldProps) => ( - { - if (e.key === "Enter") { - form.setFieldValue("termsOfUse", !field.value); - e.currentTarget.checked = !field.value; - } - }} - label={ - <> - {t("I have read and agree to")}{" "} - - {t("Terms of Use")} - - - } - {...field} - /> - )} - + + {({ field, form }: FieldProps) => ( +
      + { + if (e.key === "Enter") { + form.setFieldValue( + "termsOfUse", + !field.value, + ); + e.currentTarget.checked = !field.value; + } + }} + label={ +
      + + {t("I have read and agree to")}{" "} + + {t("Terms of Use")} + + + +
      + } + {...field} + /> +
      + )} +
      - - - -
      - -
      + + + + + + + +
      )}
      diff --git a/extension/src/popup/views/AccountCreator/styles.scss b/extension/src/popup/views/AccountCreator/styles.scss index 3873b7bd17..4ffb469ab7 100644 --- a/extension/src/popup/views/AccountCreator/styles.scss +++ b/extension/src/popup/views/AccountCreator/styles.scss @@ -1,33 +1,33 @@ @use "../../styles/utils.scss" as *; .AccountCreator { - margin-bottom: 1rem; + align-items: center; + display: flex; + height: 100%; - &__header { - text-align: center; + &__subheading { + color: var(--sds-clr-gray-11); + margin-top: #{pxToRem(8px)}; + margin-bottom: #{pxToRem(32px)}; } - &__buttow-row { - margin-top: 1.5rem; - padding: 1.5rem; + &__form-rows { + display: flex; + flex-direction: column; + gap: 0.5rem; } - &__screen { - flex-flow: column wrap; - align-content: center; - } + &__tos { + color: var(--sds-clr-gray-11); - &__half-screen { - flex-direction: column; - justify-content: center; - } -} + &__label { + align-items: center; + display: flex; + gap: 0.25rem; -.Onboarding { - .Checkbox__container { - input[type="checkbox"]:focus + label { - span { - @include native-like-outline; + svg { + height: 1rem; + width: 1rem; } } } diff --git a/extension/src/popup/views/FullscreenSuccessMessage/index.tsx b/extension/src/popup/views/FullscreenSuccessMessage/index.tsx index e2630c6c67..4b3079e463 100644 --- a/extension/src/popup/views/FullscreenSuccessMessage/index.tsx +++ b/extension/src/popup/views/FullscreenSuccessMessage/index.tsx @@ -1,165 +1,91 @@ import React from "react"; -import { useLocation } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import { Button, Notification } from "@stellar/design-system"; +import { Text, Icon } from "@stellar/design-system"; import { emitMetric } from "helpers/metrics"; -import { ROUTES } from "popup/constants/routes"; import { METRIC_NAMES } from "popup/constants/metricsNames"; -import { navigateTo } from "popup/helpers/navigate"; -import { SubmitButtonWrapper } from "popup/basics/Forms"; -import { Onboarding, OnboardingHeader } from "popup/components/Onboarding"; +import { Onboarding, OnboardingModal } from "popup/components/Onboarding"; import { View } from "popup/basics/layout/View"; -import ExtensionIllo from "popup/assets/illo-extension.png"; -import "./styles.scss"; - -// userAgent sniffing is not foolproof so shouldn't expect this method -// to be 100% accurate. -const isChrome = () => - navigator.userAgent.toLowerCase().indexOf("chrome") > -1 && !!window.chrome; +import LogoWelcome from "popup/assets/logo-freighter-welcome.svg"; -const AvoidScamsWarningBlock = () => { - const { t } = useTranslation(); - - return ( -
      - -
      -
        -
      • - {t( - "Freighter will never ask for your recovery phrase unless you’re actively importing your account using the browser extension - never on an external website", - )} -
      • -
      • - {t( - "Always check the domain of websites you’re using Freighter with", - )} -
      • -
      • - {t( - "Freighter cannot recover your account if you lose your recovery phrase, so keep it safe", - )} -
      • -
      -
      -
      -
      - ); -}; +import "./styles.scss"; -const MnemonicPhraseConfirmedMessage = () => { +export const FullscreenSuccessMessage = () => { const { t } = useTranslation(); - return ( - <> -
      -

      - {t( - "Awesome, you passed the test. Keep your recovery phrase safe, it’s your responsibility.", - )} -

      -
      - - - - - - ); -}; - -const RecoverAccountSuccessMessage = () => { - const { t } = useTranslation(); + emitMetric(METRIC_NAMES.recoverAccountFinished); return ( <> -
      -

      - {t( - "Awesome, you passed the test! Pin the extension in your browser to access it easily.", - )}{" "} - - {t("Keep your recovery phrase safe, it’s your responsibility.")} - -

      - {!isChrome() && ( -

      - {t( - "Check your account details by clicking on the Freighter icon on your browser.", - )} -

      - )} -
      - {isChrome() ? ( - - ) : ( -
      - Extension +
      +
      + {t("Pin Freighter to the toolbar")}
      - )} - - - - - ); -}; - -export const FullscreenSuccessMessage = () => { - const location = useLocation(); - const { t } = useTranslation(); - - const IS_MNEMONIC_PHRASE_STATE = - location.pathname === ROUTES.mnemonicPhraseConfirmed; - - return ( - - - - - - {t("Wallet created successfully!")} - -
      - {IS_MNEMONIC_PHRASE_STATE ? ( - - ) : ( - - )} +
      +
      +
      + +
      +
      +
      +
      + Freighter logo +
      +
      + {t("Freighter - Stellar Wallet")} +
      +
      +
      - +
      +
      + +
      + + + + {t( + "To access your wallet, click Freighter from your browser Extensions browser menu.", + )} + +
      + } + > +
      +
      +
      + +
      +
      + {t( + "Always check the domain of websites you're using Freighter with", + )} +
      +
      +
      +
      + +
      +
      + {t( + "Freighter cannot recover your account if you lose your recovery phrase, so keep it safe", + )} +
      +
      +
      + +
      +
      - + ); }; diff --git a/extension/src/popup/views/FullscreenSuccessMessage/styles.scss b/extension/src/popup/views/FullscreenSuccessMessage/styles.scss index 6fad6cbd35..2728225fb0 100644 --- a/extension/src/popup/views/FullscreenSuccessMessage/styles.scss +++ b/extension/src/popup/views/FullscreenSuccessMessage/styles.scss @@ -1,3 +1,5 @@ +@use "../../styles/utils.scss" as *; + .InfoBlock { &__header { color: var(--sds-clr-gray-12); @@ -27,6 +29,93 @@ } .FullscreenSuccessMessage { + display: flex; + height: 100%; + align-items: center; + + &__pin { + background: var(--sds-clr-gray-03); + border-radius: #{pxToRem(12px)}; + display: flex; + flex-direction: column; + gap: #{pxToRem(16px)}; + padding: #{pxToRem(16px)}; + position: absolute; + z-index: var(--z-index-tooltip); + width: #{pxToRem(336px)}; + top: #{pxToRem(24px)}; + right: #{pxToRem(24px)}; + + &__row { + display: flex; + line-height: #{pxToRem(24px)}; + + &:nth-child(2) { + gap: #{pxToRem(8px)}; + } + + &:nth-child(3) { + border-radius: #{pxToRem(8px)}; + align-items: center; + background: var(--sds-clr-gray-04); + gap: #{pxToRem(12px)}; + padding: #{pxToRem(8px)}; + } + + &__gradient { + background: linear-gradient( + 90deg, + var(--sds-clr-gray-03) 0%, + var(--sds-clr-gray-04) 49.96% + ); + border-top-right-radius: #{pxToRem(16px)}; + border-bottom-right-radius: #{pxToRem(16px)}; + width: #{pxToRem(264px)}; + height: #{pxToRem(32px)}; + } + + &__toolbar { + align-items: center; + display: flex; + border: 1px solid var(--sds-clr-gray-06); + border-radius: #{pxToRem(16px)}; + justify-content: center; + width: #{pxToRem(32px)}; + height: #{pxToRem(32px)}; + + svg { + width: #{pxToRem(20px)}; + height: #{pxToRem(20px)}; + } + } + + &__logo { + display: flex; + align-items: center; + img { + width: #{pxToRem(24px)}; + height: #{pxToRem(24px)}; + } + } + + &__text { + flex: 1 0 0; + } + + &__pin-icon { + display: flex; + + svg { + fill: var(--sds-clr-navy-09); + stroke: var(--sds-clr-navy-09); + } + } + } + } + + &__text { + color: var(--sds-clr-gray-12); + } &__wrapper { display: flex; flex-flow: column wrap; @@ -46,45 +135,44 @@ } &__infoBlock { - margin-bottom: 0.5rem; - - &__list { - list-style: inside; - - ::before { - content: none !important; + display: flex; + flex-direction: column; + gap: #{pxToRem(12px)}; + + &__row { + display: flex; + gap: #{pxToRem(12px)}; + + &__icon { + align-items: center; + background: var(--sds-clr-gray-01); + border-radius: #{pxToRem(100px)}; + border: 1px solid var(--sds-clr-gray-06); + display: flex; + height: #{pxToRem(24px)}; + justify-content: center; + padding: #{pxToRem(4px)}; + width: #{pxToRem(24px)}; + + svg { + width: #{pxToRem(16px)}; + } } - li:not(:last-of-type) { - margin-bottom: 1rem; + &__text { + color: var(--sds-clr-gray-11); } - } - } - &__illo-container { - position: relative; - } - - &__success-image { - height: 4.25rem; - } - - &__extension-image { - height: 3.5rem; - margin-top: 0.5rem; - } - - &__copy { - font-size: 1rem; - line-height: 1.5rem; - font-weight: var(--font-weight-regular); - margin-bottom: 1.5rem; - - p { - color: var(--sds-clr-gray-12) !important; + &:nth-child(1) { + svg { + stroke: var(--sds-clr-mint-09); + } + } - strong { - color: var(--sds-clr-gray-12) !important; + &:nth-child(2) { + svg { + stroke: var(--sds-clr-lime-09); + } } } } diff --git a/extension/src/popup/views/MnemonicPhrase.tsx b/extension/src/popup/views/MnemonicPhrase.tsx deleted file mode 100644 index ed0c69f2d7..0000000000 --- a/extension/src/popup/views/MnemonicPhrase.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import React, { useState } from "react"; -import { useSelector } from "react-redux"; -import shuffle from "lodash/shuffle"; -import { Redirect } from "react-router-dom"; - -import { APPLICATION_STATE } from "@shared/constants/applicationState"; - -import { ROUTES } from "popup/constants/routes"; -import { Onboarding } from "popup/components/Onboarding"; -import { ConfirmMnemonicPhrase } from "popup/components/mnemonicPhrase/ConfirmMnemonicPhrase"; -import { DisplayMnemonicPhrase } from "popup/components/mnemonicPhrase/DisplayMnemonicPhrase"; -import { applicationStateSelector } from "popup/ducks/accountServices"; -import { View } from "popup/basics/layout/View"; - -interface MnemonicPhraseProps { - mnemonicPhrase: string; -} - -export const MnemonicPhrase = ({ - mnemonicPhrase = "", -}: MnemonicPhraseProps) => { - const applicationState = useSelector(applicationStateSelector); - const [isConfirmed, setIsConfirmed] = useState(false); - - if (applicationState === APPLICATION_STATE.MNEMONIC_PHRASE_CONFIRMED) { - return ; - } - - if (mnemonicPhrase) { - return isConfirmed ? ( - - - - - setIsConfirmed(false)} - hasGoBackBtn - /> - - - - ) : ( - - - - - - - - - ); - } - - return null; -}; diff --git a/extension/src/popup/views/MnemonicPhrase/index.tsx b/extension/src/popup/views/MnemonicPhrase/index.tsx new file mode 100644 index 0000000000..7f2587b034 --- /dev/null +++ b/extension/src/popup/views/MnemonicPhrase/index.tsx @@ -0,0 +1,156 @@ +import React, { useState } from "react"; +import { useSelector, useDispatch } from "react-redux"; +import { Redirect } from "react-router-dom"; +import { useTranslation } from "react-i18next"; +import { Button, Text, Icon } from "@stellar/design-system"; + +import { APPLICATION_STATE } from "@shared/constants/applicationState"; + +import { ROUTES } from "popup/constants/routes"; +import { Onboarding, OnboardingModal } from "popup/components/Onboarding"; +import { ConfirmMnemonicPhrase } from "popup/components/mnemonicPhrase/ConfirmMnemonicPhrase"; +import { DisplayMnemonicPhrase } from "popup/components/mnemonicPhrase/DisplayMnemonicPhrase"; +import { + applicationStateSelector, + confirmMnemonicPhrase, +} from "popup/ducks/accountServices"; +import { View } from "popup/basics/layout/View"; + +import "./styles.scss"; + +interface MnemonicPhraseProps { + mnemonicPhrase: string; +} + +export const MnemonicPhrase = ({ + mnemonicPhrase = "", +}: MnemonicPhraseProps) => { + const { t } = useTranslation(); + const applicationState = useSelector(applicationStateSelector); + const [isConfirmed, setIsConfirmed] = useState(false); + const [isModalShowing, setIsModalShowing] = useState(true); + const dispatch = useDispatch(); + + const handleSkip = () => { + // confirm the mnemonic phrase for the user + + dispatch(confirmMnemonicPhrase(mnemonicPhrase)); + }; + + if (applicationState === APPLICATION_STATE.MNEMONIC_PHRASE_CONFIRMED) { + return ; + } + + if (mnemonicPhrase) { + if (isModalShowing) { + return ( +
      + + + {t( + "Your recovery phrase gives you access to your account and is the only way to access it in a new browser. ", + )} + + {t("Keep it in a safe place.")} + + + + {t( + "For your security, we'll check if you got it right in the next step.", + )} + + + } + > +
      +
      +
      + +
      +
      + {t( + "Your recovery phrase gives you full access to your wallets and funds", + )} +
      +
      +
      +
      + +
      +
      + {t( + "If you forget your password, you can use the recovery phrase to access your wallet", + )} +
      +
      +
      +
      + +
      +
      + {t("NEVER share this phrase with anyone")} +
      +
      +
      +
      + +
      +
      + {t( + "No one from Stellar Development Foundation will ever ask for your recovery phrase", + )} +
      +
      +
      +
      + + +
      +
      +
      + ); + } + return isConfirmed ? ( +
      + + + + + +
      + ) : ( +
      + + + + + +
      + ); + } + + return null; +}; diff --git a/extension/src/popup/views/MnemonicPhrase/styles.scss b/extension/src/popup/views/MnemonicPhrase/styles.scss new file mode 100644 index 0000000000..34fc025c3f --- /dev/null +++ b/extension/src/popup/views/MnemonicPhrase/styles.scss @@ -0,0 +1,81 @@ +@use "../../styles/utils.scss" as *; + +.MnemonicPhrase { + &__view { + &__wrapper { + display: flex; + height: 100%; + align-items: center; + } + } + + &__modal { + &__text { + &--highlight { + color: var(--sds-clr-gray-12); + } + } + + &__rows { + display: flex; + flex-direction: column; + gap: #{pxToRem(12px)}; + margin-bottom: #{pxToRem(32px)}; + } + + &__row { + display: flex; + gap: #{pxToRem(12px)}; + + &:nth-child(1) { + svg { + stroke: var(--sds-clr-lime-09); + } + } + + &:nth-child(2) { + svg { + stroke: var(--sds-clr-gold-09); + } + } + + &:nth-child(3) { + svg { + stroke: var(--sds-clr-pink-09); + } + } + + &:nth-child(4) { + svg { + stroke: var(--sds-clr-navy-09); + } + } + + &__icon { + align-items: center; + background: var(--sds-clr-gray-01); + border-radius: #{pxToRem(100px)}; + border: 1px solid var(--sds-clr-gray-06); + display: flex; + height: #{pxToRem(32px)}; + justify-content: center; + padding: #{pxToRem(6px)}; + width: #{pxToRem(32px)}; + + svg { + width: #{pxToRem(20px)}; + } + } + + &__text { + line-height: #{pxToRem(24px)}; + } + } + + &__footer { + display: flex; + flex-direction: column; + gap: #{pxToRem(12px)}; + } + } +} diff --git a/extension/src/popup/views/PinExtension/index.tsx b/extension/src/popup/views/PinExtension/index.tsx deleted file mode 100644 index eadd5e76c8..0000000000 --- a/extension/src/popup/views/PinExtension/index.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import React from "react"; -import { useTranslation } from "react-i18next"; -import { Button, Icon } from "@stellar/design-system"; - -import ExtensionsPin from "popup/assets/illo-pin-extension.svg"; -import { SubmitButtonWrapper } from "popup/basics/Forms"; -import { Onboarding, OnboardingHeader } from "popup/components/Onboarding"; - -import "./styles.scss"; -import { View } from "popup/basics/layout/View"; - -export const PinExtension = () => { - const { t } = useTranslation(); - - return ( - - - - - - {t("Your Freighter install is complete")} - -
      -
      -
      -
      - 1.{" "} - {t( - "Click on the extensions button at the top of your browser’s bar", - )} -
      -
      - 2.{" "} - {t( - "Click on Freighter’s pin button to have it always visible", - )} -
      -
      -
      - Extensions Pin -
      - - - -
      -
      -
      -
      -
      - ); -}; diff --git a/extension/src/popup/views/PinExtension/styles.scss b/extension/src/popup/views/PinExtension/styles.scss deleted file mode 100644 index 25cf251268..0000000000 --- a/extension/src/popup/views/PinExtension/styles.scss +++ /dev/null @@ -1,28 +0,0 @@ -.PinExtension { - width: 100%; - display: flex; - flex-direction: column; - align-items: center; - - &__wrapper { - max-width: 31rem; - } - - &__caption { - line-height: 1.5rem; - margin-bottom: 2rem; - color: var(--sds-clr-gray-12); - - div:not(:last-child) { - margin-bottom: 0.4rem; - } - } - - &__img { - margin-bottom: 2rem; - - img { - width: 100%; - } - } -} diff --git a/extension/src/popup/views/Preferences/index.tsx b/extension/src/popup/views/Preferences/index.tsx index db15afc3e5..261f199735 100644 --- a/extension/src/popup/views/Preferences/index.tsx +++ b/extension/src/popup/views/Preferences/index.tsx @@ -36,7 +36,6 @@ export const Preferences = () => { isDataSharingAllowedValue, isHideDustEnabledValue, } = formValue; - console.log(formValue); // eslint-disable-next-line await dispatch( diff --git a/extension/src/popup/views/Welcome/index.tsx b/extension/src/popup/views/Welcome/index.tsx index cc3cbc5b31..6825c4bb5c 100644 --- a/extension/src/popup/views/Welcome/index.tsx +++ b/extension/src/popup/views/Welcome/index.tsx @@ -1,11 +1,13 @@ import React from "react"; -import { Button, Card, Heading } from "@stellar/design-system"; +import { Button, Heading } from "@stellar/design-system"; import { useTranslation } from "react-i18next"; import { ROUTES } from "popup/constants/routes"; import { navigateTo } from "popup/helpers/navigate"; import { View } from "popup/basics/layout/View"; +import LogoWelcome from "popup/assets/logo-freighter-welcome.svg"; + import "./styles.scss"; export const Welcome = () => { @@ -13,54 +15,48 @@ export const Welcome = () => { return ( -
      - - {t("Welcome! Is this your first time using Freighter?")} - -
      -
      -
      - -
      {t("I’m new!")}
      -
      - {t("I’m going to need a seed phrase")} -
      -
      - -
      -
      + Freighter logo +
      + + {t("Welcome to Freighter")} + + + {t("Your favorite Stellar wallet")} +
      -
      - -
      - {t("I’ve done this before")} -
      -
      - {t("I have my 12 word seed phrase")} -
      -
      - -
      -
      +
      + {t("How do you want to get started?")}
      +
      + + +
      diff --git a/extension/src/popup/views/Welcome/styles.scss b/extension/src/popup/views/Welcome/styles.scss index 02dfb8cf1f..5b3ffad8b7 100644 --- a/extension/src/popup/views/Welcome/styles.scss +++ b/extension/src/popup/views/Welcome/styles.scss @@ -1,10 +1,6 @@ -.Welcome { - &__button-container { - display: flex; - justify-content: space-around; - padding-top: 1rem; - } +@use "../../styles/utils.scss" as *; +.Welcome { &__column { display: flex; flex-direction: column; @@ -13,7 +9,6 @@ justify-content: center; .Heading { - margin-bottom: 2.5rem !important; max-width: 30rem; text-align: center; } @@ -24,42 +19,26 @@ justify-content: space-between; flex-direction: column; align-items: center; + gap: 2rem; + margin-bottom: 1.5rem; } &__heading { - &--small { - color: var(--sds-clr-gray-12); - font-size: 1.125rem; - font-weight: var(--font-weight-medium); - margin-bottom: 0.75rem; + font-size: #{pxToRem(40px)}; + line-height: #{pxToRem(48px)} !important; + + &--subheading { + color: var(--sds-clr-gray-11); } } - &__row-screen { - display: flex; - justify-content: center; - gap: 1rem; - flex-wrap: wrap; + &__cta { + color: var(--sds-clr-gray-11); } - &__half-screen { - position: relative; + &__row-screen { display: flex; - flex-direction: column; justify-content: center; - padding: 0; - width: 24rem; - } - - &__import { - .Card--default { - background: var(--sds-clr-gray-01); - } - } - - &__text { - font-size: 1rem; - line-height: 1.5rem; - margin-bottom: 2rem; + gap: 0.75rem; } } diff --git a/extension/src/popup/views/__tests__/MnemonicPhrase.test.tsx b/extension/src/popup/views/__tests__/MnemonicPhrase.test.tsx index db8ca3c53e..85b82b642b 100644 --- a/extension/src/popup/views/__tests__/MnemonicPhrase.test.tsx +++ b/extension/src/popup/views/__tests__/MnemonicPhrase.test.tsx @@ -113,7 +113,6 @@ describe.skip("MnemonicPhrase", () => { screen.getByTestId("display-mnemonic-phrase-confirm-btn"), ); }); - await waitFor(() => screen.getByText(`redirect ${ROUTES.pinExtension}`)); }); }); });