[Glitch] Fix missing icons and subtitle in mobile boost/quote menu

Port a5fbe2f5c1 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
diondiondion
2025-09-08 10:50:46 +02:00
committed by Claire
parent 28d479ceb3
commit 8ce1c8ab7c
11 changed files with 498 additions and 470 deletions

View File

@@ -1,6 +1,7 @@
import classNames from 'classnames';
import { Link } from 'react-router-dom';
import { DropdownMenuItemContent } from 'flavours/glitch/components/dropdown_menu';
import type { MenuItem } from 'flavours/glitch/models/dropdown_menu';
import {
isActionItem,
@@ -18,14 +19,14 @@ export const ActionsModal: React.FC<{
return <li key={`sep-${i}`} className='dropdown-menu__separator' />;
}
const { text, dangerous } = option;
const { text, highlighted, disabled, dangerous } = option;
let element: React.ReactElement;
if (isActionItem(option)) {
element = (
<button onClick={onClick} data-index={i}>
{text}
<button onClick={onClick} data-index={i} disabled={disabled}>
<DropdownMenuItemContent item={option} />
</button>
);
} else if (isExternalLinkItem(option)) {
@@ -38,21 +39,22 @@ export const ActionsModal: React.FC<{
onClick={onClick}
data-index={i}
>
{text}
<DropdownMenuItemContent item={option} />
</a>
);
} else {
element = (
<Link to={option.to} onClick={onClick} data-index={i}>
{text}
<DropdownMenuItemContent item={option} />
</Link>
);
}
return (
<li
className={classNames({
className={classNames('dropdown-menu__item', {
'dropdown-menu__item--dangerous': dangerous,
'dropdown-menu__item--highlighted': highlighted,
})}
key={`${text}-${i}`}
>