Skip to content

Commit 23576d8

Browse files
committed
website: add backToUp button.
1 parent 11cca03 commit 23576d8

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@
7979
"@types/react": "^18.0.15",
8080
"@types/react-dom": "^18.0.6",
8181
"@types/react-test-renderer": "^18.0.0",
82+
"@uiw/react-back-to-top": "^1.2.0",
8283
"@uiw/react-github-corners": "^1.5.14",
83-
"@uiw/react-markdown-preview": "^4.0.22",
8484
"@uiw/react-loader": "^4.21.14",
85+
"@uiw/react-markdown-preview": "^4.0.22",
8586
"@wcj/dark-mode": "^1.0.14",
8687
"code-example": "^3.3.6",
8788
"compile-less-cli": "^1.8.13",

website/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
22
import MarkdownPreview from '@uiw/react-markdown-preview';
33
import GitHubCorners from '@uiw/react-github-corners';
44
import Loader from '@uiw/react-loader';
5+
import BackToUp from '@uiw/react-back-to-top';
56
import exts from 'code-example/ext.json';
67
import '@wcj/dark-mode';
78
import TextareaCodeEditor from '../';
@@ -50,15 +51,14 @@ const useFetch = (language: string) => {
5051
const App: React.FC = () => {
5152
const [language, setLanguage] = useState('jsx');
5253
const { lang, loading, code, setCode } = useFetch(language);
53-
// @ts-ignore
54-
const version = VERSION;
5554
return (
5655
<div className="App wmde-markdown-var">
56+
<BackToUp>Top</BackToUp>
5757
<dark-mode dark="Dark" light="Light" style={{ position: 'fixed', top: 8, left: 10 }}></dark-mode>
5858
<GitHubCorners fixed href="https://github.com/uiwjs/react-textarea-code-editor" />
5959
<h1 className="App-title">
6060
React Textarea Code Editor
61-
<sup>{version}</sup>
61+
<sup>{VERSION}</sup>
6262
</h1>
6363
<div className="App-editor">
6464
<TextareaCodeEditor

website/react-app-env.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ declare module '*.md' {
99
const src: string;
1010
export default src;
1111
}
12+
13+
declare var VERSION: string;

0 commit comments

Comments
 (0)