From 6af984c7143fc6e4341986432ba1bc6d378798a4 Mon Sep 17 00:00:00 2001 From: master1lan <278457198@qq.com> Date: Thu, 2 Mar 2023 12:08:28 +0800 Subject: [PATCH] =?UTF-8?q?:lipstick:=20style(custom):=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9pc=E7=AB=AF=E9=A1=B6=E9=83=A8=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ISSUES CLOSED: #29 --- src/routers/index.tsx | 4 ++ src/routers/layout/header.tsx | 2 +- src/routers/layout/index.tsx | 2 +- src/routers/layout/logo/index.tsx | 46 +++++++++++-------- src/routers/layout/nav/index.tsx | 62 +++++++++++++------------- src/routers/layout/rightMore/index.tsx | 7 ++- src/routers/layout/routernav/index.tsx | 8 +++- 7 files changed, 76 insertions(+), 55 deletions(-) diff --git a/src/routers/index.tsx b/src/routers/index.tsx index 5d66e97..fcd2c18 100644 --- a/src/routers/index.tsx +++ b/src/routers/index.tsx @@ -1,3 +1,7 @@ +/** + * 此页面作废 + */ + export default function Index() { return

这里是首页

; } diff --git a/src/routers/layout/header.tsx b/src/routers/layout/header.tsx index 891518e..c7c1dc3 100644 --- a/src/routers/layout/header.tsx +++ b/src/routers/layout/header.tsx @@ -25,7 +25,7 @@ const ReactiveHeader = memo(() => { return (
{/* 手机端 */} -
+
{/* pc端和平板端header部 */} diff --git a/src/routers/layout/index.tsx b/src/routers/layout/index.tsx index b979c46..502d5e1 100644 --- a/src/routers/layout/index.tsx +++ b/src/routers/layout/index.tsx @@ -27,7 +27,7 @@ export default function Layout() {
-
+
diff --git a/src/routers/layout/logo/index.tsx b/src/routers/layout/logo/index.tsx index bdf1423..3e50378 100644 --- a/src/routers/layout/logo/index.tsx +++ b/src/routers/layout/logo/index.tsx @@ -1,4 +1,5 @@ import { Button, Badge, Menu, MenuItem } from "@mui/material"; +import HelpOutlineIcon from "@mui/icons-material/HelpOutline"; import { useState, useMemo, FC } from "react"; import { Explain, Yituo } from "./modal"; import styles from "./logo.module.less"; @@ -50,6 +51,7 @@ const LGRouterListAndQA = () => { aria-haspopup='true' aria-expanded={open ? "true" : undefined} onClick={handleClick} + className='hover:bg-gray-200' > 导航 @@ -60,21 +62,20 @@ const LGRouterListAndQA = () => { onClose={handleClose} elevation={2} > - - - {RouterList.slice(0, 2).map((item) => ( - - {item.label + "站"} - + + {item.label} + + ))} @@ -82,7 +83,7 @@ const LGRouterListAndQA = () => { ); }; -const QAButton = () => { +export const AboutUSButton = () => { const [open, set] = useState(false); const [shouldShowNews, handlerReadedNews] = useCheckQANews(); const handlerClick = (event: React.MouseEvent) => { @@ -92,8 +93,13 @@ const QAButton = () => { }; return ( <> - @@ -103,18 +109,20 @@ const QAButton = () => { const RouterListAndQA = () => { return ( - <> - +
{RouterList.slice(0, 2).map((item) => ( - - {item.label + "站"} - + + {item.label} + + ))} - +
); }; diff --git a/src/routers/layout/nav/index.tsx b/src/routers/layout/nav/index.tsx index 07fe43c..a4caea0 100644 --- a/src/routers/layout/nav/index.tsx +++ b/src/routers/layout/nav/index.tsx @@ -119,7 +119,7 @@ export default function Header_Nav(props: HeaderNavType) { = memo( dispatch(addTagFunc(props)); } }; - //@ts-ignore - const color = nameToColor[props.query] || "info"; + + const styleColor = handleSetSpecialProps( + props.query, + "rgb(55 65 81)", + "rgb(96 165 250)", + clicked + ); return ( - ); - return ( - + /> ); } ); +const handleSetSpecialProps = ( + query: string, + defaultColor: string, + activeColor: string, + clicked: boolean +) => { + //@ts-ignore + const color = nameToColor[query] || defaultColor, + renderColor = (activecolor: string) => (clicked ? activecolor : color), + styleColor = color === defaultColor ? renderColor(activeColor) : color; + return styleColor; +}; + const nameToColor = { - 露早: "luzaoRed", - 柚恩: "youen", - 莞儿: "waner", - 米诺: "minuo", - 虞莫: "yumo", + 露早: "#A0191D", + 柚恩: "#EB6346", + 莞儿: "#1eafe4", + 米诺: "#f068B0", + 虞莫: "#b77fdd", }; diff --git a/src/routers/layout/rightMore/index.tsx b/src/routers/layout/rightMore/index.tsx index 691de3f..208ca36 100644 --- a/src/routers/layout/rightMore/index.tsx +++ b/src/routers/layout/rightMore/index.tsx @@ -3,6 +3,7 @@ import MoreVertIcon from "@mui/icons-material/MoreVert"; import LaunchIcon from "@mui/icons-material/Launch"; import { Button, Link, Popover } from "@mui/material"; import { TabProps } from "../routernav"; +import { AboutUSButton } from "../logo"; export default function PCRightMore() { const [anchorEl, setAnchorEl] = React.useState( null @@ -18,12 +19,14 @@ export default function PCRightMore() { const open = Boolean(anchorEl); return ( - <> +
+
@@ -69,7 +72,7 @@ export default function PCRightMore() {
- +
); } const GroupLists: TabProps[] = [ diff --git a/src/routers/layout/routernav/index.tsx b/src/routers/layout/routernav/index.tsx index d2e0bb6..df9dcb5 100644 --- a/src/routers/layout/routernav/index.tsx +++ b/src/routers/layout/routernav/index.tsx @@ -1,17 +1,21 @@ import { Drawer } from "@mui/material"; -import { useState, FC } from "react"; +import PhotoIcon from "@mui/icons-material/Photo"; +import VideoLibraryIcon from "@mui/icons-material/VideoLibrary"; +import { useState, FC, ReactElement } from "react"; import { Link, useMatch } from "react-router-dom"; import CloseIcon from "@mui/icons-material/Close"; import Header_Nav from "../nav"; import { ImportTantInfo } from ".."; -export const RouterList: TabProps[] = [ +export const RouterList: (TabProps & { startICon: ReactElement })[] = [ { label: "视频", to: "/video", + startICon: , }, { label: "图片", to: "/photo", + startICon: , }, ];