feat: D & D による上位タグ設定(#184) #186

Merged
みてるぞ merged 17 commits from feature/184 into main 2026-01-07 03:26:06 +09:00
Showing only changes of commit 1a02fb811b - Show all commits
+24 -5
View File
@@ -1,3 +1,4 @@
import { useState } from 'react'
import YoutubeEmbed from 'react-youtube'
import NicoViewer from '@/components/NicoViewer'
@@ -39,10 +40,28 @@ export default (({ post }: Props) => {
}
}
const [framed, setFramed] = useState (false)
return (
<a href={post.url} target="_blank">
<img src={post.thumbnailBase || post.thumbnail}
alt={post.url}
className="mb-4 w-full"/>
</a>)
<>
{framed
? (
<iframe
src={post.url}
title={post.title || post.url}
width={640}
height={360}/>)
: (
<div>
<a href="#" onClick={e => {
e.preventDefault ()
setFramed (confirm ('未確認の外部ページを表示します。\n'
+ '悪意のあるスクリプトが実行される可能性があります。\n'
+ '表示しますか?'))
return
}}>
</a>
</div>)}
</>)
}) satisfies FC<Props>