diff --git a/packages/apps/dev-wallet/src/App/Layout/Layout.tsx b/packages/apps/dev-wallet/src/App/Layout/Layout.tsx index f64b9a160c..3809e3ee0a 100644 --- a/packages/apps/dev-wallet/src/App/Layout/Layout.tsx +++ b/packages/apps/dev-wallet/src/App/Layout/Layout.tsx @@ -6,7 +6,6 @@ import { } from '@kadena/kode-icons/system'; import { NetworkSelector } from '@/Components/NetworkSelector/NetworkSelector'; -import { BreadCrumbs } from '@/pages/BreadCrumbs/BreadCrumbs'; import { Themes, useTheme } from '@kadena/kode-ui'; import { SideBarFooter, @@ -41,7 +40,6 @@ export const Layout: FC = () => { <> } - breadcrumbs={} location={innerLocation} sidebar={} footer={ diff --git a/packages/apps/dev-wallet/src/Components/Breadcrumbs/Breadcrumbs.tsx b/packages/apps/dev-wallet/src/Components/Breadcrumbs/Breadcrumbs.tsx new file mode 100644 index 0000000000..5dd4b241a3 --- /dev/null +++ b/packages/apps/dev-wallet/src/Components/Breadcrumbs/Breadcrumbs.tsx @@ -0,0 +1,17 @@ +import { IBreadcrumbsProps } from '@kadena/kode-ui'; +import { SideBarBreadcrumbs } from '@kadena/kode-ui/patterns'; +import React, { FC } from 'react'; +import { Link } from 'react-router-dom'; + +export const Breadcrumbs: FC = ({ children, ...props }) => { + return ( + + {React.Children.map(children, (child) => { + if (!React.isValidElement(child)) { + return null; + } + return React.cloneElement(child, { ...child.props, component: Link }); + })} + + ); +}; diff --git a/packages/apps/dev-wallet/src/pages/BreadCrumbs/BreadCrumbs.tsx b/packages/apps/dev-wallet/src/pages/BreadCrumbs/BreadCrumbs.tsx deleted file mode 100644 index 234fbcf297..0000000000 --- a/packages/apps/dev-wallet/src/pages/BreadCrumbs/BreadCrumbs.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { MonoWindow } from '@kadena/kode-icons/system'; -import { BreadcrumbsItem, Breadcrumbs as BreadcrumbsUI } from '@kadena/kode-ui'; -import { useLayout } from '@kadena/kode-ui/patterns'; -import { FC } from 'react'; -import { Link } from 'react-router-dom'; - -export const BreadCrumbs: FC = () => { - const { breadCrumbs } = useLayout(); - - return ( - } - > - <> - - Dashboard - - {breadCrumbs.map((crumb) => ( - - {crumb.label} - - ))} - - - ); -}; diff --git a/packages/apps/dev-wallet/src/pages/backup-recovery-phrase/backup-recovery-phrase.tsx b/packages/apps/dev-wallet/src/pages/backup-recovery-phrase/backup-recovery-phrase.tsx index 484b76544c..134c91bdfc 100644 --- a/packages/apps/dev-wallet/src/pages/backup-recovery-phrase/backup-recovery-phrase.tsx +++ b/packages/apps/dev-wallet/src/pages/backup-recovery-phrase/backup-recovery-phrase.tsx @@ -1,22 +1,19 @@ import { AuthCard } from '@/Components/AuthCard/AuthCard'; +import { Breadcrumbs } from '@/Components/Breadcrumbs/Breadcrumbs'; import { MonoDashboardCustomize } from '@kadena/kode-icons/system'; import { Box, Button, Heading, Stack, Text } from '@kadena/kode-ui'; -import { useLayout } from '@kadena/kode-ui/patterns'; +import { SideBarBreadcrumbsItem } from '@kadena/kode-ui/patterns'; import { Link } from 'react-router-dom'; export function BackupRecoveryPhrase() { - useLayout({ - breadCrumbs: [ - { - label: 'Backup', - visual: , - url: '/backup-recovery-phrase', - }, - ], - }); - return ( <> + }> + Dashboard + + Backup + + Backup the recovery phrase diff --git a/packages/apps/dev-wallet/src/pages/backup-recovery-phrase/write-down/write-down-recovery-phrase.tsx b/packages/apps/dev-wallet/src/pages/backup-recovery-phrase/write-down/write-down-recovery-phrase.tsx index 95f1288e6f..fd8fe83809 100644 --- a/packages/apps/dev-wallet/src/pages/backup-recovery-phrase/write-down/write-down-recovery-phrase.tsx +++ b/packages/apps/dev-wallet/src/pages/backup-recovery-phrase/write-down/write-down-recovery-phrase.tsx @@ -1,26 +1,14 @@ import { AuthCard } from '@/Components/AuthCard/AuthCard'; import { BackupMnemonic } from '@/Components/BackupMnemonic/BackupMnemonic'; +import { Breadcrumbs } from '@/Components/Breadcrumbs/Breadcrumbs'; import { useWallet } from '@/modules/wallet/wallet.hook'; import { MonoDashboardCustomize } from '@kadena/kode-icons/system'; import { Notification } from '@kadena/kode-ui'; -import { useLayout } from '@kadena/kode-ui/patterns'; +import { SideBarBreadcrumbsItem } from '@kadena/kode-ui/patterns'; import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; export function WriteDownRecoveryPhrase() { - useLayout({ - breadCrumbs: [ - { - label: 'Backup', - visual: , - url: '/backup-recovery-phrase', - }, - { - label: 'Recovery phrase', - url: '/backup-recovery-phrase/write-down', - }, - ], - }); const { decryptSecret, askForPassword, profile } = useWallet(); const [mnemonic, setMnemonic] = useState(''); const [error, setError] = useState(''); @@ -54,6 +42,12 @@ export function WriteDownRecoveryPhrase() { } return ( <> + }> + Dashboard + + Recovery phrase + + { , - url: '/contacts', - }, - ], - }); + const { setIsRightAsideExpanded, isRightAsideExpanded } = useLayout(); const [editContact, setEditContact] = useState(); const { contacts } = useWallet(); const prompt = usePrompt(); @@ -46,6 +39,13 @@ export function Contacts() { return ( <> + }> + Dashboard + + Contacts + + + { if (profile?.uuid && activeNetwork?.uuid) { @@ -40,28 +38,33 @@ export function HomePage() { ); return ( - - Welcome back - {profile?.name} - - - - Wallet Activities - - - - - - - All transactions - - - - WIP: Not implemented yet - + <> + }> + Dashboard + + + Welcome back + {profile?.name} + + + + Wallet Activities + + + + + + + All transactions + + + + WIP: Not implemented yet + + - - + + ); } diff --git a/packages/apps/dev-wallet/src/pages/keys/keys-page.tsx b/packages/apps/dev-wallet/src/pages/keys/keys-page.tsx index 9a65d2bee3..45e59c5b58 100644 --- a/packages/apps/dev-wallet/src/pages/keys/keys-page.tsx +++ b/packages/apps/dev-wallet/src/pages/keys/keys-page.tsx @@ -1,49 +1,49 @@ +import { Breadcrumbs } from '@/Components/Breadcrumbs/Breadcrumbs'; import { Mono123, MonoKey } from '@kadena/kode-icons/system'; import { Heading, Stack, TabItem, Tabs, Text } from '@kadena/kode-ui'; -import { useLayout } from '@kadena/kode-ui/patterns'; +import { SideBarBreadcrumbsItem } from '@kadena/kode-ui/patterns'; import { useParams } from 'react-router-dom'; import { Keys } from './Components/Keys'; import { KeySets } from './Components/KeySets'; export function KeysPage() { const { tab = 'keys' } = useParams(); - useLayout({ - breadCrumbs: [ - { - label: 'Manage Your Keys', - visual: , - url: '/key-management/keys', - }, - ], - }); return ( - - Manage Your Keys - - - - Your Keys - - } - > - - - - - Your Key Sets - - } - > - - - - + <> + }> + Dashboard + + Manage Your Keys + + + + Manage Your Keys + + + + Your Keys + + } + > + + + + + Your Key Sets + + } + > + + + + + ); } diff --git a/packages/apps/dev-wallet/src/pages/networks/networks.tsx b/packages/apps/dev-wallet/src/pages/networks/networks.tsx index d0fd004f10..76b30c5ee0 100644 --- a/packages/apps/dev-wallet/src/pages/networks/networks.tsx +++ b/packages/apps/dev-wallet/src/pages/networks/networks.tsx @@ -1,9 +1,10 @@ +import { Breadcrumbs } from '@/Components/Breadcrumbs/Breadcrumbs'; import { ListItem } from '@/Components/ListItem/ListItem'; import { networkRepository } from '@/modules/network/network.repository'; import { useWallet } from '@/modules/wallet/wallet.hook'; import { MonoWifiTethering } from '@kadena/kode-icons/system'; import { Button, Heading, Stack, Text } from '@kadena/kode-ui'; -import { useLayout } from '@kadena/kode-ui/patterns'; +import { SideBarBreadcrumbsItem, useLayout } from '@kadena/kode-ui/patterns'; import { useState } from 'react'; import { panelClass } from '../home/style.css'; import { @@ -17,14 +18,16 @@ export function Networks() { const { setIsRightAsideExpanded, isRightAsideExpanded } = useLayout(); const [selectedNetwork, setSelectedNetwork] = useState(() => getNewNetwork()); - useLayout({ - breadCrumbs: [ - { label: 'Networks', visual: , url: '/networks' }, - ], - }); return ( <> + }> + Dashboard + + Networks + + + ([]); const { profile, activeNetwork, networks, setActiveNetwork } = useWallet(); const navigate = useNavigate(); - useLayout({ - breadCrumbs: [ - { - label: 'Sig Builder', - visual: , - url: '/sig-builder', - }, - ], - }); const exec = pactCommand && pactCommand.payload && 'exec' in pactCommand.payload @@ -149,78 +141,89 @@ export function SignatureBuilder() { } return ( - - Paste SigData, CommandSigData, or Payload -