fix(js): fixes #4452 action buttons not showing externally while mobile (#4547)

This commit is contained in:
Gabe Kangas
2025-09-14 14:28:57 -07:00
committed by GitHub
parent c12ef0ec57
commit 8568f43310
4 changed files with 33 additions and 13 deletions
@@ -3,7 +3,7 @@ import { Button, Dropdown } from 'antd';
import classNames from 'classnames';
import dynamic from 'next/dynamic';
import styles from './ActionButtonMenu.module.scss';
import { ExternalAction } from '../../../interfaces/external-action';
import { ExternalAction, ExternalActionUtils } from '../../../interfaces/external-action';
// Lazy loaded components
@@ -50,12 +50,15 @@ export const ActionButtonMenu: FC<ActionButtonMenuProps> = ({
followItemSelected();
return;
}
const action = actions.find(x => x.url === a.key);
externalActionSelected(action);
// Find the action using the utility function
const action = ExternalActionUtils.findByKey(actions, a.key);
if (action) {
externalActionSelected(action);
}
};
const items = actions.map(action => ({
key: action.url,
key: ExternalActionUtils.generateKey(action),
label: (
<span className={styles.item}>
{action.icon && <img className={styles.icon} src={action.icon} alt={action.title} />}{' '}