From 1659d9fc8dfafb45433729373cee1f7604e9c87a Mon Sep 17 00:00:00 2001 From: zhuba-Ahhh <3477826311@qq.com> Date: Sun, 22 Sep 2024 05:24:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20:sparkles:=20=E9=93=BE=E8=B7=AF?= =?UTF-8?q?=E8=B5=B0=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/App.tsx | 13 +----- src/components/Navbar.tsx | 4 +- src/router/index.tsx | 14 +++++- src/utils/index.ts | 1 + src/utils/math.ts | 7 +++ src/views/BookChapter.tsx | 90 ++++++++++++++++++++++++++++++++++++++ src/views/BookListView.tsx | 37 +++++----------- src/views/BookView.tsx | 78 ++++++++++++++++++++++++++++----- 9 files changed, 192 insertions(+), 53 deletions(-) create mode 100644 src/utils/math.ts create mode 100644 src/views/BookChapter.tsx diff --git a/package.json b/package.json index 4b17b72..d6bb29c 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "axios": "^1.6.8", "daisyui": "^4.12.10", "lodash-es": "^4.17.21", + "rc-virtual-list": "^3.14.7", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.23.0", diff --git a/src/App.tsx b/src/App.tsx index c6fe37f..ecc340d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -10,18 +10,7 @@ function App() { }, 1000); }, []); - return ( -
- {isLoading ? ( - - ) : ( - <> -
- - - )} -
- ); + return
{isLoading ? : }
; } export default App; diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 3bd92f6..efb7e32 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -2,7 +2,7 @@ import { Link } from 'react-router-dom'; const Navbar = () => { return ( -