From cb58cde0adf624c88fb65d35f40ede79958b5d45 Mon Sep 17 00:00:00 2001 From: Kris Urbas <605420+krzysu@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:53:17 +0100 Subject: [PATCH] add simple server side cache and list sets in the sidebar nav --- .../app/components/Sidebar/Sidebar.tsx | 29 +++++++++-- packages/circle-demo-webapp/app/lib/cache.ts | 41 +++++++++++++++ packages/circle-demo-webapp/app/root.tsx | 13 ++++- .../app/routes/customers.tsx | 7 --- .../app/routes/products.tsx | 7 --- .../app/routes/wallets.$id/route.tsx | 44 +++++++++------- .../app/routes/wallets._index/route.tsx | 51 ++++++++++--------- packages/circle-demo-webapp/package.json | 1 + yarn.lock | 5 ++ 9 files changed, 135 insertions(+), 63 deletions(-) create mode 100644 packages/circle-demo-webapp/app/lib/cache.ts delete mode 100644 packages/circle-demo-webapp/app/routes/customers.tsx delete mode 100644 packages/circle-demo-webapp/app/routes/products.tsx diff --git a/packages/circle-demo-webapp/app/components/Sidebar/Sidebar.tsx b/packages/circle-demo-webapp/app/components/Sidebar/Sidebar.tsx index 18731e4..b6e435c 100644 --- a/packages/circle-demo-webapp/app/components/Sidebar/Sidebar.tsx +++ b/packages/circle-demo-webapp/app/components/Sidebar/Sidebar.tsx @@ -1,6 +1,7 @@ import { Link, NavLink } from '@remix-run/react'; -import { User, Box, LayoutDashboard } from 'lucide-react'; +import { User, Box, LayoutDashboard, Database } from 'lucide-react'; import React from 'react'; +import type { WalletSet } from 'web3-circle-sdk'; import circleLogo from './circle-logo.svg'; @@ -26,9 +27,13 @@ function SidebarNavLink({ to, icon, label }: SidebarNavLinkProps) { ); } -export function Sidebar() { +export interface SidebarProps { + walletSets: WalletSet[]; +} + +export function Sidebar({ walletSets = [] }: SidebarProps) { return ( -