aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'FrontEnd/src/app/views')
-rw-r--r--FrontEnd/src/app/views/common/AppBar.tsx2
-rw-r--r--FrontEnd/src/app/views/common/ToggleIconButton.tsx30
2 files changed, 31 insertions, 1 deletions
diff --git a/FrontEnd/src/app/views/common/AppBar.tsx b/FrontEnd/src/app/views/common/AppBar.tsx
index 319bca74..d0e39f98 100644
--- a/FrontEnd/src/app/views/common/AppBar.tsx
+++ b/FrontEnd/src/app/views/common/AppBar.tsx
@@ -26,7 +26,7 @@ const AppBar: React.FC = (_) => {
bg="primary"
variant="dark"
expand="md"
- sticky="top"
+ fixed="top"
expanded={expand}
>
<LinkContainer to="/" onClick={collapse}>
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;