diff --git a/locales/en/translation.json b/locales/en/translation.json index e70009a5..bc56e28e 100644 --- a/locales/en/translation.json +++ b/locales/en/translation.json @@ -75,7 +75,8 @@ "unlisted": "Unlisted", "private": "Private", "direct": "Direct" - } + }, + "nsfw": "Sensitive" }, "alert": { "validation": { diff --git a/renderer/components/compose/Compose.tsx b/renderer/components/compose/Compose.tsx index 7eb32443..e104ec56 100644 --- a/renderer/components/compose/Compose.tsx +++ b/renderer/components/compose/Compose.tsx @@ -1,4 +1,4 @@ -import { Dropdown, FileInput, Spinner, TextInput, Textarea } from 'flowbite-react' +import { Checkbox, Dropdown, Label, Spinner, TextInput, Textarea } from 'flowbite-react' import { ChangeEvent, useEffect, useRef, useState } from 'react' import { FormattedMessage, useIntl } from 'react-intl' import { FaEnvelope, FaGlobe, FaListCheck, FaLock, FaLockOpen, FaPaperPlane, FaPaperclip, FaXmark } from 'react-icons/fa6' @@ -40,6 +40,12 @@ export default function Compose(props: Props) { media_ids: attachments.map(m => m.id) }) } + const sensitive = document.getElementById('sensitive') as HTMLInputElement + if (sensitive.checked) { + options = Object.assign({}, options, { + sensitive: sensitive.checked + }) + } setLoading(true) try { await props.client.postStatus(body, options) @@ -119,6 +125,16 @@ export default function Compose(props: Props) { ))} + + {attachments.length > 0 && ( +