diff --git a/apps/extension/src/ui/apps/dashboard/layout/DashboardSettingsSidebar.tsx b/apps/extension/src/ui/apps/dashboard/layout/DashboardSettingsSidebar.tsx index 88e00fccd..2e54d44ea 100644 --- a/apps/extension/src/ui/apps/dashboard/layout/DashboardSettingsSidebar.tsx +++ b/apps/extension/src/ui/apps/dashboard/layout/DashboardSettingsSidebar.tsx @@ -11,17 +11,15 @@ import { UsersIcon, } from "@talismn/icons" import { classNames } from "@talismn/util" -import { Suspense, useCallback } from "react" +import { FC, ReactNode, Suspense, useCallback } from "react" import { useTranslation } from "react-i18next" -import { useNavigate } from "react-router-dom" +import { NavLink, To, useMatch, useNavigate } from "react-router-dom" import { IconButton, Tooltip, TooltipContent, TooltipTrigger } from "talisman-ui" import { SuspenseTracker } from "@talisman/components/SuspenseTracker" import { useAnalytics } from "@ui/hooks/useAnalytics" import { useMnemonicBackup } from "@ui/hooks/useMnemonicBackup" -import { SidebarNavItem } from "./SidebarNavItem" - export const DashboardSettingsSidebar = () => { const { t } = useTranslation() const { genericEvent } = useAnalytics() @@ -95,6 +93,33 @@ export const DashboardSettingsSidebar = () => { ) } +const SidebarNavItem: FC<{ + to: To + icon: ReactNode + label: ReactNode + matchPath?: string + className?: string +}> = ({ to, icon, label, matchPath, className }) => { + const forceActive = useMatch(matchPath ?? "UNEXISTANT_PATH") + + return ( + + {icon} + {label} + + ) +} + const MnemonicNotification = () => { const { allBackedUp } = useMnemonicBackup() diff --git a/apps/extension/src/ui/apps/dashboard/layout/SidebarNavItem.tsx b/apps/extension/src/ui/apps/dashboard/layout/SidebarNavItem.tsx deleted file mode 100644 index f723d6793..000000000 --- a/apps/extension/src/ui/apps/dashboard/layout/SidebarNavItem.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { classNames } from "@talismn/util" -import { FC, ReactNode } from "react" -import { NavLink, To, useMatch } from "react-router-dom" - -export const SidebarNavItem: FC<{ - to: To - icon: ReactNode - label: ReactNode - matchPath?: string - className?: string -}> = ({ to, icon, label, matchPath, className }) => { - const forceActive = useMatch(matchPath ?? "UNEXISTANT_PATH") - - return ( - - {icon} - {label} - - ) -} diff --git a/apps/extension/src/ui/apps/dashboard/routes/Portfolio/Shared/PortfolioLayout.tsx b/apps/extension/src/ui/apps/dashboard/routes/Portfolio/Shared/PortfolioLayout.tsx index 0fcc0fa77..02e422929 100644 --- a/apps/extension/src/ui/apps/dashboard/routes/Portfolio/Shared/PortfolioLayout.tsx +++ b/apps/extension/src/ui/apps/dashboard/routes/Portfolio/Shared/PortfolioLayout.tsx @@ -1,6 +1,6 @@ import { FC, PropsWithChildren, ReactNode, Suspense, useCallback } from "react" import { useTranslation } from "react-i18next" -import { useLocation, useNavigate } from "react-router-dom" +import { useNavigate } from "react-router-dom" import { Button } from "talisman-ui" import { SuspenseTracker } from "@talisman/components/SuspenseTracker" @@ -10,8 +10,6 @@ import { PortfolioTabs } from "@ui/domains/Portfolio/PortfolioTabs" import { usePortfolioNavigation } from "@ui/domains/Portfolio/usePortfolioNavigation" import { usePortfolio } from "@ui/state" -const RAMP_ROUTE = "/portfolio/buysell" - const EnableNetworkMessage: FC<{ type?: "substrate" | "evm" }> = ({ type }) => { const { t } = useTranslation() const navigate = useNavigate() @@ -54,26 +52,21 @@ const PortfolioAccountCheck: FC = ({ children }) => { export const PortfolioLayout: FC< PropsWithChildren & { toolbar?: ReactNode; header?: ReactNode } > = ({ header, toolbar, children }) => { - const location = useLocation() - const isRampRoute = location.pathname.includes(RAMP_ROUTE) return (
} > - {!isRampRoute && (header ?? )} + {header ?? } - {!isRampRoute && ( -
- - -
- }> - {toolbar} - -
+
+ +
+ }> + {toolbar} +
- )} +
}> {children} diff --git a/apps/extension/src/ui/apps/dashboard/routes/Portfolio/index.tsx b/apps/extension/src/ui/apps/dashboard/routes/Portfolio/index.tsx index 70c826d00..639922769 100644 --- a/apps/extension/src/ui/apps/dashboard/routes/Portfolio/index.tsx +++ b/apps/extension/src/ui/apps/dashboard/routes/Portfolio/index.tsx @@ -31,26 +31,24 @@ const BuyTokensOpener = () => { return null } -export const PortfolioRoutes = () => { - return ( - - - +export const PortfolioRoutes = () => ( + + + - {/* share layout to prevent tabs flickering */} - } header={}> - - } /> - } /> - } /> - } /> - } /> - - - - - ) -} + {/* share layout to prevent tabs flickering */} + } header={}> + + } /> + } /> + } /> + } /> + } /> + + + + +) const PortfolioToolbar = () => (