+
diff --git a/frontend/src/components/TagLink.tsx b/frontend/src/components/TagLink.tsx
index 5755ffe..6a41e68 100644
--- a/frontend/src/components/TagLink.tsx
+++ b/frontend/src/components/TagLink.tsx
@@ -1,8 +1,5 @@
-import { useEffect, useState } from 'react'
-
import PrefetchLink from '@/components/PrefetchLink'
import { LIGHT_COLOUR_SHADE, DARK_COLOUR_SHADE, TAG_COLOUR } from '@/consts'
-import { apiGet } from '@/lib/api'
import { cn } from '@/lib/utils'
import type { ComponentProps, FC, HTMLAttributes } from 'react'
@@ -36,35 +33,6 @@ export default (({ tag,
withWiki = true,
withCount = true,
...props }: Props) => {
- const [havingWiki, setHavingWiki] = useState (true)
-
- const wikiExists = async (tag: Tag) => {
- if ('hasWiki' in tag)
- {
- setHavingWiki (tag.hasWiki)
- return
- }
-
- const tagName = (tag as Tag).name
-
- try
- {
- await apiGet (`/wiki/title/${ encodeURIComponent (tagName) }/exists`)
- setHavingWiki (true)
- }
- catch
- {
- setHavingWiki (false)
- }
- }
-
- useEffect (() => {
- if (!(linkFlg) || !(withWiki))
- return
-
- wikiExists (tag)
- }, [tag.name, linkFlg, withWiki])
-
const spanClass = cn (
`text-${ TAG_COLOUR[tag.category] }-${ LIGHT_COLOUR_SHADE }`,
`dark:text-${ TAG_COLOUR[tag.category] }-${ DARK_COLOUR_SHADE }`)
@@ -77,17 +45,27 @@ export default (({ tag,
<>
{(linkFlg && withWiki) && (
- {havingWiki
+ {(tag.materialId != null || tag.hasWiki)
? (
-
- ?
- )
+ tag.materialId == null
+ ? (
+
+ ?
+ )
+ : (
+
+ ?
+ ))
: (
-
+
!
)}
)}
diff --git a/frontend/src/pages/materials/MaterialBasePage.tsx b/frontend/src/pages/materials/MaterialBasePage.tsx
index 4c948f1..69d6a33 100644
--- a/frontend/src/pages/materials/MaterialBasePage.tsx
+++ b/frontend/src/pages/materials/MaterialBasePage.tsx
@@ -6,7 +6,7 @@ import type { FC } from 'react'
export default (() => (
-
+
)) satisfies FC
diff --git a/frontend/src/pages/materials/MaterialDetailPage.tsx b/frontend/src/pages/materials/MaterialDetailPage.tsx
index 04b66d8..99c5d46 100644
--- a/frontend/src/pages/materials/MaterialDetailPage.tsx
+++ b/frontend/src/pages/materials/MaterialDetailPage.tsx
@@ -3,6 +3,7 @@ import { Helmet } from 'react-helmet-async'
import { useParams } from 'react-router-dom'
import TagLink from '@/components/TagLink'
+import WikiBody from '@/components/WikiBody'
import Label from '@/components/common/Label'
import PageTitle from '@/components/common/PageTitle'
import TabGroup, { Tab } from '@/components/common/TabGroup'
@@ -109,6 +110,12 @@ export default (() => {
)))}
+
+
+
+
{/* タグ */}
diff --git a/frontend/src/pages/posts/PostDetailPage.tsx b/frontend/src/pages/posts/PostDetailPage.tsx
index 11f6100..a15f035 100644
--- a/frontend/src/pages/posts/PostDetailPage.tsx
+++ b/frontend/src/pages/posts/PostDetailPage.tsx
@@ -93,7 +93,7 @@ export default (({ user }: Props) => {
: 'bg-gray-500 hover:bg-gray-600')
return (
-
+
{(post?.thumbnail || post?.thumbnailBase) && (
)}
diff --git a/frontend/src/pages/posts/PostListPage.tsx b/frontend/src/pages/posts/PostListPage.tsx
index 70e3e68..8fc4ba8 100644
--- a/frontend/src/pages/posts/PostListPage.tsx
+++ b/frontend/src/pages/posts/PostListPage.tsx
@@ -69,7 +69,7 @@ export default (() => {
}, [location.search])
return (
-
+
{tags.length
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index a9b2581..2f71826 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -54,6 +54,7 @@ export type Material = {
tag: Tag
file: string | null
url: string | null
+ wikiPageBody?: string | null
contentType: string | null
createdAt: string
createdByUser: { id: number; name: string }
@@ -140,6 +141,7 @@ export type Tag = {
createdAt: string
updatedAt: string
hasWiki: boolean
+ materialId: number
children?: Tag[]
matchedAlias?: string | null }