diff --git a/app/about/page.tsx b/app/about/page.tsx
deleted file mode 100644
index 42d35f9c..00000000
--- a/app/about/page.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import { LegalContent } from "app/legal/content";
-import Link from "next/link";
-
-export default function AboutPage() {
- return (
-
-
-
- Leaflet.pub is a web app for instantly creating and collaborating on
- documents.{" "}
-
- Click here
- {" "}
- to create one and get started!
-
-
-
- Leaflet is made by Learning Futures Inc. Previously we built{" "}
- hyperlink.academy
-
-
- You can find us on{" "}
- Bluesky or email as
- at contact@leaflet.pub
-
-
-
-
- );
-}
diff --git a/app/globals.css b/app/globals.css
index c544c238..03008310 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -370,6 +370,7 @@ pre.shiki {
@apply pl-3;
@apply ml-2;
}
+
.transparent-container {
@apply border;
@apply border-border-light;
@@ -399,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]/[rkey]/Interactions/Comments/commentAction.ts b/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/commentAction.ts
index fbc85963..124af91f 100644
--- a/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/commentAction.ts
+++ b/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/commentAction.ts
@@ -8,7 +8,10 @@ import { TID } from "@atproto/common";
import { AtUri, lexToJson, Un$Typed } from "@atproto/api";
import { supabaseServerClient } from "supabase/serverClient";
import { Json } from "supabase/database.types";
-import { Notification } from "src/notifications";
+import {
+ Notification,
+ pingIdentityToUpdateNotification,
+} from "src/notifications";
import { v7 } from "uuid";
export async function publishComment(args: {
@@ -67,21 +70,24 @@ export async function publishComment(args: {
} as unknown as Json,
})
.select();
- let notifications: Notification[] = [
- {
- id: v7(),
- recipient: new AtUri(args.document).host,
- data: { type: "comment", comment_uri: uri.toString() },
- },
- ];
- if (args.comment.replyTo)
+ let notifications: Notification[] = [];
+ let recipient = args.comment.replyTo
+ ? new AtUri(args.comment.replyTo).host
+ : new AtUri(args.document).host;
+ if (recipient !== credentialSession.did) {
notifications.push({
id: v7(),
- recipient: new AtUri(args.comment.replyTo).host,
- data: { type: "comment", comment_uri: uri.toString() },
+ recipient,
+ data: {
+ type: "comment",
+ comment_uri: uri.toString(),
+ parent_uri: args.comment.replyTo,
+ },
});
- // SOMEDAY: move this out the action with inngest or workflows
- await supabaseServerClient.from("notifications").insert(notifications);
+ // SOMEDAY: move this out the action with inngest or workflows
+ await supabaseServerClient.from("notifications").insert(notifications);
+ await pingIdentityToUpdateNotification(recipient);
+ }
return {
record: data?.[0].record as Json,
diff --git a/app/lish/[did]/[publication]/dashboard/Actions.tsx b/app/lish/[did]/[publication]/dashboard/Actions.tsx
index 96e4452c..fbd807a0 100644
--- a/app/lish/[did]/[publication]/dashboard/Actions.tsx
+++ b/app/lish/[did]/[publication]/dashboard/Actions.tsx
@@ -1,21 +1,14 @@
"use client";
-import { Media } from "components/Media";
import { NewDraftActionButton } from "./NewDraftButton";
+import { PublicationSettingsButton } from "./PublicationSettings";
import { ActionButton } from "components/ActionBar/ActionButton";
-import { useRouter } from "next/navigation";
-import { Popover } from "components/Popover";
-import { SettingsSmall } from "components/Icons/SettingsSmall";
import { ShareSmall } from "components/Icons/ShareSmall";
import { Menu } from "components/Layout";
import { MenuItem } from "components/Layout";
-import { HomeSmall } from "components/Icons/HomeSmall";
-import { EditPubForm } from "app/lish/createPub/UpdatePubForm";
import { getPublicationURL } from "app/lish/createPub/getPublicationURL";
import { usePublicationData } from "./PublicationSWRProvider";
import { useSmoker } from "components/Toast";
-import { PaintSmall } from "components/Icons/PaintSmall";
-import { PubThemeSetter } from "components/ThemeManager/PubThemeSetter";
import { useIsMobile } from "src/hooks/isMobile";
import { SpeedyLink } from "components/SpeedyLink";
@@ -24,7 +17,6 @@ export const Actions = (props: { publication: string }) => {
<>
-
>
);
@@ -85,42 +77,3 @@ function PublicationShareButton() {
);
}
-
-function PublicationSettingsButton(props: { publication: string }) {
- let isMobile = useIsMobile();
- return (
-
- label="Settings"
- />
- }
- >
-
-
- );
-}
-
-function PublicationThemeButton() {
- let isMobile = useIsMobile();
-
- return (
-
label="Theme" />
- }
- >
-
-
- );
-}
diff --git a/app/lish/[did]/[publication]/dashboard/PublicationSettings.tsx b/app/lish/[did]/[publication]/dashboard/PublicationSettings.tsx
new file mode 100644
index 00000000..c9acf387
--- /dev/null
+++ b/app/lish/[did]/[publication]/dashboard/PublicationSettings.tsx
@@ -0,0 +1,132 @@
+"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/createPub/UpdatePubForm.tsx b/app/lish/createPub/UpdatePubForm.tsx
index f2b06888..85354893 100644
--- a/app/lish/createPub/UpdatePubForm.tsx
+++ b/app/lish/createPub/UpdatePubForm.tsx
@@ -20,8 +20,13 @@ import { Verification } from "@vercel/sdk/esm/models/getprojectdomainop";
import Link from "next/link";
import { Checkbox } from "components/Checkbox";
import type { GetDomainConfigResponseBody } from "@vercel/sdk/esm/models/getdomainconfigop";
+import { PubSettingsHeader } from "../[did]/[publication]/dashboard/PublicationSettings";
-export const EditPubForm = () => {
+export const EditPubForm = (props: {
+ backToMenuAction: () => void;
+ loading: boolean;
+ setLoadingAction: (l: boolean) => void;
+}) => {
let { data } = usePublicationData();
let { publication: pubData } = data || {};
let record = pubData?.record as PubLeafletPublication.Record;
@@ -57,11 +62,11 @@ export const EditPubForm = () => {
return (