From bdb8823311e1cf96807d710b2cf80d97c11625be Mon Sep 17 00:00:00 2001 From: Anthony Malkoun Date: Sun, 7 Apr 2024 12:33:28 +0300 Subject: [PATCH] Formatting --- .../Connection/ConnectionCreator.tsx | 4 +-- .../components/Connection/NewConnection.tsx | 36 ++++++++++++------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/text2sql-frontend/src/components/Connection/ConnectionCreator.tsx b/text2sql-frontend/src/components/Connection/ConnectionCreator.tsx index 80efeb1c..85dd5fcf 100644 --- a/text2sql-frontend/src/components/Connection/ConnectionCreator.tsx +++ b/text2sql-frontend/src/components/Connection/ConnectionCreator.tsx @@ -105,7 +105,7 @@ const ConnectionCreator = ({ name = null }: { name: string | null }) => { }; return ( -
+ <>
Create a custom connection {
)} - + ); }; diff --git a/text2sql-frontend/src/components/Connection/NewConnection.tsx b/text2sql-frontend/src/components/Connection/NewConnection.tsx index 3f433f1b..9155e707 100644 --- a/text2sql-frontend/src/components/Connection/NewConnection.tsx +++ b/text2sql-frontend/src/components/Connection/NewConnection.tsx @@ -1,24 +1,21 @@ - import { useState } from "react"; import { Radio, RadioField, RadioGroup } from "@catalyst/radio"; import { Description, Label } from "@catalyst/fieldset"; import { SampleSelector } from "./SampleSelector"; import ConnectionCreator from "./ConnectionCreator"; - function classNames(...classes: string[]) { return classes.filter(Boolean).join(" "); } export const NewConnection = () => { - // Flow in this component: // A. Enter name of connection // B. Select radio deciding if SAMPLE or CUSTOM connection // C. If SAMPLE, show SampleSelector component // D. If CUSTOM, show ConnectionCreator component const [connectionName, setConnectionName] = useState(""); - const [isLoading,] = useState(false); + const [isLoading] = useState(false); type RadioValue = "sample" | "custom" | null; const [selectedRadio, setSelectedRadio] = useState(null); @@ -31,7 +28,6 @@ export const NewConnection = () => { return (
-

New Connection @@ -75,27 +71,41 @@ export const NewConnection = () => { Data Source Type - setSelectedRadio(event as RadioValue)}> + setSelectedRadio(event as RadioValue)} + > - - Samples allow you to get started quickly + + + Samples allow you to get started quickly + - - Connect to your local databases or files + + + Connect to your local databases or files +

- {(selectedRadio === "sample") && } - {selectedRadio === "custom" && } + {selectedRadio === "sample" && ( + + )} + {selectedRadio === "custom" && ( + + )}
); - };