File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import {
1515 useFiat ,
1616 useNetworthTimeSeries ,
1717} from '@/hooks/useHono'
18- import { formatCurrency } from '@/lib/utils'
18+ import { cn , formatCurrency } from '@/lib/utils'
1919
2020const chartConfig = {
2121 value : {
@@ -44,19 +44,31 @@ export function Home() {
4444 < Card >
4545 < CardContent className = "flex items-center justify-center gap-6" >
4646 < div className = "flex flex-col items-center justify-center gap-2" >
47- { fiat && currency && (
48- < h1 className = "text-5xl font-semibold" >
49- { formatCurrency (
50- ( balances . data ?. totalEthValue ?? 0 ) / fiat . getRate ( currency ) ,
51- currency
52- ) }
53- </ h1 >
54- ) }
47+ < h1 className = "text-5xl font-semibold" >
48+ { ( ( ) => {
49+ if ( fiat && currency ) {
50+ return formatCurrency (
51+ ( balances . data ?. totalEthValue ?? 0 ) /
52+ fiat . getRate ( currency ) ,
53+ currency
54+ )
55+ }
56+
57+ return '...'
58+ } ) ( ) }
59+ </ h1 >
5560
5661 < span className = "text-muted-foreground text-sm" > Total value</ span >
5762 </ div >
5863
59- < div className = "relative hidden w-full lg:block" >
64+ < div
65+ className = { cn (
66+ 'relative hidden w-full' ,
67+ ! ! networthTimeSeries &&
68+ networthTimeSeries . length > 5 &&
69+ 'lg:block'
70+ ) }
71+ >
6072 < ChartContainer
6173 config = { chartConfig }
6274 className = "aspect-auto h-[250px] w-full"
You can’t perform that action at this time.
0 commit comments