From 0723d58f7ed387cab31ecb3ea56a631da8675711 Mon Sep 17 00:00:00 2001 From: John Oshalusi Date: Tue, 10 Dec 2024 12:46:07 +0100 Subject: [PATCH] fix: remove old onboarding components --- .../MnemonicWordsConfirmInput.module.scss | 16 -- .../WalletSetup/MnemonicWordsConfirmInput.tsx | 38 ----- .../WalletSetup/SocialLink.module.scss | 49 ------- .../ui/components/WalletSetup/SocialLink.tsx | 23 --- ...SetupConnectHardwareWalletStep.module.scss | 65 --------- .../WalletSetupConnectHardwareWalletStep.tsx | 93 ------------ .../WalletSetupFinalStep.module.scss | 34 ----- .../WalletSetup/WalletSetupFinalStep.tsx | 70 --------- .../WalletSetupMnemonicIntroStep.tsx | 57 -------- .../WalletSetupModeStep.module.scss | 32 ---- .../WalletSetup/WalletSetupModeStep.tsx | 109 -------------- .../WalletSetupNamePasswordStep.tsx | 137 ------------------ .../WalletSetupNamePasswordStep/index.ts | 1 - .../WalletSetupNamePasswordStep/types.ts | 4 - .../WalletSetupPasswordStep.module.scss | 49 ------- .../WalletSetup/WalletSetupPasswordStep.tsx | 115 --------------- ...tSetupRecoveryPhraseLengthStep.module.scss | 7 - .../WalletSetupRecoveryPhraseLengthStep.tsx | 53 ------- .../WalletSetupRegisterStep.module.scss | 75 ---------- .../WalletSetup/WalletSetupRegisterStep.tsx | 82 ----------- .../WalletSetupSelectAccountsStep.module.scss | 72 --------- .../WalletSetupSelectAccountsStep.tsx | 63 -------- .../WalletSetup/WalletSetupWalletNameStep.tsx | 75 ---------- .../src/ui/components/WalletSetup/index.ts | 11 -- .../WalletSetup/wallet-steps.common.ts | 16 -- .../ui/components/WalletSetup/wallet-steps.ts | 10 -- 26 files changed, 1356 deletions(-) delete mode 100644 packages/core/src/ui/components/WalletSetup/MnemonicWordsConfirmInput.module.scss delete mode 100644 packages/core/src/ui/components/WalletSetup/MnemonicWordsConfirmInput.tsx delete mode 100644 packages/core/src/ui/components/WalletSetup/SocialLink.module.scss delete mode 100644 packages/core/src/ui/components/WalletSetup/SocialLink.tsx delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupConnectHardwareWalletStep.module.scss delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupConnectHardwareWalletStep.tsx delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupFinalStep.module.scss delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupFinalStep.tsx delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupMnemonicIntroStep.tsx delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupModeStep.module.scss delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupModeStep.tsx delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupNamePasswordStep/WalletSetupNamePasswordStep.tsx delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupPasswordStep.module.scss delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupPasswordStep.tsx delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupRecoveryPhraseLengthStep.module.scss delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupRecoveryPhraseLengthStep.tsx delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupRegisterStep.module.scss delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupRegisterStep.tsx delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupSelectAccountsStep.module.scss delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupSelectAccountsStep.tsx delete mode 100644 packages/core/src/ui/components/WalletSetup/WalletSetupWalletNameStep.tsx delete mode 100644 packages/core/src/ui/components/WalletSetup/wallet-steps.common.ts delete mode 100644 packages/core/src/ui/components/WalletSetup/wallet-steps.ts diff --git a/packages/core/src/ui/components/WalletSetup/MnemonicWordsConfirmInput.module.scss b/packages/core/src/ui/components/WalletSetup/MnemonicWordsConfirmInput.module.scss deleted file mode 100644 index 786ba1bcba..0000000000 --- a/packages/core/src/ui/components/WalletSetup/MnemonicWordsConfirmInput.module.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../styles/theme.scss'; - -.mnemonicWordsConfirm { - flex-wrap: wrap; - display: grid; - grid-template-rows: 1fr; - grid-template-columns: 190px 190px; - row-gap: size_unit(2); - column-gap: size_unit(3); - - input { - border: none; - background: transparent; - outline: none; - } -} diff --git a/packages/core/src/ui/components/WalletSetup/MnemonicWordsConfirmInput.tsx b/packages/core/src/ui/components/WalletSetup/MnemonicWordsConfirmInput.tsx deleted file mode 100644 index 73cea60ad1..0000000000 --- a/packages/core/src/ui/components/WalletSetup/MnemonicWordsConfirmInput.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import React from 'react'; -import styles from './MnemonicWordsConfirmInput.module.scss'; -import { MnemonicWordsAutoComplete } from '../MnemonicWordsAutoComplete'; - -export interface MnemonicWordsConfirmInputProps { - firstWordNumber: number; - words: string[]; - onChange: (words: string[]) => void; - onDropdownVisibleChange?: (open: boolean) => void; - suggestionList?: Array; - focus?: boolean; -} - -export const MnemonicWordsConfirmInput = ({ - firstWordNumber, - words, - onChange, - onDropdownVisibleChange, - suggestionList -}: MnemonicWordsConfirmInputProps): React.ReactElement => ( -
- {words.map((word, index) => ( - { - const newWords = [...words]; - newWords[index] = value; - onChange(newWords); - }} - onDropdownVisibleChange={onDropdownVisibleChange} - idx={index + firstWordNumber} - key={index} - wordList={suggestionList} - focus={index + firstWordNumber === firstWordNumber} - /> - ))} -
-); diff --git a/packages/core/src/ui/components/WalletSetup/SocialLink.module.scss b/packages/core/src/ui/components/WalletSetup/SocialLink.module.scss deleted file mode 100644 index 95d4df4e8c..0000000000 --- a/packages/core/src/ui/components/WalletSetup/SocialLink.module.scss +++ /dev/null @@ -1,49 +0,0 @@ -@import '../../styles/theme.scss'; - -.socialLink { - width: 100%; - background: var(--light-mode-light-grey, var(--dark-mode-grey)); - border-radius: 100px; - - display: flex; - align-items: center; - justify-content: space-between; - padding: size_unit(2) size_unit(3) size_unit(2) size_unit(2); - - outline: none; - font-weight: 600; - font-size: var(--body); - line-height: size_unit(3); - color: var(--text-color-primary); - - &:hover { - background: var(--light-mode-light-grey-plus-56, var(--dark-mode-mid-grey)); - } - - &:active, - &:focus { - background: var(--light-mode-light-grey, var(--dark-mode-dark-grey)); - } - - .logo { - width: size_unit(6); - height: size_unit(6); - border-radius: 100px; - background: var(--light-mode-black, #ffffff); - display: flex; - align-items: center; - justify-content: center; - font-size: var(--subHeading); - color: var(--bg-color-body, #ffffff); - } - - .content { - display: flex; - align-items: center; - gap: size_unit(2); - } - - .arrow { - color: var(--light-mode-dark-grey, var(--dark-mode-light-grey)); - } -} diff --git a/packages/core/src/ui/components/WalletSetup/SocialLink.tsx b/packages/core/src/ui/components/WalletSetup/SocialLink.tsx deleted file mode 100644 index 5d9502ab66..0000000000 --- a/packages/core/src/ui/components/WalletSetup/SocialLink.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react'; -import styles from './SocialLink.module.scss'; -import { ReactComponent as ArrowRight } from '../../assets/icons/chevron-right.component.svg'; - -export interface SocialLinkProps { - icon?: React.ReactNode; - text: string; - to: string; - testId: string; -} - -// eslint-disable-next-line unicorn/no-null -export const SocialLink = ({ icon = null, text, to, testId }: SocialLinkProps): React.ReactElement => ( - -
-
- {icon} -
-

{text}

-
- -
-); diff --git a/packages/core/src/ui/components/WalletSetup/WalletSetupConnectHardwareWalletStep.module.scss b/packages/core/src/ui/components/WalletSetup/WalletSetupConnectHardwareWalletStep.module.scss deleted file mode 100644 index 42f55f80ec..0000000000 --- a/packages/core/src/ui/components/WalletSetup/WalletSetupConnectHardwareWalletStep.module.scss +++ /dev/null @@ -1,65 +0,0 @@ -@import '../../styles/theme.scss'; -@import '../../../../../common/src/ui/styles/abstracts/typography'; -$btn-gradient-border: 2px solid transparent; -$btn-gradient-bg: var(--light-mode-light-grey, var(--dark-mode-mid-grey)); -$btn-gradient-bg-hover: var(--light-mode-light-grey-plus, var(--dark-mode-mid-grey)); - -.hdWalletsWrapper { - display: flex; - flex-direction: column; - gap: size_unit(2); - margin-bottom: size_unit(9); - margin-top: size_unit(8); -} - -.hdWallets { - align-items: center; - display: flex; - gap: size_unit(2); - justify-content: center; - width: 100%; - - .hdWallet { - flex: 1; - height: 104px; - display: flex; - align-items: center; - justify-content: center; - background: var(--light-mode-light-grey, var(--dark-mode-grey)); - box-sizing: border-box; - border-radius: size_unit(2); - cursor: pointer; - padding: 0; - border: none; - - &:hover { - background: var(--light-mode-light-grey-plus-56, var(--dark-mode-mid-grey)); - } - - &Active { - background-color: $btn-gradient-bg; - background: linear-gradient($btn-gradient-bg, $btn-gradient-bg) padding-box, var(--lace-gradient) border-box; - border: $btn-gradient-border; - &:hover { - background-color: $btn-gradient-bg-hover; - background: linear-gradient($btn-gradient-bg-hover, $btn-gradient-bg-hover) padding-box, var(--lace-gradient) border-box; - border: $btn-gradient-border; - } - } - } -} - -.subTitle { - @include text-body-regular; - color: var(--text-color-primary) !important; -} - -.text { - @include text-bodySmall-medium; - color: var(--text-color-secondary) !important; -} - -.logo { - font-size: 100px; - color: var(--text-color-primary) !important; -} diff --git a/packages/core/src/ui/components/WalletSetup/WalletSetupConnectHardwareWalletStep.tsx b/packages/core/src/ui/components/WalletSetup/WalletSetupConnectHardwareWalletStep.tsx deleted file mode 100644 index 00eda1abf4..0000000000 --- a/packages/core/src/ui/components/WalletSetup/WalletSetupConnectHardwareWalletStep.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import React, { useState } from 'react'; -import { WalletSetupStepLayout, WalletTimelineSteps } from './WalletSetupStepLayout'; -import styles from './WalletSetupConnectHardwareWalletStep.module.scss'; -import Icon from '@ant-design/icons'; -import { ReactComponent as LedgerLogo } from '../../assets/icons/ledger-wallet.component.svg'; -import { ReactComponent as TrezorLogo } from '../../assets/icons/trezor-wallet.component.svg'; -import { Typography } from 'antd'; -import { TranslationsFor } from '@ui/utils/types'; -import classnames from 'classnames'; - -const { Text } = Typography; - -const logoMap = { - Ledger: LedgerLogo, - Trezor: TrezorLogo -}; - -export interface WalletSetupConnectHardwareWalletStepProps { - wallets: string[]; - onBack: () => void; - onNext: () => void; - onConnect: (model: string) => Promise; - isNextEnable: boolean; - translations: TranslationsFor<'title' | 'subTitle' | 'supportedDevices' | 'connectDevice'>; - isHardwareWallet?: boolean; -} - -export const WalletSetupConnectHardwareWalletStep = ({ - wallets, - onBack, - onNext, - onConnect, - isNextEnable, - translations, - isHardwareWallet = false -}: WalletSetupConnectHardwareWalletStepProps): React.ReactElement => { - const [walletModel, setWalletModel] = useState(); - const [isConnecting, setIsConnecting] = useState(false); - const isButtonActive = (model: string) => model === walletModel; - - const handleConnect = async (model: string) => { - setIsConnecting(true); - setWalletModel(model); - try { - await onConnect(model); - } finally { - setIsConnecting(false); - } - }; - - return ( - - - {translations.subTitle} - -
-
- {wallets.map((wallet: string) => ( - - ))} -
- - {translations.supportedDevices} - -
- - {translations.connectDevice} - -
- ); -}; diff --git a/packages/core/src/ui/components/WalletSetup/WalletSetupFinalStep.module.scss b/packages/core/src/ui/components/WalletSetup/WalletSetupFinalStep.module.scss deleted file mode 100644 index 615109ad50..0000000000 --- a/packages/core/src/ui/components/WalletSetup/WalletSetupFinalStep.module.scss +++ /dev/null @@ -1,34 +0,0 @@ -@import '../../styles/theme.scss'; - -.walletSetupFinalStep { - display: flex; - flex-direction: column; - gap: size_unit(2); - - p { - font-size: var(--body); - line-height: size_unit(3); - color: var(--text-color-primary); - } -} - -@keyframes rotating { - from { - transform: translateX(-50%) rotate(0deg); - } - to { - transform: translateX(-50%) rotate(360deg); - } -} - -.walletCreationStep { - align-items: center; - height: 100%; - justify-content: center; -} - -.loader { - animation: rotating 2s linear infinite; - height: 126px; - width: 126px; -} diff --git a/packages/core/src/ui/components/WalletSetup/WalletSetupFinalStep.tsx b/packages/core/src/ui/components/WalletSetup/WalletSetupFinalStep.tsx deleted file mode 100644 index b0083278c2..0000000000 --- a/packages/core/src/ui/components/WalletSetup/WalletSetupFinalStep.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import React, { useEffect } from 'react'; -import { WalletSetupStepLayout, WalletTimelineSteps } from './WalletSetupStepLayout'; -import { SocialLink } from './SocialLink'; -import styles from './WalletSetupFinalStep.module.scss'; -import { ReactComponent as TwitterLogo } from '../../assets/icons/twitter-logo.component.svg'; -import { ReactComponent as YoutubeLogo } from '../../assets/icons/youtube-logo.component.svg'; -import { ReactComponent as DiscordLogo } from '../../assets/icons/discord-logo.component.svg'; -import { TranslationsFor } from '@ui/utils/types'; - -type TranslationKeys = 'title' | 'description' | 'close' | 'followTwitter' | 'followYoutube' | 'followDiscord'; -export interface WalletSetupFinalStepProps { - onFinish: () => void; - onRender?: () => void; - translations: TranslationsFor; - isHardwareWallet?: boolean; -} - -const TWITTER = 'Twitter'; -const YOUTUBE = 'Youtube'; -const DISCORD = 'Discord'; - -const iconsMap: { [key: string]: React.ReactNode } = { - [TWITTER]: , - [YOUTUBE]: , - [DISCORD]: -}; - -if (!process.env.TWITTER_URL || !process.env.YOUTUBE_URL || !process.env.DISCORD_URL) { - throw new Error('social links not provided'); -} - -const links: { url: string; name: keyof typeof iconsMap }[] = [ - { url: process.env.TWITTER_URL, name: TWITTER }, - { url: process.env.YOUTUBE_URL, name: YOUTUBE }, - { url: process.env.DISCORD_URL, name: DISCORD } -]; - -export const WalletSetupFinalStep = ({ - onFinish, - onRender, - translations, - isHardwareWallet = false -}: WalletSetupFinalStepProps): React.ReactElement => { - useEffect(() => { - onRender && onRender(); - }, [onRender]); - - return ( - -
- {links.map(({ name, url }) => ( - - ))} -
-
- ); -}; diff --git a/packages/core/src/ui/components/WalletSetup/WalletSetupMnemonicIntroStep.tsx b/packages/core/src/ui/components/WalletSetup/WalletSetupMnemonicIntroStep.tsx deleted file mode 100644 index b40eb1dc44..0000000000 --- a/packages/core/src/ui/components/WalletSetup/WalletSetupMnemonicIntroStep.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import React, { useRef, useState } from 'react'; -import { WalletSetupStepLayout, WalletTimelineSteps } from './WalletSetupStepLayout'; -import { TranslationsFor } from '@ui/utils/types'; -import styles from './WalletSetupOption.module.scss'; - -export interface WalletSetupMnemonicIntroStepProps { - onBack: () => void; - onNext: () => void; - onClickVideo?: () => void; - videoSrc?: string; - translations: TranslationsFor<'title' | 'description' | 'linkText'>; - paperWalletEnabled: boolean; -} - -export const WalletSetupMnemonicIntroStep = ({ - onBack, - onNext, - onClickVideo, - videoSrc, - translations, - paperWalletEnabled -}: WalletSetupMnemonicIntroStepProps): React.ReactElement => { - const [overlayVisible, setOverlayVisible] = useState(true); - const videoRef = useRef(null); - - return ( - -
{ - setOverlayVisible(false); - if (videoRef.current) videoRef.current.src += '&autoplay=1'; - onClickVideo?.(); - }} - > - {overlayVisible &&
} -