-
Notifications
- {!authed && (
-
-
-
-
+
+ {type === "like" ? (
+
+ ) : type === "repost" ? (
+
+ ) : type === "reply" ? (
+
+ ) : (
+ <>>
+ )}
+ {type}
+ {/* bad grammar replys */}
+ {count > 1 ? "s" : ""}
{count}
+
+ );
+}
+
+function NotificationItem({ notification }: { notification: string }) {
+ const aturi = new AtUri(notification);
+ const navigate = useNavigate();
+ const { data: identity } = useQueryIdentity(aturi.host);
+ const resolvedDid = identity?.did;
+ const profileUri = resolvedDid
+ ? `at://${resolvedDid}/app.bsky.actor.profile/self`
+ : undefined;
+ const { data: profileRecord } = useQueryProfile(profileUri);
+ const profile = profileRecord?.value;
+
+ const [imgcdn] = useAtom(imgCDNAtom);
+
+ function getAvatarUrl(p: typeof profile) {
+ const link = p?.avatar?.ref?.["$link"];
+ if (!link || !resolvedDid) return null;
+ return `https://${imgcdn}/img/avatar/plain/${resolvedDid}/${link}@jpeg`;
+ }
+
+ const avatar = getAvatarUrl(profile);
+
+ return (
+
+ aturi &&
+ navigate({
+ to: "/profile/$did",
+ params: { did: aturi.host },
+ })
+ }
+ >
+
+ {aturi.collection === "app.bsky.graph.follow" ? (
+
+ ) : (
+ <>>
)}
- {error &&
{error}
}
- {loading && (
-
Loading notifications...
+ {profile ? (
+

+ ) : (
+
)}
- {!loading &&
- !error &&
- responses.map((resp, i) => (
-
-
Query {i + 1}
- {!resp ||
- (typeof resp === "object" && Object.keys(resp).length === 0) ||
- (Array.isArray(resp) && resp.length === 0) ? (
-
No notifications found.
- ) : (
-
- {JSON.stringify(resp, null, 2)}
-
- )}
-
- ))}
- {/*
yo this project sucks, ill remake it some other time, like cmon inputting anything into the textbox makes it break. ive warned you
*/}
+
+
+
+ {profile?.displayName || identity?.handle || "Someone"}
+
+
+ @{identity?.handle}
+
+
+
+ {identity?.did && }
+ {/*
+ followed you
+ */}
+
+
+
+ {identity?.did &&
}
);
}
+
+
+const EmptyState = ({ text }: { text: string }) => (
+
+ {text}
+
+);
+
+const LoadingState = ({ text }: { text: string }) => (
+
+ {text}
+
+);
+
+const ErrorState = ({ error }: { error: unknown }) => (
+
+ Error: {(error as Error)?.message || "Something went wrong."}
+
+);
\ No newline at end of file
diff --git a/src/styles/app.css b/src/styles/app.css
index 89bad45..b747af7 100644
--- a/src/styles/app.css
+++ b/src/styles/app.css
@@ -233,4 +233,40 @@ body {
/* radix i love you but like cmon man */
body[data-scroll-locked]{
margin-left: var(--removed-body-scroll-bar-size) !important;
+}
+
+/* radix tabs */
+
+[data-radix-collection-item] {
+ flex: 1;
+ display: flex;
+ padding: 12px 8px;
+ align-items: center;
+ justify-content: center;
+ color: var(--color-gray-500);
+ font-weight: 500;
+ &[aria-selected="true"] {
+ color: var(--color-gray-950);
+ &::before{
+ content: "";
+ position: absolute;
+ width: min(80px, 80%);
+ border-radius: 99px 99px 0px 0px ;
+ height: 3px;
+ bottom: 0;
+ background-color: var(--color-gray-400);
+ }
+ }
+}
+
+@media (prefers-color-scheme: dark) {
+ [data-radix-collection-item] {
+ color: var(--color-gray-400);
+ &[aria-selected="true"] {
+ color: var(--color-gray-50);
+ &::before{
+ background-color: var(--color-gray-500);
+ }
+ }
+ }
}
\ No newline at end of file