From 1f669de1eaa7a03fefd65353ba7b5a2a126faf71 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Date: Tue, 26 Mar 2024 11:11:41 +0100 Subject: [PATCH] dashboard: split Dashboard into its own components So that this component is pure, it does not depend on any effects/state --- components/dashboard/index.tsx | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 components/dashboard/index.tsx diff --git a/components/dashboard/index.tsx b/components/dashboard/index.tsx new file mode 100644 index 00000000..547fbf20 --- /dev/null +++ b/components/dashboard/index.tsx @@ -0,0 +1,50 @@ +import { defi, price } from "../../utils/tzktHooks"; +import Assets from "./assets"; +import Balance from "./balance"; +import Donut from "./donut"; + +type DashboardProperty = { + balance: number; + tokens: defi[]; + price: price | null; +}; + +const Dashboard = ({ balance, tokens, price }: DashboardProperty) => { + return ( + <> +
+
+

Dashboard

+
+
+ +
+
+
+
+
+ +
+ {tokens.length !== 0 && } +
+ {tokens.length !== 0 && ( + + )} +
+
+
+ + ); +}; + +export default Dashboard;