Browse Source

#157

feature/157
みてるぞ 6 days ago
parent
commit
472717b181
1 changed files with 22 additions and 18 deletions
  1. +22
    -18
      frontend/src/components/PostEmbed.tsx

+ 22
- 18
frontend/src/components/PostEmbed.tsx View File

@@ -42,22 +42,26 @@ export default (({ post }: Props) => {

const [framed, setFramed] = useState (false)

return <>{
framed
? (
<iframe
src={post.url}
title={post.title || post.url}
width={640}
height={360}/>)
: (
<a href="#" onClick={e => {
e.preventDefault ()
setFramed (confirm ('未確認の外部ページを表示します。\n'
+ '悪意のあるスクリプトが実行される可能性があります。\n'
+ '表示しますか?'))
return
}}>
外部ページを表示
</a>)}</>
return (
<>
{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>

Loading…
Cancel
Save