Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "feat: add account redesign" #1768

Merged
merged 1 commit into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/silver-panthers-bathe.md

This file was deleted.

3 changes: 3 additions & 0 deletions apps/extension/src/@talisman/util/truncateString.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* eslint import/no-anonymous-default-export: [2, {"allowArrowFunction": true}] */
export default (str?: string, start = 4, end = 4) =>
str ? `${str.substring(0, start)}...${str.substring(str.length - end)}` : null
25 changes: 10 additions & 15 deletions apps/extension/src/ui/apps/dashboard/layout/LayoutBreadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { FC, Fragment, ReactNode, useMemo } from "react"
import { useTranslation } from "react-i18next"
import { NavLink, To, useLocation } from "react-router-dom"

import { MethodType } from "@ui/domains/Account/AccountAdd/context"

const useBreadcrumbItems = (): Partial<Record<string, BreadcrumbItemProps[]>> => {
const { t } = useTranslation()

Expand All @@ -15,10 +13,7 @@ const useBreadcrumbItems = (): Partial<Record<string, BreadcrumbItemProps[]>> =>
// reusables
const settings = { label: t("Settings"), to: "/settings/general" }
const accounts = { label: t("Accounts"), to: "/settings/accounts" }
const accountsAdd = (methodType?: MethodType) => ({
label: t("Add Account"),
to: `/accounts/add${methodType ? `?methodType=${methodType}` : ""}`,
})
const accountsAdd = { label: t("Add Account"), to: "/accounts/add" }
const securityAndPrivacy = {
label: t("Security & Privacy"),
to: "/settings/security-privacy-settings",
Expand All @@ -27,53 +22,53 @@ const useBreadcrumbItems = (): Partial<Record<string, BreadcrumbItemProps[]>> =>

return {
"/settings/accounts": [settings, accounts],
"/accounts/add": [settings, accounts, accountsAdd()],
"/accounts/add": [settings, accounts, accountsAdd],
"/accounts/add/derived": [
settings,
accounts,
accountsAdd(),
accountsAdd,
{ label: t("New"), to: "/accounts/add/derived" },
],
"/accounts/add/mnemonic": [
settings,
accounts,
accountsAdd("import"),
accountsAdd,
{ label: t("Recovery Phrase"), to: "/accounts/add/mnemonic" },
],
"/accounts/add/pk": [
settings,
accounts,
accountsAdd("import"),
accountsAdd,
{ label: t("Private Key"), to: "/accounts/add/pk" },
],
"/accounts/add/json": [
settings,
accounts,
accountsAdd("import"),
accountsAdd,
{ label: t("JSON"), to: "/accounts/add/json" },
],
"/accounts/add/ledger": [
settings,
accounts,
accountsAdd("connect"),
accountsAdd,
{ label: t("Ledger"), to: "/accounts/add/ledger" },
],
"/accounts/add/qr": [
settings,
accounts,
accountsAdd("connect"),
accountsAdd,
{ label: t("Polkadot Vault"), to: "/accounts/add/qr" },
],
"/accounts/add/signet": [
settings,
accounts,
accountsAdd("connect"),
accountsAdd,
{ label: t("Signet Vault"), to: "/accounts/add/signet" },
],
"/accounts/add/watched": [
settings,
accounts,
accountsAdd("watched"),
accountsAdd,
{ label: t("Watched Account"), to: "/accounts/add/watched" },
],

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { AccountAddDcentDisabledMessage } from "@ui/domains/Account/AccountAdd/AccountAddDcent"

import { DashboardLayout } from "../../layout"

export const AccountAddDcentDashboardWizard = () => {
return (
<DashboardLayout sidebar="settings">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import { useSearchParams } from "react-router-dom"
import { AccountAddressType } from "@extension/core"
import { HeaderBlock } from "@talisman/components/HeaderBlock"
import { Spacer } from "@talisman/components/Spacer"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { AccountAddDerivedForm } from "@ui/domains/Account/AccountAdd/AccountAddDerived/AccountAddDerivedForm"
import { useSelectAccountAndNavigate } from "@ui/hooks/useSelectAccountAndNavigate"

import { DashboardLayout } from "../../layout"

const Content = () => {
const { t } = useTranslation("admin")
// get type paramter from url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ import { useTranslation } from "react-i18next"

import { HeaderBlock } from "@talisman/components/HeaderBlock"
import { Spacer } from "@talisman/components/Spacer"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { AccountAddJson } from "@ui/domains/Account/AccountAdd/AccountAddJson"
import { useSelectAccountAndNavigate } from "@ui/hooks/useSelectAccountAndNavigate"

import { DashboardLayout } from "../../layout"

const Content = () => {
const { t } = useTranslation("admin")
const { setAddress } = useSelectAccountAndNavigate("/portfolio")

return (
<>
<HeaderBlock
title={t("Import via JSON")}
text={t("Please choose the json file you exported from Polkadot.js or Talisman")}
title={t("Import JSON")}
text={t("Please choose the .json file you exported from Polkadot.js or Talisman")}
/>
<Spacer />
<AccountAddJson onSuccess={setAddress} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { AccountAddSignetWizard } from "@ui/domains/Account/AccountAdd/AccountAddSignet/index"
import { useSelectAccountAndNavigate } from "@ui/hooks/useSelectAccountAndNavigate"

import { DashboardLayout } from "../../layout"

const Content = () => {
const { setAddress } = useSelectAccountAndNavigate("/portfolio")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
import { useTranslation } from "react-i18next"
import { useSearchParams } from "react-router-dom"

import { AccountAddressType } from "@extension/core"
import { HeaderBlock } from "@talisman/components/HeaderBlock"
import { Spacer } from "@talisman/components/Spacer"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { AccountAddWatchedForm } from "@ui/domains/Account/AccountAdd/AccountAddWatchedForm"
import { useSelectAccountAndNavigate } from "@ui/hooks/useSelectAccountAndNavigate"

import { DashboardLayout } from "../../layout"

export const Content = () => {
const { t } = useTranslation("admin")
// get type paramter from url
const [params] = useSearchParams()
const urlParamType = (params.get("type") ?? undefined) as AccountAddressType | undefined
const { setAddress } = useSelectAccountAndNavigate("/portfolio")

return (
<>
<HeaderBlock
title={t("Add a watched account")}
text={!urlParamType && t("What type of account would you like to create?")}
title={t("Choose account type")}
text={t("What type of account would you like to add?")}
/>
<Spacer small />
<Spacer />
<AccountAddWatchedForm onSuccess={setAddress} />
</>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { useTranslation } from "react-i18next"

import { HeaderBlock } from "@talisman/components/HeaderBlock"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { AccountCreateMenu } from "@ui/domains/Account/AccountAdd"
import { useBalancesHydrate } from "@ui/state"

import { DashboardLayout } from "../../layout"

const Content = () => {
useBalancesHydrate() // preload
const { t } = useTranslation()
Expand All @@ -13,7 +14,7 @@ const Content = () => {
<div className="flex flex-col gap-16">
<HeaderBlock
title={t("Add Account")}
text={t("Create a new account or import an existing account")}
text={t("Create a new account or import an existing one")}
/>
<AccountCreateMenu />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { useTranslation } from "react-i18next"
import { useNavigate, useParams } from "react-router-dom"

import { AnalyticsPage } from "@ui/api/analytics"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import {
EvmNetworkForm,
SubNetworkFormAdd,
SubNetworkFormEdit,
} from "@ui/domains/Settings/ManageNetworks/NetworkForm"
import { useAnalyticsPageView } from "@ui/hooks/useAnalyticsPageView"

import { DashboardLayout } from "../../layout"
import { useNetworksType } from "./useNetworksType"

const ANALYTICS_PAGE: AnalyticsPage = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { OptionSwitch } from "@talisman/components/OptionSwitch"
import { SearchInput } from "@talisman/components/SearchInput"
import { Spacer } from "@talisman/components/Spacer"
import { sendAnalyticsEvent } from "@ui/api/analytics"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { EnableTestnetPillButton } from "@ui/domains/Settings/EnableTestnetPillButton"
import { useAnalyticsPageView } from "@ui/hooks/useAnalyticsPageView"
import {
Expand All @@ -22,6 +21,7 @@ import {
getSettingValue$,
} from "@ui/state"

import { DashboardLayout } from "../../layout"
import { ANALYTICS_PAGE } from "./analytics"
import { ChainsList } from "./ChainsList"
import { EvmNetworksList } from "./EvmNetworksList"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { useEffect } from "react"
import { Route, Routes, useSearchParams } from "react-router-dom"

import { NavigateWithQuery } from "@talisman/components/NavigateWithQuery"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { useBuyTokensModal } from "@ui/domains/Asset/Buy/useBuyTokensModal"
import { DashboardPortfolioHeader } from "@ui/domains/Portfolio/DashboardPortfolioHeader"
import { PortfolioContainer } from "@ui/domains/Portfolio/PortfolioContainer"
import { PortfolioToolbarNfts } from "@ui/domains/Portfolio/PortfolioToolbarNfts"
import { PortfolioToolbarTokens } from "@ui/domains/Portfolio/PortfolioToolbarTokens"

import { DashboardLayout } from "../../layout"
import { PortfolioAsset, PortfolioAssetHeader } from "./PortfolioAsset"
import { PortfolioAssets } from "./PortfolioAssets"
import { PortfolioNftCollection } from "./PortfolioNftCollection"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import {
TERMS_OF_USE_URL,
} from "@extension/shared"
import { HeaderBlock } from "@talisman/components/HeaderBlock"
import { DashboardLayout } from "@ui/apps/dashboard/layout"

import { DashboardLayout } from "../../layout"

const Content = () => {
const { t } = useTranslation("admin")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { Spacer } from "@talisman/components/Spacer"
import { SuspenseTracker } from "@talisman/components/SuspenseTracker"
import { useOpenClose } from "@talisman/hooks/useOpenClose"
import { AnalyticsPage } from "@ui/api/analytics"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { AccountIcon } from "@ui/domains/Account/AccountIcon"
import { Address } from "@ui/domains/Account/Address"
import { useCopyAddressModal } from "@ui/domains/CopyAddress"
Expand All @@ -46,6 +45,8 @@ import { useAnalyticsPageView } from "@ui/hooks/useAnalyticsPageView"
import { useSendFundsPopup } from "@ui/hooks/useSendFundsPopup"
import { useBalances, useChainByGenesisHash } from "@ui/state"

import { DashboardLayout } from "../../layout"

const ANALYTICS_PAGE: AnalyticsPage = {
container: "Fullscreen",
feature: "Settings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { useTranslation } from "react-i18next"
import { Toggle } from "talisman-ui"

import { Setting } from "@talisman/components/Setting"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { AnalyticsOptInInfo } from "@ui/domains/Settings/Analytics/AnalyticsOptInInfo"
import { useSetting } from "@ui/state"

import { DashboardLayout } from "../../layout"

const Content = () => {
const { t } = useTranslation("admin")
const [useAnalyticsTracking, setUseAnalyticsTracking] = useSetting("useAnalyticsTracking")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import { Spacer } from "@talisman/components/Spacer"
import { shortenAddress } from "@talisman/util/shortenAddress"
import { api } from "@ui/api"
import { AnalyticsPage } from "@ui/api/analytics"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { AccountIcon } from "@ui/domains/Account/AccountIcon"
import { AccountsStack } from "@ui/domains/Account/AccountIconsStack"
import { ChainLogo } from "@ui/domains/Asset/ChainLogo"
Expand Down Expand Up @@ -71,6 +70,7 @@ import {
import { isErc20Token } from "@ui/util/isErc20Token"
import { isUniswapV2Token } from "@ui/util/isUniswapV2Token"

import { DashboardLayout } from "../../../layout"
import {
useAssetDiscoveryFetchTokenRates,
useAssetDiscoveryTokenRates,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { useTranslation } from "react-i18next"
import { ExclusiveButtonsList } from "@talisman/components/ExclusiveButtonsList"
import { HeaderBlock } from "@talisman/components/HeaderBlock"
import { Spacer } from "@talisman/components/Spacer"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { useSetting } from "@ui/state"

import { DashboardLayout } from "../../layout"

type Option = { value: number; label: string }

export const Content = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { AuthorisedSites } from "@ui/domains/Settings/AuthorisedSites/AuthorisedSites"

import { DashboardLayout } from "../../layout"

export const ConnectedSitesPage = () => (
<DashboardLayout sidebar="settings">
<AuthorisedSites />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import { useTranslation } from "react-i18next"

import { HeaderBlock } from "@talisman/components/HeaderBlock"
import { Spacer } from "@talisman/components/Spacer"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { currencyConfig, currencyOrder, sortCurrencies } from "@ui/domains/Asset/currencyConfig"
import { useFavoriteCurrencies } from "@ui/hooks/useFavoriteCurrencies"
import { useSetting } from "@ui/state"

import { DashboardLayout } from "../../layout"

const Content = () => {
const [favorites, setFavorites] = useFavoriteCurrencies()
const [, setSelected] = useSetting("selectedCurrency")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ import { SPIRIT_KEYS_DOCS_URL } from "@extension/shared"
import { HeaderBlock } from "@talisman/components/HeaderBlock"
import { Setting } from "@talisman/components/Setting"
import { AnalyticsPage } from "@ui/api/analytics"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { AvatarTypeSelect } from "@ui/domains/Settings/AvatarTypeSelect"
import { useRuntimeReload } from "@ui/hooks/useRuntimeReload"
import { useAppState, useSetting } from "@ui/state"

import { DashboardLayout } from "../../layout"

const ANALYTICS_PAGE: AnalyticsPage = {
container: "Fullscreen",
feature: "Settings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { languages } from "@common/i18nConfig"
import { ExclusiveButtonsList } from "@talisman/components/ExclusiveButtonsList"
import { HeaderBlock } from "@talisman/components/HeaderBlock"
import { Spacer } from "@talisman/components/Spacer"
import { DashboardLayout } from "@ui/apps/dashboard/layout"

import { DashboardLayout } from "../../layout"

const Content = () => {
const { t, i18n } = useTranslation()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import { CtaButton, Toggle } from "talisman-ui"
import { HeaderBlock } from "@talisman/components/HeaderBlock"
import { Setting } from "@talisman/components/Setting"
import { Spacer } from "@talisman/components/Spacer"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import { useSetting } from "@ui/state"

import { DashboardLayout } from "../../layout"

const Content = () => {
const { t } = useTranslation("admin")
const [useTestnets, setUseTestnets] = useSetting("useTestnets")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { FadeIn } from "@talisman/components/FadeIn"
import { HeaderBlock } from "@talisman/components/HeaderBlock"
import { notify } from "@talisman/components/Notifications"
import { api } from "@ui/api"
import { DashboardLayout } from "@ui/apps/dashboard/layout"
import {
MnemonicCreateModal,
MnemonicCreateModalProvider,
Expand All @@ -22,6 +21,8 @@ import { MetadataQrCode } from "@ui/domains/Sign/Qr/MetadataQrCode"
import { NetworkSpecsQrCode } from "@ui/domains/Sign/Qr/NetworkSpecsQrCode"
import { useAppState, useBalancesHydrate, useChains, useMnemonic } from "@ui/state"

import { DashboardLayout } from "../../layout"

const SetVerifierCertificateContentInner = () => {
const { t } = useTranslation("admin")
const navigate = useNavigate()
Expand Down
Loading
Loading