Skip to content
This repository was archived by the owner on Mar 7, 2024. It is now read-only.

Commit c677ca9

Browse files
partial fixed scroll reset problem (#106)
1 parent 891d12b commit c677ca9

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/Routes.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import TermsView from './views/pages/documents/termsView';
2222
import DocsLayout from './layouts/DocsLayout';
2323
import PrivacyView from './views/pages/documents/privacyView';
2424
import RefundView from './views/pages/documents/refundView';
25+
import ScrollReset from './components/ScrollReset';
2526

2627
const renderRoutes = () => (
2728
<Suspense fallback={<LoadingScreen />}>
@@ -30,9 +31,12 @@ const renderRoutes = () => (
3031
path="/"
3132
exact
3233
render={props => (
33-
<MainLayout>
34-
<HomeView {...props} />
35-
</MainLayout>
34+
<>
35+
<ScrollReset />
36+
<MainLayout>
37+
<HomeView {...props} />
38+
</MainLayout>
39+
</>
3640
)}
3741
/>
3842

@@ -51,6 +55,7 @@ const renderRoutes = () => (
5155
exact
5256
render={props => (
5357
<MainLayout>
58+
<ScrollReset />
5459
<EventsView {...props} />
5560
</MainLayout>
5661
)}
@@ -78,16 +83,20 @@ const renderRoutes = () => (
7883
<Route
7984
path="/courses"
8085
render={props => (
81-
<MainLayout>
82-
<CoursesView {...props} />
83-
</MainLayout>
86+
<>
87+
<ScrollReset />
88+
<MainLayout>
89+
<CoursesView {...props} />
90+
</MainLayout>
91+
</>
8492
)}
8593
/>
8694
<Route
8795
path="/campusLeaders"
8896
exact
8997
render={props => (
9098
<MainLayout>
99+
<ScrollReset />
91100
<CAView {...props} />
92101
</MainLayout>
93102
)}

0 commit comments

Comments
 (0)