From f4f798b1b4bae3073b669a562fd2b3a7880dffc3 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 15 May 2023 11:45:23 -0300 Subject: second form --- packages/exchange-backoffice-ui/src/Dashborad.tsx | 80 +++++++++++++++-------- 1 file changed, 52 insertions(+), 28 deletions(-) (limited to 'packages/exchange-backoffice-ui/src/Dashborad.tsx') diff --git a/packages/exchange-backoffice-ui/src/Dashborad.tsx b/packages/exchange-backoffice-ui/src/Dashborad.tsx index a8bac8ece..3ad2b7745 100644 --- a/packages/exchange-backoffice-ui/src/Dashborad.tsx +++ b/packages/exchange-backoffice-ui/src/Dashborad.tsx @@ -16,16 +16,22 @@ import { ChevronDownIcon, MagnifyingGlassIcon, } from "@heroicons/react/20/solid"; -import { useRef, useState } from "preact/hooks"; +import { useEffect, useRef, useState } from "preact/hooks"; import { NiceForm } from "./NiceForm.js"; +import { v1 as form_902_1e_v1 } from "./forms/902_1e.js"; +import { v1 as form_902_11e_v1 } from "./forms/902_11e.js"; const navigation = [ - { name: "Dashboard", href: "#", icon: HomeIcon, current: true }, - { name: "Team", href: "#", icon: UsersIcon, current: false }, - { name: "Projects", href: "#", icon: FolderIcon, current: false }, - { name: "Calendar", href: "#", icon: CalendarIcon, current: false }, - { name: "Documents", href: "#", icon: DocumentDuplicateIcon, current: false }, - { name: "Reports", href: "#", icon: ChartPieIcon, current: false }, + { + name: "Identification form (902.1e)", + icon: DocumentDuplicateIcon, + impl: form_902_1e_v1, + }, + { + name: "Operational legal entity or partnership (902.11e)", + icon: DocumentDuplicateIcon, + impl: form_902_11e_v1, + }, ]; const teams = [ { id: 1, name: "Heroicons", href: "#", initial: "H", current: false }, @@ -69,8 +75,24 @@ export function Dashboard({ children?: ComponentChildren; }): VNode { const [sidebarOpen, setSidebarOpen] = useState(false); + const [selectedForm, setSelectedForm] = useState(1); const logRef = useRef(null); + const storedValue = { + when: { + t_ms: new Date().getTime(), + }, + }; + function showFormOnSidebar(v: any) { + if (!logRef.current) return; + logRef.current.innerHTML = JSON.stringify(v, undefined, 1); + } + useEffect(() => { + // initial render + showFormOnSidebar(storedValue); + }); + const showingFrom = navigation[selectedForm]; + console.log(showingFrom); return ( <>
@@ -139,12 +161,15 @@ export function Dashboard({
-
-

-            
+
+

+            
@@ -403,10 +428,9 @@ export function Dashboard({
{ - if (!logRef.current) return; - logRef.current.innerHTML = JSON.stringify(v, undefined, 1); - }} + initial={storedValue} + form={showingFrom.impl as any} + onUpdate={showFormOnSidebar} />
-- cgit v1.2.3