Share asks the person who holds the pen to confirm their community agreed before a link turns on, and deleting an account lists each owned Rule with PDF and RULE.md export. Case-study Share copies the page link instead of opening the privacy modal, and the sign-in banner stays below the header so Share remains clickable.
61 lines
1.7 KiB
TypeScript
61 lines
1.7 KiB
TypeScript
"use client";
|
|
|
|
/**
|
|
* Figma: Overlay / Modal / Delete Account (24985:1959)
|
|
* https://www.figma.com/design/agv0VBLiBlcnSAaiAORgPR/Community-Rule-System?node-id=24985-1959
|
|
*/
|
|
import { memo, useEffect, useId, useRef, useState } from "react";
|
|
import { useMessages } from "../../../contexts/MessagesContext";
|
|
import { useCreateModalA11y } from "../Create/useCreateModalA11y";
|
|
import { DeleteAccountView } from "./DeleteAccount.view";
|
|
import type { DeleteAccountProps } from "./DeleteAccount.types";
|
|
|
|
const DeleteAccountContainer = memo<DeleteAccountProps>((props) => {
|
|
const {
|
|
isOpen,
|
|
onClose,
|
|
onConfirm,
|
|
busy = false,
|
|
rules,
|
|
onExportPdf,
|
|
onExportMarkdown,
|
|
className = "",
|
|
backdropVariant = "blurredYellow",
|
|
} = props;
|
|
const dialogRef = useRef<HTMLDivElement>(null);
|
|
const overlayRef = useRef<HTMLDivElement>(null);
|
|
const titleId = useId();
|
|
const copy = useMessages().modals.deleteAccount;
|
|
const [understood, setUnderstood] = useState(false);
|
|
|
|
useCreateModalA11y(isOpen, busy ? () => undefined : onClose, dialogRef);
|
|
|
|
useEffect(() => {
|
|
if (!isOpen) setUnderstood(false);
|
|
}, [isOpen]);
|
|
|
|
return (
|
|
<DeleteAccountView
|
|
isOpen={isOpen}
|
|
onClose={onClose}
|
|
onConfirm={onConfirm}
|
|
busy={busy}
|
|
rules={rules}
|
|
onExportPdf={onExportPdf}
|
|
onExportMarkdown={onExportMarkdown}
|
|
className={className}
|
|
backdropVariant={backdropVariant}
|
|
dialogRef={dialogRef}
|
|
overlayRef={overlayRef}
|
|
titleId={titleId}
|
|
copy={copy}
|
|
understood={understood}
|
|
onUnderstoodChange={setUnderstood}
|
|
/>
|
|
);
|
|
});
|
|
|
|
DeleteAccountContainer.displayName = "DeleteAccount";
|
|
|
|
export default DeleteAccountContainer;
|