diff --git a/client/containers/CommunityCreate/CommunityCreate.tsx b/client/containers/CommunityCreate/CommunityCreate.tsx index ee1099dc32..2b2601bd91 100644 --- a/client/containers/CommunityCreate/CommunityCreate.tsx +++ b/client/containers/CommunityCreate/CommunityCreate.tsx @@ -91,6 +91,7 @@ const CommunityCreate = () => { evt.preventDefault(); setCreateIsLoading(true); if (!acceptTerms) return false; + const formData = new FormData(evt.currentTarget); const honeypot = (formData.get('website') as string) ?? ''; const payload = { @@ -118,7 +119,13 @@ const CommunityCreate = () => { setIsCreated(true); } catch (error) { setCreateIsLoading(false); - setCreateError((error as Error).message); + if (error instanceof Error) { + setCreateError(error.message); + } else if (typeof error === 'string') { + setCreateError(error); + } else { + setCreateError('Error Creating Community'); + } return; } }; @@ -138,6 +145,7 @@ const CommunityCreate = () => { setHeroLogo(val); }; + console.log('createError', createError); return (
@@ -173,6 +181,13 @@ const CommunityCreate = () => { value={subdomain} onChange={onSubdomainChange} helperText={`https://${subdomain || '[URL]'}.pubpub.org`} + error={ + createError + ? createError === 'URL already used' + ? 'URL already in use by another community' + : 'Error Creating Community' + : undefined + } /> { - -
)} diff --git a/client/containers/Landing/Landing.tsx b/client/containers/Landing/Landing.tsx index f6c18c62d3..0e92368230 100644 --- a/client/containers/Landing/Landing.tsx +++ b/client/containers/Landing/Landing.tsx @@ -189,11 +189,11 @@ const Landing = () => {

Create knowledge. Share it with audiences who care.

{/* enable soon */} - {/*
+
Create your community -
*/} +
{/*
Support PubPub @@ -338,7 +338,7 @@ const Landing = () => { {/* BEGIN Create Block */}
- {/*
+

Create

@@ -352,7 +352,7 @@ const Landing = () => { * A community can be your individual space to create content, or you can invite others to collaborate with you!

-
*/} +
{/* END Create Block */}