ComposeModal: become group-aware

This commit is contained in:
Alex Gleason 2023-04-26 15:14:54 -05:00
parent f9b5954060
commit a193108ef8
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -27,7 +27,7 @@ const ComposeModal: React.FC<IComposeModal> = ({ onClose, composeId = 'compose-m
const node = useRef<HTMLDivElement>(null);
const compose = useCompose(composeId);
const { id: statusId, privacy, in_reply_to: inReplyTo, quote } = compose!;
const { id: statusId, privacy, in_reply_to: inReplyTo, quote, group_id: groupId } = compose!;
const { isDragging, isDraggedOver } = useDraggedFiles(node, (files) => {
dispatch(uploadCompose(composeId, files, intl));
@ -59,6 +59,10 @@ const ComposeModal: React.FC<IComposeModal> = ({ onClose, composeId = 'compose-m
return <FormattedMessage id='navigation_bar.compose_edit' defaultMessage='Edit post' />;
} else if (privacy === 'direct') {
return <FormattedMessage id='navigation_bar.compose_direct' defaultMessage='Direct message' />;
} else if (inReplyTo && groupId) {
return <FormattedMessage id='navigation_bar.compose_group_reply' defaultMessage='Reply to group post' />;
} else if (groupId) {
return <FormattedMessage id='navigation_bar.compose_group' defaultMessage='Compose to group' />;
} else if (inReplyTo) {
return <FormattedMessage id='navigation_bar.compose_reply' defaultMessage='Reply to post' />;
} else if (quote) {