Skip to content

Commit

Permalink
Hide "more" icon for posts in notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Jan 11, 2024
1 parent 07f927d commit 4b9ff0c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
21 changes: 18 additions & 3 deletions src/components/notification.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,12 @@ function Notification({
instance ? `/${instance}/s/${status.id}` : `/s/${status.id}`
}
>
<Status status={status} size="s" />
<Status
status={status}
size="s"
previewMode
allowContextMenu
/>
</TruncatedLink>
</li>
))}
Expand Down Expand Up @@ -326,9 +331,19 @@ function Notification({
}
>
{isStatic ? (
<Status status={actualStatus} size="s" />
<Status
status={actualStatus}
size="s"
previewMode
allowContextMenu
/>
) : (
<Status statusID={actualStatusID} size="s" />
<Status
statusID={actualStatusID}
size="s"
previewMode
allowContextMenu
/>
)}
</TruncatedLink>
)}
Expand Down
6 changes: 4 additions & 2 deletions src/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ function Status({
quoted,
onStatusLinkClick = () => {},
showFollowedTags,
allowContextMenu,
}) {
if (skeleton) {
return (
Expand Down Expand Up @@ -987,7 +988,8 @@ function Status({
const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);
const [contextMenuProps, setContextMenuProps] = useState({});

const showContextMenu = !isSizeLarge && !previewMode && !_deleted && !quoted;
const showContextMenu =
allowContextMenu || (!isSizeLarge && !previewMode && !_deleted && !quoted);

// Only iOS/iPadOS browsers don't support contextmenu
// Some comments report iPadOS might support contextmenu if a mouse is connected
Expand Down Expand Up @@ -1412,7 +1414,7 @@ function Status({
/>
)}{' '}
<RelativeTime datetime={createdAtDate} format="micro" />
{showContextMenu && <Icon icon="more2" class="more" />}
{!previewMode && <Icon icon="more2" class="more" />}
</Link>
) : (
// <Menu
Expand Down

0 comments on commit 4b9ff0c

Please sign in to comment.