From 27aa5321a177ce0db582a1d1f1feb0094be0c788 Mon Sep 17 00:00:00 2001 From: miteruzo Date: Sat, 27 Jun 2026 18:43:40 +0900 Subject: [PATCH] #306 --- frontend/src/components/common/PageTitle.tsx | 2 +- .../src/pages/materials/MaterialDetailPage.tsx | 1 - .../src/pages/materials/MaterialListPage.tsx | 18 +++++++----------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/common/PageTitle.tsx b/frontend/src/components/common/PageTitle.tsx index e692ba6..6ae991e 100644 --- a/frontend/src/components/common/PageTitle.tsx +++ b/frontend/src/components/common/PageTitle.tsx @@ -4,7 +4,7 @@ import { cn } from '@/lib/utils' import type { FC } from 'react' -type Props = { children: React.ReactNode } +type Props = { children: React.ReactNode; className?: string } const PageTitle: FC = ({ children, className, ...rest }) => ( diff --git a/frontend/src/pages/materials/MaterialDetailPage.tsx b/frontend/src/pages/materials/MaterialDetailPage.tsx index c25791a..b6be85f 100644 --- a/frontend/src/pages/materials/MaterialDetailPage.tsx +++ b/frontend/src/pages/materials/MaterialDetailPage.tsx @@ -8,7 +8,6 @@ import WikiBody from '@/components/WikiBody' import FieldError from '@/components/common/FieldError' import FormField from '@/components/common/FormField' import PageTitle from '@/components/common/PageTitle' -import PrefetchLink from '@/components/PrefetchLink' import TabGroup, { Tab } from '@/components/common/TabGroup' import TagInput from '@/components/common/TagInput' import MainArea from '@/components/layout/MainArea' diff --git a/frontend/src/pages/materials/MaterialListPage.tsx b/frontend/src/pages/materials/MaterialListPage.tsx index 09138e5..6a6da5c 100644 --- a/frontend/src/pages/materials/MaterialListPage.tsx +++ b/frontend/src/pages/materials/MaterialListPage.tsx @@ -52,10 +52,6 @@ const SORT_LABELS: Record = { version_no: 'バージョン', id: 'ID'} -const GROUP_BY_LABELS: Record = { - none: 'オフ', - parent_tag: '親タグ'} - const setIf = (qs: URLSearchParams, key: string, value: string | null) => { const next = value?.trim () @@ -94,14 +90,16 @@ const groupedTagPath = ( const materialNewPath = ( tagName: string, - returnTo: string): string => + returnTo: string, +): string => `/materials/new?tag=${ encodeURIComponent (tagName) }` + `&return_to=${ encodeURIComponent (returnTo) }` const clearedTagSelectionPath = ( locationSearch: string, - materialFilter: MaterialFilter): string => { + materialFilter: MaterialFilter, +): string => { const qs = new URLSearchParams (locationSearch) qs.delete ('tag_id') qs.delete ('include_descendants') @@ -190,10 +188,9 @@ const MaterialListItem: FC<{ material: Material }> = ({ material }) => ( const GroupHeading: FC<{ count: number materialFilter: MaterialFilter - returnTo: string title: string tagId: number -}> = ({ count, materialFilter, returnTo, title, tagId }) => ( +}> = ({ count, materialFilter, title, tagId }) => (
{ tagId={group.tag.id} title={group.tag.name} count={group.count} - materialFilter={materialFilter} - returnTo={location.pathname + location.search}/> + materialFilter={materialFilter}/> {renderMaterialCollection (groupMaterials)} ) })} @@ -601,7 +597,7 @@ const MaterialListPage: FC = () => { {(!isLoading && !isError && materials.length === 0) && (

素材はありません。 - {['character', 'material'].includes (tagScope?.tag.category) && ( + {(tagScope && ['character', 'material'].includes (tagScope.tag.category)) && ( <>