From 2089ee4161a7e70e4938f422db954885d9d5a8d6 Mon Sep 17 00:00:00 2001 From: John Groszko Date: Thu, 23 Apr 2026 16:36:38 -0500 Subject: [PATCH] Timeline - Link to subs --- web/vite/src/TimelineList.tsx | 135 +++++++++++++++++++--------------- 1 file changed, 74 insertions(+), 61 deletions(-) diff --git a/web/vite/src/TimelineList.tsx b/web/vite/src/TimelineList.tsx index bd3de15..3473d75 100644 --- a/web/vite/src/TimelineList.tsx +++ b/web/vite/src/TimelineList.tsx @@ -14,6 +14,7 @@ import { IconLock, IconX, } from "@tabler/icons-react"; +import { useUserContext } from "./UserContext"; const TIMELINE_TYPE = { ORDER_NOT_ISSUED: { @@ -60,69 +61,81 @@ const TIMELINE_TYPE = { export const TimelineList: React.FC<{ timeline: TimelineEvent[]; -}> = ({ timeline }) => ( - - - Timeline - - - - {timeline.map( - ({ - id, - updated_at, - type, - text, - username, - actor_username, - orders_pool, - extra, - }) => ( - - - {text.split("\n").map((str, idx) => ( - - {str} -
-
- ))} -
- - {extra?.mastodon_status_url ? ( +}> = ({ timeline }) => { + const { username: my_username } = useUserContext(); + + return ( + + + Timeline + + + + {timeline.map( + ({ + id, + updated_at, + type, + text, + username, + actor_username, + orders_pool, + extra, + }) => ( + + + {text.split("\n").map((str, idx) => ( + + {str} +
+
+ ))} +
+ + {extra?.mastodon_status_url ? ( + + + Mastodon Post + + + ) : null} + {orders_pool ? ( + + {orders_pool.id ? ( + + {orders_pool.name} + + ) : ( + orders_pool.name + )} + + ) : null} + {actor_username ? ( + + {actor_username} + + ) : null} - - Mastodon Post - - - ) : null} - {orders_pool ? ( - - {orders_pool.id ? ( - - {orders_pool.name} + {username != my_username ? ( + + {username} ) : ( - orders_pool.name + <> + {username} + )} - ) : null} - {actor_username ? ( - - {actor_username} - - ) : null} - - {username} - - {moment(updated_at).fromNow()} - -
- ), - )} -
-
-
-); + {moment(updated_at).fromNow()} +
+
+ ), + )} +
+
+
+ ); +};