|
|
|
@@ -52,10 +52,6 @@ const SORT_LABELS: Record<MaterialIndexSort, string> = {
|
|
|
|
|
version_no: 'バージョン',
|
|
|
|
|
id: 'ID'}
|
|
|
|
|
|
|
|
|
|
const GROUP_BY_LABELS: Record<MaterialIndexGroupBy, string> = {
|
|
|
|
|
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 }) => (
|
|
|
|
|
<div className="flex items-center gap-2 border-b border-stone-200 pb-2
|
|
|
|
|
dark:border-stone-700">
|
|
|
|
|
<PrefetchLink
|
|
|
|
@@ -378,8 +375,7 @@ const MaterialListPage: FC = () => {
|
|
|
|
|
tagId={group.tag.id}
|
|
|
|
|
title={group.tag.name}
|
|
|
|
|
count={group.count}
|
|
|
|
|
materialFilter={materialFilter}
|
|
|
|
|
returnTo={location.pathname + location.search}/>
|
|
|
|
|
materialFilter={materialFilter}/>
|
|
|
|
|
{renderMaterialCollection (groupMaterials)}
|
|
|
|
|
</section>)
|
|
|
|
|
})}
|
|
|
|
@@ -601,7 +597,7 @@ const MaterialListPage: FC = () => {
|
|
|
|
|
{(!isLoading && !isError && materials.length === 0) && (
|
|
|
|
|
<p>
|
|
|
|
|
素材はありません。
|
|
|
|
|
{['character', 'material'].includes (tagScope?.tag.category) && (
|
|
|
|
|
{(tagScope && ['character', 'material'].includes (tagScope.tag.category)) && (
|
|
|
|
|
<>
|
|
|
|
|
<PrefetchLink
|
|
|
|
|
to={materialNewPath (tagScope.tag.name, location.pathname + location.search)}
|
|
|
|
|