Skip to content

Commit

Permalink
fix(dw): bread crumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
javadkh2 committed Dec 2, 2024
1 parent 7c7cb09 commit 9301530
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 23 deletions.
14 changes: 7 additions & 7 deletions packages/apps/dev-wallet/src/App/Layout/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const SideBar: FC = () => {
<>
<SideBarItem
visual={<MonoWallet />}
label="Assets"
label="Your Assets"
component={Link}
href="/"
/>
Expand All @@ -89,17 +89,17 @@ export const SideBar: FC = () => {
/>

<SideBarItem
visual={<MonoSignature />}
label="Sig Builder"
visual={<MonoTableRows />}
label="Transactions"
component={Link}
href="/sig-builder"
href="/transactions"
/>

<SideBarItem
visual={<MonoTableRows />}
label="Transactions"
visual={<MonoSignature />}
label="Sig Builder"
component={Link}
href="/transactions"
href="/sig-builder"
/>

<SideBarItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ import { SideBarBreadcrumbs as SideBarBreadcrumbsUI } from '@kadena/kode-ui/patt
import React, { FC } from 'react';
import { Link } from 'react-router-dom';

export const SideBarBreadcrumbs: FC<IBreadcrumbsProps> = ({
children,
...props
}) => {
export const SideBarBreadcrumbs: FC<
IBreadcrumbsProps & { isGlobal?: boolean }
> = ({ children, isGlobal, ...props }) => {
const { activeNetwork } = useWallet();

return (
<SideBarBreadcrumbsUI
{...props}
badge={
<Badge size="sm" style="highContrast">{`${activeNetwork?.name}`}</Badge>
<Badge
size="sm"
style="highContrast"
>{`${isGlobal ? 'Global' : activeNetwork?.name}`}</Badge>
}
>
{React.Children.map(children, (child) => {
Expand Down
9 changes: 7 additions & 2 deletions packages/apps/dev-wallet/src/pages/account/account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,14 @@ export function AccountPage() {
return (
<Stack flexDirection={'column'} gap={'lg'}>
<SideBarBreadcrumbs icon={<MonoWallet />}>
<SideBarBreadcrumbsItem href="/">Dashboard</SideBarBreadcrumbsItem>
<SideBarBreadcrumbsItem href="/">Your Assets</SideBarBreadcrumbsItem>
<SideBarBreadcrumbsItem href="/">
{account.contract}
</SideBarBreadcrumbsItem>
<SideBarBreadcrumbsItem href={`/account/${accountId}`}>
Account ({account.alias || account.address})
{account.alias
? `${account.alias} (${account.address})`
: account.address}
</SideBarBreadcrumbsItem>
</SideBarBreadcrumbs>
<AliasForm show={isRightAsideExpanded} account={account} />
Expand Down
3 changes: 1 addition & 2 deletions packages/apps/dev-wallet/src/pages/contacts/contacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ export function Contacts() {

return (
<>
<SideBarBreadcrumbs icon={<MonoContacts />}>
<SideBarBreadcrumbsItem href="/">Dashboard</SideBarBreadcrumbsItem>
<SideBarBreadcrumbs icon={<MonoContacts />} isGlobal>
<SideBarBreadcrumbsItem href="/contacts">
Contacts
</SideBarBreadcrumbsItem>
Expand Down
3 changes: 1 addition & 2 deletions packages/apps/dev-wallet/src/pages/keys/keys-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ export function KeysPage() {

return (
<>
<SideBarBreadcrumbs icon={<MonoKey />}>
<SideBarBreadcrumbsItem href="/">Dashboard</SideBarBreadcrumbsItem>
<SideBarBreadcrumbs icon={<MonoKey />} isGlobal>
<SideBarBreadcrumbsItem href="/key-management/keys">
Manage Your Keys
</SideBarBreadcrumbsItem>
Expand Down
9 changes: 8 additions & 1 deletion packages/apps/dev-wallet/src/pages/settings/settings.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { SideBarBreadcrumbs } from '@/Components/SideBarBreadcrumbs/SideBarBreadcrumbs';
import { dbService } from '@/modules/db/db.service';
import {
MonoDownload,
MonoPassword,
MonoPerson,
MonoRemoveRedEye,
MonoSettings,
MonoSettingsBackupRestore,
} from '@kadena/kode-icons/system';
import { Button, Heading, Stack, Link as UiLink } from '@kadena/kode-ui';
import { useLayout } from '@kadena/kode-ui/patterns';
import { SideBarBreadcrumbsItem, useLayout } from '@kadena/kode-ui/patterns';
import { Link } from 'react-router-dom';
import { isFileSystemAccessSupported } from '../../modules/backup/fileApi';
import { ProfileNameColorForm } from './components/ProfileNameColorForm';
Expand All @@ -17,6 +19,11 @@ export function Settings() {
const { isRightAsideExpanded, setIsRightAsideExpanded } = useLayout();
return (
<Stack flexDirection={'column'} gap={'md'} alignItems={'flex-start'}>
<SideBarBreadcrumbs icon={<MonoSettings />} isGlobal>
<SideBarBreadcrumbsItem href="/settings">
Settings
</SideBarBreadcrumbsItem>
</SideBarBreadcrumbs>
<Heading variant="h3">Settings</Heading>
<ProfileNameColorForm isOpen={isRightAsideExpanded} />
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ export function SignatureBuilder() {

return (
<>
<SideBarBreadcrumbs icon={<MonoDashboardCustomize />}>
<SideBarBreadcrumbsItem href="/">Dashboard</SideBarBreadcrumbsItem>
<SideBarBreadcrumbs icon={<MonoDashboardCustomize />} isGlobal>
<SideBarBreadcrumbsItem href="/sig-builder">
Sig Builder
</SideBarBreadcrumbsItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export function Transactions() {
return (
<>
<SideBarBreadcrumbs icon={<MonoSwapHoriz />}>
<SideBarBreadcrumbsItem href="/">Dashboard</SideBarBreadcrumbsItem>
<SideBarBreadcrumbsItem href="/transactions">
Transactions
</SideBarBreadcrumbsItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ export function TransferV2() {
return (
<>
<SideBarBreadcrumbs icon={<MonoSwapHoriz />}>
<SideBarBreadcrumbsItem href="/">Dashboard</SideBarBreadcrumbsItem>
<SideBarBreadcrumbsItem href="/transfer">
Transfer
</SideBarBreadcrumbsItem>
Expand Down

0 comments on commit 9301530

Please sign in to comment.