From b0974c72001b43a43540738fa6fe9d14e02f80aa Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 29 Jul 2023 00:01:10 -0400 Subject: [PATCH] feat: add support for fetching and rendering the network name --- ui/apps/dashboard/components/Network.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/apps/dashboard/components/Network.jsx b/ui/apps/dashboard/components/Network.jsx index d8cac5a..645291c 100644 --- a/ui/apps/dashboard/components/Network.jsx +++ b/ui/apps/dashboard/components/Network.jsx @@ -1,12 +1,13 @@ import "./Network.scss"; import { useEffect, useState } from "react"; import classNames from "classnames"; -import { getNetworkModuleStatus } from "@lumeweb/libkernel"; +import { callModule, getNetworkModuleStatus } from "@lumeweb/libkernel"; export default function Network({ module }) { let [ready, setReady] = useState(false); let [sync, setSync] = useState(null); let [peers, setPeers] = useState(0); + let [name, setName] = useState(); useEffect(() => { const destroy = getNetworkModuleStatus((data) => { @@ -15,6 +16,10 @@ export default function Network({ module }) { setPeers(data.peers); }, module); + callModule(module, "name").then((value) => { + setName(value); + }); + return () => destroy?.(); }, [module]); @@ -29,7 +34,7 @@ export default function Network({ module }) { "icon-wait": !ready, })} /> - Network + {name} Network {ready ? (
Synced