Support quoted tombstone
This commit is contained in:
parent
8f8dd689a3
commit
36bbef2293
2 changed files with 9 additions and 4 deletions
|
@ -6,15 +6,15 @@ import { Text } from 'soapbox/components/ui';
|
||||||
|
|
||||||
interface ITombstone {
|
interface ITombstone {
|
||||||
id: string
|
id: string
|
||||||
onMoveUp: (statusId: string) => void
|
onMoveUp?: (statusId: string) => void
|
||||||
onMoveDown: (statusId: string) => void
|
onMoveDown?: (statusId: string) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Represents a deleted item. */
|
/** Represents a deleted item. */
|
||||||
const Tombstone: React.FC<ITombstone> = ({ id, onMoveUp, onMoveDown }) => {
|
const Tombstone: React.FC<ITombstone> = ({ id, onMoveUp, onMoveDown }) => {
|
||||||
const handlers = {
|
const handlers = {
|
||||||
moveUp: () => onMoveUp(id),
|
moveUp: () => onMoveUp?.(id),
|
||||||
moveDown: () => onMoveDown(id),
|
moveDown: () => onMoveDown?.(id),
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
|
|
||||||
import QuotedStatus from 'soapbox/components/quoted-status';
|
import QuotedStatus from 'soapbox/components/quoted-status';
|
||||||
|
import Tombstone from 'soapbox/components/tombstone';
|
||||||
import { useAppSelector } from 'soapbox/hooks';
|
import { useAppSelector } from 'soapbox/hooks';
|
||||||
import { makeGetStatus } from 'soapbox/selectors';
|
import { makeGetStatus } from 'soapbox/selectors';
|
||||||
|
|
||||||
|
@ -18,6 +19,10 @@ const QuotedStatusContainer: React.FC<IQuotedStatusContainer> = ({ statusId }) =
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (status.tombstone) {
|
||||||
|
return <Tombstone id={status.id} />;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<QuotedStatus
|
<QuotedStatus
|
||||||
status={status}
|
status={status}
|
||||||
|
|
Loading…
Reference in a new issue