diff --git a/app/(home-pages)/notifications/CommentNotication.tsx b/app/(home-pages)/notifications/CommentNotication.tsx index d927e883..c208c70c 100644 --- a/app/(home-pages)/notifications/CommentNotication.tsx +++ b/app/(home-pages)/notifications/CommentNotication.tsx @@ -7,7 +7,11 @@ import { import { HydratedCommentNotification } from "src/notifications"; import { blobRefToSrc } from "src/utils/blobRefToSrc"; import { Avatar } from "components/Avatar"; -import { Notification } from "./Notification"; +import { + CommentInNotification, + ContentLayout, + Notification, +} from "./Notification"; export const CommentNotification = (props: HydratedCommentNotification) => { let docRecord = props.commentData.documents @@ -18,35 +22,51 @@ export const CommentNotification = (props: HydratedCommentNotification) => { return ( + + + } + /> + ); +}; + +export const DummyCommentNotification = () => { + return ( + -
- {docRecord.title} -
-
- {" "} -
-              
-            
-
- + + + } /> ); diff --git a/app/(home-pages)/notifications/FollowNotification.tsx b/app/(home-pages)/notifications/FollowNotification.tsx new file mode 100644 index 00000000..61550a8c --- /dev/null +++ b/app/(home-pages)/notifications/FollowNotification.tsx @@ -0,0 +1,14 @@ +import { Notification } from "./Notification"; + +export const DummyFollowNotification = () => { + return ( + + ); +}; diff --git a/app/(home-pages)/notifications/MentionNotification.tsx b/app/(home-pages)/notifications/MentionNotification.tsx new file mode 100644 index 00000000..5ddf6f3e --- /dev/null +++ b/app/(home-pages)/notifications/MentionNotification.tsx @@ -0,0 +1,40 @@ +import { ContentLayout, Notification } from "./Notification"; + +export const DummyPostMentionNotification = () => { + return ( + + I'm just gonna put the description here. The surrounding context is + just sort of a pain to figure out +
+
Title of the Mentioned Post
+
+ And here is the description that follows it +
+
+ + } + /> + ); +}; + +export const DummyUserMentionNotification = () => { + return ( + +
+ ...llo this is the content of a post or whatever here it comes{" "} + @celine and here it + was! ooooh heck yeah the high is unre... +
+ + } + /> + ); +}; diff --git a/app/(home-pages)/notifications/Notification.tsx b/app/(home-pages)/notifications/Notification.tsx index 60600567..6e2a0a71 100644 --- a/app/(home-pages)/notifications/Notification.tsx +++ b/app/(home-pages)/notifications/Notification.tsx @@ -1,37 +1,112 @@ +import { Avatar } from "components/Avatar"; +import { BaseTextBlock } from "app/lish/[did]/[publication]/[rkey]/BaseTextBlock"; import { CommentTiny } from "components/Icons/CommentTiny"; import { ReplyTiny } from "components/Icons/ReplyTiny"; +import { PubLeafletRichtextFacet } from "lexicons/api"; +import { MentionTiny } from "components/Icons/MentionTiny"; +import { PubIcon } from "components/ActionBar/Publications"; export const Notification = (props: { identity: string; - action: "comment" | "reply" | "follow"; - content: React.ReactNode; + action: + | { type: "comment" } + | { type: "reply" } + | { type: "follow"; avatar: string | undefined; pubName: string } + | { type: "post-mention" } + | { type: "user-mention" }; + + content?: React.ReactNode; }) => { return ( -
-
- {props.action === "comment" ? ( - - ) : props.action === "reply" ? ( - - ) : props.action === "follow" ? ( - "followed you!" - ) : ( - "did something!" - )} -
-
-
+
+
+
+ {props.action.type === "comment" ? ( + + ) : props.action.type === "reply" ? ( + + ) : props.action.type === "follow" ? ( + + ) : props.action.type === "post-mention" ? ( + + ) : props.action.type === "user-mention" ? ( + + ) : ( + "" + )} +
+
{props.identity}{" "} - {props.action === "comment" + {props.action.type === "comment" ? "commented on your post" - : props.action === "reply" + : props.action.type === "reply" ? "replied to your comment" - : props.action === "follow" - ? "followed you!" - : "did something!"} + : props.action.type === "follow" + ? `followed ${props.action.pubName}!` + : props.action.type === "post-mention" + ? `mentioned your post` + : props.action.type === "user-mention" + ? "mentioned you" + : "did something!"}
- {props.content}
+ {props.content && ( +
+
+ {props.content} +
+ )} +
+ ); +}; + +export const ContentLayout = (props: { + children: React.ReactNode; + postTitle: string; +}) => { + return ( +
+
+ {props.postTitle} +
+ {props.children} +
+ +
+
+ Pub Name Here +
+
+ ); +}; + +type Facet = PubLeafletRichtextFacet.Main; +export const CommentInNotification = (props: { + avatar: string | undefined; + displayName: string; + plaintext: string; + facets?: Facet[]; + index: number[]; + className?: string; +}) => { + return ( +
+ +
+        
+      
); }; diff --git a/app/(home-pages)/notifications/ReplyNotification.tsx b/app/(home-pages)/notifications/ReplyNotification.tsx new file mode 100644 index 00000000..d32b7cc8 --- /dev/null +++ b/app/(home-pages)/notifications/ReplyNotification.tsx @@ -0,0 +1,41 @@ +import { Avatar } from "components/Avatar"; +import { BaseTextBlock } from "app/lish/[did]/[publication]/[rkey]/BaseTextBlock"; +import { + CommentInNotification, + ContentLayout, + Notification, +} from "./Notification"; + +export const DummyReplyNotification = () => { + return ( + + +
+ + + } + /> + ); +}; diff --git a/components/ActionBar/Navigation.tsx b/components/ActionBar/Navigation.tsx index e2c903c1..56614c65 100644 --- a/components/ActionBar/Navigation.tsx +++ b/components/ActionBar/Navigation.tsx @@ -21,9 +21,18 @@ import { getIdentityData } from "actions/getIdentityData"; import { redirect } from "next/navigation"; import { hydrateNotifications } from "src/notifications"; import { supabaseServerClient } from "supabase/serverClient"; -import { CommentNotification } from "app/(home-pages)/notifications/CommentNotication"; +import { + CommentNotification, + DummyCommentNotification, +} from "app/(home-pages)/notifications/CommentNotication"; import { Separator } from "components/Layout"; import { useIsMobile } from "src/hooks/isMobile"; +import { DummyReplyNotification } from "app/(home-pages)/notifications/ReplyNotification"; +import { DummyFollowNotification } from "app/(home-pages)/notifications/FollowNotification"; +import { + DummyPostMentionNotification, + DummyUserMentionNotification, +} from "app/(home-pages)/notifications/MentionNotification"; export type navPages = "home" | "reader" | "pub" | "discover" | "notifications"; @@ -63,19 +72,6 @@ export const MobileNavigation = (props: { trigger={
- {/*{props.currentPage !== "notifications" && ( -
- {props.currentPage === "home" ? ( - <>Home - ) : props.currentPage === "reader" ? ( - <>Reader - ) : props.currentPage === "discover" ? ( - <>Discover - ) : props.currentPage === "pub" ? ( - thisPublication && <>{thisPublication.name} - ) : null} -
- )}*/}
} > @@ -180,6 +176,7 @@ export function NotificationButton(props: { current?: boolean }) { asChild side={isMobile ? "top" : "right"} align={isMobile ? "center" : "start"} + className="max-w-sm pt-3! pb-3!" trigger={ } > -
- See All +
+ + + + + +
+ + See All + ); } diff --git a/components/Avatar.tsx b/components/Avatar.tsx index fa99ca28..bc9bb6a3 100644 --- a/components/Avatar.tsx +++ b/components/Avatar.tsx @@ -3,20 +3,26 @@ import { AccountTiny } from "./Icons/AccountTiny"; export const Avatar = (props: { src: string | undefined; displayName: string | undefined; - small?: boolean; + tiny?: boolean; }) => { if (props.src) return ( {props.displayName ); else return ( -
- +
+
); }; diff --git a/components/Icons/MentionTiny.tsx b/components/Icons/MentionTiny.tsx new file mode 100644 index 00000000..cb8bef0b --- /dev/null +++ b/components/Icons/MentionTiny.tsx @@ -0,0 +1,21 @@ +import { Props } from "./Props"; + +export const MentionTiny = (props: Props) => { + return ( + + + + ); +}; diff --git a/components/Icons/ReplyTiny.tsx b/components/Icons/ReplyTiny.tsx index 97f0c03c..a902e84b 100644 --- a/components/Icons/ReplyTiny.tsx +++ b/components/Icons/ReplyTiny.tsx @@ -10,8 +10,8 @@ export const ReplyTiny = (props: Props) => { xmlns="http://www.w3.org/2000/svg" >