
diff --git a/src/components/masonry/index.tsx b/src/components/masonry/index.tsx
index 9395ec7..391b16a 100644
--- a/src/components/masonry/index.tsx
+++ b/src/components/masonry/index.tsx
@@ -1,7 +1,6 @@
import { FC, useState, useEffect, useCallback } from "react";
import { Masonry as Masonic_masonry } from "masonic";
import Image from "@components/image";
-import { FetchNewImages } from "@utils/faker/index";
import { SingleRun, concurrencyRequest } from "@utils/index";
import { fetchVideos } from "@utils/fetch";
import { nanoid } from "nanoid";
diff --git a/src/main.tsx b/src/main.tsx
index 2c5c399..72d3cbf 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -1,14 +1,14 @@
-import React from "react";
+import React, { lazy, Suspense } from "react";
import ReactDOM from "react-dom/client";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import VideoPage from "./routers/video";
import "./index.less";
-import ReadPage from "./routers/read";
-import Layout from "./routers/layout";
-import PhotoPage from "./routers/photo";
-import ErrorPage from "./routers/error";
import "intersection-observer";
import "./normalize.css";
+const ReadPage = lazy(() => import("./routers/read")),
+ Layout = lazy(() => import("./routers/layout")),
+ PhotoPage = lazy(() => import("./routers/photo")),
+ ErrorPage = lazy(() => import("./routers/error"));
const router = createBrowserRouter([
{
path: "/",
@@ -50,7 +50,9 @@ const router = createBrowserRouter([
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
//
-
+
+
+
//
);
diff --git a/src/routers/layout/layout.module.less b/src/routers/layout/layout.module.less
index 2cdf1ce..9b18792 100644
--- a/src/routers/layout/layout.module.less
+++ b/src/routers/layout/layout.module.less
@@ -76,9 +76,7 @@
}
}
-::-webkit-scrollbar {
- display: none;
-}
+
.nav {
position: relative;
@@ -89,6 +87,11 @@
overflow-x: auto;
scrollbar-width: none;
-ms-overflow-style: none;
+
+ &::-webkit-scrollbar {
+ display: none;
+ }
+
@itemWidth: 80px;
@itemMarginHalfWidth: 8px;
@itemMarginHalfHeight: 4px;
@@ -140,6 +143,4 @@
z-index: 1;
cursor: pointer;
}
-}
-
-//todo 写好header
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/src/routers/layout/nav.tsx b/src/routers/layout/nav.tsx
index 7964b08..36b1961 100644
--- a/src/routers/layout/nav.tsx
+++ b/src/routers/layout/nav.tsx
@@ -22,12 +22,11 @@ import { nanoid } from "nanoid";
import styles from "./layout.module.less";
import { FC, useState, useEffect, useMemo, memo } from "react";
import { Pick } from "@utils/index";
-
+//todo 拆分组件
+//todo 修改文件夹
export default function Header_Nav() {
//todo 这里在loacalstorage中查找
const [navLists, setLists] = useState
(nav_tag_list);
- //最后一个span是否可见
- const { ref, inView } = useInView({ initialInView: true });
//tag区是否展开
const [showed, setShow] = useState(false);
//拖拽事件绑定
@@ -86,29 +85,41 @@ export default function Header_Nav() {
data-showed={showed}
>
{ComRes}
-
- setShow((showed) => !showed)}
- style={{
- display: inView ? "none" : "flex",
- }}
- >
-
-
+ setShow((show) => !show)} />
);
}
-const NavItem: FC