Only display sensitive media button if there are any
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
@ -33,7 +33,7 @@ import ReplyGroupIndicator from './reply-group-indicator';
|
||||
import ReplyMentions from './reply-mentions';
|
||||
import ScheduleButton from './schedule-button';
|
||||
import ScheduleForm from './schedule-form';
|
||||
import SpoilerButton from './spoiler-button';
|
||||
import SensitiveMediaButton from './sensitive-media-button';
|
||||
import SpoilerInput from './spoiler-input';
|
||||
import TextCharacterCounter from './text-character-counter';
|
||||
import UploadForm from './upload-form';
|
||||
@ -179,7 +179,7 @@ const ComposeForm = <ID extends string>({ id, shouldCondense, autoFocus, clickab
|
||||
<EmojiPickerDropdown onPickEmoji={handleEmojiPick} condensed={shouldCondense} />
|
||||
{features.polls && <PollButton composeId={id} />}
|
||||
{features.scheduledStatuses && <ScheduleButton composeId={id} />}
|
||||
{features.spoilers && <SpoilerButton composeId={id} />}
|
||||
{anyMedia && features.spoilers && <SensitiveMediaButton composeId={id} />}
|
||||
</HStack>
|
||||
), [features, id]);
|
||||
|
||||
|
||||
@ -7,15 +7,15 @@ import { useAppDispatch, useCompose } from 'pl-fe/hooks';
|
||||
import ComposeFormButton from './compose-form-button';
|
||||
|
||||
const messages = defineMessages({
|
||||
marked: { id: 'compose_form.spoiler.marked', defaultMessage: 'Media is marked as sensitive' },
|
||||
unmarked: { id: 'compose_form.spoiler.unmarked', defaultMessage: 'Media is not marked as sensitive' },
|
||||
marked: { id: 'compose_form.sensitive.marked', defaultMessage: 'Media is marked as sensitive' },
|
||||
unmarked: { id: 'compose_form.sensitive.unmarked', defaultMessage: 'Media is not marked as sensitive' },
|
||||
});
|
||||
|
||||
interface ISpoilerButton {
|
||||
interface ISensitiveMediaButton {
|
||||
composeId: string;
|
||||
}
|
||||
|
||||
const SpoilerButton: React.FC<ISpoilerButton> = ({ composeId }) => {
|
||||
const SensitiveMediaButton: React.FC<ISensitiveMediaButton> = ({ composeId }) => {
|
||||
const intl = useIntl();
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
@ -34,4 +34,4 @@ const SpoilerButton: React.FC<ISpoilerButton> = ({ composeId }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export { SpoilerButton as default };
|
||||
export { SensitiveMediaButton as default };
|
||||
Reference in New Issue
Block a user