Skip to content

Commit f35d2d4

Browse files
committed
fix(ui): handle flowData null check and clean up footer legend rendering
1 parent c309265 commit f35d2d4

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

src/components/dashboard/chain-flow-sankey.tsx

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export function ChainFlowSankey({ tokens, prices, isLoading }: ChainFlowSankeyPr
290290
});
291291
};
292292

293-
if (isLoading || chainData.length === 0) {
293+
if (isLoading || chainData.length === 0 || !flowData) {
294294
return null;
295295
}
296296

@@ -448,8 +448,6 @@ export function ChainFlowSankey({ tokens, prices, isLoading }: ChainFlowSankeyPr
448448
<MobileView />
449449

450450
{/* Desktop Layout: Source | Flow | Target */}
451-
{flowData && (
452-
<>
453451
<div className="hidden md:flex gap-0 min-h-[380px]">
454452
{/* Left Column - Source Chains */}
455453
<div className="w-[220px] flex-shrink-0 border-r border-(--border) pr-4">
@@ -698,24 +696,22 @@ export function ChainFlowSankey({ tokens, prices, isLoading }: ChainFlowSankeyPr
698696
</div>
699697
</div>
700698

701-
{/* Footer Legend - Desktop only */}
702-
<div className="hidden md:flex justify-center mt-6 pt-4 border-t border-(--border)">
703-
<div className="flex items-center gap-6 text-xs text-(--muted-foreground)">
704-
<div className="flex items-center gap-2">
705-
<div className="w-3 h-3 rounded-full bg-(--primary)/50 ring-2 ring-(--primary)/30" />
706-
<span>Selected chain</span>
707-
</div>
708-
<div className="flex items-center gap-2">
709-
<div className="flex gap-0.5">
710-
<div className="w-6 h-0.5 bg-gradient-to-r from-[#627EEA] to-[#26A17B] rounded opacity-70" />
711-
<div className="w-6 h-0.5 bg-gradient-to-r from-[#627EEA] to-[#26A17B] rounded opacity-70" />
712-
</div>
713-
<span>Asset flow</span>
699+
{/* Footer Legend - Desktop only */}
700+
<div className="hidden md:flex justify-center mt-6 pt-4 border-t border-(--border)">
701+
<div className="flex items-center gap-6 text-xs text-(--muted-foreground)">
702+
<div className="flex items-center gap-2">
703+
<div className="w-3 h-3 rounded-full bg-(--primary)/50 ring-2 ring-(--primary)/30" />
704+
<span>Selected chain</span>
705+
</div>
706+
<div className="flex items-center gap-2">
707+
<div className="flex gap-0.5">
708+
<div className="w-6 h-0.5 bg-gradient-to-r from-[#627EEA] to-[#26A17B] rounded opacity-70" />
709+
<div className="w-6 h-0.5 bg-gradient-to-r from-[#627EEA] to-[#26A17B] rounded opacity-70" />
714710
</div>
711+
<span>Asset flow</span>
715712
</div>
716713
</div>
717-
</>
718-
)}
714+
</div>
719715
</motion.section>
720716
);
721717
}

0 commit comments

Comments
 (0)