pl-fe: add alternative tombstone label

Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
mkljczk 2024-12-05 14:27:00 +01:00
parent 9bb2a3a3fe
commit 81c2abb276
5 changed files with 9 additions and 17 deletions

View file

@ -299,11 +299,7 @@ const Status: React.FC<IStatus> = (props) => {
if (!status) return null; if (!status) return null;
if (status.deleted) return ( if (status.deleted) return (
<Tombstone <Tombstone id={status.id} onMoveUp={onMoveUp} onMoveDown={onMoveDown} deleted />
id={status.id}
onMoveUp={onMoveUp}
onMoveDown={onMoveDown}
/>
); );
if (filtered && status.showFiltered !== false) { if (filtered && status.showFiltered !== false) {

View file

@ -8,10 +8,11 @@ interface ITombstone {
id: string; id: string;
onMoveUp?: (statusId: string) => void; onMoveUp?: (statusId: string) => void;
onMoveDown?: (statusId: string) => void; onMoveDown?: (statusId: string) => void;
deleted?: boolean;
} }
/** Represents a deleted item. */ /** Represents a deleted item. */
const Tombstone: React.FC<ITombstone> = ({ id, onMoveUp, onMoveDown }) => { const Tombstone: React.FC<ITombstone> = ({ id, onMoveUp, onMoveDown, deleted }) => {
const handlers = { const handlers = {
moveUp: () => onMoveUp?.(id), moveUp: () => onMoveUp?.(id),
moveDown: () => onMoveDown?.(id), moveDown: () => onMoveDown?.(id),
@ -25,10 +26,9 @@ const Tombstone: React.FC<ITombstone> = ({ id, onMoveUp, onMoveDown }) => {
tabIndex={0} tabIndex={0}
> >
<Text theme='muted'> <Text theme='muted'>
<FormattedMessage {deleted
id='statuses.tombstone' ? <FormattedMessage id='statuses.tombstone.deleted' defaultMessage='The post is deleted.' />
defaultMessage='One or more posts are unavailable.' : <FormattedMessage id='statuses.tombstone' defaultMessage='One or more posts are unavailable.' />}
/>
</Text> </Text>
</div> </div>
</div> </div>

View file

@ -26,12 +26,7 @@ const ThreadStatus: React.FC<IThreadStatus> = (props): JSX.Element => {
if (isDeleted) { if (isDeleted) {
return ( return (
<div className='py-4 pb-8'> <div className='py-4 pb-8'>
<Tombstone <Tombstone id={id} onMoveUp={props.onMoveUp} onMoveDown={props.onMoveDown} deleted />
key={id}
id={id}
onMoveUp={props.onMoveUp}
onMoveDown={props.onMoveDown}
/>
</div> </div>
); );
} }

View file

@ -329,7 +329,7 @@ const Thread: React.FC<IThread> = ({
const focusedStatus = ( const focusedStatus = (
<div className={clsx({ 'pb-4': hasDescendants })} key={status.id}> <div className={clsx({ 'pb-4': hasDescendants })} key={status.id}>
{status.deleted ? ( {status.deleted ? (
<Tombstone id={status.id} onMoveUp={handleMoveUp} onMoveDown={handleMoveDown} /> <Tombstone id={status.id} onMoveUp={handleMoveUp} onMoveDown={handleMoveDown} deleted />
) : ( ) : (
<HotKeys handlers={handlers}> <HotKeys handlers={handlers}>
<div <div

View file

@ -1543,6 +1543,7 @@
"status_list.queue_label": "Click to see {count} new {count, plural, one {post} other {posts}}", "status_list.queue_label": "Click to see {count} new {count, plural, one {post} other {posts}}",
"statuses.quote_tombstone": "Post is unavailable.", "statuses.quote_tombstone": "Post is unavailable.",
"statuses.tombstone": "One or more posts are unavailable.", "statuses.tombstone": "One or more posts are unavailable.",
"statuses.tombstone.deleted": "The post is deleted.",
"streamfield.add": "Add", "streamfield.add": "Add",
"streamfield.remove": "Remove", "streamfield.remove": "Remove",
"suggestions.dismiss": "Dismiss suggestion", "suggestions.dismiss": "Dismiss suggestion",