From 94c4da0175e93c1472215b9cb556b5284dde9d54 Mon Sep 17 00:00:00 2001 From: Nabarun Gogoi Date: Wed, 27 Dec 2023 18:26:20 +0530 Subject: [PATCH] Add form for adding new domains (#30) * Add layout to implement addition of new domains * Refactor code * Add page to setup domain name * Update layout of add domain page * Use react-hook-form in add domain page * Remove unnecessary code * Handle review change --------- Co-authored-by: neeraj --- .../projects/project/settings/Domains.tsx | 2 +- .../projects/project/settings/SetupDomain.tsx | 78 ++++++++++++++++--- .../src/pages/projects/id/domain/Add.tsx | 10 +-- 3 files changed, 72 insertions(+), 18 deletions(-) diff --git a/packages/frontend/src/components/projects/project/settings/Domains.tsx b/packages/frontend/src/components/projects/project/settings/Domains.tsx index d9eca992..e2709d61 100644 --- a/packages/frontend/src/components/projects/project/settings/Domains.tsx +++ b/packages/frontend/src/components/projects/project/settings/Domains.tsx @@ -12,7 +12,7 @@ const Domains = () => { <>
Domain - + diff --git a/packages/frontend/src/components/projects/project/settings/SetupDomain.tsx b/packages/frontend/src/components/projects/project/settings/SetupDomain.tsx index 857b0983..76ab292f 100644 --- a/packages/frontend/src/components/projects/project/settings/SetupDomain.tsx +++ b/packages/frontend/src/components/projects/project/settings/SetupDomain.tsx @@ -1,32 +1,90 @@ import React from 'react'; import { Link } from 'react-router-dom'; -import { Typography, Button, Input } from '@material-tailwind/react'; +import { useForm } from 'react-hook-form'; +import { + Radio, + Typography, + Button, + Input, + Alert, +} from '@material-tailwind/react'; const SetupDomain = () => { + const { + register, + handleSubmit, + formState: { isValid }, + watch, + } = useForm({ + defaultValues: { + domainName: '', + isWWW: 'false', + }, + }); + return ( -
+
{})} + className="flex flex-col gap-6 w-full" + >
- Setup domain name + Setup domain name Add your domain and setup redirects
-
- Domain name + +
+ Domain name
- -
+
); }; diff --git a/packages/frontend/src/pages/projects/id/domain/Add.tsx b/packages/frontend/src/pages/projects/id/domain/Add.tsx index 9b528b80..22d6fa36 100644 --- a/packages/frontend/src/pages/projects/id/domain/Add.tsx +++ b/packages/frontend/src/pages/projects/id/domain/Add.tsx @@ -53,13 +53,9 @@ const AddDomain = () => {
-
-
- -
-
- -
+
+ +