Refactor and enhance UI components across the application

- Improved formatting and consistency in BotConfigPage, HomeSidebar, and Plugin components.
- Removed unnecessary Spin component to prevent layout collapse in BotConfigPage.
- Enhanced sidebar selection logic to reflect current URL path in HomeSidebar.
- Updated layout styles for better responsiveness and visual appeal.
- Implemented mock data fetching in PluginMarketComponent for improved testing and development.
- Added pagination and search functionality in PluginMarketComponent.
- Refactored PluginInstalledComponent to streamline plugin list rendering and modal handling.
- Adjusted CSS styles for better alignment and spacing in various components.
- Removed commented-out code in HttpClient for cleaner codebase.
- Enhanced NotFound component layout for better user experience.
This commit is contained in:
Chris
2025-04-28 23:10:33 +08:00
parent 8eca2cba58
commit ea1a24fd1e
16 changed files with 631 additions and 420 deletions
+32 -14
View File
@@ -1,30 +1,48 @@
"use client";
"use client"
import "@ant-design/v5-patch-for-react-19";
import styles from "./layout.module.css";
import '@ant-design/v5-patch-for-react-19';
import styles from "./layout.module.css"
import HomeSidebar from "@/app/home/components/home-sidebar/HomeSidebar";
import HomeTitleBar from "@/app/home/components/home-titlebar/HomeTitleBar";
import React, { useState } from "react";
import { SidebarChildVO } from "@/app/home/components/home-sidebar/HomeSidebarChild";
import { useRouter } from 'next/navigation';
import { Layout } from 'antd';
const { Sider, Content } = Layout;
export default function HomeLayout({
children
}: Readonly<{
children: React.ReactNode;
}>) {
const [title, setTitle] = useState<string>("");
const router = useRouter();
const [title, setTitle] = useState<string>("")
const onSelectedChange = (child: SidebarChildVO) => {
setTitle(child.name);
};
setTitle(child.name)
}
return (
<div className={`${styles.homeLayoutContainer}`}>
<HomeSidebar onSelectedChangeAction={onSelectedChange} />
<div className={`${styles.main}`}>
<Layout className={styles.homeLayoutContainer}>
{/* homeLayoutContainer 是整个容器的入口,使用 flex 的左右布局 */}
<Sider className="left">
<HomeSidebar
onSelectedChange={onSelectedChange}
/>
{/* HomeSidebar 为侧边栏 */}
</Sider>
<Layout className="right">
{/* right 为内容显示区域,right使用 flex 上下布局,right 使用 flex 布局吃掉剩余部分 */}
<HomeTitleBar title={title} />
{/* 主页面 */}
<div className={`${styles.mainContent}`}>{children}</div>
</div>
</div>
);
<Content className={styles.main}>
{/* mainContent 为主页面 */}
{children}
</Content>
</Layout>
</Layout>
)
}