-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.jsx
48 lines (39 loc) · 1.08 KB
/
App.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React, { useEffect } from 'react';
import {
Routes,
Route,
useLocation
} from 'react-router-dom';
import './src/css/style.scss';
import AOS from 'aos';
import Home from './src/components/Home';
import SignIn from './src/components/SignIn';
import SignUp from './src/components/SignUp';
import ResetPassword from './src/components/ResetPassword';
function App() {
const location = useLocation();
useEffect(() => {
AOS.init({
once: true,
disable: 'phone',
duration: 700,
easing: 'ease-out-cubic',
});
});
useEffect(() => {
document.querySelector('html').style.scrollBehavior = 'auto'
window.scroll({ top: 0 })
document.querySelector('html').style.scrollBehavior = ''
}, [location.pathname]); // triggered on route change
return (
<>
<Routes>
<Route exact path="/" element={<Home />} />
<Route path="/signin" element={<SignIn />} />
<Route path="/signup" element={<SignUp />} />
<Route path="/reset-password" element={<ResetPassword />} />
</Routes>
</>
);
}
export default App;