From 2f330a3b40d9fadb1e1025455a116fc83e8c0f0c Mon Sep 17 00:00:00 2001 From: john Date: Mon, 5 May 2025 23:20:31 +0200 Subject: [PATCH] signup page --- src/App.tsx | 2 + src/layouts/AppLayout.tsx | 15 ++++++++ src/pages/HomePage.tsx | 11 ++++-- src/pages/SignupPage.tsx | 81 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 105 insertions(+), 4 deletions(-) create mode 100644 src/layouts/AppLayout.tsx create mode 100644 src/pages/SignupPage.tsx diff --git a/src/App.tsx b/src/App.tsx index 72da22e..de92776 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,6 +3,7 @@ import HomePage from './pages/HomePage.tsx' import { PostsService } from './model/posts/postsService.ts' import AuthorPage from './pages/AuthorPage.tsx' import { MediaService } from './model/mediaService.ts' +import SignupPage from './pages/SignupPage.tsx' function App() { const postService = new PostsService() @@ -15,6 +16,7 @@ function App() { element={} /> } /> + } /> ) diff --git a/src/layouts/AppLayout.tsx b/src/layouts/AppLayout.tsx new file mode 100644 index 0000000..095d06b --- /dev/null +++ b/src/layouts/AppLayout.tsx @@ -0,0 +1,15 @@ +import { PropsWithChildren } from 'react' +import { Link } from 'react-router' + +export default function AppLayout({ children }: PropsWithChildren) { + return ( +
+ +
{children}
+
+ ) +} diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx index f57956e..900595b 100644 --- a/src/pages/HomePage.tsx +++ b/src/pages/HomePage.tsx @@ -7,6 +7,7 @@ import NewPostWidget from '../components/NewPostWidget.tsx' import { useFeedViewModel } from '../feed/feedViewModel.ts' import { Post } from '../model/posts/posts.ts' import { Temporal } from '@js-temporal/polyfill' +import AppLayout from '../layouts/AppLayout.tsx' interface HomePageProps { postsService: PostsService @@ -48,9 +49,11 @@ export default function HomePage({ postsService, mediaService }: HomePageProps) ) return ( -
- - -
+ +
+ + +
+
) } diff --git a/src/pages/SignupPage.tsx b/src/pages/SignupPage.tsx new file mode 100644 index 0000000..2b27524 --- /dev/null +++ b/src/pages/SignupPage.tsx @@ -0,0 +1,81 @@ +import { useSearchParams } from 'react-router' +import { useState } from 'react' + +export default function SignupPage() { + const [searchParams] = useSearchParams() + const signupCode = searchParams.get('c') + const [isSubmitting, setIsSubmitting] = useState(false) + + if (!signupCode) { + return + } + + return ( +
+
+
e.preventDefault()}> +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+
+
+ ) +} + +function RejectionMessage() { + return ( +
+
+

An invitation is required to create an account.

+

+ I'm surprised you even found your way here without one and honestly I'd prefer it if you + would leave +

+

+ If you do want to create an account, you should know who + to contact +

+
+
+ ) +}