mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
blur nsfw attachments
This commit is contained in:
parent
f63d3a3ba1
commit
2741ccdb4d
@ -14,7 +14,7 @@ const renderDebug = localStorage.getItem("render_debug") === "true"
|
|||||||
|
|
||||||
const Attachment = React.memo((props) => {
|
const Attachment = React.memo((props) => {
|
||||||
const [loaded, setLoaded] = React.useState(false)
|
const [loaded, setLoaded] = React.useState(false)
|
||||||
|
const [nsfwAccepted, setNsfwAccepted] = React.useState(false)
|
||||||
const [mimeType, setMimeType] = React.useState(null)
|
const [mimeType, setMimeType] = React.useState(null)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -111,6 +111,17 @@ const Attachment = React.memo((props) => {
|
|||||||
className="attachment"
|
className="attachment"
|
||||||
onDoubleClick={onDoubleClickAttachment}
|
onDoubleClick={onDoubleClickAttachment}
|
||||||
>
|
>
|
||||||
|
{props.attachment.flags &&
|
||||||
|
props.attachment.flags.includes("nsfw") &&
|
||||||
|
!nsfwAccepted && (
|
||||||
|
<div className="nsfw_alert">
|
||||||
|
<h2>This media may contain sensitive content</h2>
|
||||||
|
|
||||||
|
<Button onClick={() => setNsfwAccepted(true)}>
|
||||||
|
Show anyways
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{renderMedia()}
|
{renderMedia()}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
z-index: 200;
|
z-index: 200;
|
||||||
|
|
||||||
padding: 10px 0;
|
padding: 40px;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -80,6 +80,8 @@
|
|||||||
|
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
|
||||||
|
gap: 10px;
|
||||||
|
|
||||||
backdrop-filter: blur(25px);
|
backdrop-filter: blur(25px);
|
||||||
-webkit-backdrop-filter: blur(25px);
|
-webkit-backdrop-filter: blur(25px);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user