Give finished Rules a print path, folded launch counts, and a two-day follow-up.
Export is PDF, RULE.md, and Print on US Letter, with every shared term, no member names, and a takeaway that points at Ask an organizer. Finished Rules keep type and place so the team can read folded counts without a database, Umami can sit beside the app with no cookies, and the person who holds the pen gets working PDF and RULE.md links 48 hours later.
This commit is contained in:
1 parent
0efc907633
commit
d9c475a967
74 files changed
+2401
-630
No files matched your search
@@ -4,16 +4,17 @@ import { useState, useEffect } from "react";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import CommunityRule from "../../../../components/type/CommunityRule";
|
||||
import type { CommunityRuleSection } from "../../../../components/type/CommunityRule/CommunityRule.types";
|
||||
import Link from "next/link";
|
||||
import Alert from "../../../../components/modals/Alert";
|
||||
import AskOrganizerInquiryModal from "../../../../components/modals/AskOrganizerInquiry";
|
||||
import InlineTextButton from "../../../../components/buttons/InlineTextButton";
|
||||
import { useMessages } from "../../../../contexts/MessagesContext";
|
||||
import { fetchPublishedRuleDetail } from "../../../../../lib/create/api";
|
||||
import { parsePublishedDocumentForCommunityRuleDisplay } from "../../../../../lib/create/publishedDocumentToDisplaySections";
|
||||
import {
|
||||
finishedAtIso,
|
||||
readLastPublishedRule,
|
||||
writeLastPublishedRule,
|
||||
} from "../../../../../lib/create/lastPublishedRule";
|
||||
import { ASK_ORGANIZER_HASH } from "../../../../../lib/sharePaths";
|
||||
import { useCreateFlowMdUp } from "../../hooks/useCreateFlowMdUp";
|
||||
import { CreateFlowHeaderLockup } from "../../components/CreateFlowHeaderLockup";
|
||||
import {
|
||||
@@ -99,7 +100,6 @@ export function CompletedScreen() {
|
||||
/** Latch: toast copy should survive `router.replace` after we strip `?celebrate=1`. */
|
||||
const [showCelebrateToast] = useState(celebrateInUrl);
|
||||
const [showCopiedReady] = useState(copiedInUrl);
|
||||
const [askOrganizerOpen, setAskOrganizerOpen] = useState(false);
|
||||
const [headerTitle, setHeaderTitle] = useState(initial.headerTitle);
|
||||
const [headerDescription, setHeaderDescription] = useState<
|
||||
string | undefined
|
||||
@@ -124,11 +124,13 @@ export function CompletedScreen() {
|
||||
return;
|
||||
}
|
||||
const doc = detail.rule.document as Record<string, unknown>;
|
||||
const finishedAt = finishedAtIso(detail.rule.createdAt);
|
||||
writeLastPublishedRule({
|
||||
id: detail.rule.id,
|
||||
title: detail.rule.title,
|
||||
summary: detail.rule.summary,
|
||||
document: doc,
|
||||
...(finishedAt ? { finishedAt } : {}),
|
||||
});
|
||||
const parsed = parsePublishedDocumentForCommunityRuleDisplay(doc);
|
||||
if (parsed.length === 0) {
|
||||
@@ -210,13 +212,17 @@ export function CompletedScreen() {
|
||||
/>
|
||||
{headerTitle && !surfaceCopied ? (
|
||||
<p className="mt-[var(--space-400)] max-w-[640px] text-small-paragraph text-[var(--color-content-invert-secondary)]">
|
||||
{completed.askOrganizerLead}{" "}
|
||||
<InlineTextButton
|
||||
className="text-small-paragraph text-[var(--color-content-invert-primary)]"
|
||||
onClick={() => setAskOrganizerOpen(true)}
|
||||
{completed.askOrganizerLead ? (
|
||||
<>
|
||||
{completed.askOrganizerLead}{" "}
|
||||
</>
|
||||
) : null}
|
||||
<Link
|
||||
href={`/#${ASK_ORGANIZER_HASH}`}
|
||||
className="text-small-paragraph text-[var(--color-content-invert-primary)] underline"
|
||||
>
|
||||
{completed.askOrganizerLink}
|
||||
</InlineTextButton>
|
||||
</Link>
|
||||
</p>
|
||||
) : null}
|
||||
</div>
|
||||
@@ -261,10 +267,6 @@ export function CompletedScreen() {
|
||||
</div>
|
||||
</div>
|
||||
{toast}
|
||||
<AskOrganizerInquiryModal
|
||||
isOpen={askOrganizerOpen}
|
||||
onClose={() => setAskOrganizerOpen(false)}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user