refactor: rename Status to LegacyStatus and EntityTypes[Entities.STATUSES] to StatusEntity
This commit is contained in:
parent
6a44582c9c
commit
45a81a937c
|
@ -9,9 +9,9 @@ import { closeDropdownMenu as closeDropdownMenuRedux, openDropdownMenu } from 's
|
|||
import { closeModal, openModal } from 'soapbox/actions/modals.ts';
|
||||
import IconButton from 'soapbox/components/ui/icon-button.tsx';
|
||||
import Portal from 'soapbox/components/ui/portal.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
||||
import { userTouching } from 'soapbox/is-mobile.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
|
||||
import DropdownMenuItem, { MenuItem } from './dropdown-menu-item.tsx';
|
||||
|
||||
|
@ -27,7 +27,7 @@ interface IDropdownMenu {
|
|||
onShiftClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
|
||||
placement?: Placement;
|
||||
src?: string;
|
||||
status?: EntityTypes[Entities.STATUSES];
|
||||
status?: StatusEntity;
|
||||
title?: string;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ import Button from 'soapbox/components/ui/button.tsx';
|
|||
import HStack from 'soapbox/components/ui/hstack.tsx';
|
||||
import Stack from 'soapbox/components/ui/stack.tsx';
|
||||
import Text from 'soapbox/components/ui/text.tsx';
|
||||
import { EntityTypes, Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import PureEventActionButton from 'soapbox/features/event/components/pure-event-action-button.tsx';
|
||||
import PureEventDate from 'soapbox/features/event/components/pure-event-date.tsx';
|
||||
import { useAppSelector } from 'soapbox/hooks/useAppSelector.ts';
|
||||
|
@ -15,6 +14,7 @@ import { useAppSelector } from 'soapbox/hooks/useAppSelector.ts';
|
|||
import Icon from './icon.tsx';
|
||||
import VerificationBadge from './verification-badge.tsx';
|
||||
|
||||
import type { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
|
||||
const messages = defineMessages({
|
||||
eventBanner: { id: 'event.banner', defaultMessage: 'Event banner' },
|
||||
|
@ -23,7 +23,7 @@ const messages = defineMessages({
|
|||
});
|
||||
|
||||
interface IPureEventPreview {
|
||||
status: EntityTypes[Entities.STATUSES];
|
||||
status: StatusEntity;
|
||||
className?: string;
|
||||
hideAction?: boolean;
|
||||
floatingAction?: boolean;
|
||||
|
|
|
@ -4,7 +4,7 @@ import { useState, useRef, useLayoutEffect, useMemo, memo } from 'react';
|
|||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import Icon from 'soapbox/components/icon.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
import { isOnlyEmoji as _isOnlyEmoji } from 'soapbox/utils/only-emoji.ts';
|
||||
import { getTextDirection } from 'soapbox/utils/rtl.ts';
|
||||
|
||||
|
@ -28,7 +28,7 @@ const ReadMoreButton: React.FC<IReadMoreButton> = ({ onClick }) => (
|
|||
);
|
||||
|
||||
interface IPureStatusContent {
|
||||
status: EntityTypes[Entities.STATUSES];
|
||||
status: StatusEntity;
|
||||
onClick?: () => void;
|
||||
collapsable?: boolean;
|
||||
translatable?: boolean;
|
||||
|
|
|
@ -6,11 +6,11 @@ import { FormattedMessage } from 'react-intl';
|
|||
import LoadGap from 'soapbox/components/load-gap.tsx';
|
||||
import PureStatus from 'soapbox/components/pure-status.tsx';
|
||||
import ScrollableList from 'soapbox/components/scrollable-list.tsx';
|
||||
import { EntityTypes, Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import FeedSuggestions from 'soapbox/features/feed-suggestions/feed-suggestions.tsx';
|
||||
import PlaceholderStatus from 'soapbox/features/placeholder/components/placeholder-status.tsx';
|
||||
import PendingStatus from 'soapbox/features/ui/components/pending-status.tsx';
|
||||
import { useSoapboxConfig } from 'soapbox/hooks/useSoapboxConfig.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
|
||||
import type { VirtuosoHandle } from 'react-virtuoso';
|
||||
import type { IScrollableList } from 'soapbox/components/scrollable-list.tsx';
|
||||
|
@ -19,11 +19,11 @@ interface IPureStatusList extends Omit<IScrollableList, 'onLoadMore' | 'children
|
|||
/** Unique key to preserve the scroll position when navigating back. */
|
||||
scrollKey: string;
|
||||
/** List of statuses to display. */
|
||||
statuses: readonly EntityTypes[Entities.STATUSES][];
|
||||
statuses: readonly StatusEntity[];
|
||||
/** Last _unfiltered_ status ID (maxId) for pagination. */
|
||||
lastStatusId?: string;
|
||||
/** Pinned statuses to show at the top of the feed. */
|
||||
featuredStatuses?: readonly EntityTypes[Entities.STATUSES][];
|
||||
featuredStatuses?: readonly StatusEntity[];
|
||||
/** Pagination callback when the end of the list is reached. */
|
||||
onLoadMore?: (lastStatusId: string) => void;
|
||||
/** Whether the data is currently being fetched. */
|
||||
|
@ -124,7 +124,7 @@ const PureStatusList: React.FC<IPureStatusList> = ({
|
|||
);
|
||||
};
|
||||
|
||||
const renderStatus = (status: EntityTypes[Entities.STATUSES]) => {
|
||||
const renderStatus = (status: StatusEntity) => {
|
||||
return (
|
||||
<PureStatus
|
||||
status={status}
|
||||
|
|
|
@ -4,13 +4,12 @@ import { Link } from 'react-router-dom';
|
|||
import { openModal } from 'soapbox/actions/modals.ts';
|
||||
import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper.tsx';
|
||||
import HoverStatusWrapper from 'soapbox/components/hover-status-wrapper.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
import { shortenNostr } from 'soapbox/utils/nostr.ts';
|
||||
|
||||
|
||||
interface IPureStatusReplyMentions {
|
||||
status: EntityTypes[Entities.STATUSES];
|
||||
status: StatusEntity;
|
||||
hoverable?: boolean;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ import Icon from 'soapbox/components/ui/icon.tsx';
|
|||
import Stack from 'soapbox/components/ui/stack.tsx';
|
||||
import Text from 'soapbox/components/ui/text.tsx';
|
||||
import AccountContainer from 'soapbox/containers/account-container.tsx';
|
||||
import { EntityTypes, Entities } from 'soapbox/entity-store/entities.ts';
|
||||
import QuotedStatus from 'soapbox/features/status/containers/quoted-status-container.tsx';
|
||||
import { HotKeys } from 'soapbox/features/ui/components/hotkeys.tsx';
|
||||
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
||||
|
@ -29,7 +28,8 @@ import { useReplyCompose } from 'soapbox/hooks/useReplyCompose.ts';
|
|||
import { useSettings } from 'soapbox/hooks/useSettings.ts';
|
||||
import { useStatusHidden } from 'soapbox/hooks/useStatusHidden.ts';
|
||||
import { normalizeStatus } from 'soapbox/normalizers/index.ts';
|
||||
import { Status } from 'soapbox/types/entities.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
import { Status as LegacyStatus } from 'soapbox/types/entities.ts';
|
||||
import { emojifyText } from 'soapbox/utils/emojify.tsx';
|
||||
import { defaultMediaVisibility, textForScreenReader, getActualStatus } from 'soapbox/utils/status.ts';
|
||||
|
||||
|
@ -48,7 +48,7 @@ const messages = defineMessages({
|
|||
export interface IPureStatus {
|
||||
id?: string;
|
||||
avatarSize?: number;
|
||||
status: EntityTypes[Entities.STATUSES];
|
||||
status: StatusEntity;
|
||||
onClick?: () => void;
|
||||
muted?: boolean;
|
||||
hidden?: boolean;
|
||||
|
@ -126,7 +126,7 @@ const PureStatus: React.FC<IPureStatus> = (props) => {
|
|||
}
|
||||
}, [overlay.current]);
|
||||
|
||||
const statusImmutable = normalizeStatus(status) as Status; // TODO: remove this line, it will be removed once all components in this file are pure.
|
||||
const statusImmutable = normalizeStatus(status) as LegacyStatus; // TODO: remove this line, it will be removed once all components in this file are pure.
|
||||
|
||||
const handleToggleMediaVisibility = (): void => {
|
||||
setShowMedia(!showMedia);
|
||||
|
|
|
@ -5,14 +5,14 @@ import { translateStatus, undoStatusTranslation } from 'soapbox/actions/statuses
|
|||
import Button from 'soapbox/components/ui/button.tsx';
|
||||
import Stack from 'soapbox/components/ui/stack.tsx';
|
||||
import Text from 'soapbox/components/ui/text.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
||||
import { useAppSelector } from 'soapbox/hooks/useAppSelector.ts';
|
||||
import { useFeatures } from 'soapbox/hooks/useFeatures.ts';
|
||||
import { useInstance } from 'soapbox/hooks/useInstance.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
|
||||
interface IPureTranslateButton {
|
||||
status: EntityTypes[Entities.STATUSES];
|
||||
status: StatusEntity;
|
||||
}
|
||||
|
||||
const PureTranslateButton: React.FC<IPureTranslateButton> = ({ status }) => {
|
||||
|
|
|
@ -7,8 +7,8 @@ import { useHistory } from 'react-router-dom';
|
|||
import StatusMedia from 'soapbox/components/status-media.tsx';
|
||||
import Stack from 'soapbox/components/ui/stack.tsx';
|
||||
import AccountContainer from 'soapbox/containers/account-container.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import { useSettings } from 'soapbox/hooks/useSettings.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
import { defaultMediaVisibility } from 'soapbox/utils/status.ts';
|
||||
|
||||
import EventPreview from './event-preview.tsx';
|
||||
|
@ -18,7 +18,7 @@ import StatusContent from './status-content.tsx';
|
|||
import StatusReplyMentions from './status-reply-mentions.tsx';
|
||||
import SensitiveContentOverlay from './statuses/sensitive-content-overlay.tsx';
|
||||
|
||||
import type { Status as StatusEntity } from 'soapbox/types/entities.ts';
|
||||
import type { Status as LegacyStatus } from 'soapbox/types/entities.ts';
|
||||
|
||||
const messages = defineMessages({
|
||||
cancel: { id: 'reply_indicator.cancel', defaultMessage: 'Cancel' },
|
||||
|
@ -26,7 +26,7 @@ const messages = defineMessages({
|
|||
|
||||
interface IQuotedStatus {
|
||||
/** The quoted status entity. */
|
||||
status?: StatusEntity;
|
||||
status?: LegacyStatus;
|
||||
/** Callback when cancelled (during compose). */
|
||||
onCancel?: Function;
|
||||
/** Whether the status is shown in the post composer. */
|
||||
|
@ -139,7 +139,7 @@ const QuotedStatus: React.FC<IQuotedStatus> = ({ status, onCancel, compose }) =>
|
|||
|
||||
{status.media_attachments.size > 0 && (
|
||||
<StatusMedia
|
||||
status={status.toJS() as EntityTypes[Entities.STATUSES]}
|
||||
status={status.toJS() as StatusEntity}
|
||||
muted={compose}
|
||||
showMedia={showMedia}
|
||||
onToggleVisibility={handleToggleMediaVisibility}
|
||||
|
|
|
@ -49,20 +49,20 @@ import DropdownMenu from 'soapbox/components/dropdown-menu/index.ts';
|
|||
import StatusActionButton from 'soapbox/components/status-action-button.tsx';
|
||||
import StatusReactionWrapper from 'soapbox/components/status-reaction-wrapper.tsx';
|
||||
import HStack from 'soapbox/components/ui/hstack.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
||||
import { useAppSelector } from 'soapbox/hooks/useAppSelector.ts';
|
||||
import { useFeatures } from 'soapbox/hooks/useFeatures.ts';
|
||||
import { useOwnAccount } from 'soapbox/hooks/useOwnAccount.ts';
|
||||
import { useSettings } from 'soapbox/hooks/useSettings.ts';
|
||||
import { GroupRoles } from 'soapbox/schemas/group-member.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
import toast from 'soapbox/toast.tsx';
|
||||
import copy from 'soapbox/utils/copy.ts';
|
||||
|
||||
import GroupPopover from './groups/popover/group-popover.tsx';
|
||||
|
||||
import type { Menu } from 'soapbox/components/dropdown-menu/index.ts';
|
||||
import type { Group, Status } from 'soapbox/types/entities.ts';
|
||||
import type { Group, Status as LegacyStatus } from 'soapbox/types/entities.ts';
|
||||
|
||||
const messages = defineMessages({
|
||||
adminAccount: { id: 'status.admin_account', defaultMessage: 'Moderate @{name}' },
|
||||
|
@ -141,7 +141,7 @@ const messages = defineMessages({
|
|||
});
|
||||
|
||||
interface IStatusActionBar {
|
||||
status: Status;
|
||||
status: LegacyStatus;
|
||||
expandable?: boolean;
|
||||
space?: 'sm' | 'md' | 'lg';
|
||||
statusActionButtonTheme?: 'default' | 'inverse';
|
||||
|
@ -827,7 +827,7 @@ const StatusActionBar: React.FC<IStatusActionBar> = ({
|
|||
/>
|
||||
)}
|
||||
|
||||
<DropdownMenu items={menu} status={status.toJS() as EntityTypes[Entities.STATUSES]}>
|
||||
<DropdownMenu items={menu} status={status.toJS() as StatusEntity}>
|
||||
<StatusActionButton
|
||||
title={intl.formatMessage(messages.more)}
|
||||
icon={dotsIcon}
|
||||
|
|
|
@ -4,16 +4,15 @@ import { Suspense } from 'react';
|
|||
import { openModal } from 'soapbox/actions/modals.ts';
|
||||
import AttachmentThumbs from 'soapbox/components/attachment-thumbs.tsx';
|
||||
import PreviewCard from 'soapbox/components/preview-card.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import { GroupLinkPreview } from 'soapbox/features/groups/components/group-link-preview.tsx';
|
||||
import PlaceholderCard from 'soapbox/features/placeholder/components/placeholder-card.tsx';
|
||||
import { MediaGallery, Video, Audio } from 'soapbox/features/ui/util/async-components.ts';
|
||||
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
||||
import { Attachment } from 'soapbox/schemas/index.ts';
|
||||
import { Status as StatusEntity, Attachment } from 'soapbox/schemas/index.ts';
|
||||
|
||||
interface IStatusMedia {
|
||||
/** Status entity to render media for. */
|
||||
status: EntityTypes[Entities.STATUSES];
|
||||
status: StatusEntity;
|
||||
/** Whether to display compact media. */
|
||||
muted?: boolean;
|
||||
/** Callback when compact media is clicked. */
|
||||
|
|
|
@ -16,11 +16,11 @@ import Icon from 'soapbox/components/ui/icon.tsx';
|
|||
import Stack from 'soapbox/components/ui/stack.tsx';
|
||||
import Text from 'soapbox/components/ui/text.tsx';
|
||||
import AccountContainer from 'soapbox/containers/account-container.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import QuotedStatus from 'soapbox/features/status/containers/quoted-status-container.tsx';
|
||||
import { HotKeys } from 'soapbox/features/ui/components/hotkeys.tsx';
|
||||
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
||||
import { useSettings } from 'soapbox/hooks/useSettings.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
import { emojifyText } from 'soapbox/utils/emojify.tsx';
|
||||
import { defaultMediaVisibility, textForScreenReader, getActualStatus } from 'soapbox/utils/status.ts';
|
||||
|
||||
|
@ -33,7 +33,7 @@ import SensitiveContentOverlay from './statuses/sensitive-content-overlay.tsx';
|
|||
import StatusInfo from './statuses/status-info.tsx';
|
||||
import Tombstone from './tombstone.tsx';
|
||||
|
||||
import type { Status as StatusEntity } from 'soapbox/types/entities.ts';
|
||||
import type { Status as LegacyStatus } from 'soapbox/types/entities.ts';
|
||||
|
||||
// Defined in components/scrollable-list
|
||||
export type ScrollPosition = { height: number; top: number };
|
||||
|
@ -45,7 +45,7 @@ const messages = defineMessages({
|
|||
export interface IStatus {
|
||||
id?: string;
|
||||
avatarSize?: number;
|
||||
status: StatusEntity;
|
||||
status: LegacyStatus;
|
||||
onClick?: () => void;
|
||||
muted?: boolean;
|
||||
hidden?: boolean;
|
||||
|
@ -466,7 +466,7 @@ const Status: React.FC<IStatus> = (props) => {
|
|||
{(quote || actualStatus.card || actualStatus.media_attachments.size > 0) && (
|
||||
<Stack space={4}>
|
||||
<StatusMedia
|
||||
status={actualStatus.toJS() as EntityTypes[Entities.STATUSES]}
|
||||
status={actualStatus.toJS() as StatusEntity}
|
||||
muted={muted}
|
||||
onClick={handleClick}
|
||||
showMedia={showMedia}
|
||||
|
|
|
@ -13,15 +13,14 @@ import DropdownMenu from 'soapbox/components/dropdown-menu/index.ts';
|
|||
import Button from 'soapbox/components/ui/button.tsx';
|
||||
import HStack from 'soapbox/components/ui/hstack.tsx';
|
||||
import Text from 'soapbox/components/ui/text.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
||||
import { useOwnAccount } from 'soapbox/hooks/useOwnAccount.ts';
|
||||
import { useSettings } from 'soapbox/hooks/useSettings.ts';
|
||||
import { useSoapboxConfig } from 'soapbox/hooks/useSoapboxConfig.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
import { emojifyText } from 'soapbox/utils/emojify.tsx';
|
||||
import { defaultMediaVisibility } from 'soapbox/utils/status.ts';
|
||||
|
||||
|
||||
const messages = defineMessages({
|
||||
delete: { id: 'status.delete', defaultMessage: 'Delete' },
|
||||
deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
|
||||
|
@ -37,7 +36,7 @@ const messages = defineMessages({
|
|||
});
|
||||
|
||||
interface IPureSensitiveContentOverlay {
|
||||
status: EntityTypes[Entities.STATUSES];
|
||||
status: StatusEntity;
|
||||
onToggleVisibility?(): void;
|
||||
visible?: boolean;
|
||||
}
|
||||
|
|
|
@ -9,10 +9,10 @@ import StatusContent from 'soapbox/components/status-content.tsx';
|
|||
import StatusMedia from 'soapbox/components/status-media.tsx';
|
||||
import HStack from 'soapbox/components/ui/hstack.tsx';
|
||||
import Stack from 'soapbox/components/ui/stack.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
|
||||
import type { AdminReport, Status } from 'soapbox/types/entities.ts';
|
||||
import type { AdminReport, Status as LegacyStatus } from 'soapbox/types/entities.ts';
|
||||
|
||||
const messages = defineMessages({
|
||||
viewStatus: { id: 'admin.reports.actions.view_status', defaultMessage: 'View post' },
|
||||
|
@ -20,7 +20,7 @@ const messages = defineMessages({
|
|||
});
|
||||
|
||||
interface IReportStatus {
|
||||
status: Status;
|
||||
status: LegacyStatus;
|
||||
report?: AdminReport;
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ const ReportStatus: React.FC<IReportStatus> = ({ status }) => {
|
|||
<HStack space={2} alignItems='start'>
|
||||
<Stack space={2} className='overflow-hidden' grow>
|
||||
<StatusContent status={status} />
|
||||
<StatusMedia status={status.toJS() as EntityTypes[Entities.STATUSES]} />
|
||||
<StatusMedia status={status.toJS() as StatusEntity} />
|
||||
</Stack>
|
||||
|
||||
<div className='flex-none'>
|
||||
|
|
|
@ -5,12 +5,12 @@ import AttachmentThumbs from 'soapbox/components/attachment-thumbs.tsx';
|
|||
import Markup from 'soapbox/components/markup.tsx';
|
||||
import Stack from 'soapbox/components/ui/stack.tsx';
|
||||
import AccountContainer from 'soapbox/containers/account-container.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
import { getTextDirection } from 'soapbox/utils/rtl.ts';
|
||||
|
||||
interface IReplyIndicator {
|
||||
className?: string;
|
||||
status?: EntityTypes[Entities.STATUSES];
|
||||
status?: StatusEntity;
|
||||
onCancel?: () => void;
|
||||
hideActions: boolean;
|
||||
}
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
import { connect } from 'react-redux';
|
||||
|
||||
import { cancelReplyCompose } from 'soapbox/actions/compose.ts';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
import { makeGetStatus } from 'soapbox/selectors/index.ts';
|
||||
|
||||
import ReplyIndicator from '../components/reply-indicator.tsx';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
import type { Status } from 'soapbox/types/entities.ts';
|
||||
import type { Status as LegacyStatus } from 'soapbox/types/entities.ts';
|
||||
|
||||
|
||||
const makeMapStateToProps = () => {
|
||||
const getStatus = makeGetStatus();
|
||||
|
@ -17,7 +18,7 @@ const makeMapStateToProps = () => {
|
|||
const editing = !!state.compose.get(composeId)?.id;
|
||||
|
||||
return {
|
||||
status: (getStatus(state, { id: statusId }) as Status)?.toJS() as EntityTypes[Entities.STATUSES],
|
||||
status: (getStatus(state, { id: statusId }) as LegacyStatus)?.toJS() as StatusEntity,
|
||||
hideActions: editing,
|
||||
};
|
||||
};
|
||||
|
|
|
@ -5,9 +5,9 @@ import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|||
import { joinEvent, leaveEvent } from 'soapbox/actions/events.ts';
|
||||
import { openModal } from 'soapbox/actions/modals.ts';
|
||||
import Button from 'soapbox/components/ui/button.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
||||
import { useAppSelector } from 'soapbox/hooks/useAppSelector.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
|
||||
import type { ButtonThemes } from 'soapbox/components/ui/useButtonStyles.ts';
|
||||
|
||||
|
@ -17,7 +17,7 @@ const messages = defineMessages({
|
|||
});
|
||||
|
||||
interface IPureEventAction {
|
||||
status: EntityTypes[Entities.STATUSES];
|
||||
status: StatusEntity;
|
||||
theme?: ButtonThemes;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,11 +3,10 @@ import { FormattedDate } from 'react-intl';
|
|||
|
||||
import Icon from 'soapbox/components/icon.tsx';
|
||||
import HStack from 'soapbox/components/ui/hstack.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
|
||||
interface IPureEventDate {
|
||||
status: EntityTypes[Entities.STATUSES];
|
||||
status: StatusEntity;
|
||||
}
|
||||
|
||||
const PureEventDate: React.FC<IPureEventDate> = ({ status }) => {
|
||||
|
|
|
@ -15,16 +15,16 @@ import HStack from 'soapbox/components/ui/hstack.tsx';
|
|||
import Icon from 'soapbox/components/ui/icon.tsx';
|
||||
import Stack from 'soapbox/components/ui/stack.tsx';
|
||||
import Text from 'soapbox/components/ui/text.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import QuotedStatus from 'soapbox/features/status/containers/quoted-status-container.tsx';
|
||||
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
||||
import { useAppSelector } from 'soapbox/hooks/useAppSelector.ts';
|
||||
import { useSettings } from 'soapbox/hooks/useSettings.ts';
|
||||
import { useSoapboxConfig } from 'soapbox/hooks/useSoapboxConfig.ts';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
import { makeGetStatus } from 'soapbox/selectors/index.ts';
|
||||
import { defaultMediaVisibility } from 'soapbox/utils/status.ts';
|
||||
|
||||
import type { Status as StatusEntity } from 'soapbox/types/entities.ts';
|
||||
import type { Status as StatusLegacy } from 'soapbox/types/entities.ts';
|
||||
|
||||
type RouteParams = { statusId: string };
|
||||
|
||||
|
@ -36,7 +36,7 @@ const EventInformation: React.FC<IEventInformation> = ({ params }) => {
|
|||
const dispatch = useAppDispatch();
|
||||
const getStatus = useCallback(makeGetStatus(), []);
|
||||
|
||||
const status = useAppSelector(state => getStatus(state, { id: params.statusId })) as StatusEntity;
|
||||
const status = useAppSelector(state => getStatus(state, { id: params.statusId })) as StatusLegacy;
|
||||
|
||||
const { tileServer } = useSoapboxConfig();
|
||||
const { displayMedia } = useSettings();
|
||||
|
@ -209,7 +209,7 @@ const EventInformation: React.FC<IEventInformation> = ({ params }) => {
|
|||
)}
|
||||
|
||||
<StatusMedia
|
||||
status={status.toJS() as EntityTypes[Entities.STATUSES]}
|
||||
status={status.toJS() as StatusEntity}
|
||||
showMedia={showMedia}
|
||||
onToggleVisibility={handleToggleMediaVisibility}
|
||||
/>
|
||||
|
|
|
@ -16,19 +16,19 @@ import HStack from 'soapbox/components/ui/hstack.tsx';
|
|||
import Icon from 'soapbox/components/ui/icon.tsx';
|
||||
import Stack from 'soapbox/components/ui/stack.tsx';
|
||||
import Text from 'soapbox/components/ui/text.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import QuotedStatus from 'soapbox/features/status/containers/quoted-status-container.tsx';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
import { getActualStatus } from 'soapbox/utils/status.ts';
|
||||
|
||||
import StatusInteractionBar from './status-interaction-bar.tsx';
|
||||
|
||||
import type { Group, Status as StatusEntity } from 'soapbox/types/entities.ts';
|
||||
import type { Group, Status as LegacyStatus } from 'soapbox/types/entities.ts';
|
||||
|
||||
interface IDetailedStatus {
|
||||
status: StatusEntity;
|
||||
status: LegacyStatus;
|
||||
showMedia?: boolean;
|
||||
withMedia?: boolean;
|
||||
onOpenCompareHistoryModal: (status: StatusEntity) => void;
|
||||
onOpenCompareHistoryModal: (status: LegacyStatus) => void;
|
||||
onToggleMediaVisibility: () => void;
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ const DetailedStatus: React.FC<IDetailedStatus> = ({
|
|||
{(withMedia && (quote || actualStatus.card || actualStatus.media_attachments.size > 0)) && (
|
||||
<Stack space={4}>
|
||||
<StatusMedia
|
||||
status={actualStatus.toJS() as EntityTypes[Entities.STATUSES]}
|
||||
status={actualStatus.toJS() as StatusEntity}
|
||||
showMedia={showMedia}
|
||||
onToggleVisibility={onToggleMediaVisibility}
|
||||
/>
|
||||
|
|
|
@ -4,15 +4,15 @@ import { spring } from 'react-motion';
|
|||
|
||||
import HStack from 'soapbox/components/ui/hstack.tsx';
|
||||
import SvgIcon from 'soapbox/components/ui/svg-icon.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import ReplyIndicator from 'soapbox/features/compose/components/reply-indicator.tsx';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
|
||||
import Motion from '../../util/optional-motion.tsx';
|
||||
|
||||
import type { Menu, MenuItem } from 'soapbox/components/dropdown-menu/index.ts';
|
||||
|
||||
interface IActionsModal {
|
||||
status: EntityTypes[Entities.STATUSES];
|
||||
status: StatusEntity;
|
||||
actions: Menu;
|
||||
onClick: () => void;
|
||||
onClose: () => void;
|
||||
|
|
|
@ -5,10 +5,10 @@ import Icon from 'soapbox/components/icon.tsx';
|
|||
import Modal from 'soapbox/components/ui/modal.tsx';
|
||||
import Stack from 'soapbox/components/ui/stack.tsx';
|
||||
import Text from 'soapbox/components/ui/text.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import ReplyIndicator from 'soapbox/features/compose/components/reply-indicator.tsx';
|
||||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
|
||||
import type { Status as StatusEntity } from 'soapbox/types/entities.ts';
|
||||
import type { Status as LegacyStatus } from 'soapbox/types/entities.ts';
|
||||
|
||||
const messages = defineMessages({
|
||||
cancel_reblog: { id: 'status.cancel_reblog_private', defaultMessage: 'Un-repost' },
|
||||
|
@ -16,8 +16,8 @@ const messages = defineMessages({
|
|||
});
|
||||
|
||||
interface IBoostModal {
|
||||
status: StatusEntity;
|
||||
onReblog: (status: StatusEntity) => void;
|
||||
status: LegacyStatus;
|
||||
onReblog: (status: LegacyStatus) => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ const BoostModal: React.FC<IBoostModal> = ({ status, onReblog, onClose }) => {
|
|||
confirmationText={intl.formatMessage(buttonText)}
|
||||
>
|
||||
<Stack space={4}>
|
||||
<ReplyIndicator status={status.toJS() as EntityTypes[Entities.STATUSES]} hideActions />
|
||||
<ReplyIndicator status={status.toJS() as StatusEntity} hideActions />
|
||||
|
||||
<Text>
|
||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||
|
|
|
@ -19,7 +19,6 @@ import HStack from 'soapbox/components/ui/hstack.tsx';
|
|||
import IconButton from 'soapbox/components/ui/icon-button.tsx';
|
||||
import Icon from 'soapbox/components/ui/icon.tsx';
|
||||
import Stack from 'soapbox/components/ui/stack.tsx';
|
||||
import { Entities, EntityTypes } from 'soapbox/entity-store/entities.ts';
|
||||
import Audio from 'soapbox/features/audio/index.tsx';
|
||||
import PlaceholderStatus from 'soapbox/features/placeholder/components/placeholder-status.tsx';
|
||||
import Thread from 'soapbox/features/status/components/thread.tsx';
|
||||
|
@ -27,8 +26,8 @@ import Video from 'soapbox/features/video/index.tsx';
|
|||
import { useAppDispatch } from 'soapbox/hooks/useAppDispatch.ts';
|
||||
import { userTouching } from 'soapbox/is-mobile.ts';
|
||||
import { normalizeStatus } from 'soapbox/normalizers/index.ts';
|
||||
import { Attachment } from 'soapbox/schemas/index.ts';
|
||||
import { Status } from 'soapbox/types/entities.ts';
|
||||
import { Status as StatusEntity, Attachment } from 'soapbox/schemas/index.ts';
|
||||
import { Status as LegacyStatus } from 'soapbox/types/entities.ts';
|
||||
import { getActualStatus } from 'soapbox/utils/status.ts';
|
||||
|
||||
import ImageLoader from '../image-loader.tsx';
|
||||
|
@ -56,7 +55,7 @@ const containerStyle: React.CSSProperties = {
|
|||
|
||||
interface IMediaModal {
|
||||
media: readonly Attachment[];
|
||||
status?: EntityTypes[Entities.STATUSES];
|
||||
status?: StatusEntity;
|
||||
index: number;
|
||||
time?: number;
|
||||
onClose(): void;
|
||||
|
@ -343,7 +342,7 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
|
|||
className={clsx('absolute bottom-2 flex w-full transition-opacity', navigationHiddenClassName)}
|
||||
>
|
||||
<StatusActionBar
|
||||
status={normalizeStatus(actualStatus) as Status}
|
||||
status={normalizeStatus(actualStatus) as LegacyStatus}
|
||||
space='md'
|
||||
statusActionButtonTheme='inverse'
|
||||
/>
|
||||
|
@ -361,7 +360,7 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
|
|||
}
|
||||
>
|
||||
<Thread
|
||||
status={normalizeStatus(actualStatus) as Status}
|
||||
status={normalizeStatus(actualStatus) as LegacyStatus}
|
||||
withMedia={false}
|
||||
useWindowScroll={false}
|
||||
itemClassName='px-4'
|
||||
|
|
Loading…
Reference in New Issue