import { HomeOutlined, SettingOutlined, ApiOutlined, FolderOutlined, ClearOutlined, UserOutlined, CommentOutlined, AlertOutlined, UploadOutlined, ClockCircleTwoTone, PlusCircleTwoTone, ControlTwoTone, MessageTwoTone, } from "@ant-design/icons"; import type { MenuProps } from "antd"; import { Menu } from "antd"; import React, { useState } from "react"; import { Input, Avatar } from "antd"; import { SearchOutlined } from "@ant-design/icons"; import "./Navbar.css"; import { Dialog, Portal, createOverlay, CloseButton } from "@chakra-ui/react"; import { PasswordInput } from "@/components/ui/password-input"; import { Input as ChakraInput, InputGroup, Box } from "@chakra-ui/react"; import { QRCode, Button } from "antd"; // import { PasswordInput } from "@/components/ui/password-input" import { Tabs } from "antd"; import { Space } from "antd"; import { Flex } from "antd"; interface DialogProps { title: string; description?: string; content?: React.ReactNode; } const login_dialog = createOverlay((props) => { const { ...rest } = props; return (
扫描二维码登录
使用APP扫码登录
扫描登录或者扫码下载APP
账号密码登录 ), key: "1", children: ( ), }, { label: ( 邮箱验证码登录 ), key: "2", children: ( ), }, ]} />
其他登录方式
未注册过账号的手机号/邮箱,我们将自动帮你注册账号{" "}
登录或完成注册即代表你同意 和
); }); // login_dialog.open({}); const Navbar: React.FC = () => { const [current, setCurrent] = useState("mail"); const [isLogin, setIsLogin] = useState(false); const items: MenuProps["items"] = [ { label: "主页", key: "home", icon: , }, { label: "工具大全", key: "tools", icon: , }, { label: "文章资源", key: "articles", icon: , }, { label: "消息", key: "xx", icon: , children: [ { label: "回复我的", key: "xx1", }, { label: "@我的", key: "xx2", }, { label: "收到的赞", key: "xx3", }, { label: "系统消息", key: "xx4", }, { label: "我的消息", key: "xx5", }, ], }, { label: "bug反馈", key: "bug", icon: , }, { label: ( } /> ), key: "search", disabled: true, className: "right-align-container", }, { label: ( { login_dialog.open({}); }} > } className="margin_3_0" /> 用户: 10086 ), key: "my", children: isLogin ? [ { className: "width_300", type: "group", label: (
用户10086
), children: [ { label: "个人中心", key: "setting:1", icon: , }, { label: "个人设置", key: "setting:2", icon: , }, { label: "浏览历史", key: "setting:3", icon: , }, { label: (
), disabled: true, key: "divider", }, { label: "退出登录", key: "setting:4", icon: , }, ], }, ] : [ { label: (
登录后你可以:
111
), key: "login", disabled: true, }, { label: ( <> {" "} 你发布评论后,也可以收到别人的回复 ), disabled: true, }, { label: ( <> {" "} 查看自己的历史浏览记录 ), disabled: true, }, { label: ( <> {" "} 收藏需要的工具和文章 ), disabled: true, }, { label: ( <> {" "} 部分登录才可以使用的功能 ), disabled: true, }, { label: ( ), key: "divider", disabled: true, }, { label: (
首次登录?{" "}
), disabled: true, }, ], className: "right-align-container", }, ]; const onClick: MenuProps["onClick"] = (e) => { console.log("click ", e); setCurrent(e.key); if (e.key == "home") { login_dialog.open({}); } }; return (
); }; export default Navbar;