From c4eaeee3203a8ed2ebfa4bc792ada3ec4703438e Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Mon, 11 Jan 2021 22:28:58 +0800
Subject: feat: Fix #200.

---
 FrontEnd/src/app/views/common/ToggleIconButton.tsx | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 FrontEnd/src/app/views/common/ToggleIconButton.tsx

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

diff --git a/FrontEnd/src/app/views/common/ToggleIconButton.tsx b/FrontEnd/src/app/views/common/ToggleIconButton.tsx
new file mode 100644
index 00000000..76c48960
--- /dev/null
+++ b/FrontEnd/src/app/views/common/ToggleIconButton.tsx
@@ -0,0 +1,30 @@
+import React from "react";
+import clsx from "clsx";
+
+export interface ToggleIconButtonProps
+  extends React.HTMLAttributes<HTMLElement> {
+  state: boolean;
+  trueIconClassName: string;
+  falseIconClassName: string;
+}
+
+const ToggleIconButton: React.FC<ToggleIconButtonProps> = ({
+  state,
+  className,
+  trueIconClassName,
+  falseIconClassName,
+  ...otherProps
+}) => {
+  return (
+    <i
+      className={clsx(
+        state ? trueIconClassName : falseIconClassName,
+        "icon-button",
+        className
+      )}
+      {...otherProps}
+    />
+  );
+};
+
+export default ToggleIconButton;
-- 
cgit v1.2.3

