Skip to content

Commit 91a1a35

Browse files
committedAug 29, 2022
website: add backToUp button.
1 parent db62101 commit 91a1a35

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
 

‎website/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@
3333
},
3434
"dependencies": {
3535
"@uiw/formatter": "~1.3.2",
36+
"@uiw/react-back-to-top": "^1.2.0",
3637
"@uiw/react-code-preview": "~4.0.5",
3738
"@uiw/react-markdown-preview": "~3.5.0",
3839
"@uiw/reset.css": "~1.0.5",
39-
"react": "~17.0.2",
40-
"react-dom": "~17.0.2",
40+
"react": ">=16.9.0",
41+
"react-dom": ">=16.9.0",
4142
"react-router-dom": "~6.2.2",
4243
"uiw": "^4.21.16"
4344
},

‎website/src/index.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useReducer } from 'react';
22
import ReactDOM from 'react-dom';
33
import { useRoutes, HashRouter } from 'react-router-dom';
4+
import BackToUp from '@uiw/react-back-to-top';
45
import '@uiw/reset.css';
56
import { routes } from './routers';
67
import './styles/index.less';
@@ -14,6 +15,7 @@ export const Provider = ({ children }: { children: React.ReactNode }) => {
1415

1516
ReactDOM.render(
1617
<HashRouter>
18+
<BackToUp style={{ zIndex: 9999 }}>Top</BackToUp>
1719
<Provider>
1820
<App />
1921
</Provider>

0 commit comments

Comments
 (0)
Please sign in to comment.