Merge remote-tracking branch 'origin/develop' into chats

chats-router
Alex Gleason 2 years ago
commit 90c8096f9e
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

@ -605,7 +605,7 @@ class MediaGallery extends React.PureComponent {
}
if (inReview) {
summary = <FormattedMessage id='status.in_review_summary.summary' defaultMessage='This Truth has been sent to Moderation for review and is only visible to you.' />;
summary = <FormattedMessage id='status.in_review_summary.summary' defaultMessage='This post has been sent to Moderation for review and is only visible to you.' />;
} else {
summary = <FormattedMessage id='status.sensitive_warning.subtitle' defaultMessage='This content may not be suitable for all audiences.' />;
}

@ -18,7 +18,7 @@ import AutosuggestInput, { AutoSuggestion } from 'soapbox/components/autosuggest
import AutosuggestTextarea from 'soapbox/components/autosuggest_textarea';
import Icon from 'soapbox/components/icon';
import { Button, Stack } from 'soapbox/components/ui';
import { useAppDispatch, useAppSelector, useCompose, useFeatures } from 'soapbox/hooks';
import { useAppDispatch, useAppSelector, useCompose, useFeatures, usePrevious } from 'soapbox/hooks';
import { isMobile } from 'soapbox/is_mobile';
import EmojiPickerDropdown from '../components/emoji-picker/emoji-picker-dropdown';
@ -76,6 +76,7 @@ const ComposeForm = <ID extends string>({ id, shouldCondense, autoFocus, clickab
const features = useFeatures();
const { text, suggestions, spoiler, spoiler_text: spoilerText, privacy, focusDate, caretPosition, is_submitting: isSubmitting, is_changing_upload: isChangingUpload, is_uploading: isUploading, schedule: scheduledAt } = compose;
const prevSpoiler = usePrevious(spoiler);
const hasPoll = !!compose.poll;
const isEditing = compose.id !== null;
@ -206,9 +207,10 @@ const ComposeForm = <ID extends string>({ id, shouldCondense, autoFocus, clickab
}, []);
useEffect(() => {
switch (spoiler) {
case true: focusSpoilerInput(); break;
case false: focusTextarea(); break;
if (spoiler && !prevSpoiler) {
focusSpoilerInput();
} else if (!spoiler && prevSpoiler) {
focusTextarea();
}
}, [spoiler]);

@ -9,6 +9,7 @@ export { useFeatures } from './useFeatures';
export { useLocale } from './useLocale';
export { useOnScreen } from './useOnScreen';
export { useOwnAccount } from './useOwnAccount';
export { usePrevious } from './usePrevious';
export { useRefEventHandler } from './useRefEventHandler';
export { useSettings } from './useSettings';
export { useSoapboxConfig } from './useSoapboxConfig';

@ -0,0 +1,13 @@
import { useRef, useEffect } from 'react';
/** Get the last version of this value. */
// https://usehooks.com/usePrevious/
export const usePrevious = <T>(value: T): T | undefined => {
const ref = useRef<T>();
useEffect(() => {
ref.current = value;
}, [value]);
return ref.current;
};

@ -992,7 +992,7 @@
"status.favourite": "Like",
"status.filtered": "Filtered",
"status.in_review_warning": "Content Under Review",
"status.in_review_summary.summary": "This Truth has been sent to Moderation for review and is only visible to you.",
"status.in_review_summary.summary": "This post has been sent to Moderation for review and is only visible to you.",
"status.in_review_summary.contact": "If you believe this is in error please {link}.",
"status.in_review_summary.link": "Contact Support",
"status.load_more": "Load more",

Loading…
Cancel
Save