signup
This commit is contained in:
parent
2f330a3b40
commit
a4fd3a3556
2 changed files with 10 additions and 5 deletions
|
@ -8,6 +8,7 @@ import SignupPage from './pages/SignupPage.tsx'
|
||||||
function App() {
|
function App() {
|
||||||
const postService = new PostsService()
|
const postService = new PostsService()
|
||||||
const mediaService = new MediaService()
|
const mediaService = new MediaService()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<Routes>
|
<Routes>
|
||||||
|
@ -16,7 +17,7 @@ function App() {
|
||||||
element={<HomePage postsService={postService} mediaService={mediaService} />}
|
element={<HomePage postsService={postService} mediaService={mediaService} />}
|
||||||
/>
|
/>
|
||||||
<Route path="/u/:username" element={<AuthorPage postsService={postService} />} />
|
<Route path="/u/:username" element={<AuthorPage postsService={postService} />} />
|
||||||
<Route path="/signup" element={<SignupPage />} />
|
<Route path="/signup/:code?" element={<SignupPage />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
import { useSearchParams } from 'react-router'
|
import { useParams } from 'react-router'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
|
||||||
export default function SignupPage() {
|
export default function SignupPage() {
|
||||||
const [searchParams] = useSearchParams()
|
const { code: signupCode } = useParams()
|
||||||
const signupCode = searchParams.get('c')
|
|
||||||
const [isSubmitting, setIsSubmitting] = useState(false)
|
const [isSubmitting, setIsSubmitting] = useState(false)
|
||||||
|
|
||||||
|
const onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
|
e.preventDefault()
|
||||||
|
setIsSubmitting(true)
|
||||||
|
}
|
||||||
|
|
||||||
if (!signupCode) {
|
if (!signupCode) {
|
||||||
return <RejectionMessage />
|
return <RejectionMessage />
|
||||||
}
|
}
|
||||||
|
@ -13,7 +17,7 @@ export default function SignupPage() {
|
||||||
return (
|
return (
|
||||||
<main className="w-full max-w-3xl mx-auto p-4">
|
<main className="w-full max-w-3xl mx-auto p-4">
|
||||||
<div className="mt-12">
|
<div className="mt-12">
|
||||||
<form className="flex flex-col gap-4 max-w-md" onSubmit={(e) => e.preventDefault()}>
|
<form className="flex flex-col gap-4 max-w-md" onSubmit={onSubmit}>
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<label htmlFor="username" className="text-sm text-gray-600">
|
<label htmlFor="username" className="text-sm text-gray-600">
|
||||||
Username
|
Username
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue