From 57e82b6ffdfe22def61a260a9e3d47d4e913b09f Mon Sep 17 00:00:00 2001 From: miteruzo Date: Sun, 22 Mar 2026 00:58:58 +0900 Subject: [PATCH] #297 --- frontend/src/components/PrefetchLink.tsx | 3 +- frontend/src/components/TopNav.tsx | 4 ++ .../src/pages/theatres/TheatreDetailPage.tsx | 38 +++++++++++++++---- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/PrefetchLink.tsx b/frontend/src/components/PrefetchLink.tsx index 0aebe18..18fc855 100644 --- a/frontend/src/components/PrefetchLink.tsx +++ b/frontend/src/components/PrefetchLink.tsx @@ -71,7 +71,8 @@ export default forwardRef (({ || ev.metaKey || ev.ctrlKey || ev.shiftKey - || ev.altKey) + || ev.altKey + || (rest.target && rest.target !== '_self')) return ev.preventDefault () diff --git a/frontend/src/components/TopNav.tsx b/frontend/src/components/TopNav.tsx index 354105c..7d1575c 100644 --- a/frontend/src/components/TopNav.tsx +++ b/frontend/src/components/TopNav.tsx @@ -211,6 +211,7 @@ export default (({ user }: Props) => { {item.name} )))} @@ -277,6 +278,9 @@ export default (({ user }: Props) => { {subItem.name} )))} diff --git a/frontend/src/pages/theatres/TheatreDetailPage.tsx b/frontend/src/pages/theatres/TheatreDetailPage.tsx index b9d37aa..3413a7b 100644 --- a/frontend/src/pages/theatres/TheatreDetailPage.tsx +++ b/frontend/src/pages/theatres/TheatreDetailPage.tsx @@ -23,9 +23,14 @@ import type { NiconicoMetadata, type TheatreInfo = { hostFlg: boolean postId: number | null - postStartedAt: string | null } + postStartedAt: string | null + watchingUsers: { id: number; name: string }[] } -const INITIAL_THEATRE_INFO = { hostFlg: false, postId: null, postStartedAt: null } as const +const INITIAL_THEATRE_INFO = + { hostFlg: false, + postId: null, + postStartedAt: null, + watchingUsers: [] as { id: number; name: string }[] } as const export default (() => { @@ -93,7 +98,7 @@ export default (() => { commentsRef.current?.scrollTo ({ top: commentsRef.current.scrollHeight, behavior: 'smooth' }) - }, [commentsRef]) + }, [comments]) useEffect (() => { if (!(id)) @@ -265,7 +270,7 @@ export default (() => {
{ e.preventDefault () @@ -286,25 +291,42 @@ export default (() => { setSending (false) } }}> +
+ 現在の同接数:{theatreInfo.watchingUsers.length} +
+ +
+
    + {theatreInfo.watchingUsers.map (user => ( +
  • + {user.name || `名もなきニジラー(#${ user.id })`} +
  • ))} +
+
+
+ className="overflow-x-hidden overflow-y-scroll text-wrap w-full + h-[32vh] md:h-[64vh] border rounded"> {comments.map (comment => (
{comment.content}
- by {comment.user ? (comment.user.name || '名もなきニジラー') : '運営'} + by {comment.user + ? (comment.user.name || `名もなきニジラー(#${ comment.user.id })`) + : '運営'}
{dateString (comment.createdAt)}
))}
+ setContent (e.target.value)}