forked from basehub-ai/marketing-website-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update auth layout and sign-in page
- Add formWrapperFragment to auth layout - Add RichTextFormWrapper component to auth layout - Update sign-in page to use formWrapperFragment - Update sign-in page to use RichTextFormWrapper for subtitle rendering
- Loading branch information
Showing
4 changed files
with
252 additions
and
118 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
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,41 +1,83 @@ | ||
import { Button } from "@/common/button"; | ||
import { AuthLayout } from "../_components/auth-layout"; | ||
import { AuthLayout, RichTextFormWrapper, formWrapperFragment } from "../_components/auth-layout"; | ||
import { LabeledInput, LabeledTextarea } from "../_components/labeled-input"; | ||
import Link from "next/link"; | ||
import { ArrowRightIcon } from "@radix-ui/react-icons"; | ||
import { BackToHomeButton } from "../_components/back-to-home-button"; | ||
import { Pump } from "basehub/react-pump"; | ||
|
||
export default function RequestDemo() { | ||
return ( | ||
<AuthLayout | ||
subtitle="Interested in a live demonstration? Complete the form below, and we’ll contact you to set up a session tailored to your needs." | ||
title="Request Demo" | ||
<Pump | ||
queries={[ | ||
{ | ||
site: { | ||
requestDemo: { | ||
wrapper: formWrapperFragment, | ||
howDidYouHearAboutUs: true, | ||
}, | ||
}, | ||
}, | ||
]} | ||
> | ||
<form className="flex flex-col gap-3"> | ||
<LabeledInput required label="First Name" name="name" placeholder="Jhon" type="text" /> | ||
<LabeledInput required label="Last Name" name="last-name" placeholder="Doe" type="text" /> | ||
<LabeledInput | ||
required | ||
label="Email Address" | ||
name="email" | ||
placeholder="[email protected]" | ||
type="email" | ||
/> | ||
<LabeledTextarea | ||
required | ||
label="Message" | ||
minLength={200} | ||
name="message" | ||
placeholder="What are you looking to learn from the demo?" | ||
rows={8} | ||
/> | ||
<div className="mt-2 flex items-center justify-between"> | ||
<Button icon={<ArrowRightIcon className="size-5" />} iconSide="right" type="submit"> | ||
Request Demo | ||
</Button> | ||
<BackToHomeButton /> | ||
</div> | ||
</form> | ||
</AuthLayout> | ||
{async ([{ site }]) => { | ||
"use server"; | ||
|
||
return ( | ||
<AuthLayout | ||
subtitle={ | ||
site.requestDemo.wrapper.subtitle ? ( | ||
<RichTextFormWrapper> | ||
{site.requestDemo.wrapper.subtitle?.json.content} | ||
</RichTextFormWrapper> | ||
) : null | ||
} | ||
title={site.requestDemo.wrapper.title} | ||
> | ||
<form className="flex flex-col gap-3"> | ||
<LabeledInput | ||
required | ||
label="First Name" | ||
name="name" | ||
placeholder="Jhon" | ||
type="text" | ||
/> | ||
<LabeledInput | ||
required | ||
label="Last Name" | ||
name="last-name" | ||
placeholder="Doe" | ||
type="text" | ||
/> | ||
<LabeledInput | ||
required | ||
label="Email Address" | ||
name="email" | ||
placeholder="[email protected]" | ||
type="email" | ||
/> | ||
<LabeledTextarea | ||
required | ||
label="Message" | ||
minLength={200} | ||
name="message" | ||
placeholder="What are you looking to learn from the demo?" | ||
rows={8} | ||
/> | ||
<div className="mt-2 flex items-center justify-between"> | ||
<Button | ||
icon={<ArrowRightIcon className="size-5" />} | ||
iconSide="right" | ||
intent={site.requestDemo.wrapper.cta.type} | ||
type="submit" | ||
> | ||
{site.requestDemo.wrapper.cta.label} | ||
</Button> | ||
<BackToHomeButton /> | ||
</div> | ||
</form> | ||
</AuthLayout> | ||
); | ||
}} | ||
</Pump> | ||
); | ||
} |
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,46 +1,67 @@ | ||
import { Button } from "@/common/button"; | ||
import Link from "next/link"; | ||
import { AuthLayout } from "../_components/auth-layout"; | ||
import { AuthLayout, RichTextFormWrapper, formWrapperFragment } from "../_components/auth-layout"; | ||
import { LabeledInput } from "../_components/labeled-input"; | ||
import { BackToHomeButton } from "../_components/back-to-home-button"; | ||
import { Pump } from "basehub/react-pump"; | ||
import { ArrowRightIcon } from "@radix-ui/react-icons"; | ||
|
||
export default function SignIn() { | ||
return ( | ||
<AuthLayout | ||
subtitle={ | ||
<> | ||
{" "} | ||
You don't have an account?{" "} | ||
<Link | ||
className="text-accent-500 hover:text-accent-600 dark:hover:text-accent-400" | ||
href="/sign-up" | ||
> | ||
Sign Up | ||
</Link> | ||
</> | ||
} | ||
title="Sign In" | ||
<Pump | ||
queries={[ | ||
{ | ||
site: { | ||
signIn: { | ||
wrapper: formWrapperFragment, | ||
}, | ||
}, | ||
}, | ||
]} | ||
> | ||
<form className="flex flex-col gap-3"> | ||
<LabeledInput | ||
required | ||
label="Email Address" | ||
name="email" | ||
placeholder="[email protected]" | ||
type="email" | ||
/> | ||
<LabeledInput | ||
required | ||
label="Password" | ||
name="password" | ||
placeholder="Type a secure password" | ||
type="password" | ||
/> | ||
<div className="mt-2 flex items-center justify-between"> | ||
<Button type="submit">Sign In</Button> | ||
<BackToHomeButton /> | ||
</div> | ||
</form> | ||
</AuthLayout> | ||
{async ([{ site }]) => { | ||
"use server"; | ||
|
||
return ( | ||
<AuthLayout | ||
subtitle={ | ||
site.signIn.wrapper.subtitle ? ( | ||
<RichTextFormWrapper> | ||
{site.signIn.wrapper.subtitle?.json.content} | ||
</RichTextFormWrapper> | ||
) : null | ||
} | ||
title={site.signIn.wrapper.title} | ||
> | ||
<form className="flex flex-col gap-3"> | ||
<LabeledInput | ||
required | ||
label="Email Address" | ||
name="email" | ||
placeholder="[email protected]" | ||
type="email" | ||
/> | ||
<LabeledInput | ||
required | ||
label="Password" | ||
name="password" | ||
placeholder="Type a secure password" | ||
type="password" | ||
/> | ||
<div className="mt-2 flex items-center justify-between"> | ||
<Button | ||
icon={<ArrowRightIcon className="size-5" />} | ||
iconSide="right" | ||
intent={site.signIn.wrapper.cta.type} | ||
type="submit" | ||
> | ||
{site.signIn.wrapper.cta.label} | ||
</Button> | ||
<BackToHomeButton /> | ||
</div> | ||
</form> | ||
</AuthLayout> | ||
); | ||
}} | ||
</Pump> | ||
); | ||
} |
Oops, something went wrong.