From 43cf429cb81e928a6466522864682bd4a68ea42e Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 11 Jan 2021 22:28:58 +0800 Subject: feat: Fix #200. --- FrontEnd/src/app/App.tsx | 1 + FrontEnd/src/app/views/common/AppBar.tsx | 2 +- FrontEnd/src/app/views/common/ToggleIconButton.tsx | 30 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 FrontEnd/src/app/views/common/ToggleIconButton.tsx (limited to 'FrontEnd/src') diff --git a/FrontEnd/src/app/App.tsx b/FrontEnd/src/app/App.tsx index 6cdf2434..7bd92bf7 100644 --- a/FrontEnd/src/app/App.tsx +++ b/FrontEnd/src/app/App.tsx @@ -39,6 +39,7 @@ const App: React.FC = () => { }> +
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} > 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 { + state: boolean; + trueIconClassName: string; + falseIconClassName: string; +} + +const ToggleIconButton: React.FC = ({ + state, + className, + trueIconClassName, + falseIconClassName, + ...otherProps +}) => { + return ( + + ); +}; + +export default ToggleIconButton; -- cgit v1.2.3