From 2e2a45d0a39f68627579edf027991a42ad201920 Mon Sep 17 00:00:00 2001 From: miteruzo Date: Thu, 24 Jul 2025 04:07:51 +0900 Subject: [PATCH] =?UTF-8?q?#23=20=E3=82=BF=E3=82=B0=E4=B8=80=E8=A6=A7?= =?UTF-8?q?=E3=81=AE=E3=82=B9=E3=83=9E=E3=83=9B=E3=81=A7=E3=81=AE=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E4=BD=8D=E7=BD=AE=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ErrorScreen.tsx | 2 +- frontend/src/components/TagSearch.tsx | 2 +- frontend/src/components/TagSidebar.tsx | 72 +++++++++++++---------- frontend/src/pages/posts/PostListPage.tsx | 9 +-- 4 files changed, 47 insertions(+), 38 deletions(-) diff --git a/frontend/src/components/ErrorScreen.tsx b/frontend/src/components/ErrorScreen.tsx index 03ae2e0..651a81b 100644 --- a/frontend/src/components/ErrorScreen.tsx +++ b/frontend/src/components/ErrorScreen.tsx @@ -42,7 +42,7 @@ export default ({ status }: Props) => { {title} | {SITE_TITLE} -
{ }, [location.search]) return ( -
+
type Props = { posts: Post[] } @@ -19,6 +20,7 @@ type Props = { posts: Post[] } export default ({ posts }: Props) => { const navigate = useNavigate () + const [tagsVsbl, setTagsVsbl] = useState (false) const [tags, setTags] = useState ({ }) const location = useLocation () @@ -57,34 +59,44 @@ export default ({ posts }: Props) => { return ( - タグ -
    - {CATEGORIES.flatMap (cat => cat in tags ? ( - tags[cat].map (tag => ( -
  • - -
  • ))) : [])} -
- 関聯 - {posts.length > 0 && ( - { - ev.preventDefault () - void ((async () => { - try - { - const { data } = await axios.get (`${ API_BASE_URL }/posts/random`, - { params: { tags: tagsQuery.split (' ').filter (e => e !== '').join (','), - match: (anyFlg ? 'any' : 'all') } }) - navigate (`/posts/${ (data as Post).id }`) - } - catch - { - ; - } - }) ()) - }}> - ランダム - )} + + { + ev.preventDefault () + setTagsVsbl (!(tagsVsbl)) + }}> + {tagsVsbl ? '▲▲▲ タグ一覧を閉じる ▲▲▲' : '▼▼▼ タグ一覧を表示 ▼▼▼'} +
) } diff --git a/frontend/src/pages/posts/PostListPage.tsx b/frontend/src/pages/posts/PostListPage.tsx index 6d40409..34dcd81 100644 --- a/frontend/src/pages/posts/PostListPage.tsx +++ b/frontend/src/pages/posts/PostListPage.tsx @@ -85,9 +85,9 @@ export default () => { : `${ SITE_TITLE } 〜 ぼざろクリーチャーシリーズ綜合リンク集サイト`} -
- -
+ + + @@ -120,8 +120,5 @@ export default () => { )} -
- -
) }