From de7df0e4fb38863b830a104a5a38d0e5247679f8 Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Tue, 29 Jun 2021 23:50:55 +0800
Subject: ...

---
 FrontEnd/src/views/common/Menu.tsx | 80 --------------------------------------
 1 file changed, 80 deletions(-)
 delete mode 100644 FrontEnd/src/views/common/Menu.tsx

(limited to 'FrontEnd/src/views/common/Menu.tsx')

diff --git a/FrontEnd/src/views/common/Menu.tsx b/FrontEnd/src/views/common/Menu.tsx
deleted file mode 100644
index a5d2ec2c..00000000
--- a/FrontEnd/src/views/common/Menu.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import React from "react";
-import classnames from "classnames";
-import { useTranslation } from "react-i18next";
-
-import { convertI18nText, I18nText } from "@/common";
-import { PaletteColorType } from "@/palette";
-
-export type MenuItem =
-  | {
-      type: "divider";
-    }
-  | {
-      type: "button";
-      text: I18nText;
-      iconClassName?: string;
-      color?: PaletteColorType;
-      onClick: () => void;
-    };
-
-export type MenuItems = MenuItem[];
-
-export interface MenuProps {
-  items: MenuItems;
-  className?: string;
-  onItemClicked?: () => void;
-}
-
-const Menu: React.FC<MenuProps> = ({ items, className, onItemClicked }) => {
-  const { t } = useTranslation();
-
-  return (
-    <div className={classnames("cru-menu", className)}>
-      {items.map((item, index) => {
-        if (item.type === "divider") {
-          return <div key={index} className="cru-menu-divider" />;
-        } else {
-          return (
-            <div
-              key={index}
-              className={classnames(
-                "cru-menu-item",
-                `color-${item.color ?? "primary"}`
-              )}
-              onClick={() => {
-                item.onClick();
-                onItemClicked?.();
-              }}
-            >
-              {item.iconClassName != null ? (
-                <i
-                  className={classnames(
-                    item.iconClassName,
-                    "cru-menu-item-icon"
-                  )}
-                />
-              ) : null}
-              {convertI18nText(item.text, t)}
-            </div>
-          );
-        }
-      })}
-    </div>
-  );
-};
-
-export default Menu;
-
-export interface PopupMenuProps {
-  items: MenuItems;
-  children: React.ReactElement;
-}
-
-export const PopupMenu: React.FC<PopupMenuProps> = ({ items, children }) => {
-  const [show, setShow] = React.useState<boolean>(false);
-  const toggle = (): void => setShow(!show);
-
-  // TODO:
-
-  return <Menu items={items} onItemClicked={() => setShow(false)} />;
-};
-- 
cgit v1.2.3

