Media Viewer: Fix "Forward" button display (#3370)

This commit is contained in:
Alexander Zinchuk 2023-06-18 12:04:06 +02:00
parent 6e35e9c987
commit 9108a030a0

View File

@ -201,7 +201,7 @@ const MediaViewerActions: FC<OwnProps & StateProps> = ({
if (isMobile) { if (isMobile) {
const menuItems: MenuItemProps[] = []; const menuItems: MenuItemProps[] = [];
if (!message?.isForwardingAllowed && !isChatProtected) { if (message?.isForwardingAllowed && !isChatProtected) {
menuItems.push({ menuItems.push({
icon: 'forward', icon: 'forward',
onClick: onForward, onClick: onForward,
@ -227,7 +227,7 @@ const MediaViewerActions: FC<OwnProps & StateProps> = ({
if (canReport) { if (canReport) {
menuItems.push({ menuItems.push({
icon: 'report', icon: 'flag',
onClick: onReport, onClick: onReport,
children: lang('ReportPeer.Report'), children: lang('ReportPeer.Report'),
}); });
@ -246,6 +246,7 @@ const MediaViewerActions: FC<OwnProps & StateProps> = ({
icon: 'delete', icon: 'delete',
onClick: openDeleteModal, onClick: openDeleteModal,
children: lang('Delete'), children: lang('Delete'),
destructive: true,
}); });
} }
@ -260,7 +261,7 @@ const MediaViewerActions: FC<OwnProps & StateProps> = ({
positionX="right" positionX="right"
> >
{menuItems.map(({ {menuItems.map(({
icon, onClick, href, download, children, icon, onClick, href, download, children, destructive,
}) => ( }) => (
<MenuItem <MenuItem
key={icon} key={icon}
@ -268,6 +269,7 @@ const MediaViewerActions: FC<OwnProps & StateProps> = ({
href={href} href={href}
download={download} download={download}
onClick={onClick} onClick={onClick}
destructive={destructive}
> >
{children} {children}
</MenuItem> </MenuItem>