diff --git a/web/components/pageComponents/ConnectionsPage/NewConnection/index.module.css b/web/components/pageComponents/ConnectionsPage/NewConnection/index.module.css index 9192b7fa..65841a00 100644 --- a/web/components/pageComponents/ConnectionsPage/NewConnection/index.module.css +++ b/web/components/pageComponents/ConnectionsPage/NewConnection/index.module.css @@ -7,11 +7,15 @@ } .whiteContainer { - @apply max-w-xl w-full border rounded-lg py-10 px-16 bg-white mx-auto; + @apply max-w-xl w-full border rounded-lg py-10 bg-white mx-auto; } -.nameInput { - @apply pb-4 mb-8 border-b; +.section { + @apply px-14 py-4; +} + +.middle { + @apply border-y pt-8; } .or { diff --git a/web/components/pageComponents/ConnectionsPage/NewConnection/index.tsx b/web/components/pageComponents/ConnectionsPage/NewConnection/index.tsx index 3e8af3fd..b8b4759c 100644 --- a/web/components/pageComponents/ConnectionsPage/NewConnection/index.tsx +++ b/web/components/pageComponents/ConnectionsPage/NewConnection/index.tsx @@ -5,6 +5,7 @@ import FormInput from "@components/FormInput"; import Loader from "@components/Loader"; import { FaCaretDown } from "@react-icons/all-files/fa/FaCaretDown"; import { FaCaretUp } from "@react-icons/all-files/fa/FaCaretUp"; +import cx from "classnames"; import css from "./index.module.css"; import useConfig from "./useConfig"; @@ -18,7 +19,6 @@ export default function NewConnection(props: Props) { const canSubmit = state.name && (state.connectionUrl || (state.host && state.username)); const isDocker = location.origin === "http://localhost:3000"; - console.log(location); const onCancel = props.canGoBack ? () => { @@ -31,100 +31,113 @@ export default function NewConnection(props: Props) {
-

Set up new connection

-
+
+

Set up new connection

+
+ setState({ name: n })} + label="Name" + placeholder="my-database (required)" + horizontal + light + /> +
+
+
+ setState({ connectionUrl: c })} + label="URL" + placeholder="mysql://[user]:[password]@[host]/[database]" + horizontal + light + /> +
OR
+ setState({ host: h })} + placeholder={isDocker ? "host.docker.internal" : "127.0.0.1"} + horizontal + light + /> + setState({ port: p })} + placeholder="3306" + horizontal + light + /> + setState({ username: u })} + placeholder="root" + horizontal + light + /> setState({ name: n })} - label="Name" - placeholder="mydatabase (required)" + label="Password" + value={state.password} + onChangeString={p => setState({ password: p })} + placeholder="**********" + type="password" horizontal + light + /> + setState({ database: d })} + placeholder="mydb" + horizontal + light />
- setState({ connectionUrl: c })} - label="URL" - placeholder="mysql://[username]:[password]@[host]/[database]" - horizontal - /> -
OR
- setState({ host: h })} - placeholder={isDocker ? "host.docker.internal" : "127.0.0.1"} - horizontal - /> - setState({ port: p })} - placeholder="3306" - horizontal - /> - setState({ username: u })} - placeholder="root" - horizontal - /> - setState({ password: p })} - placeholder="**********" - type="password" - horizontal - /> - setState({ database: d })} - placeholder="mydb" - horizontal - /> - - setState({ showAdvancedSettings: !state.showAdvancedSettings }) - } - className={css.advancedSettings} - > - {state.showAdvancedSettings ? : }{" "} - Advanced settings - - {state.showAdvancedSettings && ( -
- setState({ useSSL: !state.useSSL })} - name="use-ssl" - label="Use SSL" - description="If server does not allow insecure connections, client must use SSL/TLS." - className={css.checkbox} - /> - - setState({ hideDoltFeatures: !state.hideDoltFeatures }) - } - name="hide-dolt-features" - label="Hide Dolt features" - description="Hides Dolt features like branches, logs, and commits for non-Dolt MySQL databases. Will otherwise be disabled." - className={css.checkbox} - /> -
- )} - - - +
+ + setState({ showAdvancedSettings: !state.showAdvancedSettings }) + } + className={css.advancedSettings} + > + {state.showAdvancedSettings ? : }{" "} + Advanced settings + + {state.showAdvancedSettings && ( +
+ setState({ useSSL: !state.useSSL })} + name="use-ssl" + label="Use SSL" + description="If server does not allow insecure connections, client must use SSL/TLS." + className={css.checkbox} + /> + + setState({ hideDoltFeatures: !state.hideDoltFeatures }) + } + name="hide-dolt-features" + label="Hide Dolt features" + description="Hides Dolt features like branches, logs, and commits for non-Dolt MySQL databases. Will otherwise be disabled." + className={css.checkbox} + /> +
+ )} + + + +