+
{theatre && (
diff --git a/frontend/src/pages/wiki/WikiDetailPage.tsx b/frontend/src/pages/wiki/WikiDetailPage.tsx
index fd2c0b5..4ead153 100644
--- a/frontend/src/pages/wiki/WikiDetailPage.tsx
+++ b/frontend/src/pages/wiki/WikiDetailPage.tsx
@@ -7,7 +7,6 @@ import PostList from '@/components/PostList'
import PrefetchLink from '@/components/PrefetchLink'
import TagLink from '@/components/TagLink'
import WikiBody from '@/components/WikiBody'
-import PageTitle from '@/components/common/PageTitle'
import TabGroup, { Tab } from '@/components/common/TabGroup'
import MainArea from '@/components/layout/MainArea'
import { SITE_TITLE } from '@/config'
@@ -107,21 +106,23 @@ export default () => {
) : '(最新)'}
)}
-
-
-
-
- {loading ? 'Loading...' : }
-
-
- {(!(version) && posts.length > 0) && (
-
-
-
-
- )}
+
+
+
+
+ {loading ? Loading...
: }
+
+ {(!(version) && posts.length > 0) && (
+ )}
+
)
}
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index efb7d22..6340b52 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -49,12 +49,34 @@ export type FetchTagsParams = {
limit: number
order: FetchTagsOrder }
+export type Material = {
+ id: number
+ tag: Tag
+ file: string | null
+ url: string | null
+ wikiPageBody?: string | null
+ contentType: string | null
+ createdAt: string
+ createdByUser: { id: number; name: string }
+ updatedAt: string
+ updatedByUser: { id: number; name: string } }
+
export type Menu = MenuItem[]
-export type MenuItem = {
+export type MenuInvisibleItem = {
+ name: ReactNode
+ to?: string
+ base?: string
+ visible: false
+ subMenu: SubMenuItem[] }
+
+export type MenuItem = MenuVisibleItem | MenuInvisibleItem
+
+export type MenuVisibleItem = {
name: ReactNode
to: string
base?: string
+ visible?: true
subMenu: SubMenuItem[] }
export type NicoTag = Tag & {
@@ -95,9 +117,9 @@ export type NiconicoViewerHandle = {
export type Post = {
id: number
url: string
- title: string
- thumbnail: string
- thumbnailBase: string
+ title: string | null
+ thumbnail: string | null
+ thumbnailBase: string | null
tags: Tag[]
viewed: boolean
related: Post[]
@@ -105,7 +127,7 @@ export type Post = {
originalCreatedBefore: string | null
createdAt: string
updatedAt: string
- uploadedUser: { id: number; name: string } | null }
+ uploadedUser: { id: number; name: string | null } | null }
export type PostTagChange = {
post: Post
@@ -114,24 +136,56 @@ export type PostTagChange = {
changeType: 'add' | 'remove'
timestamp: string }
-export type SubMenuItem =
- | { component: ReactNode
- visible: boolean }
- | { name: ReactNode
- to: string
- visible?: boolean }
+export type PostVersion = {
+ postId: number
+ versionNo: number
+ eventType: 'create' | 'update' | 'discard' | 'restore'
+ title: { current: string | null; prev: string | null }
+ url: { current: string; prev: string | null }
+ thumbnail: { current: string | null; prev: string | null }
+ thumbnailBase: { current: string | null; prev: string | null }
+ tags: { name: string; type: 'context' | 'added' | 'removed' }[]
+ originalCreatedFrom: { current: string | null; prev: string | null }
+ originalCreatedBefore: { current: string | null; prev: string | null }
+ createdAt: string
+ createdByUser: { id: number; name: string | null } | null }
+
+export type SubMenuComponentItem = {
+ component: ReactNode
+ visible: boolean }
+
+export type SubMenuItem = SubMenuComponentItem | SubMenuStringItem
+
+export type SubMenuStringItem = {
+ name: ReactNode
+ to: string
+ visible?: boolean }
export type Tag = {
id: number
name: string
category: Category
+ aliases: string[]
+ parents: Tag[]
postCount: number
createdAt: string
updatedAt: string
hasWiki: boolean
+ materialId: number
children?: Tag[]
matchedAlias?: string | null }
+export type TagVersion = {
+ tagId: number
+ versionNo: number
+ eventType: 'create' | 'update' | 'discard' | 'restore'
+ name: { current: string; prev: string | null }
+ category: { current: Category; prev: Category | null }
+ aliases: { name: string; type: 'context' | 'added' | 'removed' }[]
+ parentTags: { tag: Tag; type: 'context' | 'added' | 'removed' }[]
+ createdAt: string
+ createdByUser: { id: number; name: string | null } | null }
+
export type Theatre = {
id: number
name: string | null
diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js
index fddc378..7982b0a 100644
--- a/frontend/tailwind.config.js
+++ b/frontend/tailwind.config.js
@@ -8,7 +8,7 @@ import { DARK_COLOUR_SHADE,
const colours = Object.values (TAG_COLOUR)
export default {
- content: ['./src/**/*.{html,js,ts,jsx,tsx}'],
+ content: ['./src/**/*.{html,js,ts,jsx,tsx,mdx}'],
safelist: [...colours.map (c => `text-${ c }-${ LIGHT_COLOUR_SHADE }`),
...colours.map (c => `hover:text-${ c }-${ LIGHT_COLOUR_SHADE - 200 }`),
...colours.map (c => `dark:text-${ c }-${ DARK_COLOUR_SHADE }`),
@@ -24,4 +24,4 @@ export default {
'rainbow-scroll': {
'0%': { backgroundPosition: '0% 50%' },
'100%': { backgroundPosition: '200% 50%' } } } } },
- plugins: [] } satisfies Config
+ plugins: [require ('@tailwindcss/typography')] } satisfies Config
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
index 9e1bfe2..948e859 100644
--- a/frontend/vite.config.ts
+++ b/frontend/vite.config.ts
@@ -1,11 +1,12 @@
-import { defineConfig } from 'vite'
+import mdx from '@mdx-js/rollup'
import react from '@vitejs/plugin-react'
import path from 'path'
+import { defineConfig } from 'vite'
// https://vite.dev/config/
export default defineConfig ({
- plugins: [react()],
+ plugins: [mdx ({ providerImportSource: '@/mdx-components' }), react ()],
resolve: { alias: { '@': path.resolve (__dirname, './src') } },
server: { host: true,
port: 5173,