Show Login and Ask an organizer sent and error states.
Connect the live modals to the drawn sent, expired, invalid-email, and send-failed screens, pin the phone footer above the keyboard, and send the light login email.
This commit is contained in:
1 parent
44010c7b73
commit
27d74e510c
29 files changed
+771
-281
No files matched your search
@@ -5,6 +5,7 @@ import Create from "../Create";
|
||||
import TextInput from "../../controls/TextInput";
|
||||
import TextArea from "../../controls/TextArea";
|
||||
import Button from "../../buttons/Button";
|
||||
import Alert from "../Alert";
|
||||
import {
|
||||
ASK_ORGANIZER_INQUIRY_FORM_ID,
|
||||
ORGANIZER_INQUIRY_HONEYPOT_FIELD,
|
||||
@@ -12,7 +13,8 @@ import {
|
||||
import type { AskOrganizerInquiryModalViewProps } from "./AskOrganizerInquiryModal.types";
|
||||
|
||||
/**
|
||||
* Figma: Community Rule System — Modal / Ask an Organizer (22078-587823)
|
||||
* Figma: Overlay / Modal / Ask an Organizer (22078:587823)
|
||||
* Sent 25032:48584, send failed 25032:48642
|
||||
*/
|
||||
export function AskOrganizerInquiryModalView({
|
||||
isOpen,
|
||||
@@ -23,40 +25,58 @@ export function AskOrganizerInquiryModalView({
|
||||
honeypot,
|
||||
submitting,
|
||||
success,
|
||||
formError,
|
||||
sendFailed,
|
||||
emailError,
|
||||
questionError,
|
||||
onEmailChange,
|
||||
onMessageChange,
|
||||
onHoneypotChange,
|
||||
onSubmit,
|
||||
onDismissFailed,
|
||||
}: AskOrganizerInquiryModalViewProps) {
|
||||
const footer = success ? (
|
||||
<div className="w-full px-1">
|
||||
<Button
|
||||
type="button"
|
||||
buttonType="filled"
|
||||
palette="default"
|
||||
size="large"
|
||||
className="w-full !justify-center"
|
||||
onClick={onClose}
|
||||
>
|
||||
{copy.closeAfterSuccess}
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-full px-1">
|
||||
<Button
|
||||
type="submit"
|
||||
form={ASK_ORGANIZER_INQUIRY_FORM_ID}
|
||||
buttonType="filled"
|
||||
palette="default"
|
||||
size="large"
|
||||
className="w-full !justify-center"
|
||||
disabled={submitting}
|
||||
>
|
||||
{copy.submitButton}
|
||||
</Button>
|
||||
const failedToast = sendFailed ? (
|
||||
<Alert
|
||||
type="toast"
|
||||
status="danger"
|
||||
size="s"
|
||||
title={copy.sendFailedTitle}
|
||||
description={copy.sendFailedDescription}
|
||||
hasLeadingIcon
|
||||
hasBodyText
|
||||
hasTrailingIcon={false}
|
||||
onClose={onDismissFailed}
|
||||
className="w-full"
|
||||
/>
|
||||
) : null;
|
||||
|
||||
const footer = (
|
||||
<div className="flex w-full flex-col gap-4 px-1">
|
||||
<div className="md:hidden">{failedToast}</div>
|
||||
{success ? (
|
||||
<Button
|
||||
type="button"
|
||||
buttonType="filled"
|
||||
palette="default"
|
||||
size="large"
|
||||
className="w-full !justify-center"
|
||||
autoFocus
|
||||
onClick={onClose}
|
||||
>
|
||||
{copy.closeAfterSuccess}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
type="submit"
|
||||
form={ASK_ORGANIZER_INQUIRY_FORM_ID}
|
||||
buttonType="filled"
|
||||
palette="default"
|
||||
size="large"
|
||||
className="w-full !justify-center"
|
||||
disabled={submitting}
|
||||
>
|
||||
{copy.submitButton}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -64,9 +84,10 @@ export function AskOrganizerInquiryModalView({
|
||||
<Create
|
||||
isOpen={isOpen}
|
||||
onClose={onClose}
|
||||
presentation="sheet"
|
||||
backdropVariant="blurredYellow"
|
||||
title={copy.title}
|
||||
description={copy.description}
|
||||
title={success ? copy.successTitle : copy.title}
|
||||
description={success ? copy.successDescription : copy.description}
|
||||
showBackButton={false}
|
||||
showNextButton={false}
|
||||
stepper={false}
|
||||
@@ -74,40 +95,27 @@ export function AskOrganizerInquiryModalView({
|
||||
footerContent={footer}
|
||||
footerClassName="!h-auto min-h-[112px] shrink-0 flex flex-col justify-end pb-8 pt-3 px-4"
|
||||
belowCard={
|
||||
<Link
|
||||
href="/"
|
||||
className="text-small-paragraph text-[var(--color-content-invert-tertiary,#2d2d2d)] text-center hover:opacity-90"
|
||||
onClick={() => onClose()}
|
||||
>
|
||||
{copy.backToHome}
|
||||
</Link>
|
||||
success ? undefined : (
|
||||
<div className="flex w-full max-w-[546px] flex-col items-center gap-6">
|
||||
<div className="hidden w-full md:block">{failedToast}</div>
|
||||
<Link
|
||||
href="/"
|
||||
className="text-small-paragraph text-[var(--color-content-invert-tertiary,#2d2d2d)] text-center hover:opacity-90"
|
||||
onClick={() => onClose()}
|
||||
>
|
||||
{copy.backToHome}
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
>
|
||||
{success ? (
|
||||
<div className="flex flex-col gap-3 py-2">
|
||||
<p className="text-large-label text-[var(--color-content-default-primary)]">
|
||||
{copy.successTitle}
|
||||
</p>
|
||||
<p className="text-small-paragraph text-[var(--color-content-default-secondary)]">
|
||||
{copy.successDescription}
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
{success ? null : (
|
||||
<form
|
||||
id={ASK_ORGANIZER_INQUIRY_FORM_ID}
|
||||
className="relative flex flex-col gap-6 pb-2"
|
||||
onSubmit={onSubmit}
|
||||
noValidate
|
||||
>
|
||||
{formError ? (
|
||||
<p
|
||||
role="alert"
|
||||
className="text-small-paragraph text-[var(--color-border-default-negative-primary)]"
|
||||
>
|
||||
{formError}
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
<TextInput
|
||||
type="email"
|
||||
name="email"
|
||||
|
||||
Reference in new issue
Block a user