Skip to content

Commit b484708

Browse files
authored
feat: make dropdown scroll visible in safari and move report (#5134)
1 parent d73091e commit b484708

3 files changed

Lines changed: 23 additions & 18 deletions

File tree

packages/shared/src/components/dropdown/DropdownMenu.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ export const DropdownMenuContent = React.forwardRef<
111111
className={classNames('DropdownMenuContent overflow-hidden', className)}
112112
align={align}
113113
>
114-
<div className="max-h-72 overflow-y-auto bg-inherit">{children}</div>
114+
<div className="DropdownMenuScrollable max-h-72 overflow-y-auto bg-inherit">
115+
{children}
116+
</div>
115117
</DropdownMenuContentRoot>
116118
</DropdownMenuPortal>
117119
);

packages/shared/src/components/dropdown/style.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,8 @@
9696
}
9797
}
9898

99-
99+
/* Force scrollbar to always be visible (especially for Safari) */
100+
.DropdownMenuScrollable {
101+
scrollbar-width: thin;
102+
scrollbar-color: var(--theme-text-tertiary) transparent;
103+
}

packages/shared/src/features/posts/PostOptionButton.tsx

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,21 @@ const PostOptionButtonContent = ({
444444
label: 'Hide',
445445
action: onHidePost,
446446
},
447+
!isBriefPost && {
448+
icon: <MenuIcon Icon={FlagIcon} />,
449+
label: 'Report',
450+
action: async () =>
451+
openModal({
452+
type: LazyModal.ReportPost,
453+
props: {
454+
index: postIndex,
455+
post,
456+
onReported: onReportedPost,
457+
origin: Origin.PostContextMenu,
458+
isAd: !!boostedBy,
459+
},
460+
}),
461+
},
447462
isBriefPost && {
448463
icon: <MenuIcon Icon={SettingsIcon} />,
449464
label: 'Settings',
@@ -743,22 +758,6 @@ const PostOptionButtonContent = ({
743758
}
744759
});
745760

746-
postOptions.push({
747-
icon: <MenuIcon Icon={FlagIcon} />,
748-
label: 'Report',
749-
action: async () =>
750-
openModal({
751-
type: LazyModal.ReportPost,
752-
props: {
753-
index: postIndex,
754-
post,
755-
onReported: onReportedPost,
756-
origin: Origin.PostContextMenu,
757-
isAd: !!boostedBy,
758-
},
759-
}),
760-
});
761-
762761
if (
763762
post.type !== PostType.Poll &&
764763
user?.id &&

0 commit comments

Comments
 (0)