diff --git a/packages/frontend/src/components/projects/project/settings/Domains.tsx b/packages/frontend/src/components/projects/project/settings/Domains.tsx index ac58da1..d9eca99 100644 --- a/packages/frontend/src/components/projects/project/settings/Domains.tsx +++ b/packages/frontend/src/components/projects/project/settings/Domains.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { useParams } from 'react-router-dom'; +import { useParams, Link } from 'react-router-dom'; import { Button, Typography } from '@material-tailwind/react'; import DomainCard from './DomainCard'; @@ -7,13 +7,16 @@ import domainsData from '../../../../assets/domains.json'; const Domains = () => { const { id } = useParams(); + return ( <> -
+
Domain - + + +
{domainsData diff --git a/packages/frontend/src/components/projects/project/settings/SetupDomain.tsx b/packages/frontend/src/components/projects/project/settings/SetupDomain.tsx new file mode 100644 index 0000000..857b098 --- /dev/null +++ b/packages/frontend/src/components/projects/project/settings/SetupDomain.tsx @@ -0,0 +1,33 @@ +import React from 'react'; +import { Link } from 'react-router-dom'; +import { Typography, Button, Input } from '@material-tailwind/react'; + +const SetupDomain = () => { + return ( +
+
+ Setup domain name + + Add your domain and setup redirects + +
+
+ Domain name + +
+ +
+ ); +}; + +export default SetupDomain; diff --git a/packages/frontend/src/pages/projects/id/domain/Add.tsx b/packages/frontend/src/pages/projects/id/domain/Add.tsx new file mode 100644 index 0000000..9b528b8 --- /dev/null +++ b/packages/frontend/src/pages/projects/id/domain/Add.tsx @@ -0,0 +1,69 @@ +import React, { useMemo } from 'react'; +import { useParams, useNavigate, useLocation } from 'react-router-dom'; +import { Typography, IconButton } from '@material-tailwind/react'; + +import Stepper from '../../../../components/Stepper'; +import SetupDomain from '../../../../components/projects/project/settings/SetupDomain'; + +const AddDomain = () => { + const { id } = useParams(); + const location = useLocation(); + const navigate = useNavigate(); + + const stepperValues = [ + { + step: 1, + route: `/projects/${id}/domain/add`, + label: 'Setup', + }, + { + step: 2, + route: `/projects/${id}/domain/add/config`, + label: 'Configure DNS', + }, + ]; + + const activeStep = useMemo( + () => + stepperValues.find((data) => data.route === location.pathname)?.step ?? 0, + [location.pathname], + ); + + return ( +
+
+ Add Domain + + navigate(-1)} + > + X + +
+ +
+
+
+ ^ + + Project Name + +
+
+ +
+
+ +
+
+ +
+
+
+
+ ); +}; + +export default AddDomain; diff --git a/packages/frontend/src/pages/projects/routes.tsx b/packages/frontend/src/pages/projects/routes.tsx index e31eeef..a6d6553 100644 --- a/packages/frontend/src/pages/projects/routes.tsx +++ b/packages/frontend/src/pages/projects/routes.tsx @@ -3,6 +3,7 @@ import React from 'react'; import CreateProject from './Create'; import Project from './Project'; import { createProjectRoutes } from './create/routes'; +import AddDomain from './id/domain/Add'; export const projectsRoutesWithoutSearch = [ { @@ -10,6 +11,10 @@ export const projectsRoutesWithoutSearch = [ element: , children: createProjectRoutes, }, + { + path: ':id/domain/add', + element: , + }, ]; export const projectsRoutesWithSearch = [