From d8e0b87bb30e0a613473de70fc9104294b85c61d Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Sun, 24 May 2026 16:44:36 -0600 Subject: [PATCH] Fix ask organizer modal --- .gitea/ISSUE_TEMPLATE/config.yaml | 4 +-- .../AskOrganizerInquiryModal.container.tsx | 4 ++- .../AskOrganizerInquiryModal.types.ts | 1 + .../AskOrganizerInquiryModal.view.tsx | 10 +++++++ .../modals/Create/Create.container.tsx | 2 ++ app/components/modals/Create/Create.types.ts | 3 +++ app/components/modals/Create/Create.view.tsx | 2 ++ .../modals/Create/CreateModalFrame.view.tsx | 26 ++++++++++++------- tests/components/AskOrganizer.test.tsx | 9 +++++++ tests/components/Create.test.tsx | 8 ++++++ 10 files changed, 57 insertions(+), 12 deletions(-) diff --git a/.gitea/ISSUE_TEMPLATE/config.yaml b/.gitea/ISSUE_TEMPLATE/config.yaml index d0cb2be..dfe17d7 100644 --- a/.gitea/ISSUE_TEMPLATE/config.yaml +++ b/.gitea/ISSUE_TEMPLATE/config.yaml @@ -3,7 +3,7 @@ blank_issues_enabled: false contact_links: - name: Open the staging site url: https://staging.communityrule.info - about: Preview version of Community Rule — test here before reporting + about: Preview version of Community Rule, test here before reporting - name: How to sign in (read first) url: https://staging.communityrule.info/login - about: Use your email — we send a link to click, not a code to type + about: Use your email to recieve a link to click diff --git a/app/components/modals/AskOrganizerInquiry/AskOrganizerInquiryModal.container.tsx b/app/components/modals/AskOrganizerInquiry/AskOrganizerInquiryModal.container.tsx index 64b89ec..e624da0 100644 --- a/app/components/modals/AskOrganizerInquiry/AskOrganizerInquiryModal.container.tsx +++ b/app/components/modals/AskOrganizerInquiry/AskOrganizerInquiryModal.container.tsx @@ -14,6 +14,7 @@ import { useTranslation } from "../../../contexts/MessagesContext"; const AskOrganizerInquiryModalContainer = memo( ({ isOpen, onClose }) => { const t = useTranslation("modals.askOrganizerInquiry"); + const tLogin = useTranslation("pages.login"); const copy = useMemo( () => ({ title: t("title"), @@ -28,8 +29,9 @@ const AskOrganizerInquiryModalContainer = memo( successDescription: t("successDescription"), ariaDialog: t("ariaDialog"), honeypotLabel: t("honeypotLabel"), + backToHome: tLogin("backToHome"), }), - [t], + [t, tLogin], ); const [email, setEmail] = useState(""); const [message, setMessage] = useState(""); diff --git a/app/components/modals/AskOrganizerInquiry/AskOrganizerInquiryModal.types.ts b/app/components/modals/AskOrganizerInquiry/AskOrganizerInquiryModal.types.ts index f5ae402..4ee5055 100644 --- a/app/components/modals/AskOrganizerInquiry/AskOrganizerInquiryModal.types.ts +++ b/app/components/modals/AskOrganizerInquiry/AskOrganizerInquiryModal.types.ts @@ -16,6 +16,7 @@ export interface AskOrganizerInquiryModalCopy { successDescription: string; ariaDialog: string; honeypotLabel: string; + backToHome: string; } export interface AskOrganizerInquiryModalViewProps diff --git a/app/components/modals/AskOrganizerInquiry/AskOrganizerInquiryModal.view.tsx b/app/components/modals/AskOrganizerInquiry/AskOrganizerInquiryModal.view.tsx index f01f9ac..1df4ee5 100644 --- a/app/components/modals/AskOrganizerInquiry/AskOrganizerInquiryModal.view.tsx +++ b/app/components/modals/AskOrganizerInquiry/AskOrganizerInquiryModal.view.tsx @@ -1,5 +1,6 @@ "use client"; +import Link from "next/link"; import Create from "../Create"; import TextInput from "../../controls/TextInput"; import TextArea from "../../controls/TextArea"; @@ -72,6 +73,15 @@ export function AskOrganizerInquiryModalView({ ariaLabel={copy.ariaDialog} footerContent={footer} footerClassName="!h-auto min-h-[112px] shrink-0 flex flex-col justify-end pb-8 pt-3 px-4" + belowCard={ + onClose()} + > + {copy.backToHome} + + } > {success ? (
diff --git a/app/components/modals/Create/Create.container.tsx b/app/components/modals/Create/Create.container.tsx index 1f00a7a..e80d30c 100644 --- a/app/components/modals/Create/Create.container.tsx +++ b/app/components/modals/Create/Create.container.tsx @@ -36,6 +36,7 @@ const CreateContainer = memo( kebabTriggerAriaLabel, kebabMenuAriaLabel, kebabMenuItems, + belowCard, }) => { const createRef = useRef(null); const overlayRef = useRef(null); @@ -72,6 +73,7 @@ const CreateContainer = memo( kebabTriggerAriaLabel={kebabTriggerAriaLabel} kebabMenuAriaLabel={kebabMenuAriaLabel} kebabMenuItems={kebabMenuItems} + belowCard={belowCard} /> ); }, diff --git a/app/components/modals/Create/Create.types.ts b/app/components/modals/Create/Create.types.ts index 25500c4..7dcb769 100644 --- a/app/components/modals/Create/Create.types.ts +++ b/app/components/modals/Create/Create.types.ts @@ -43,6 +43,8 @@ export interface CreateProps { kebabTriggerAriaLabel?: string; kebabMenuAriaLabel?: string; kebabMenuItems?: ModalHeaderMenuItem[]; + /** Rendered below the dialog card on the backdrop (e.g. “Back to home”). */ + belowCard?: React.ReactNode; } export interface CreateViewProps { @@ -73,4 +75,5 @@ export interface CreateViewProps { kebabTriggerAriaLabel?: string; kebabMenuAriaLabel?: string; kebabMenuItems?: ModalHeaderMenuItem[]; + belowCard?: React.ReactNode; } diff --git a/app/components/modals/Create/Create.view.tsx b/app/components/modals/Create/Create.view.tsx index 30bf18d..62eecfb 100644 --- a/app/components/modals/Create/Create.view.tsx +++ b/app/components/modals/Create/Create.view.tsx @@ -34,6 +34,7 @@ export function CreateView({ kebabTriggerAriaLabel, kebabMenuAriaLabel, kebabMenuItems, + belowCard, }: CreateViewProps) { return ( ; dialogRef: RefObject; children: ReactNode; + /** Rendered below the dialog card on the backdrop (e.g. “Back to home”). */ + belowCard?: ReactNode; }; /** @@ -37,28 +39,34 @@ export function CreateModalFrameView({ overlayRef, dialogRef, children, + belowCard, }: CreateModalFrameViewProps) { if (!isOpen) return null; const content = ( - <> -