Rebuild Share and Delete Account from the privacy designs.
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.
This commit is contained in:
1 parent
5cbda35e32
commit
b6795c1f18
28 files changed
+1467
-377
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import React, { useState } from "react";
|
||||
import DeleteAccount from "../../app/components/modals/DeleteAccount";
|
||||
|
||||
/** Figma: Overlay / Modal / Delete Account — node 24985-1959. */
|
||||
export default {
|
||||
title: "Components/Modals/DeleteAccount",
|
||||
component: DeleteAccount,
|
||||
parameters: {
|
||||
layout: "fullscreen",
|
||||
docs: {
|
||||
description: {
|
||||
component:
|
||||
"Account deletion lists each owned Rule with PDF and RULE.md export, then requires a confirmation checkbox.",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
function DeleteAccountStoryHost() {
|
||||
const [open, setOpen] = useState(true);
|
||||
return (
|
||||
<div className="min-h-[100dvh] bg-[var(--color-surface-invert-brand-primary)] p-6">
|
||||
<button
|
||||
type="button"
|
||||
className="rounded-md bg-[var(--color-surface-default-primary)] px-4 py-2 text-small-paragraph text-[var(--color-content-default-primary)]"
|
||||
onClick={() => setOpen(true)}
|
||||
>
|
||||
Open Delete Account
|
||||
</button>
|
||||
<DeleteAccount
|
||||
isOpen={open}
|
||||
onClose={() => setOpen(false)}
|
||||
onConfirm={() => setOpen(false)}
|
||||
rules={[
|
||||
{ id: "rule-1", title: "Juniper Street Food Share" },
|
||||
{ id: "rule-2", title: "Mutual Aid Colorado" },
|
||||
]}
|
||||
onExportPdf={() => undefined}
|
||||
onExportMarkdown={() => undefined}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export const Default = {
|
||||
render: () => <DeleteAccountStoryHost />,
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useState } from "react";
|
||||
import Share from "../../app/components/modals/Share";
|
||||
|
||||
/** Figma: Modal / Share — node 22073-30884 (Community Rule System). */
|
||||
/** Figma: Overlay / Modal / Share — node 24972-2094. */
|
||||
export default {
|
||||
title: "Components/Modals/Share",
|
||||
component: Share,
|
||||
@@ -10,12 +10,31 @@ export default {
|
||||
docs: {
|
||||
description: {
|
||||
component:
|
||||
"Share modal for published rules (copy link and channel actions).",
|
||||
"Share settings for a finished Rule: invite people, confirm a link, or copy it.",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const previewSettings = {
|
||||
visibility: "private",
|
||||
shareSlug: null,
|
||||
shareUrl: "https://communityrule.info/rules/rule-1",
|
||||
shareUrlDisplay: null,
|
||||
title: "Juniper Street Food Share",
|
||||
ownerEmail: "name@example.org",
|
||||
ownerInitials: "N",
|
||||
readers: [
|
||||
{ email: "rosa@example.org", initials: "R", role: "reader" },
|
||||
{ email: "a@example.org", initials: "A", role: "reader" },
|
||||
{ email: "b@example.org", initials: "B", role: "reader" },
|
||||
{ email: "c@example.org", initials: "C", role: "reader" },
|
||||
{ email: "d@example.org", initials: "D", role: "reader" },
|
||||
{ email: "e@example.org", initials: "E", role: "reader" },
|
||||
],
|
||||
copyEnabled: true,
|
||||
};
|
||||
|
||||
function ShareStoryHost() {
|
||||
const [open, setOpen] = useState(true);
|
||||
return (
|
||||
@@ -30,11 +49,7 @@ function ShareStoryHost() {
|
||||
<Share
|
||||
isOpen={open}
|
||||
onClose={() => setOpen(false)}
|
||||
onCopyLink={() => {}}
|
||||
onEmailShare={() => {}}
|
||||
onSignalShare={() => {}}
|
||||
onSlackShare={() => {}}
|
||||
onDiscordShare={() => {}}
|
||||
previewSettings={previewSettings}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
@@ -43,3 +58,19 @@ function ShareStoryHost() {
|
||||
export const Default = {
|
||||
render: () => <ShareStoryHost />,
|
||||
};
|
||||
|
||||
export const AnyoneWithTheLink = {
|
||||
render: () => (
|
||||
<Share
|
||||
isOpen
|
||||
onClose={() => undefined}
|
||||
previewSettings={{
|
||||
...previewSettings,
|
||||
visibility: "shared_by_link",
|
||||
shareSlug: "k7f2-9qxm",
|
||||
shareUrl: "https://communityrule.info/r/k7f2-9qxm",
|
||||
shareUrlDisplay: "communityrule.info/r/k7f2-9qxm",
|
||||
}}
|
||||
/>
|
||||
),
|
||||
};
|
||||
Reference in new issue
Block a user