|
@@ -1,155 +1,23 @@
|
|
"use client";
|
|
"use client";
|
|
-import React, { useState } from "react";
|
|
|
|
-import { isMobile } from "react-device-detect";
|
|
|
|
-import styles from "./nav.module.css";
|
|
|
|
|
|
|
|
-const Nav: React.FC = (props) => {
|
|
|
|
- const [showMenu, setShowMenu] = useState("");
|
|
|
|
|
|
+import React from "react";
|
|
|
|
+import dynamic from "next/dynamic";
|
|
|
|
+import NavPC from "./navPC";
|
|
|
|
+import NavMobile from "./navMobile";
|
|
|
|
|
|
- const isCurrent = (title: string) => {
|
|
|
|
- return title == props.title;
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- return isMobile ? (
|
|
|
|
- <div className={styles["nav-fixed"]}>
|
|
|
|
- <div
|
|
|
|
- className={styles.header}
|
|
|
|
- onClick={() => {
|
|
|
|
- if (showMenu == "" || showMenu == "hide") {
|
|
|
|
- setShowMenu("show");
|
|
|
|
- } else {
|
|
|
|
- setShowMenu("hide");
|
|
|
|
- }
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- <div className={styles.logo}>HIPO 高潜</div>
|
|
|
|
- <img src="/asset/ic_menu_dark.png" className={styles.menu} />
|
|
|
|
- </div>
|
|
|
|
- <div className={styles["nav-line"]} />
|
|
|
|
- <div className={showMenu} style={{ overflow: "hidden", height: 0 }}>
|
|
|
|
- <div className={styles["nav-sub"]}>
|
|
|
|
- <a href="/">
|
|
|
|
- <div
|
|
|
|
- className={styles.item}
|
|
|
|
- onClick={() => {
|
|
|
|
- setShowMenu("hide");
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 首页
|
|
|
|
- </div>
|
|
|
|
- </a>
|
|
|
|
- <a href="/about">
|
|
|
|
- <div
|
|
|
|
- className={styles.item}
|
|
|
|
- onClick={() => {
|
|
|
|
- setShowMenu("hide");
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 关于我们
|
|
|
|
- </div>
|
|
|
|
- </a>
|
|
|
|
- <a href="/#service">
|
|
|
|
- <div
|
|
|
|
- className={styles.item}
|
|
|
|
- onClick={() => {
|
|
|
|
- setShowMenu("hide");
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 业务介绍
|
|
|
|
- </div>
|
|
|
|
- </a>
|
|
|
|
- <a href="/#consultant">
|
|
|
|
- <div
|
|
|
|
- className={styles.item}
|
|
|
|
- onClick={() => {
|
|
|
|
- setShowMenu("hide");
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 顾问介绍
|
|
|
|
- </div>
|
|
|
|
- </a>
|
|
|
|
- <a href="/caseList">
|
|
|
|
- <div
|
|
|
|
- className={styles.item}
|
|
|
|
- onClick={() => {
|
|
|
|
- setShowMenu("hide");
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 经典案例
|
|
|
|
- </div>
|
|
|
|
- </a>
|
|
|
|
- <a href="/contactUs">
|
|
|
|
- <div
|
|
|
|
- className={styles.item}
|
|
|
|
- onClick={() => {
|
|
|
|
- setShowMenu("hide");
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 联系我们
|
|
|
|
- </div>
|
|
|
|
- </a>
|
|
|
|
- <a href={"/user/login"}>
|
|
|
|
- <div
|
|
|
|
- className={styles.item}
|
|
|
|
- onClick={() => {
|
|
|
|
- setShowMenu("hide");
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 登录
|
|
|
|
- </div>
|
|
|
|
- </a>
|
|
|
|
- <a href={"/user/register"}>
|
|
|
|
- <div
|
|
|
|
- className={styles.item}
|
|
|
|
- onClick={() => {
|
|
|
|
- setShowMenu("hide");
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 注册
|
|
|
|
- </div>
|
|
|
|
- </a>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- ) : (
|
|
|
|
- <div className={styles.nav}>
|
|
|
|
- <div className={styles["nav-bar"]}>
|
|
|
|
- <div className={styles["navbar-brand"]}>
|
|
|
|
- <a href={"/"}>
|
|
|
|
- <div className={styles.logo}>HIPO 高潜</div>
|
|
|
|
- </a>
|
|
|
|
- </div>
|
|
|
|
- <div className={styles["navbar-collapse"]}>
|
|
|
|
- <div className={styles["navbar-content"]}>
|
|
|
|
- <a className={styles.link} href="/">
|
|
|
|
- 首页
|
|
|
|
- </a>
|
|
|
|
- <a className={isCurrent("关于我们") ? styles.linkChecked : styles.link} href="/about">
|
|
|
|
- 关于我们
|
|
|
|
- </a>
|
|
|
|
- <a className={styles.link} href="/#service">
|
|
|
|
- 业务介绍
|
|
|
|
- </a>
|
|
|
|
- <a className={isCurrent("顾问介绍") ? styles.linkChecked : styles.link} href="/#consultant">
|
|
|
|
- 顾问介绍
|
|
|
|
- </a>
|
|
|
|
- <a className={isCurrent("经典案例") ? styles.linkChecked : styles.link} href="/caseList">
|
|
|
|
- 经典案例
|
|
|
|
- </a>
|
|
|
|
- <a className={isCurrent("联系我们") ? styles.linkChecked : styles.link} href="/contactUs">
|
|
|
|
- 联系我们
|
|
|
|
- </a>
|
|
|
|
- <a className={styles.link} href={"/user/login"}>
|
|
|
|
- 登录
|
|
|
|
- </a>
|
|
|
|
- <a className={styles.link} href={"/user/register"}>
|
|
|
|
- 注册
|
|
|
|
- </a>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div className={styles["nav-line"]} />
|
|
|
|
- </div>
|
|
|
|
|
|
+const Nav: React.FC = () => {
|
|
|
|
+ const MediaQuery = dynamic(() => import("react-responsive"), {
|
|
|
|
+ ssr: false,
|
|
|
|
+ });
|
|
|
|
+ return (
|
|
|
|
+ <>
|
|
|
|
+ <MediaQuery maxWidth={767}>
|
|
|
|
+ <NavMobile />
|
|
|
|
+ </MediaQuery>
|
|
|
|
+ <MediaQuery minWidth={768}>
|
|
|
|
+ <NavPC />
|
|
|
|
+ </MediaQuery>
|
|
|
|
+ </>
|
|
);
|
|
);
|
|
};
|
|
};
|
|
|
|
|