From 94a81e63457cc5b27b1b630a20b040c0350c7792 Mon Sep 17 00:00:00 2001 From: Ehsan Date: Thu, 24 Oct 2024 00:17:55 +0330 Subject: [PATCH] scroll to top after change step --- app/component/ScrollToTop.js | 8 ++++++++ .../panel/addDoctor/listMenu/officeInformation/index.js | 2 ++ components/panel/addDoctor/listMenu/workingDays/index.js | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 app/component/ScrollToTop.js diff --git a/app/component/ScrollToTop.js b/app/component/ScrollToTop.js new file mode 100644 index 0000000..2a6eee0 --- /dev/null +++ b/app/component/ScrollToTop.js @@ -0,0 +1,8 @@ +import { useEffect } from "react"; + +function ScrollToTop() { + useEffect(() => window.scrollTo(0, 0), []); + return; +} + +export default ScrollToTop; diff --git a/components/panel/addDoctor/listMenu/officeInformation/index.js b/components/panel/addDoctor/listMenu/officeInformation/index.js index 470f06c..1e5eac4 100644 --- a/components/panel/addDoctor/listMenu/officeInformation/index.js +++ b/components/panel/addDoctor/listMenu/officeInformation/index.js @@ -2,10 +2,12 @@ import ArrowLeftPA from "@/components/icons/ArrowLeftPA"; import { Button } from "@mui/material"; import Form from "./Form"; import { checkAllValues } from "@/helper"; +import ScrollToTop from "@/app/component/ScrollToTop"; function OfficeInformation({ setValue, parent, data, setData }) { return (
+