diff --git a/app/lish/[did]/[publication]/dashboard/Actions.tsx b/app/lish/[did]/[publication]/dashboard/Actions.tsx index fbd807a0..94f934d6 100644 --- a/app/lish/[did]/[publication]/dashboard/Actions.tsx +++ b/app/lish/[did]/[publication]/dashboard/Actions.tsx @@ -1,7 +1,7 @@ "use client"; import { NewDraftActionButton } from "./NewDraftButton"; -import { PublicationSettingsButton } from "./PublicationSettings"; +import { PublicationSettingsButton } from "./publicationSettings/PublicationSettings"; import { ActionButton } from "components/ActionBar/ActionButton"; import { ShareSmall } from "components/Icons/ShareSmall"; import { Menu } from "components/Layout"; diff --git a/app/lish/[did]/[publication]/dashboard/PublicationSettings.tsx b/app/lish/[did]/[publication]/dashboard/PublicationSettings.tsx deleted file mode 100644 index c9acf387..00000000 --- a/app/lish/[did]/[publication]/dashboard/PublicationSettings.tsx +++ /dev/null @@ -1,132 +0,0 @@ -"use client"; - -import { ActionButton } from "components/ActionBar/ActionButton"; -import { Popover } from "components/Popover"; -import { SettingsSmall } from "components/Icons/SettingsSmall"; -import { EditPubForm } from "app/lish/createPub/UpdatePubForm"; -import { PubThemeSetter } from "components/ThemeManager/PubThemeSetter"; -import { useIsMobile } from "src/hooks/isMobile"; -import { useState } from "react"; -import { GoBackSmall } from "components/Icons/GoBackSmall"; -import { theme } from "tailwind.config"; -import { ButtonPrimary } from "components/Buttons"; -import { DotLoader } from "components/utils/DotLoader"; -import { ArrowRightTiny } from "components/Icons/ArrowRightTiny"; - -export function PublicationSettingsButton(props: { publication: string }) { - let isMobile = useIsMobile(); - let [state, setState] = useState<"menu" | "general" | "theme">("menu"); - let [loading, setLoading] = useState(false); - - return ( - setState("menu")} - side={isMobile ? "top" : "right"} - align={isMobile ? "center" : "start"} - className={`max-w-xs w-[1000px] ${state === "theme" && "bg-white!"}`} - arrowFill={theme.colors["border-light"]} - trigger={ - - label="Settings" - /> - } - > - {state === "general" ? ( - setState("menu")} - loading={loading} - setLoadingAction={setLoading} - /> - ) : state === "theme" ? ( - setState("menu")} - loading={loading} - setLoading={setLoading} - /> - ) : ( - - )} - - ); -} - -const PubSettingsMenu = (props: { - state: "menu" | "general" | "theme"; - setState: (s: typeof props.state) => void; - loading: boolean; - setLoading: (l: boolean) => void; -}) => { - let menuItemClassName = - "menuItem -mx-[8px] text-left flex items-center justify-between hover:no-underline!"; - - return ( -
- - - -
- ); -}; - -export const PubSettingsHeader = (props: { - state: "menu" | "general" | "theme"; - backToMenuAction?: () => void; - loading: boolean; - setLoadingAction: (l: boolean) => void; -}) => { - return ( -
- {props.state === "menu" - ? "Settings" - : props.state === "general" - ? "General" - : props.state === "theme" - ? "Publication Theme" - : ""} - {props.state !== "menu" && ( -
- - - - {props.loading ? : "Update"} - -
- )} -
- ); -}; diff --git a/app/lish/[did]/[publication]/dashboard/publicationSettings/PublicationContributors.tsx b/app/lish/[did]/[publication]/dashboard/publicationSettings/PublicationContributors.tsx index 396bcb36..d95060ab 100644 --- a/app/lish/[did]/[publication]/dashboard/publicationSettings/PublicationContributors.tsx +++ b/app/lish/[did]/[publication]/dashboard/publicationSettings/PublicationContributors.tsx @@ -7,6 +7,8 @@ import { DeleteSmall } from "components/Icons/DeleteSmall"; import { useState } from "react"; import { Input } from "components/Input"; import { ButtonPrimary } from "components/Buttons"; +import { PopoverArrow } from "components/Icons/PopoverArrow"; +import { useSmoker } from "components/Toast"; export const PubContributorManager = (props: { backToMenuAction: () => void; @@ -54,17 +56,8 @@ const PubContributorsContent = (props: { }) => { let [inputValue, setInputValue] = useState(""); return ( -
-
-
- - Get Contributor Invite Link - - Only added contributors can access -
-
-
-
+
+
Add a New Contributor
@@ -72,23 +65,40 @@ const PubContributorsContent = (props: {
@
setInputValue(e.currentTarget.value)} />
+ +
+ getContributorLink(e)}> + Copy Accept Invite Link + + Send this link to contributors so they can access this publication +
+
+ {props.contributors.map((contributor) => { return (
-
-
{contributor.name}
+
+ {contributor.name} +
+ +
{contributor.status === "pending" && ( -
Invited
+ )} -
- + +
); })} @@ -96,9 +106,17 @@ const PubContributorsContent = (props: { ); }; -const PubContibutor = () => { - return
; -}; +function getContributorLink(e: React.MouseEvent) { + let smoker = useSmoker(); + + smoker({ + text: "Copied Invite Link!", + position: { + y: e.clientY, + x: e.clientX, + }, + }); +} const PubContributorOptions = () => { return ( diff --git a/app/lish/[did]/[publication]/dashboard/publicationSettings/PublicationSettings.tsx b/app/lish/[did]/[publication]/dashboard/publicationSettings/PublicationSettings.tsx index 59a7f495..9a94286b 100644 --- a/app/lish/[did]/[publication]/dashboard/publicationSettings/PublicationSettings.tsx +++ b/app/lish/[did]/[publication]/dashboard/publicationSettings/PublicationSettings.tsx @@ -1,5 +1,4 @@ "use client"; - import { ActionButton } from "components/ActionBar/ActionButton"; import { Popover } from "components/Popover"; import { SettingsSmall } from "components/Icons/SettingsSmall"; @@ -27,7 +26,7 @@ export function PublicationSettingsButton(props: { publication: string }) { onOpenChange={() => setState("menu")} side={isMobile ? "top" : "right"} align={isMobile ? "center" : "start"} - className={`max-w-xs w-[1000px] ${state === "theme" && "bg-white!"}`} + className={`text-secondary max-w-xs w-[1000px] ${state === "theme" && "bg-white!"}`} arrowFill={theme.colors["border-light"]} trigger={ void; @@ -84,10 +84,11 @@ export const EditPubForm = (props: { > + > + Publication Settings +

diff --git a/components/Icons/PopoverArrow.tsx b/components/Icons/PopoverArrow.tsx index 25b77aca..d710b110 100644 --- a/components/Icons/PopoverArrow.tsx +++ b/components/Icons/PopoverArrow.tsx @@ -11,7 +11,7 @@ export const PopoverArrow = ( height="8" viewBox="0 0 16 8" fill="none" - className="-mt-px" + className={`-mt-px ${props.className}`} xmlns="http://www.w3.org/2000/svg" > + > + Publication Theme +