From 8362672aaa8dcdb6d8a640f643f755b494390c28 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 18 Apr 2023 23:02:38 +0100 Subject: [PATCH] feat: share to twitter button in publish buttons --- src/components/dashboard/PublishButton.tsx | 25 ++++++++++++++++------ src/pages/dashboard/[subdomain]/editor.tsx | 9 ++++++++ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/components/dashboard/PublishButton.tsx b/src/components/dashboard/PublishButton.tsx index b2045b73..b832350e 100644 --- a/src/components/dashboard/PublishButton.tsx +++ b/src/components/dashboard/PublishButton.tsx @@ -9,7 +9,8 @@ export const PublishButton: React.FC<{ published: boolean isSaving: boolean isDisabled: boolean -}> = ({ save, published, isSaving, isDisabled }) => { + twitterShareUrl?: string +}> = ({ save, published, isSaving, isDisabled, twitterShareUrl }) => { const [showDropdown, setShowDropdown] = useState(false) const dropdownRef = useRef(null) const triggerRef = useRef(null) @@ -58,12 +59,22 @@ export const PublishButton: React.FC<{
{published && ( - +
+ + +
)}
diff --git a/src/pages/dashboard/[subdomain]/editor.tsx b/src/pages/dashboard/[subdomain]/editor.tsx index b9ada64e..68156cb5 100644 --- a/src/pages/dashboard/[subdomain]/editor.tsx +++ b/src/pages/dashboard/[subdomain]/editor.tsx @@ -655,6 +655,15 @@ export default function SubdomainEditor() {