#57 完了
This commit is contained in:
@@ -2,9 +2,9 @@ import axios from 'axios'
|
||||
import toCamel from 'camelcase-keys'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Helmet } from 'react-helmet'
|
||||
import ReactMarkdown from 'react-markdown'
|
||||
import { Link, useLocation, useParams, useNavigate } from 'react-router-dom'
|
||||
|
||||
import WikiBody from '@/components/WikiBody'
|
||||
import PageTitle from '@/components/common/PageTitle'
|
||||
import MainArea from '@/components/layout/MainArea'
|
||||
import { API_BASE_URL, SITE_TITLE } from '@/config'
|
||||
@@ -61,15 +61,9 @@ export default () => {
|
||||
</div>)}
|
||||
<PageTitle>{title}</PageTitle>
|
||||
<div className="prose mx-auto p-4">
|
||||
{wikiPage === undefined ? 'Loading...' : (
|
||||
<>
|
||||
<ReactMarkdown components={{ a: (
|
||||
({ href, children }) => (['/', '.'].some (e => href?.startsWith (e))
|
||||
? <Link to={href!}>{children}</Link>
|
||||
: <a href={href} target="_blank" rel="noopener noreferrer">{children}</a>)) }}>
|
||||
{wikiPage?.body || `このページは存在しません。[新規作成してください](/wiki/new?title=${ title })。`}
|
||||
</ReactMarkdown>
|
||||
</>)}
|
||||
{wikiPage === undefined
|
||||
? 'Loading...'
|
||||
: <WikiBody body={wikiPage?.body || `このページは存在しません。[新規作成してください](/wiki/new?title=${ title })。`} />}
|
||||
</div>
|
||||
</MainArea>)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user