+ {/**/}
+
+ {/*');
diff --git a/app/app/(admin)/admin/page.tsx b/app/app/(admin)/admin/page.tsx
index a06fceb86..0775d6be9 100644
--- a/app/app/(admin)/admin/page.tsx
+++ b/app/app/(admin)/admin/page.tsx
@@ -7,7 +7,6 @@ import {
SettingOutlined,
} from "@ant-design/icons";
import type { MenuProps, MenuTheme } from "antd";
-import { Menu, Switch } from "antd";
type MenuItem = Required
["items"][number];
diff --git a/app/app/(admin)/components/sidebar.tsx b/app/app/(admin)/components/sidebar.tsx
index 841e06d32..195f419bf 100644
--- a/app/app/(admin)/components/sidebar.tsx
+++ b/app/app/(admin)/components/sidebar.tsx
@@ -2,7 +2,7 @@
import React, { useEffect, useState } from "react";
import Link from "next/link";
-import { useRouter } from "next/navigation";
+import { useRouter, usePathname } from "next/navigation";
import {
AppstoreOutlined,
@@ -55,10 +55,10 @@ const items: MenuItem[] = [
const SideBar: React.FC = () => {
const [theme, setTheme] = useState("dark");
- const [current, setCurrent] = useState("1");
+ const [current, setCurrent] = useState("/admin/ana");
const router = useRouter();
const [loading, setLoading] = useState(false);
-
+ const pathname = usePathname();
// const changeTheme = (value: boolean) => {
// setTheme(value ? 'dark' : 'light');
// };
@@ -68,7 +68,12 @@ const SideBar: React.FC = () => {
setCurrent(e.key);
router.push(e.key);
};
-
+ useEffect(() => {
+ // 如果按钮和路径不相等,那其实应该跳转到按钮的网址
+ if (current != pathname) {
+ router.push(current);
+ }
+ }, []);
// useEffect(() => {
// const handleStart = () => setLoading(true)
// const handleComplete = () => setLoading(false);
diff --git a/app/app/(admin)/layout.tsx b/app/app/(admin)/layout.tsx
index 93262fdab..e17e6a7b8 100644
--- a/app/app/(admin)/layout.tsx
+++ b/app/app/(admin)/layout.tsx
@@ -2,6 +2,7 @@ import "@/app/app/login.scss";
import { Metadata } from "next";
import { ReactNode } from "react";
import { AntdRegistry } from "@ant-design/nextjs-registry";
+// import Head from "next/head";
export const metadata: Metadata = {
title: "Admin | 管理页面",
diff --git a/app/components/emoji.tsx b/app/components/emoji.tsx
index b24349307..3b1f5e751 100644
--- a/app/components/emoji.tsx
+++ b/app/components/emoji.tsx
@@ -21,6 +21,7 @@ export function AvatarPicker(props: {
}) {
return (
setShowEmojiPicker(true)}
+ onClick={() => {
+ setShowEmojiPicker(!showEmojiPicker);
+ }}
>
diff --git a/app/components/ui-lib.module.scss b/app/components/ui-lib.module.scss
index c67d352be..83c02f92a 100644
--- a/app/components/ui-lib.module.scss
+++ b/app/components/ui-lib.module.scss
@@ -14,17 +14,24 @@
.popover-content {
position: absolute;
+ width: 350px;
animation: slide-in 0.3s ease;
right: 0;
top: calc(100% + 10px);
}
-
+@media screen and (max-width: 600px) {
+ .popover-content {
+ width: auto;
+ }
+}
.popover-mask {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
+ background-color: rgba(0, 0, 0, 0.3);
+ backdrop-filter: blur(5px);
}
.list-item {
diff --git a/app/components/ui-lib.tsx b/app/components/ui-lib.tsx
index f7e326fd3..da700c0fb 100644
--- a/app/components/ui-lib.tsx
+++ b/app/components/ui-lib.tsx
@@ -26,10 +26,10 @@ export function Popover(props: {
{props.children}
{props.open && (
-
+
+ )}
+ {props.open && (
+
{props.content}
)}
);