Add "Mark media as sensitive" checkbox

It does the same thing as spoiler text toggle.
This commit is contained in:
Lim Chee Aun 2023-01-22 19:33:45 +08:00
parent e7dffecfe0
commit a522511e0e
2 changed files with 24 additions and 0 deletions

View file

@ -324,6 +324,16 @@
margin-bottom: 4px;
}
#compose-container .media-sensitive {
padding: 8px;
background-color: var(--bg-blur-color);
border-radius: 8px;
cursor: pointer;
}
#compose-container .media-sensitive > * {
vertical-align: middle;
}
#compose-container form .poll {
background-color: var(--bg-faded-color);
border-radius: 8px;

View file

@ -876,6 +876,20 @@ function Compose({
/>
);
})}
<label class="media-sensitive">
<input
name="sensitive"
type="checkbox"
checked={sensitive}
disabled={uiState === 'loading'}
onChange={(e) => {
const sensitive = e.target.checked;
setSensitive(sensitive);
}}
/>{' '}
<span>Mark media as sensitive</span>{' '}
<Icon icon={`eye-${sensitive ? 'close' : 'open'}`} />
</label>
</div>
)}
{!!poll && (