mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-24 02:05:39 +03:00
Don't show byline if card posted by author themselves
This commit is contained in:
parent
bbe276e18c
commit
fd5e574e70
2 changed files with 11 additions and 5 deletions
|
@ -1991,9 +1991,11 @@ a.card:is(:hover, :focus):visited {
|
|||
flex-direction: column-reverse;
|
||||
}
|
||||
.card-byline-author {
|
||||
display: inline-block;
|
||||
display: inline-flex;
|
||||
gap: 4px;
|
||||
color: var(--text-insignificant-color);
|
||||
padding: 0 8px;
|
||||
padding: 2px 8px;
|
||||
align-items: center;
|
||||
|
||||
.avatar {
|
||||
width: 16px !important;
|
||||
|
|
|
@ -2152,6 +2152,9 @@ function Status({
|
|||
selfReferential={
|
||||
card?.url === status.url || card?.url === status.uri
|
||||
}
|
||||
selfAuthor={card?.authors?.some(
|
||||
(a) => a.account?.url === accountURL,
|
||||
)}
|
||||
instance={currentInstance}
|
||||
/>
|
||||
)}
|
||||
|
@ -2564,7 +2567,8 @@ function isCardPost(domain) {
|
|||
return ['x.com', 'twitter.com', 'threads.net', 'bsky.app'].includes(domain);
|
||||
}
|
||||
|
||||
function Byline({ authors, children }) {
|
||||
function Byline({ authors, hidden, children }) {
|
||||
if (hidden) return children;
|
||||
if (!authors?.[0]?.account?.id) return children;
|
||||
const author = authors[0].account;
|
||||
|
||||
|
@ -2583,7 +2587,7 @@ function Byline({ authors, children }) {
|
|||
);
|
||||
}
|
||||
|
||||
function Card({ card, selfReferential, instance }) {
|
||||
function Card({ card, selfReferential, selfAuthor, instance }) {
|
||||
const snapStates = useSnapshot(states);
|
||||
const {
|
||||
blurhash,
|
||||
|
@ -2697,7 +2701,7 @@ function Card({ card, selfReferential, instance }) {
|
|||
const isPost = isCardPost(domain);
|
||||
|
||||
return (
|
||||
<Byline authors={authors}>
|
||||
<Byline hidden={!!selfAuthor} authors={authors}>
|
||||
<a
|
||||
href={cardStatusURL || url}
|
||||
target={cardStatusURL ? null : '_blank'}
|
||||
|
|
Loading…
Reference in a new issue