diff --git a/app/(home-pages)/notifications/CommentNotication.tsx b/app/(home-pages)/notifications/CommentNotication.tsx new file mode 100644 index 00000000..d927e883 --- /dev/null +++ b/app/(home-pages)/notifications/CommentNotication.tsx @@ -0,0 +1,53 @@ +import { BaseTextBlock } from "app/lish/[did]/[publication]/[rkey]/BaseTextBlock"; +import { + AppBskyActorProfile, + PubLeafletComment, + PubLeafletDocument, +} from "lexicons/api"; +import { HydratedCommentNotification } from "src/notifications"; +import { blobRefToSrc } from "src/utils/blobRefToSrc"; +import { Avatar } from "components/Avatar"; +import { Notification } from "./Notification"; + +export const CommentNotification = (props: HydratedCommentNotification) => { + let docRecord = props.commentData.documents + ?.data as PubLeafletDocument.Record; + let commentRecord = props.commentData.record as PubLeafletComment.Record; + let profileRecord = props.commentData.bsky_profiles + ?.record as AppBskyActorProfile.Record; + return ( + +
+ {docRecord.title} +
+
+ {" "} +
+              
+            
+
+ + } + /> + ); +}; diff --git a/app/(home-pages)/notifications/Notification.tsx b/app/(home-pages)/notifications/Notification.tsx new file mode 100644 index 00000000..60600567 --- /dev/null +++ b/app/(home-pages)/notifications/Notification.tsx @@ -0,0 +1,37 @@ +import { CommentTiny } from "components/Icons/CommentTiny"; +import { ReplyTiny } from "components/Icons/ReplyTiny"; + +export const Notification = (props: { + identity: string; + action: "comment" | "reply" | "follow"; + content: React.ReactNode; +}) => { + return ( +
+
+ {props.action === "comment" ? ( + + ) : props.action === "reply" ? ( + + ) : props.action === "follow" ? ( + "followed you!" + ) : ( + "did something!" + )} +
+
+
+ {props.identity}{" "} + {props.action === "comment" + ? "commented on your post" + : props.action === "reply" + ? "replied to your comment" + : props.action === "follow" + ? "followed you!" + : "did something!"} +
+ {props.content} +
+
+ ); +}; diff --git a/app/(home-pages)/notifications/page.tsx b/app/(home-pages)/notifications/page.tsx index 796ea99d..12f181b2 100644 --- a/app/(home-pages)/notifications/page.tsx +++ b/app/(home-pages)/notifications/page.tsx @@ -1,22 +1,11 @@ import { getIdentityData } from "actions/getIdentityData"; -import { BaseTextBlock } from "app/lish/[did]/[publication]/[rkey]/BaseTextBlock"; import { DashboardLayout } from "components/PageLayouts/DashboardLayout"; -import { PubLeafletComment, PubLeafletDocument } from "lexicons/api"; import { redirect } from "next/navigation"; -import { - HydratedCommentNotification, - hydrateNotifications, -} from "src/notifications"; +import { hydrateNotifications } from "src/notifications"; import { supabaseServerClient } from "supabase/serverClient"; +import { CommentNotification } from "./CommentNotication"; export default async function Notifications() { - let identity = await getIdentityData(); - if (!identity?.atp_did) return redirect("/home"); - let { data, error } = await supabaseServerClient - .from("notifications") - .select("*") - .eq("recipient", identity.atp_did); - let notifications = await hydrateNotifications(data || []); return ( -

Notifications

- {notifications.map((n) => { - if (n.type === "comment") { - n; - return ; - } - })} - - ), + content: , }, }} /> ); } -const CommentNotification = (props: HydratedCommentNotification) => { - let docRecord = props.commentData.documents - ?.data as PubLeafletDocument.Record; - let commentRecord = props.commentData.record as PubLeafletComment.Record; - return ( - -

{docRecord.title}

-
-
-              
-            
-
- - } - /> - ); -}; - -const Notification = (props: { - identity: string; - action: string; - content: React.ReactNode; -}) => { +const NotificationContent = async () => { + let identity = await getIdentityData(); + if (!identity?.atp_did) return redirect("/home"); + let { data } = await supabaseServerClient + .from("notifications") + .select("*") + .eq("recipient", identity.atp_did); + let notifications = await hydrateNotifications(data || []); return ( -
-
- {props.identity} {props.action} +
+
+ {notifications.map((n) => { + if (n.type === "comment") { + n; + return ; + } + })}
- {props.content}
); }; diff --git a/app/[leaflet_id]/publish/PublishPost.tsx b/app/[leaflet_id]/publish/PublishPost.tsx index f662b9fd..570dfd4a 100644 --- a/app/[leaflet_id]/publish/PublishPost.tsx +++ b/app/[leaflet_id]/publish/PublishPost.tsx @@ -146,7 +146,7 @@ const PublishPostForm = (
diff --git a/app/globals.css b/app/globals.css index d9ecb8f0..47b1f6af 100644 --- a/app/globals.css +++ b/app/globals.css @@ -96,6 +96,11 @@ --accent-2: 255, 255, 255; --accent-contrast: 0, 0, 225; --accent-1-is-contrast: "true"; + --accent-light: color-mix( + in oklab, + rgb(var(--accent-contrast)), + rgb(var(--bg-page)) 85% + ); --highlight-1: 255, 177, 177; --highlight-2: 253, 245, 203; @@ -365,6 +370,7 @@ pre.shiki { @apply pl-3; @apply ml-2; } + .transparent-container { @apply border; @apply border-border-light; diff --git a/components/ActionBar/ActionButton.tsx b/components/ActionBar/ActionButton.tsx index 20be8f51..65f22b35 100644 --- a/components/ActionBar/ActionButton.tsx +++ b/components/ActionBar/ActionButton.tsx @@ -17,6 +17,7 @@ export const ActionButton = ( nav?: boolean; className?: string; subtext?: string; + labelOnMobile?: boolean; }, ) => { let { id, icon, label, primary, secondary, nav, ...buttonProps } = props; @@ -30,6 +31,11 @@ export const ActionButton = ( }; } }, [sidebar, inOpenPopover]); + + let showLabelOnMobile = + props.labelOnMobile !== false && + (props.primary || props.secondary || props.nav); + return (