feat(web/menu): list menu icon support

This commit is contained in:
Luke
2022-07-29 17:58:13 +02:00
committed by Luke
parent 43ffa86387
commit a43b5eee04
2 changed files with 41 additions and 29 deletions

View File

@@ -5,11 +5,18 @@ import { debugData } from "../../../utils/debugData";
import ListItem from "./ListItem";
import Header from "./Header";
import FocusTrap from "focus-trap-react";
import { IconProp } from "@fortawesome/fontawesome-svg-core";
export interface MenuItem {
label: string;
value: string | string[];
icon?: IconProp;
}
interface MenuSettings {
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
title: string;
items: Array<{ label: string; value: string | string[] }>;
items: Array<MenuItem>;
}
debugData<MenuSettings>([
@@ -19,9 +26,9 @@ debugData<MenuSettings>([
// position: "bottom-left",
title: "Vehicle garage",
items: [
{ label: "Option 1", value: "option1" },
{ label: "Option 2", value: "option2" },
{ label: "Vehicle class", value: ["Nice", "Super nice", "Extra nice"] },
{ label: "Option 1", value: "option1", icon: "heart" },
{ label: "Option 2", value: "option2", icon: "basket-shopping" },
{ label: "Vehicle class", value: ["Nice", "Super nice", "Extra nice"], icon: "tag" },
{ label: "Option 1", value: "option1" },
{ label: "Option 2", value: "option2" },
{ label: "Vehicle class", value: ["Nice", "Super nice", "Extra nice"] },