From 1de4d2c01391ef10cad7130c0d130599b1d016b7 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 12 Oct 2023 14:12:03 -0400 Subject: [PATCH] refactor: pass props to trigger --- src/components/lume/LumeDashboard/LumeDashboard.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/lume/LumeDashboard/LumeDashboard.tsx b/src/components/lume/LumeDashboard/LumeDashboard.tsx index 320444b..149aea6 100644 --- a/src/components/lume/LumeDashboard/LumeDashboard.tsx +++ b/src/components/lume/LumeDashboard/LumeDashboard.tsx @@ -15,7 +15,8 @@ const SYNCSTATE_TO_TEXT: Record = { export const LumeDashboardTrigger = Dialog.Trigger; LumeDashboardTrigger.displayName = "LumeDashboardTrigger"; -const LumeDashboard = ({ children }: React.PropsWithChildren) => { +const LumeDashboard = (props: any) => { + const { children }: { children: React.PropsWithChildren } = props; const { lume: { networks }, } = useLume(); @@ -37,9 +38,8 @@ const LumeDashboard = ({ children }: React.PropsWithChildren) => { ); - const GivenTrigger = React.Children.toArray(children) + const GivenTrigger = React.Children.toArray(children.children) .filter((c) => { - console.log({ component: c }); if (typeof c === "object") { //@ts-expect-error -- I dont know what the type of this should be, i just know that this works return c.type?.displayName === "LumeDashboardTrigger"; @@ -52,7 +52,7 @@ const LumeDashboard = ({ children }: React.PropsWithChildren) => { return ( - +