From e95b3c91fc1625e24c46f8d99a417eb46b7bad8a Mon Sep 17 00:00:00 2001 From: celine Date: Tue, 4 Nov 2025 19:45:55 -0500 Subject: [PATCH] moved home theme into settings, adjusted menu styles --- .../home/Actions/AccountSettings.tsx | 129 ++++++++++++- app/(home-pages)/home/Actions/Actions.tsx | 8 +- app/globals.css | 20 ++ .../[did]/[publication]/dashboard/Actions.tsx | 11 +- app/lish/createPub/UpdatePubForm.tsx | 4 +- components/Layout.tsx | 11 +- components/ThemeManager/PubThemeSetter.tsx | 4 +- components/ThemeManager/ThemeSetter.tsx | 178 ++++++++++-------- 8 files changed, 259 insertions(+), 106 deletions(-) diff --git a/app/(home-pages)/home/Actions/AccountSettings.tsx b/app/(home-pages)/home/Actions/AccountSettings.tsx index d6f30762..5edfc59a 100644 --- a/app/(home-pages)/home/Actions/AccountSettings.tsx +++ b/app/(home-pages)/home/Actions/AccountSettings.tsx @@ -1,27 +1,140 @@ "use client"; import { ActionButton } from "components/ActionBar/ActionButton"; -import { Menu, MenuItem } from "components/Layout"; import { mutate } from "swr"; import { AccountSmall } from "components/Icons/AccountSmall"; import { LogoutSmall } from "components/Icons/LogoutSmall"; +import { Popover } from "components/Popover"; +import { ArrowRightTiny } from "components/Icons/ArrowRightTiny"; +import { SpeedyLink } from "components/SpeedyLink"; +import { GoBackSmall } from "components/Icons/GoBackSmall"; +import { useState } from "react"; +import { ThemeSetterContent } from "components/ThemeManager/ThemeSetter"; + +export const AccountSettings = (props: { entityID: string }) => { + let [state, setState] = useState<"menu" | "general" | "theme">("menu"); -// it was going have a popover with a log out button -export const AccountSettings = () => { return ( - setState("menu")} + side="right" + align="start" + className={`max-w-xs w-[1000px] ${state === "theme" && "bg-white!"}`} trigger={ label="Settings" />} > - { + {state === "general" ? ( + setState("menu")} /> + ) : state === "theme" ? ( + setState("menu")} + /> + ) : ( + + )} + + ); +}; + +const SettingsMenu = (props: { + state: "menu" | "general" | "theme"; + setState: (s: typeof props.state) => void; +}) => { + let menuItemClassName = + "menuItem -mx-[8px] text-left flex items-center justify-between"; + + return ( +
+ + + + + About Leaflet + + +
+ ); +}; + +const GeneralSettings = (props: { backToMenu: () => void }) => { + return ( +
+ props.backToMenu()} + /> + +
+ + + ); +}; +const AccountThemeSettings = (props: { + entityID: string; + backToMenu: () => void; +}) => { + return ( +
+ props.backToMenu()} + /> + +
+ ); +}; +export const AccountSettingsHeader = (props: { + state: "menu" | "general" | "theme"; + backToMenu?: () => void; +}) => { + return ( +
+ {props.state === "menu" + ? "Settings" + : props.state === "general" + ? "General" + : props.state === "theme" + ? "Publication Theme" + : ""} + {props.backToMenu && ( + + )} +
); }; diff --git a/app/(home-pages)/home/Actions/Actions.tsx b/app/(home-pages)/home/Actions/Actions.tsx index c52ece50..5f99d3f6 100644 --- a/app/(home-pages)/home/Actions/Actions.tsx +++ b/app/(home-pages)/home/Actions/Actions.tsx @@ -13,9 +13,11 @@ export const Actions = () => { return ( <> - {identity ? : } - {/**/} - + {identity ? ( + + ) : ( + + )} ); diff --git a/app/globals.css b/app/globals.css index 47b1f6af..03008310 100644 --- a/app/globals.css +++ b/app/globals.css @@ -400,6 +400,26 @@ pre.shiki { @apply rounded-md; } +.menuItem { + @apply text-secondary; + @apply hover:text-secondary; + @apply data-highlighted:bg-[var(--accent-light)]; + @apply data-highlighted:outline-none; + @apply hover:bg-[var(--accent-light)]; + text-align: left; + font-weight: 800; + padding: 0.25rem 0.5rem; + border-radius: 0.25rem; + outline: none !important; + cursor: pointer; + background-color: transparent; + + :hover { + text-decoration: none !important; + background-color: rgb(var(--accent-light)); + } +} + .pwa-padding { padding-top: max(calc(env(safe-area-inset-top) - 8px)) !important; } diff --git a/app/lish/[did]/[publication]/dashboard/Actions.tsx b/app/lish/[did]/[publication]/dashboard/Actions.tsx index 6c6d42d5..855f0d31 100644 --- a/app/lish/[did]/[publication]/dashboard/Actions.tsx +++ b/app/lish/[did]/[publication]/dashboard/Actions.tsx @@ -100,6 +100,7 @@ function PublicationSettingsButton(props: { publication: string }) { return ( setState("menu")} side={isMobile ? "top" : "right"} align={isMobile ? "center" : "start"} className={`max-w-xs w-[1000px] ${state === "theme" && "bg-white!"}`} @@ -114,13 +115,13 @@ function PublicationSettingsButton(props: { publication: string }) { > {state === "general" ? ( setState("menu")} + backToMenu={() => setState("menu")} loading={loading} setLoading={setLoading} /> ) : state === "theme" ? ( setState("menu")} + backToMenu={() => setState("menu")} loading={loading} setLoading={setLoading} /> @@ -143,7 +144,7 @@ const SettingsMenu = (props: { setLoading: (l: boolean) => void; }) => { let menuItemClassName = - "hover:bg-[var(--accent-light)] text-secondary hover:no-underline! rounded-md px-2 py-0.5 -mx-[8px] font-bold text-left flex items-center justify-between"; + "menuItem -mx-[8px] text-left flex items-center justify-between"; return (
@@ -184,7 +185,7 @@ const SettingsMenu = (props: { export const PubSettingsHeader = (props: { state: "menu" | "general" | "theme"; - goBackAction?: () => void; + backToMenu?: () => void; loading: boolean; setLoadingAction: (l: boolean) => void; }) => { @@ -202,7 +203,7 @@ export const PubSettingsHeader = (props: {