feat: 投稿詳細のサイド・バーに投稿情報追加(#102) (#131)
Merge branch 'main' into #102 #102 サイドバーの投稿詳細 Merge branch '#102' of https://git.miteruzo.com/miteruzo/btrc-hub into #102 #102 サイドバーの投稿詳細,形だけ #102 サイドバーの投稿詳細,形だけ Co-authored-by: miteruzo <miteruzo@naver.com> Reviewed-on: #131
This commit was merged in pull request #131.
This commit is contained in:
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'
|
|||||||
|
|
||||||
import TagLink from '@/components/TagLink'
|
import TagLink from '@/components/TagLink'
|
||||||
import TagSearch from '@/components/TagSearch'
|
import TagSearch from '@/components/TagSearch'
|
||||||
|
import SectionTitle from '@/components/common/SectionTitle'
|
||||||
import SubsectionTitle from '@/components/common/SubsectionTitle'
|
import SubsectionTitle from '@/components/common/SubsectionTitle'
|
||||||
import SidebarComponent from '@/components/layout/SidebarComponent'
|
import SidebarComponent from '@/components/layout/SidebarComponent'
|
||||||
import { CATEGORIES } from '@/consts'
|
import { CATEGORIES } from '@/consts'
|
||||||
@@ -53,11 +54,54 @@ export default (({ post }: Props) => {
|
|||||||
<div className="my-3" key={cat}>
|
<div className="my-3" key={cat}>
|
||||||
<SubsectionTitle>{categoryNames[cat]}</SubsectionTitle>
|
<SubsectionTitle>{categoryNames[cat]}</SubsectionTitle>
|
||||||
<ul>
|
<ul>
|
||||||
{tags[cat].map ((tag, i) => (
|
{tags[cat].map (tag => (
|
||||||
<li key={i} className="mb-1">
|
<li key={tag.id} className="mb-1">
|
||||||
<TagLink tag={tag}/>
|
<TagLink tag={tag}/>
|
||||||
</li>))}
|
</li>))}
|
||||||
</ul>
|
</ul>
|
||||||
</div>))}
|
</div>))}
|
||||||
|
{post && (
|
||||||
|
<div>
|
||||||
|
<SectionTitle>情報</SectionTitle>
|
||||||
|
<ul>
|
||||||
|
<li>Id.: {post.id}</li>
|
||||||
|
{/* TODO: uploadedUser の取得を対応したらコメント外す */}
|
||||||
|
{/*
|
||||||
|
<li>
|
||||||
|
<>耕作者: </>
|
||||||
|
{post.uploadedUser
|
||||||
|
? (
|
||||||
|
<Link to={`/users/${ post.uploadedUser.id }`}>
|
||||||
|
{post.uploadedUser.name || '名もなきニジラー'}
|
||||||
|
</Link>)
|
||||||
|
: 'bot操作'}
|
||||||
|
</li>
|
||||||
|
*/}
|
||||||
|
<li>耕作日時: {(new Date (post.createdAt)).toLocaleString ()}</li>
|
||||||
|
<li>
|
||||||
|
<>リンク: </>
|
||||||
|
<a
|
||||||
|
className="break-all"
|
||||||
|
href={post.url}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer nofollow">
|
||||||
|
{post.url}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
{/* TODO: 表示形式きしょすぎるので何とかする */}
|
||||||
|
<>オリジナルの投稿日時: </>
|
||||||
|
{!(post.originalCreatedFrom) && !(post.originalCreatedBefore)
|
||||||
|
? '不明'
|
||||||
|
: (
|
||||||
|
<>
|
||||||
|
{post.originalCreatedFrom
|
||||||
|
&& `${ (new Date (post.originalCreatedFrom)).toLocaleString () } 以降 `}
|
||||||
|
{post.originalCreatedBefore
|
||||||
|
&& `${ (new Date (post.originalCreatedBefore)).toLocaleString () } より前`}
|
||||||
|
</>)}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>)}
|
||||||
</SidebarComponent>)
|
</SidebarComponent>)
|
||||||
}) satisfies FC<Props>
|
}) satisfies FC<Props>
|
||||||
|
|||||||
Reference in New Issue
Block a user