From 52258dbcb1fa05286d35feb072687f827024afba Mon Sep 17 00:00:00 2001 From: celine Date: Tue, 3 Mar 2026 18:23:13 -0500 Subject: [PATCH] adjusting some issues in popover --- app/[leaflet_id]/actions/HelpButton.tsx | 6 +- .../settings/PublicationSettings.tsx | 15 +- app/lish/createPub/UpdatePubForm.tsx | 3 +- components/Icons/PopoverArrow.tsx | 2 +- components/Popover/index.tsx | 1 - components/ThemeManager/PubThemeSetter.tsx | 310 +++++++++--------- components/ThemeManager/ThemeProvider.tsx | 4 +- 7 files changed, 177 insertions(+), 164 deletions(-) diff --git a/app/[leaflet_id]/actions/HelpButton.tsx b/app/[leaflet_id]/actions/HelpButton.tsx index 12877a6a..aeab5ce5 100644 --- a/app/[leaflet_id]/actions/HelpButton.tsx +++ b/app/[leaflet_id]/actions/HelpButton.tsx @@ -19,10 +19,12 @@ export const HelpButton = (props: { noShortcuts?: boolean }) => { side={isMobile ? "top" : "right"} align={isMobile ? "center" : "start"} asChild - className="max-w-xs w-full" + className="max-w-xs w-full p-0!" trigger={} label="About" />} > -
+
{/* about links */} diff --git a/app/lish/[did]/[publication]/dashboard/settings/PublicationSettings.tsx b/app/lish/[did]/[publication]/dashboard/settings/PublicationSettings.tsx index 92f72613..73cd71a6 100644 --- a/app/lish/[did]/[publication]/dashboard/settings/PublicationSettings.tsx +++ b/app/lish/[did]/[publication]/dashboard/settings/PublicationSettings.tsx @@ -27,7 +27,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={`flex flex-col max-w-xs w-[1000px] ${state === "theme" && "bg-white!"} pb-0!`} arrowFill={theme.colors["border-light"]} trigger={ )} +
); } @@ -93,23 +94,23 @@ const PubSettingsMenu = (props: { props.setState("general"); }} > - General Settings + Publication Settings
@@ -124,7 +125,7 @@ export const PubSettingsHeader = (props: { children: React.ReactNode; }) => { return ( -
+
{props.children} {props.state !== "menu" && (
diff --git a/app/lish/createPub/UpdatePubForm.tsx b/app/lish/createPub/UpdatePubForm.tsx index f9844796..c7301c5c 100644 --- a/app/lish/createPub/UpdatePubForm.tsx +++ b/app/lish/createPub/UpdatePubForm.tsx @@ -74,6 +74,7 @@ export const EditPubForm = (props: { return (
{ if (!pubData) return; e.preventDefault(); @@ -104,7 +105,7 @@ export const EditPubForm = (props: { > General Settings -
+

Logo (optional) diff --git a/components/Icons/PopoverArrow.tsx b/components/Icons/PopoverArrow.tsx index 25b77aca..82bfee19 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="" xmlns="http://www.w3.org/2000/svg" > - { - e.preventDefault(); - if (!pub) return; - props.setLoading(true); - let result = await updatePublicationTheme({ - uri: pub.uri, - theme: { - pageBackground: ColorToRGBA(localPubTheme.bgPage), - showPageBackground: showPageBackground, - backgroundColor: image - ? ColorToRGBA(localPubTheme.bgLeaflet) - : ColorToRGB(localPubTheme.bgLeaflet), - backgroundRepeat: image?.repeat, - backgroundImage: image ? image.file : null, - pageWidth: pageWidth, - primary: ColorToRGB(localPubTheme.primary), - accentBackground: ColorToRGB(localPubTheme.accent1), - accentText: ColorToRGB(localPubTheme.accent2), - }, - }); + +

+ { + e.preventDefault(); + if (!pub) return; + props.setLoading(true); + let result = await updatePublicationTheme({ + uri: pub.uri, + theme: { + pageBackground: ColorToRGBA(localPubTheme.bgPage), + showPageBackground: showPageBackground, + backgroundColor: image + ? ColorToRGBA(localPubTheme.bgLeaflet) + : ColorToRGB(localPubTheme.bgLeaflet), + backgroundRepeat: image?.repeat, + backgroundImage: image ? image.file : null, + pageWidth: pageWidth, + primary: ColorToRGB(localPubTheme.primary), + accentBackground: ColorToRGB(localPubTheme.accent1), + accentText: ColorToRGB(localPubTheme.accent2), + }, + }); - if (!result.success) { - props.setLoading(false); - if (result.error && isOAuthSessionError(result.error)) { - toaster({ - content: , - type: "error", - }); - } else { - toaster({ - content: "Failed to update theme", - type: "error", - }); + if (!result.success) { + props.setLoading(false); + if (result.error && isOAuthSessionError(result.error)) { + toaster({ + content: , + type: "error", + }); + } else { + toaster({ + content: "Failed to update theme", + type: "error", + }); + } + return; } - return; - } - mutate((pub) => { - if (result.publication && pub?.publication) - return { - ...pub, - publication: { ...pub.publication, ...result.publication }, - }; - return pub; - }, false); - props.setLoading(false); - }} - > - { + if (result.publication && pub?.publication) + return { + ...pub, + publication: { ...pub.publication, ...result.publication }, + }; + return pub; + }, false); + props.setLoading(false); + }} > - Theme and Layout - - + + Theme and Layout + + + +
+ +
+
+
+ { + setTheme((t) => ({ ...t, bgPage: color })); + }} + setBackgroundColor={(color) => { + setTheme((t) => ({ ...t, bgLeaflet: color })); + }} + openPicker={openPicker} + setOpenPicker={setOpenPicker} + hasPageBackground={!!showPageBackground} + setHasPageBackground={setShowPageBackground} + /> +
+ + +
+
-
- -
-
- + { setTheme((t) => ({ ...t, bgPage: color })); }} - setBackgroundColor={(color) => { - setTheme((t) => ({ ...t, bgLeaflet: color })); + setPrimary={(color) => { + setTheme((t) => ({ ...t, primary: color })); + }} + openPicker={openPicker} + setOpenPicker={(pickers) => setOpenPicker(pickers)} + hasPageBackground={showPageBackground} + /> + { + setTheme((t) => ({ ...t, accent1: color })); + }} + accent2={localPubTheme.accent2} + setAccent2={(color) => { + setTheme((t) => ({ ...t, accent2: color })); }} openPicker={openPicker} - setOpenPicker={setOpenPicker} - hasPageBackground={!!showPageBackground} - setHasPageBackground={setShowPageBackground} + setOpenPicker={(pickers) => setOpenPicker(pickers)} />
- -
-
- -
-
- { - setTheme((t) => ({ ...t, bgPage: color })); - }} - setPrimary={(color) => { - setTheme((t) => ({ ...t, primary: color })); - }} - openPicker={openPicker} - setOpenPicker={(pickers) => setOpenPicker(pickers)} - hasPageBackground={showPageBackground} - /> - { - setTheme((t) => ({ ...t, accent1: color })); - }} - accent2={localPubTheme.accent2} - setAccent2={(color) => { - setTheme((t) => ({ ...t, accent2: color })); - }} - openPicker={openPicker} - setOpenPicker={(pickers) => setOpenPicker(pickers)} - /> -
-
-
-
-
Preview
- {" "} - - +
+
+
Preview
+ {" "} + + +
+ {sample === "pub" ? ( + + ) : ( + + )}
- {sample === "pub" ? ( - - ) : ( - - )}
diff --git a/components/ThemeManager/ThemeProvider.tsx b/components/ThemeManager/ThemeProvider.tsx index b68e51b6..40d0e6ea 100644 --- a/components/ThemeManager/ThemeProvider.tsx +++ b/components/ThemeManager/ThemeProvider.tsx @@ -122,6 +122,7 @@ export const BaseThemeProvider = ({ showPageBackground, pageWidth, hasBackgroundImage, + className, children, }: { local?: boolean; @@ -136,6 +137,7 @@ export const BaseThemeProvider = ({ highlight2: AriaColor; highlight3: AriaColor; pageWidth?: number; + className?: string; children: React.ReactNode; }) => { // When showPageBackground is false and there's no background image, @@ -239,7 +241,7 @@ export const BaseThemeProvider = ({ ]); return (