From 2b81561a63103fe2cee6e212fa1d60dc8a9b74af Mon Sep 17 00:00:00 2001 From: Vivian Phung Date: Sat, 22 Jun 2024 21:03:18 -0400 Subject: [PATCH] project for id --- .../org-slug/projects/create/success/Id.tsx | 190 ++++++++++-------- .../pages/org-slug/projects/id/Overview.tsx | 7 +- 2 files changed, 115 insertions(+), 82 deletions(-) diff --git a/packages/frontend/src/pages/org-slug/projects/create/success/Id.tsx b/packages/frontend/src/pages/org-slug/projects/create/success/Id.tsx index b7f98c7..7e8deb3 100644 --- a/packages/frontend/src/pages/org-slug/projects/create/success/Id.tsx +++ b/packages/frontend/src/pages/org-slug/projects/create/success/Id.tsx @@ -11,98 +11,128 @@ import { import { Heading } from 'components/shared/Heading'; import logoAnimation from 'components/../../public/lottie/logo.json'; +import { useGQLClient } from 'context/GQLClientContext'; +import { Project } from 'gql-client'; +import { useEffect, useState } from 'react'; const Id = () => { const { id, orgSlug } = useParams(); + const client = useGQLClient(); + const [project, setProject] = useState(null); - const handleSetupDomain = () => { - //TODO: Implement this + const handleSetupDomain = async () => { + if (id) { + // console.log('id', id); + // console.log('getting project for id', id); + const project = await client.getProject(id); + // console.log('project found:', project); + if (project && project.project) { + // console.log('project:', project.project); + setProject(project.project); + } + } else { + window.location.href = '/'; + } }; + + useEffect(() => { + handleSetupDomain(); + }); + return ( -
- {/* Icon */} -
- -
- - {/* Heading */} -
- - Project deployed successfully. - -

- Your project has been deployed at{' '} - -

-
- - {/* Card */} -
- {/* Trigger question */} -
-
- + <> + {project ? ( +
+ {/* Icon */} +
+
- - {`Wondering what's next?`} - -
- {/* CTA card */} -
-
- 1 -
-
- - Add a custom domain - -

- Make it easy for your visitors to remember your URL with a - custom domain. -

-
- +

+
+ + {/* Card */} +
+ {/* Trigger question */} +
+
+ +
+ + {`Wondering what's next?`} + +
+ + {/* CTA card */} +
+
+ 1 +
+
+ + Add a custom domain + +

+ Make it easy for your visitors to remember your URL with a + custom domain. +

+
+ +
+
+
+
+ + {/* CTA Buttons */} +
+
+ + + +
+
+ + +
-
- - {/* CTA Buttons */} -
-
- - - -
-
- - - -
-
-
+ ) : ( + <> + )} + ); }; diff --git a/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx b/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx index 2de55d8..367b348 100644 --- a/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx +++ b/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx @@ -131,9 +131,12 @@ const OverviewTabPanel = () => { {project.name} -

+ {project.subDomain} -

+
}>