diff --git a/app/lish/[did]/[publication]/dashboard/DraftList.tsx b/app/lish/[did]/[publication]/dashboard/DraftList.tsx index e6776f41..e4ed4507 100644 --- a/app/lish/[did]/[publication]/dashboard/DraftList.tsx +++ b/app/lish/[did]/[publication]/dashboard/DraftList.tsx @@ -73,6 +73,7 @@ export function DeleteDraft(props: { id: string }) { if (state === "normal") { return ( { if (state === "normal") { e.preventDefault(); @@ -80,8 +81,8 @@ export function DeleteDraft(props: { id: string }) { } }} > - Delete Draft + ); } diff --git a/app/lish/[did]/[publication]/dashboard/PublishedPostsLists.tsx b/app/lish/[did]/[publication]/dashboard/PublishedPostsLists.tsx index 1362271f..766bbeb8 100644 --- a/app/lish/[did]/[publication]/dashboard/PublishedPostsLists.tsx +++ b/app/lish/[did]/[publication]/dashboard/PublishedPostsLists.tsx @@ -14,6 +14,9 @@ import { mutate } from "swr"; import { Button } from "react-aria-components"; import { ButtonPrimary } from "components/Buttons"; import { MoreOptionsVerticalTiny } from "components/Icons/MoreOptionsVerticalTiny"; +import { DeleteSmall } from "components/Icons/DeleteSmall"; +import { ShareSmall } from "components/Icons/ShareSmall"; +import { ShareButton } from "components/ShareOptions"; export function PublishedPostsList() { let { data: publication } = usePublicationData(); @@ -103,6 +106,7 @@ let Options = (props: { document_uri: string }) => { return ( @@ -111,27 +115,50 @@ let Options = (props: { document_uri: string }) => { } > <> - + ); }; -function DeletePost(props: { document_uri: string }) { - let { mutate } = usePublicationData(); +function OptionsMenu(props: { document_uri: string }) { + let { mutate, data: publication } = usePublicationData(); let [state, setState] = useState<"normal" | "confirm">("normal"); + let postLink = publication + ? `${getPublicationURL(publication)}/${new AtUri(props.document_uri).rkey}` + : null; + if (state === "normal") { return ( - { - e.preventDefault(); - setState("confirm"); - return; - }} - > - Delete Post - + <> + + Share Post Link + + + } + subtext="" + smokerText="Post link copied!" + id="get-post-link" + link={postLink} + /> + +
+ { + e.preventDefault(); + setState("confirm"); + return; + }} + > + Delete Post + + + ); } if (state === "confirm") { diff --git a/components/Layout.tsx b/components/Layout.tsx index 4295866c..9e363837 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -15,8 +15,9 @@ export const Menu = (props: { open?: boolean; trigger: React.ReactNode; children: React.ReactNode; - align?: "start" | "end" | "center"; - side?: "top" | "bottom" | "right" | "left"; + align?: "start" | "end" | "center" | undefined; + alignOffset?: number; + side?: "top" | "bottom" | "right" | "left" | undefined; background?: string; border?: string; className?: string; @@ -41,6 +42,7 @@ export const Menu = (props: { { let smoker = useSmoker(); @@ -212,7 +213,7 @@ export const ShareButton = (props: { } }} > -
+
{props.text}