diff --git a/src/components/compose/Status.tsx b/src/components/compose/Status.tsx index df35337d..5834d513 100644 --- a/src/components/compose/Status.tsx +++ b/src/components/compose/Status.tsx @@ -1,4 +1,4 @@ -import { Form, Button, ButtonToolbar, Schema, Whisper, Input, Popover, Dropdown, useToaster, IconButton } from 'rsuite' +import { Form, Button, ButtonToolbar, Schema, Whisper, Input, Popover, Dropdown, useToaster, IconButton, Toggle } from 'rsuite' import { useState, useEffect, useRef, forwardRef, ChangeEvent } from 'react' import { Icon } from '@rsuite/icons' import { BsEmojiLaughing, BsPaperclip, BsMenuButtonWide, BsGlobe, BsUnlock, BsLock, BsEnvelope, BsXCircle } from 'react-icons/bs' @@ -19,6 +19,7 @@ type Props = { type FormValue = { status: string attachments?: Array + nsfw?: boolean } type CustomEmojiCategory = { @@ -112,6 +113,11 @@ const Status: React.FC = props => { media_ids: formValue.attachments.map(m => m.id) }) } + if (formValue.nsfw !== undefined) { + options = Object.assign({}, options, { + sensitive: formValue.nsfw + }) + } await props.client.postStatus(formValue.status, options) clear() } catch { @@ -257,6 +263,12 @@ const Status: React.FC = props => { + {formValue.attachments?.length > 0 && ( + + + + )} +
{formValue.attachments?.map((media, index) => (