diff options
Diffstat (limited to 'packages/exchange-backoffice-ui/src/Dashborad.tsx')
-rw-r--r-- | packages/exchange-backoffice-ui/src/Dashborad.tsx | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/packages/exchange-backoffice-ui/src/Dashborad.tsx b/packages/exchange-backoffice-ui/src/Dashborad.tsx index 19ea4a31c..a8bac8ece 100644 --- a/packages/exchange-backoffice-ui/src/Dashborad.tsx +++ b/packages/exchange-backoffice-ui/src/Dashborad.tsx @@ -17,7 +17,7 @@ import { MagnifyingGlassIcon, } from "@heroicons/react/20/solid"; import { useRef, useState } from "preact/hooks"; -import { Form } from "./Form.js"; +import { NiceForm } from "./NiceForm.js"; const navigation = [ { name: "Dashboard", href: "#", icon: HomeIcon, current: true }, @@ -41,6 +41,28 @@ function classNames(...classes: string[]) { return classes.filter(Boolean).join(" "); } +/** + * mapping route to view + * not found (error page) + * nested, index element, relative routes + * link interception + * form POST interception, call action + * fromData => Object.fromEntries + * segments in the URL + * navigationState: idle, submitting, loading + * form GET interception: does a navigateTo + * form GET Sync: + * 1.- back after submit: useEffect to sync URL to form + * 2.- refresh after submit: input default value + * useSubmit for form submission onChange, history replace + * + * post form without redirect + * + * + * @param param0 + * @returns + */ + export function Dashboard({ children, }: { @@ -380,7 +402,7 @@ export function Dashboard({ <main class="py-10"> <div class="px-4 sm:px-6 lg:px-8"> <div class="mx-auto max-w-3xl"> - <Form + <NiceForm onUpdate={(v) => { if (!logRef.current) return; logRef.current.innerHTML = JSON.stringify(v, undefined, 1); |