diff --git a/src/components/App.tsx b/src/components/App.tsx
index 65c3304..76c41f6 100644
--- a/src/components/App.tsx
+++ b/src/components/App.tsx
@@ -9,6 +9,7 @@ import { SnackbarProvider } from 'notistack';
import { tools } from '../tools';
import './index.css';
import { darkTheme, lightTheme } from '../config/muiConfig';
+import ScrollToTopButton from './ScrollToTopButton';
const AppRoutes = () => {
const updatedRoutesConfig = [...routesConfig];
@@ -48,6 +49,7 @@ function App() {
+
);
}
diff --git a/src/components/ScrollToTopButton.tsx b/src/components/ScrollToTopButton.tsx
new file mode 100644
index 0000000..fdbc755
--- /dev/null
+++ b/src/components/ScrollToTopButton.tsx
@@ -0,0 +1,47 @@
+import { useState, useEffect } from 'react';
+import Button from '@mui/material/Button';
+import { Icon } from '@iconify/react';
+
+export default function ScrollToTopButton() {
+ const [visible, setVisible] = useState(false);
+
+ useEffect(() => {
+ const toggleVisibility = () => {
+ setVisible(window.scrollY > 100);
+ };
+
+ window.addEventListener('scroll', toggleVisibility);
+ return () => window.removeEventListener('scroll', toggleVisibility);
+ }, []);
+
+ const scrollToTop = () => {
+ window.scrollTo({ top: 0, behavior: 'smooth' });
+ };
+
+ if (!visible) return null;
+
+ return (
+
+ );
+}