aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-11 22:28:58 +0800
committercrupest <crupest@outlook.com>2021-01-11 22:28:58 +0800
commit43cf429cb81e928a6466522864682bd4a68ea42e (patch)
tree44b555c734a657355af2a3fca3255d8dc9bd191b /FrontEnd/src
parent5d3a3111bbc349d5d5ff0a4ed92f97b14a9d65fe (diff)
downloadtimeline-43cf429cb81e928a6466522864682bd4a68ea42e.tar.gz
timeline-43cf429cb81e928a6466522864682bd4a68ea42e.tar.bz2
timeline-43cf429cb81e928a6466522864682bd4a68ea42e.zip
feat: Fix #200.
Diffstat (limited to 'FrontEnd/src')
-rw-r--r--FrontEnd/src/app/App.tsx1
-rw-r--r--FrontEnd/src/app/views/common/AppBar.tsx2
-rw-r--r--FrontEnd/src/app/views/common/ToggleIconButton.tsx30
3 files changed, 32 insertions, 1 deletions
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 = () => {
<React.Suspense fallback={<LoadingPage />}>
<Router>
<AppBar />
+ <div style={{ height: 56 }} />
<Switch>
<Route exact path="/">
<Home />
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;