-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
342 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const getFormBoolean = ( | ||
formData: FormData, | ||
fieldName: string, | ||
): boolean => formData.get(fieldName)?.toString() === "on"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
import { Input } from "@/app/(ui)/form/Input"; | ||
import { SubmitButton } from "@/app/(ui)/button/SubmitButton"; | ||
|
||
const ForgotPasswordPage = () => { | ||
const ResetLinkSentPage = () => { | ||
return ( | ||
<div className={"m-2 lg:mx-4"}> | ||
<h1 className={"text-xl font-bold"}>{"Forgot password"}</h1> | ||
<div className={"mt-10 max-w-[600px] text-neutral-300"}> | ||
<h1 className={"mb-2 text-xl font-bold"}>{"Forgot password"}</h1> | ||
<div className={"max-w-[600px] text-neutral-300"}> | ||
{"A password reset link has been sent to your e-mail."} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ForgotPasswordPage; | ||
export default ResetLinkSentPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
"use client"; | ||
|
||
import { Input } from "@/app/(ui)/form/Input"; | ||
import { SubmitButton } from "@/app/(ui)/button/SubmitButton"; | ||
import { signupAction } from "@/app/signup/signupActions"; | ||
import { CaptchaResponse, SiteView } from "lemmy-js-client"; | ||
import { TextArea } from "@/app/(ui)/form/TextArea"; | ||
import { Markdown } from "@/app/(ui)/markdown/Markdown"; | ||
|
||
export const SignupForm = (props: { | ||
readonly siteView: SiteView; | ||
readonly captcha?: CaptchaResponse; | ||
}) => { | ||
return ( | ||
<form | ||
action={signupAction.bind(null, props.captcha?.uuid)} | ||
className={"space-y-6"} | ||
> | ||
<input | ||
autoComplete={"off"} | ||
className={"hidden"} | ||
id={"honey"} | ||
name={"honey"} | ||
type={"text"} | ||
/> | ||
<div> | ||
<label | ||
className={"block text-sm font-medium leading-6"} | ||
htmlFor={"username"} | ||
> | ||
{"Username"} | ||
</label> | ||
<Input | ||
className={"mt-2"} | ||
id={"username"} | ||
minLength={3} | ||
name={"username"} | ||
pattern={"[a-zA-Z0-9_]+"} | ||
required | ||
/> | ||
</div> | ||
<div> | ||
<label | ||
className={"block text-sm font-medium leading-6"} | ||
htmlFor={"email"} | ||
> | ||
{"E-mail"} | ||
</label> | ||
<Input | ||
autoComplete={"email"} | ||
className={"mt-2"} | ||
id={"email"} | ||
name={"email"} | ||
required={props.siteView.local_site.require_email_verification} | ||
type={"email"} | ||
/> | ||
</div> | ||
|
||
<div> | ||
<div> | ||
<label | ||
className={"block text-sm font-medium leading-6"} | ||
htmlFor={"password"} | ||
> | ||
{"Password"} | ||
</label> | ||
</div> | ||
<Input | ||
autoComplete={"new-password"} | ||
className={"mt-2"} | ||
id={"password"} | ||
maxLength={60} | ||
minLength={10} | ||
name={"password"} | ||
required | ||
type={"password"} | ||
/> | ||
</div> | ||
|
||
<div> | ||
<div> | ||
<label | ||
className={"block text-sm font-medium leading-6"} | ||
htmlFor={"password_verify"} | ||
> | ||
{"Verify password"} | ||
</label> | ||
</div> | ||
<Input | ||
autoComplete={"new-password"} | ||
className={"mt-2"} | ||
id={"password_verify"} | ||
maxLength={60} | ||
minLength={10} | ||
name={"password_verify"} | ||
required | ||
type={"password"} | ||
/> | ||
</div> | ||
|
||
{props.siteView.local_site.registration_mode === "RequireApplication" && ( | ||
<> | ||
<div> | ||
<div | ||
className={ | ||
"rounded border border-amber-600 bg-amber-950 p-2 text-sm text-amber-200" | ||
} | ||
> | ||
{ | ||
"To join this server, you need to fill out an application, and wait to be accepted." | ||
} | ||
</div> | ||
<div className={"flex items-center justify-between"}> | ||
<label | ||
className={"block text-sm font-medium leading-6"} | ||
htmlFor={"twofactor"} | ||
> | ||
{"Application instructions"} | ||
</label> | ||
</div> | ||
<Markdown | ||
content={props.siteView.local_site.application_question ?? ""} | ||
/>{" "} | ||
</div> | ||
<div> | ||
<div className={"flex items-center justify-between"}> | ||
<label | ||
className={"block text-sm font-medium leading-6"} | ||
htmlFor={"twofactor"} | ||
> | ||
{"Answer"} | ||
</label> | ||
</div> | ||
<TextArea className={"mt-2"} id={"answer"} name={"answer"} /> | ||
</div> | ||
</> | ||
)} | ||
|
||
{props.captcha && ( | ||
<div> | ||
<img | ||
alt={"Captcha"} | ||
className={"rounded"} | ||
src={`data:image/png;base64,${props.captcha.png}`} | ||
/> | ||
<label | ||
className={"mt-2 block text-sm font-medium leading-6"} | ||
htmlFor={"captcha_answer"} | ||
> | ||
{"Enter text displayed on the captcha image"} | ||
</label> | ||
<Input | ||
className={"mt-2"} | ||
id={"captcha_answer"} | ||
minLength={3} | ||
name={"captcha_answer"} | ||
required | ||
/> | ||
</div> | ||
)} | ||
|
||
<div> | ||
<SubmitButton className={"w-full leading-6"} color={"primary"}> | ||
{"Sign up"} | ||
</SubmitButton> | ||
</div> | ||
</form> | ||
); | ||
}; |
Oops, something went wrong.