a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

added a copy post link option to the published list in dashboard

celine dfa2cee2 2266cb87

+48 -17
+2 -1
app/lish/[did]/[publication]/dashboard/DraftList.tsx
··· 73 73 if (state === "normal") { 74 74 return ( 75 75 <MenuItem 76 + className="justify-end" 76 77 onSelect={(e) => { 77 78 if (state === "normal") { 78 79 e.preventDefault(); ··· 80 81 } 81 82 }} 82 83 > 83 - <DeleteSmall /> 84 84 Delete Draft 85 + <DeleteSmall /> 85 86 </MenuItem> 86 87 ); 87 88 }
+39 -12
app/lish/[did]/[publication]/dashboard/PublishedPostsLists.tsx
··· 14 14 import { Button } from "react-aria-components"; 15 15 import { ButtonPrimary } from "components/Buttons"; 16 16 import { MoreOptionsVerticalTiny } from "components/Icons/MoreOptionsVerticalTiny"; 17 + import { DeleteSmall } from "components/Icons/DeleteSmall"; 18 + import { ShareSmall } from "components/Icons/ShareSmall"; 19 + import { ShareButton } from "components/ShareOptions"; 17 20 18 21 export function PublishedPostsList() { 19 22 let { data: publication } = usePublicationData(); ··· 103 106 return ( 104 107 <Menu 105 108 align="end" 109 + alignOffset={20} 106 110 asChild 107 111 trigger={ 108 112 <button className="text-secondary rounded-md selected-outline !border-transparent hover:!border-border h-min"> ··· 111 115 } 112 116 > 113 117 <> 114 - <DeletePost document_uri={props.document_uri} /> 118 + <OptionsMenu document_uri={props.document_uri} /> 115 119 </> 116 120 </Menu> 117 121 ); 118 122 }; 119 123 120 - function DeletePost(props: { document_uri: string }) { 121 - let { mutate } = usePublicationData(); 124 + function OptionsMenu(props: { document_uri: string }) { 125 + let { mutate, data: publication } = usePublicationData(); 122 126 let [state, setState] = useState<"normal" | "confirm">("normal"); 123 127 128 + let postLink = publication 129 + ? `${getPublicationURL(publication)}/${new AtUri(props.document_uri).rkey}` 130 + : null; 131 + 124 132 if (state === "normal") { 125 133 return ( 126 - <MenuItem 127 - onSelect={async (e) => { 128 - e.preventDefault(); 129 - setState("confirm"); 130 - return; 131 - }} 132 - > 133 - Delete Post 134 - </MenuItem> 134 + <> 135 + <ShareButton 136 + className="justify-end" 137 + text={ 138 + <div className="flex gap-2"> 139 + Share Post Link 140 + <ShareSmall /> 141 + </div> 142 + } 143 + subtext="" 144 + smokerText="Post link copied!" 145 + id="get-post-link" 146 + link={postLink} 147 + /> 148 + 149 + <hr className="border-border-light" /> 150 + <MenuItem 151 + className="justify-end" 152 + onSelect={async (e) => { 153 + e.preventDefault(); 154 + setState("confirm"); 155 + return; 156 + }} 157 + > 158 + Delete Post 159 + <DeleteSmall /> 160 + </MenuItem> 161 + </> 135 162 ); 136 163 } 137 164 if (state === "confirm") {
+4 -2
components/Layout.tsx
··· 15 15 open?: boolean; 16 16 trigger: React.ReactNode; 17 17 children: React.ReactNode; 18 - align?: "start" | "end" | "center"; 19 - side?: "top" | "bottom" | "right" | "left"; 18 + align?: "start" | "end" | "center" | undefined; 19 + alignOffset?: number; 20 + side?: "top" | "bottom" | "right" | "left" | undefined; 20 21 background?: string; 21 22 border?: string; 22 23 className?: string; ··· 41 42 <DropdownMenu.Content 42 43 side={props.side ? props.side : "bottom"} 43 44 align={props.align ? props.align : "center"} 45 + alignOffset={props.alignOffset ? props.alignOffset : undefined} 44 46 sideOffset={4} 45 47 collisionPadding={16} 46 48 className={`dropdownMenu z-20 bg-bg-page flex flex-col py-1 gap-0.5 border border-border rounded-md shadow-md ${props.className}`}
+3 -2
components/ShareOptions/index.tsx
··· 180 180 }; 181 181 182 182 export const ShareButton = (props: { 183 - text: string; 183 + text: React.ReactNode; 184 184 subtext: React.ReactNode; 185 185 helptext?: string; 186 186 smokerText: string; 187 187 id: string; 188 188 link: null | string; 189 189 fullLink?: string; 190 + className?: string; 190 191 }) => { 191 192 let smoker = useSmoker(); 192 193 ··· 212 213 } 213 214 }} 214 215 > 215 - <div className={`group/${props.id}`}> 216 + <div className={`group/${props.id} ${props.className}`}> 216 217 <div className={`group-hover/${props.id}:text-accent-contrast`}> 217 218 {props.text} 218 219 </div>