From 36bbef229366af7c5c14fccd3e5c2c8b8ee52404 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 22 May 2023 11:47:49 -0500 Subject: [PATCH] Support quoted tombstone --- app/soapbox/components/tombstone.tsx | 8 ++++---- .../status/containers/quoted-status-container.tsx | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/soapbox/components/tombstone.tsx b/app/soapbox/components/tombstone.tsx index b92fb7e70f..62e7c72d25 100644 --- a/app/soapbox/components/tombstone.tsx +++ b/app/soapbox/components/tombstone.tsx @@ -6,15 +6,15 @@ import { Text } from 'soapbox/components/ui'; interface ITombstone { id: string - onMoveUp: (statusId: string) => void - onMoveDown: (statusId: string) => void + onMoveUp?: (statusId: string) => void + onMoveDown?: (statusId: string) => void } /** Represents a deleted item. */ const Tombstone: React.FC = ({ id, onMoveUp, onMoveDown }) => { const handlers = { - moveUp: () => onMoveUp(id), - moveDown: () => onMoveDown(id), + moveUp: () => onMoveUp?.(id), + moveDown: () => onMoveDown?.(id), }; return ( diff --git a/app/soapbox/features/status/containers/quoted-status-container.tsx b/app/soapbox/features/status/containers/quoted-status-container.tsx index fa60f65c44..58d4dbd68a 100644 --- a/app/soapbox/features/status/containers/quoted-status-container.tsx +++ b/app/soapbox/features/status/containers/quoted-status-container.tsx @@ -1,6 +1,7 @@ import React, { useCallback } from 'react'; import QuotedStatus from 'soapbox/components/quoted-status'; +import Tombstone from 'soapbox/components/tombstone'; import { useAppSelector } from 'soapbox/hooks'; import { makeGetStatus } from 'soapbox/selectors'; @@ -18,6 +19,10 @@ const QuotedStatusContainer: React.FC = ({ statusId }) = return null; } + if (status.tombstone) { + return ; + } + return (