From f18684cfd94db3a4aae961f9e8aa415075486c34 Mon Sep 17 00:00:00 2001 From: miteruzo Date: Tue, 12 Aug 2025 17:14:55 +0900 Subject: [PATCH] =?UTF-8?q?=E7=B4=B0=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.tsx | 17 +++++++++++------ frontend/src/main.tsx | 11 ++++++++--- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 1469f65..2fec828 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,11 +1,11 @@ import cn from 'classnames' import { useEffect, useRef, useState } from 'react' -import { BrowserRouter, - Link, +import { Link, Navigate, Route, Routes, - useLocation } from 'react-router-dom' + useLocation, + useSearchParams } from 'react-router-dom' import bgmSrc from '@/assets/music.mp3' import ThreadListPage from '@/pages/threads/ThreadListPage' @@ -36,6 +36,9 @@ const ScrollToTop = () => { export default () => { const bgmRef = useRef (null) + const [searchParams] = useSearchParams () + const threadId = searchParams.get ('thread') + const [colourIndex, setColourIndex] = useState (0) const [mute, setMute] = useState (false) const [playing, setPlaying] = useState (false) @@ -77,7 +80,7 @@ export default () => { }, []) return ( - + <>
{
- } /> + } /> } /> } /> @@ -117,5 +122,5 @@ export default () => {
-
) + ) } diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index aa331f7..197077c 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -1,5 +1,10 @@ import { createRoot } from 'react-dom/client' -import './index.css' -import App from './App.tsx' +import { BrowserRouter } from 'react-router-dom' -createRoot(document.getElementById('root')!).render() +import App from '@/App.tsx' +import '@/index.css' + +createRoot(document.getElementById('root')!).render( + + + )