From d71d8187bac18ba0673d7687327089d4e37d2ff9 Mon Sep 17 00:00:00 2001 From: Steven Straatemans Date: Tue, 29 Oct 2024 16:06:43 +0100 Subject: [PATCH] add full layout --- .../apps/dev-wallet/src/App/Layout/Layout.tsx | 65 ++++--- .../dev-wallet/src/App/Layout/SideBar.tsx | 182 +++++++++--------- packages/apps/dev-wallet/src/App/app.tsx | 7 +- .../dev-wallet/src/App/layout-mini.css.ts | 14 -- .../apps/dev-wallet/src/App/layout-mini.tsx | 10 +- .../patterns/SideBarLayout/InnerLayout.tsx | 33 ---- .../src/patterns/SideBarLayout/SideBar.tsx | 18 +- .../SideBarLayout/SideBarLayout.stories.tsx | 178 ++++++++++------- .../patterns/SideBarLayout/SideBarLayout.tsx | 52 ++++- .../components/SideBarAppContext.tsx | 4 +- .../components/SideBarHeader.tsx | 47 +++-- .../components/SideBarProvider.tsx | 18 ++ .../src/patterns/SideBarLayout/index.ts | 5 +- .../src/patterns/SideBarLayout/sidebar.css.ts | 17 +- .../src/patterns/SideBarLayout/styles.css.ts | 91 ++++++--- packages/libs/kode-ui/src/patterns/index.ts | 4 +- 16 files changed, 423 insertions(+), 322 deletions(-) delete mode 100644 packages/libs/kode-ui/src/patterns/SideBarLayout/InnerLayout.tsx diff --git a/packages/apps/dev-wallet/src/App/Layout/Layout.tsx b/packages/apps/dev-wallet/src/App/Layout/Layout.tsx index 819d251b3a..684c5666b0 100644 --- a/packages/apps/dev-wallet/src/App/Layout/Layout.tsx +++ b/packages/apps/dev-wallet/src/App/Layout/Layout.tsx @@ -28,38 +28,39 @@ export const Layout: FC = () => { }; return ( <> - }> - - -
- -
- - } - label="" - onPress={() => {}} - /> - } - label="Profile" - onPress={() => { - navigate('/profile'); - }} - /> - } - label="Select network" - onPress={() => {}} - > - - - } - label="Change theme" - onPress={toggleTheme} - /> - + } + sidebar={} + footer={ + + } + label="" + onPress={() => {}} + /> + } + label="Profile" + onPress={() => { + navigate('/profile'); + }} + /> + } + label="Select network" + onPress={() => {}} + > + + + } + label="Change theme" + onPress={toggleTheme} + /> + + } + > +
diff --git a/packages/apps/dev-wallet/src/App/Layout/SideBar.tsx b/packages/apps/dev-wallet/src/App/Layout/SideBar.tsx index ab2ab6f8b1..fa3cb9827a 100644 --- a/packages/apps/dev-wallet/src/App/Layout/SideBar.tsx +++ b/packages/apps/dev-wallet/src/App/Layout/SideBar.tsx @@ -20,11 +20,8 @@ import { useTheme, } from '@kadena/kode-ui'; import { - SideBarAppContext, - SideBarContext, SideBarItem, SideBarItemsInline, - SideBarNavigation, SideBarTree, SideBarTreeItem, SideBar as SideBarUI, @@ -48,8 +45,8 @@ export const SideBar: FC = () => { lockProfile(); }; return ( - - + } label="Select network" @@ -61,99 +58,102 @@ export const SideBar: FC = () => { isCompact={!isExpanded} /> - - - } - label="Dashboard" - onPress={() => navigate('/')} - /> - - } label="My Wallets"> - navigate('/key-management/keys')} - /> - - } label="Transactions"> - navigate('/transactions')} - /> - - } label="Utilities"> - navigate('/sig-builder')} - /> - navigate('/terminal')} - /> - navigate('/backup-recovery-phrase/write-down')} + } + navigation={ + <> + } + label="Dashboard" + onPress={() => navigate('/')} /> - - } - label="Transfer" - onPress={() => { - navigate('/transfer'); - }} - /> + } label="My Wallets"> + navigate('/key-management/keys')} + /> + + } label="Transactions"> + navigate('/transactions')} + /> + + } label="Utilities"> + navigate('/sig-builder')} + /> + navigate('/terminal')} + /> + navigate('/backup-recovery-phrase/write-down')} + /> + - } - label="Contacts" - onPress={() => navigate('/contacts')} - /> - + } + label="Transfer" + onPress={() => { + navigate('/transfer'); + }} + /> - - } - label="Profile" - onPress={() => {}} - > - } - > - {isExpanded ? 'Profile' : undefined} - - } + label="Contacts" + onPress={() => navigate('/contacts')} + /> + + } + context={ + <> + + } + label="Profile" + onPress={() => {}} > - navigate('/profile')} - label="Profile" - /> - } - label="Logout" - onClick={handleLogout} + } + > + {isExpanded ? 'Profile' : undefined} + + } + > + navigate('/profile')} + label="Profile" + /> + } + label="Logout" + onClick={handleLogout} + /> + + + } + onPress={toggleTheme} + label="Change theme" + > +