mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-18 08:12:01 +03:00
Make filtered status work for boosts too
This commit is contained in:
parent
f5646fe8a8
commit
35a8641f16
1 changed files with 19 additions and 3 deletions
|
@ -1728,10 +1728,12 @@ function FilteredStatus({ status, filterInfo, instance, containerProps = {} }) {
|
||||||
account: { avatar, avatarStatic },
|
account: { avatar, avatarStatic },
|
||||||
createdAt,
|
createdAt,
|
||||||
visibility,
|
visibility,
|
||||||
|
reblog,
|
||||||
} = status;
|
} = status;
|
||||||
|
const isReblog = !!reblog;
|
||||||
const filterTitleStr = filterInfo?.titlesStr || '';
|
const filterTitleStr = filterInfo?.titlesStr || '';
|
||||||
const createdAtDate = new Date(createdAt);
|
const createdAtDate = new Date(createdAt);
|
||||||
const statusPeekText = statusPeek(status);
|
const statusPeekText = statusPeek(status.reblog || status);
|
||||||
|
|
||||||
const [showPeek, setShowPeek] = useState(false);
|
const [showPeek, setShowPeek] = useState(false);
|
||||||
const bindLongPress = useLongPress(
|
const bindLongPress = useLongPress(
|
||||||
|
@ -1747,6 +1749,7 @@ function FilteredStatus({ status, filterInfo, instance, containerProps = {} }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
class={isReblog ? 'status-reblog' : ''}
|
||||||
{...containerProps}
|
{...containerProps}
|
||||||
title={statusPeekText}
|
title={statusPeekText}
|
||||||
onContextMenu={(e) => {
|
onContextMenu={(e) => {
|
||||||
|
@ -1776,9 +1779,22 @@ function FilteredStatus({ status, filterInfo, instance, containerProps = {} }) {
|
||||||
alt={visibilityText[visibility]}
|
alt={visibilityText[visibility]}
|
||||||
size="s"
|
size="s"
|
||||||
/>{' '}
|
/>{' '}
|
||||||
|
{isReblog ? (
|
||||||
|
'boosted'
|
||||||
|
) : (
|
||||||
<RelativeTime datetime={createdAtDate} format="micro" />
|
<RelativeTime datetime={createdAtDate} format="micro" />
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
<span class="status-filtered-info-2">
|
||||||
|
{isReblog && (
|
||||||
|
<>
|
||||||
|
<Avatar
|
||||||
|
url={reblog.account.avatarStatic || reblog.account.avatar}
|
||||||
|
/>{' '}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
{statusPeekText}
|
||||||
</span>
|
</span>
|
||||||
<span class="status-filtered-info-2">{statusPeekText}</span>
|
|
||||||
</span>
|
</span>
|
||||||
</article>
|
</article>
|
||||||
{!!showPeek && (
|
{!!showPeek && (
|
||||||
|
|
Loading…
Add table
Reference in a new issue