feat(web): add ability to not be able to close menu

This commit is contained in:
Luke
2022-09-08 10:26:35 +02:00
parent adf0994b3f
commit 336a16baed
2 changed files with 3 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ export interface MenuItem {
export interface MenuSettings {
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
title: string;
canClose?: boolean;
items: Array<MenuItem>;
}
@@ -36,6 +37,7 @@ const ListMenu: React.FC = () => {
const listRefs = useRef<Array<HTMLDivElement | null>>([]);
const closeMenu = (ignoreFetch?: boolean) => {
if (menu.canClose === false) return;
setVisible(false);
if (!ignoreFetch) fetchNui('closeMenu');
};