Merge remote-tracking branch 'soapbox/develop' into cleanup

This commit is contained in:
marcin mikołajczak
2022-12-31 19:52:03 +01:00
38 changed files with 636 additions and 7719 deletions

View File

@@ -27,7 +27,7 @@ const FloatingActionButton: React.FC<IFloatingActionButton> = () => {
onClick={handleOpenComposeModal}
className={clsx(
'p-4 inline-flex items-center border font-medium rounded-full focus:outline-none focus:ring-2 focus:ring-offset-2 appearance-none transition-all',
'bg-primary-500 hover:bg-primary-400 dark:hover:bg-primary-600 border-transparent focus:bg-primary-500 text-gray-100 focus:ring-primary-300',
'border-transparent bg-secondary-500 hover:bg-secondary-400 focus:bg-secondary-500 text-gray-100 focus:ring-secondary-300',
)}
aria-label={intl.formatMessage(messages.publish)}
>

View File

@@ -13,7 +13,7 @@ import Video from 'soapbox/features/video';
import ImageLoader from '../image-loader';
import type { List as ImmutableList } from 'immutable';
import type { Account, Attachment, Status } from 'soapbox/types/entities';
import type { Attachment, Status } from 'soapbox/types/entities';
const messages = defineMessages({
close: { id: 'lightbox.close', defaultMessage: 'Close' },
@@ -24,7 +24,6 @@ const messages = defineMessages({
interface IMediaModal {
media: ImmutableList<Attachment>,
status?: Status,
account: Account,
index: number,
time?: number,
onClose: () => void,
@@ -34,7 +33,6 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
const {
media,
status,
account,
onClose,
time = 0,
} = props;
@@ -94,9 +92,9 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
};
const handleStatusClick: React.MouseEventHandler = e => {
if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {
if (status && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
e.preventDefault();
history.push(`/@${account.acct}/posts/${status?.id}`);
history.push(`/@${status.getIn(['account', 'acct'])}/posts/${status?.id}`);
onClose();
}
};
@@ -170,7 +168,7 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
const width = (attachment.meta.getIn(['original', 'width']) || undefined) as number | undefined;
const height = (attachment.meta.getIn(['original', 'height']) || undefined) as number | undefined;
const link = (status && account && (
const link = (status && (
<a href={status.url} onClick={handleStatusClick}>
<FormattedMessage id='lightbox.view_context' defaultMessage='View context' />
</a>

View File

@@ -31,7 +31,7 @@ const ProfileMediaPanel: React.FC<IProfileMediaPanel> = ({ account }) => {
const media = attachment.getIn(['status', 'media_attachments']) as ImmutableList<Attachment>;
const index = media.findIndex(x => x.id === attachment.id);
dispatch(openModal('MEDIA', { media, index, status: attachment.status, account: attachment.account }));
dispatch(openModal('MEDIA', { media, index, status: attachment.status }));
}
};