From 7ad3ff2dc28e574d165146bea2660f47007a3dbe Mon Sep 17 00:00:00 2001 From: Sidney Alcantara Date: Wed, 6 Apr 2022 16:05:16 +1000 Subject: [PATCH] allow table creation with _schema doc preset --- src/components/TableSettings/index.tsx | 8 ++++++++ src/pages/Home.tsx | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/TableSettings/index.tsx b/src/components/TableSettings/index.tsx index 8f11b2f8..a2ccf90f 100644 --- a/src/components/TableSettings/index.tsx +++ b/src/components/TableSettings/index.tsx @@ -25,6 +25,7 @@ import { TABLE_GROUP_SCHEMAS, TABLE_SCHEMAS, } from "@src/config/dbPaths"; +import { Controller } from "react-hook-form"; export enum TableSettingsDialogModes { create, @@ -203,6 +204,13 @@ export default function TableSettings({ return ( <> + <>} + /> + + const handleCreateTable = (data?: null | (Table & { tableType: string })) => setSettingsDialogState({ mode: TableSettingsDialogModes.create, - data: null, + data: data || null, }); const [settingsDocState] = useDoc( @@ -107,7 +107,7 @@ export default function HomePage() { handleCreateTable()} sx={{ zIndex: "speedDial", position: "fixed",