File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ function AccountDialog({
116116 prompt : 'Add' | 'Edit'
117117} & VariantProps < typeof buttonVariants > ) {
118118 const accounts = useAccounts ( )
119+ const { refetch : refetchOffchainAccounts } = useAccounts ( 'offchain' )
119120 const selectedAccount = accounts . data ?. find (
120121 ( account ) => account . address === address
121122 )
@@ -137,6 +138,7 @@ function AccountDialog({
137138 loading : `${ prompt } ing account...` ,
138139 success : ( ) => {
139140 accounts . refetch ( )
141+ refetchOffchainAccounts ( )
140142 return `${ prompt } ed account`
141143 } ,
142144 error : {
Original file line number Diff line number Diff line change 11import { ArrowUpRight } from 'lucide-react'
22import { Link , useLocation } from 'react-router-dom'
33
4+ import { useAccounts } from '@/hooks/useHono'
45import { SERVER_URL } from '@/hooks/useHono'
56import { useQueues } from '@/hooks/useQueues'
67import { cn } from '@/lib/utils'
@@ -32,18 +33,27 @@ const links = [
3233 label : 'Balances' ,
3334 to : '/balances' ,
3435 } ,
35- ]
36+ ] as const
37+
3638export function Layout ( { children } : { children : React . ReactNode } ) {
3739 const { pathname } = useLocation ( )
3840 const queues = useQueues ( )
41+ const { data : offchainAccounts } = useAccounts ( 'offchain' )
3942
4043 return (
4144 < div className = "grid grid-cols-[10rem_1fr] lg:grid-cols-[15rem_1fr]" >
4245 < aside className = "sticky top-0 flex h-svh flex-col justify-between border-r p-2 lg:p-6" >
4346 < nav >
4447 < ul >
4548 { links . map ( ( link ) => (
46- < li key = { link . to } >
49+ < li
50+ key = { link . to }
51+ className = { cn (
52+ link . label === 'Balances' &&
53+ offchainAccounts ?. length === 0 &&
54+ 'hidden'
55+ ) }
56+ >
4757 < Link
4858 to = { link . to }
4959 className = { cn (
You can’t perform that action at this time.
0 commit comments