diff --git a/app/soapbox/components/status.tsx b/app/soapbox/components/status.tsx index 37cf7a24b..020b0756a 100644 --- a/app/soapbox/components/status.tsx +++ b/app/soapbox/components/status.tsx @@ -47,6 +47,7 @@ export interface IStatus { featured?: boolean, hideActionBar?: boolean, hoverable?: boolean, + withDismiss?: boolean, } const Status: React.FC = (props) => { @@ -63,6 +64,7 @@ const Status: React.FC = (props) => { unread, group, hideActionBar, + withDismiss, } = props; const intl = useIntl(); const history = useHistory(); @@ -179,7 +181,7 @@ const Status: React.FC = (props) => { }; if (!status) return null; - let prepend, rebloggedByText, reblogElement, reblogElementMobile; + let rebloggedByText, reblogElement, reblogElementMobile; if (hidden) { return ( @@ -205,20 +207,6 @@ const Status: React.FC = (props) => { ); } - if (featured) { - prepend = ( -
- - - - - - - -
- ); - } - if (status.reblog && typeof status.reblog === 'object') { const displayNameHtml = { __html: String(status.getIn(['account', 'display_name_html'])) }; @@ -316,7 +304,17 @@ const Status: React.FC = (props) => { onClick={() => history.push(statusUrl)} role='link' > - {prepend} + {featured && ( +
+ + + + + + + +
+ )}
= (props) => { {!hideActionBar && (
- +
)}
diff --git a/app/soapbox/components/status_list.tsx b/app/soapbox/components/status_list.tsx index db9695b87..c45216e03 100644 --- a/app/soapbox/components/status_list.tsx +++ b/app/soapbox/components/status_list.tsx @@ -122,7 +122,6 @@ const StatusList: React.FC = ({ const renderStatus = (statusId: string) => { return ( - // @ts-ignore = ({ if (!featuredStatusIds) return []; return featuredStatusIds.toArray().map(statusId => ( - // @ts-ignore { +interface IStatusContainer extends Omit { id: string, /** @deprecated Unused. */ contextType?: any, /** @deprecated Unused. */ otherAccounts?: any, /** @deprecated Unused. */ - withDismiss?: any, - /** @deprecated Unused. */ getScrollPosition?: any, /** @deprecated Unused. */ updateScrollBottom?: any, @@ -24,11 +22,12 @@ const getStatus = makeGetStatus(); * Legacy Status wrapper accepting a status ID instead of the full entity. * @deprecated Use the Status component directly. */ -const StatusContainer: React.FC = ({ id, onMoveUp, onMoveDown }) => { +const StatusContainer: React.FC = (props) => { + const { id, ...rest } = props; const status = useAppSelector(state => getStatus(state, { id })); if (status) { - return ; + return ; } else { return null; } diff --git a/app/soapbox/features/notifications/components/notification.tsx b/app/soapbox/features/notifications/components/notification.tsx index cbf67c4dd..b7e528ef5 100644 --- a/app/soapbox/features/notifications/components/notification.tsx +++ b/app/soapbox/features/notifications/components/notification.tsx @@ -18,7 +18,7 @@ import { makeGetNotification } from 'soapbox/selectors'; import { NotificationType, validType } from 'soapbox/utils/notification'; import type { ScrollPosition } from 'soapbox/components/status'; -import type { Account, Status, Notification as NotificationEntity } from 'soapbox/types/entities'; +import type { Account, Status as StatusEntity, Notification as NotificationEntity } from 'soapbox/types/entities'; const getNotification = makeGetNotification(); @@ -143,7 +143,7 @@ interface INotificaton { notification: NotificationEntity, onMoveUp?: (notificationId: string) => void, onMoveDown?: (notificationId: string) => void, - onReblog?: (status: Status, e?: KeyboardEvent) => void, + onReblog?: (status: StatusEntity, e?: KeyboardEvent) => void, getScrollPosition?: () => ScrollPosition | undefined, updateScrollBottom?: (bottom: number) => void, } @@ -216,7 +216,7 @@ const Notification: React.FC = (props) => { if (e?.shiftKey || !boostModal) { dispatch(reblog(status)); } else { - dispatch(openModal('BOOST', { status, onReblog: (status: Status) => { + dispatch(openModal('BOOST', { status, onReblog: (status: StatusEntity) => { dispatch(reblog(status)); } })); } @@ -303,16 +303,12 @@ const Notification: React.FC = (props) => { case 'update': case 'pleroma:emoji_reaction': return status && typeof status === 'object' ? ( - // @ts-ignore