From 4d31e9a790a145d5def292b31064e13fc40d4ca4 Mon Sep 17 00:00:00 2001 From: Xutaotaotao Date: Mon, 13 May 2024 20:09:38 +0800 Subject: [PATCH] feat: add page title --- src/layouts/index.tsx | 8 +++++++- src/pages/imageCompress/batchImageCompress.tsx | 3 ++- src/pages/imageCompress/singleImageCompress.tsx | 7 ++++--- src/pages/jsonFormatting.tsx | 3 ++- src/utils/const.ts | 2 +- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index 4b5c873..9a0977f 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -4,12 +4,14 @@ import { IconGithubLogo, IconLikeHeart, } from "@douyinfe/semi-icons"; -import { Button, Layout, Nav, Popover,Image, Row, Col } from "@douyinfe/semi-ui"; +import { Button, Layout, Nav, Popover,Image, Row, Col,Typography } from "@douyinfe/semi-ui"; import Logo from "@/assets/img/XTools.svg"; import "@/assets/normalize.css"; import { NAV_MAP } from "./menu"; const { Header, Sider, Content } = Layout; +const { Text,Title } = Typography; + const XLayout = () => { const location = useLocation(); @@ -111,6 +113,10 @@ const XLayout = () => { backgroundColor: "var(--semi-color-bg-0)", }} > +
+ {NAV_MAP.find(item => item.itemKey === location.pathname)?.text} + {NAV_MAP.find(item => item.itemKey === location.pathname)?.des} +
diff --git a/src/pages/imageCompress/batchImageCompress.tsx b/src/pages/imageCompress/batchImageCompress.tsx index ee0cdab..5d4b105 100644 --- a/src/pages/imageCompress/batchImageCompress.tsx +++ b/src/pages/imageCompress/batchImageCompress.tsx @@ -6,6 +6,7 @@ import Compressor from "compressorjs"; import { useRef, useState } from "react"; import { UploadFile, UploadProps } from "antd/lib/upload/interface"; import { FormApi } from "@douyinfe/semi-ui/lib/es/form"; +import { BODY_HEIGHT } from "@/utils/const"; const { Dragger } = Upload; @@ -187,7 +188,7 @@ export default function BatchImageCompress() { }; return ( -
+
+
(api.current = formApi)} @@ -144,7 +145,7 @@ export default function ImageCompress() { {currentImg ? ( -
+
{ return -