From d811b87b125fcf4202826e782c74559f839dae6d Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Sun, 1 Mar 2026 21:44:15 -0700 Subject: [PATCH] Final review template --- app/create/final-review/page.tsx | 116 ++++++++++++++++++++-- app/create/layout.tsx | 4 +- tests/components/FinalReviewPage.test.tsx | 69 +++++++++++++ tests/pages/user-journey.test.jsx | 28 +++--- 4 files changed, 194 insertions(+), 23 deletions(-) create mode 100644 tests/components/FinalReviewPage.test.tsx diff --git a/app/create/final-review/page.tsx b/app/create/final-review/page.tsx index bd12c20..3f50a17 100644 --- a/app/create/final-review/page.tsx +++ b/app/create/final-review/page.tsx @@ -1,25 +1,125 @@ "use client"; +import { useState, useEffect } from "react"; import { useMediaQuery } from "../../hooks/useMediaQuery"; import HeaderLockup from "../../components/type/HeaderLockup"; +import RuleCard from "../../components/cards/RuleCard"; +import type { Category } from "../../components/cards/RuleCard/RuleCard.types"; + +const TITLE = "Review your CommunityRule"; +const DESCRIPTION = + "Here's what other people will see. Make sure everything looks good before you finalize everything. Once the rule is finalized, you must use one of your decision-making mechanisms to edit it again."; + +const RULE_CARD_TITLE = "Mutual Aid Mondays"; +const RULE_CARD_DESCRIPTION = + "Mutual Aid Monday is a grassroots community in Denver, founded in November 2020 by Kelsang Virya, dedicated to supporting neighbors experiencing homelessness."; + +/** Static categories for final review (read-only display). */ +const FINAL_REVIEW_CATEGORIES: Category[] = [ + { + name: "Values", + chipOptions: [ + { id: "v1", label: "Consciousness", state: "unselected" }, + { id: "v2", label: "Ecology", state: "unselected" }, + { id: "v3", label: "Abundance", state: "unselected" }, + { id: "v4", label: "Art", state: "unselected" }, + { id: "v5", label: "Decisiveness", state: "unselected" }, + ], + }, + { + name: "Communication", + chipOptions: [{ id: "c1", label: "Signal", state: "unselected" }], + }, + { + name: "Membership", + chipOptions: [ + { id: "m1", label: "Open Admission", state: "unselected" }, + ], + }, + { + name: "Decision-making", + chipOptions: [ + { id: "d1", label: "Lazy Consensus", state: "unselected" }, + { id: "d2", label: "Modified Consensus", state: "unselected" }, + ], + }, + { + name: "Conflict management", + chipOptions: [ + { id: "cf1", label: "Code of Conduct", state: "unselected" }, + { id: "cf2", label: "Restorative Justice", state: "unselected" }, + ], + }, +]; /** * Final review step (right before completed). - * Figma: 20907-212767 + * Figma: 20907-212767 (full-size), 20976-220705 (small breakpoint). */ export default function FinalReviewPage() { + const [isMounted, setIsMounted] = useState(false); const isMdOrLarger = useMediaQuery("(min-width: 640px)"); + // Avoid flash: only use breakpoint after mount so SSR and first paint use same layout (desktop). + useEffect(() => { + // eslint-disable-next-line react-hooks/set-state-in-effect -- intentional: defer layout breakpoint until after mount to prevent flash + setIsMounted(true); + }, []); + + const showDesktopLayout = !isMounted || isMdOrLarger; + + if (showDesktopLayout) { + return ( +