このコミットが含まれているのは:
@@ -4,7 +4,7 @@ import { cn } from '@/lib/utils'
|
|||||||
|
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
|
|
||||||
type Props = { children: React.ReactNode }
|
type Props = { children: React.ReactNode; className?: string }
|
||||||
|
|
||||||
|
|
||||||
const PageTitle: FC<Props> = ({ children, className, ...rest }) => (
|
const PageTitle: FC<Props> = ({ children, className, ...rest }) => (
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import WikiBody from '@/components/WikiBody'
|
|||||||
import FieldError from '@/components/common/FieldError'
|
import FieldError from '@/components/common/FieldError'
|
||||||
import FormField from '@/components/common/FormField'
|
import FormField from '@/components/common/FormField'
|
||||||
import PageTitle from '@/components/common/PageTitle'
|
import PageTitle from '@/components/common/PageTitle'
|
||||||
import PrefetchLink from '@/components/PrefetchLink'
|
|
||||||
import TabGroup, { Tab } from '@/components/common/TabGroup'
|
import TabGroup, { Tab } from '@/components/common/TabGroup'
|
||||||
import TagInput from '@/components/common/TagInput'
|
import TagInput from '@/components/common/TagInput'
|
||||||
import MainArea from '@/components/layout/MainArea'
|
import MainArea from '@/components/layout/MainArea'
|
||||||
|
|||||||
@@ -52,10 +52,6 @@ const SORT_LABELS: Record<MaterialIndexSort, string> = {
|
|||||||
version_no: 'バージョン',
|
version_no: 'バージョン',
|
||||||
id: 'ID'}
|
id: 'ID'}
|
||||||
|
|
||||||
const GROUP_BY_LABELS: Record<MaterialIndexGroupBy, string> = {
|
|
||||||
none: 'オフ',
|
|
||||||
parent_tag: '親タグ'}
|
|
||||||
|
|
||||||
|
|
||||||
const setIf = (qs: URLSearchParams, key: string, value: string | null) => {
|
const setIf = (qs: URLSearchParams, key: string, value: string | null) => {
|
||||||
const next = value?.trim ()
|
const next = value?.trim ()
|
||||||
@@ -94,14 +90,16 @@ const groupedTagPath = (
|
|||||||
|
|
||||||
const materialNewPath = (
|
const materialNewPath = (
|
||||||
tagName: string,
|
tagName: string,
|
||||||
returnTo: string): string =>
|
returnTo: string,
|
||||||
|
): string =>
|
||||||
`/materials/new?tag=${ encodeURIComponent (tagName) }`
|
`/materials/new?tag=${ encodeURIComponent (tagName) }`
|
||||||
+ `&return_to=${ encodeURIComponent (returnTo) }`
|
+ `&return_to=${ encodeURIComponent (returnTo) }`
|
||||||
|
|
||||||
|
|
||||||
const clearedTagSelectionPath = (
|
const clearedTagSelectionPath = (
|
||||||
locationSearch: string,
|
locationSearch: string,
|
||||||
materialFilter: MaterialFilter): string => {
|
materialFilter: MaterialFilter,
|
||||||
|
): string => {
|
||||||
const qs = new URLSearchParams (locationSearch)
|
const qs = new URLSearchParams (locationSearch)
|
||||||
qs.delete ('tag_id')
|
qs.delete ('tag_id')
|
||||||
qs.delete ('include_descendants')
|
qs.delete ('include_descendants')
|
||||||
@@ -190,10 +188,9 @@ const MaterialListItem: FC<{ material: Material }> = ({ material }) => (
|
|||||||
const GroupHeading: FC<{
|
const GroupHeading: FC<{
|
||||||
count: number
|
count: number
|
||||||
materialFilter: MaterialFilter
|
materialFilter: MaterialFilter
|
||||||
returnTo: string
|
|
||||||
title: string
|
title: string
|
||||||
tagId: number
|
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
|
<div className="flex items-center gap-2 border-b border-stone-200 pb-2
|
||||||
dark:border-stone-700">
|
dark:border-stone-700">
|
||||||
<PrefetchLink
|
<PrefetchLink
|
||||||
@@ -378,8 +375,7 @@ const MaterialListPage: FC = () => {
|
|||||||
tagId={group.tag.id}
|
tagId={group.tag.id}
|
||||||
title={group.tag.name}
|
title={group.tag.name}
|
||||||
count={group.count}
|
count={group.count}
|
||||||
materialFilter={materialFilter}
|
materialFilter={materialFilter}/>
|
||||||
returnTo={location.pathname + location.search}/>
|
|
||||||
{renderMaterialCollection (groupMaterials)}
|
{renderMaterialCollection (groupMaterials)}
|
||||||
</section>)
|
</section>)
|
||||||
})}
|
})}
|
||||||
@@ -601,7 +597,7 @@ const MaterialListPage: FC = () => {
|
|||||||
{(!isLoading && !isError && materials.length === 0) && (
|
{(!isLoading && !isError && materials.length === 0) && (
|
||||||
<p>
|
<p>
|
||||||
素材はありません。
|
素材はありません。
|
||||||
{['character', 'material'].includes (tagScope?.tag.category) && (
|
{(tagScope && ['character', 'material'].includes (tagScope.tag.category)) && (
|
||||||
<>
|
<>
|
||||||
<PrefetchLink
|
<PrefetchLink
|
||||||
to={materialNewPath (tagScope.tag.name, location.pathname + location.search)}
|
to={materialNewPath (tagScope.tag.name, location.pathname + location.search)}
|
||||||
|
|||||||
新しい課題から参照
ユーザをブロックする