mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-09-03 08:07:14 +00:00
perf: sidebar style
This commit is contained in:
@@ -2,14 +2,14 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background-color: #ffffff;
|
background-color: #eee;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding-block: 1rem;
|
padding-block: 1rem;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.1);
|
/* box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.1); */
|
||||||
}
|
}
|
||||||
|
|
||||||
.langbotIconContainer {
|
.langbotIconContainer {
|
||||||
@@ -64,7 +64,6 @@
|
|||||||
margin: 0.8rem 0;
|
margin: 0.8rem 0;
|
||||||
padding-left: 2rem;
|
padding-left: 2rem;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@@ -81,7 +80,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sidebarUnselected {
|
.sidebarUnselected {
|
||||||
background-color: white;
|
|
||||||
color: #6C6C6C;
|
color: #6C6C6C;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +92,6 @@
|
|||||||
.sidebarBottomContainer {
|
.sidebarBottomContainer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
background-color: #ffffff;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -104,7 +101,6 @@
|
|||||||
.sidebarBottomChildContainer {
|
.sidebarBottomChildContainer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
background-color: aqua;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #f2f2f2;
|
background-color: #fafafa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.titleText {
|
.titleText {
|
||||||
|
|||||||
@@ -4,14 +4,28 @@
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 主内容区域 */
|
/* 主内容区域 */
|
||||||
.main {
|
.main {
|
||||||
background-color: #f2f2f2;
|
background-color: #fafafa;
|
||||||
overflow: auto;
|
flex: 1;
|
||||||
width: 100%;
|
display: flex;
|
||||||
height: 100%;
|
flex-direction: column;
|
||||||
|
/* height: 100vh; */
|
||||||
|
width: calc(100% - 1.2rem);
|
||||||
|
height: calc(100% - 1.2rem);
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 1.5rem 0 0 1.5rem;
|
||||||
|
margin-left: 0.6rem;
|
||||||
|
margin-top: 0.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mainContent {
|
||||||
padding: 1.5rem;
|
padding: 1.5rem;
|
||||||
padding-left: 2rem;
|
padding-left: 2rem;
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
background-color: #fafafa;
|
||||||
}
|
}
|
||||||
+30
-15
@@ -6,9 +6,9 @@ import HomeSidebar from '@/app/home/components/home-sidebar/HomeSidebar';
|
|||||||
import HomeTitleBar from '@/app/home/components/home-titlebar/HomeTitleBar';
|
import HomeTitleBar from '@/app/home/components/home-titlebar/HomeTitleBar';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { SidebarChildVO } from '@/app/home/components/home-sidebar/HomeSidebarChild';
|
import { SidebarChildVO } from '@/app/home/components/home-sidebar/HomeSidebarChild';
|
||||||
import { Layout } from 'antd';
|
// import { Layout } from 'antd';
|
||||||
|
|
||||||
const { Sider, Content } = Layout;
|
// const { Sider, Content } = Layout;
|
||||||
|
|
||||||
export default function HomeLayout({
|
export default function HomeLayout({
|
||||||
children,
|
children,
|
||||||
@@ -21,24 +21,39 @@ export default function HomeLayout({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout className={styles.homeLayoutContainer}>
|
// <Layout className={styles.homeLayoutContainer}>
|
||||||
{/* homeLayoutContainer 是整个容器的入口,使用 flex 的左右布局 */}
|
// {/* homeLayoutContainer 是整个容器的入口,使用 flex 的左右布局 */}
|
||||||
|
|
||||||
<Sider className="left">
|
// <Sider className="left">
|
||||||
|
// <HomeSidebar onSelectedChangeAction={onSelectedChangeAction} />
|
||||||
|
// {/* HomeSidebar 为侧边栏 */}
|
||||||
|
// </Sider>
|
||||||
|
|
||||||
|
// <Layout className="right">
|
||||||
|
// {/* right 为内容显示区域,right使用 flex 上下布局,right 使用 flex 布局吃掉剩余部分 */}
|
||||||
|
|
||||||
|
// <HomeTitleBar title={title} />
|
||||||
|
|
||||||
|
// <Content className={styles.main}>
|
||||||
|
// {/* mainContent 为主页面 */}
|
||||||
|
// {children}
|
||||||
|
// </Content>
|
||||||
|
// </Layout>
|
||||||
|
// </Layout>
|
||||||
|
|
||||||
|
<div className={styles.homeLayoutContainer}>
|
||||||
|
<aside className={styles.sidebar}>
|
||||||
<HomeSidebar onSelectedChangeAction={onSelectedChangeAction} />
|
<HomeSidebar onSelectedChangeAction={onSelectedChangeAction} />
|
||||||
{/* HomeSidebar 为侧边栏 */}
|
</aside>
|
||||||
</Sider>
|
|
||||||
|
|
||||||
<Layout className="right">
|
|
||||||
{/* right 为内容显示区域,right使用 flex 上下布局,right 使用 flex 布局吃掉剩余部分 */}
|
|
||||||
|
|
||||||
|
<div className={styles.main}>
|
||||||
<HomeTitleBar title={title} />
|
<HomeTitleBar title={title} />
|
||||||
|
|
||||||
<Content className={styles.main}>
|
<main className={styles.mainContent}>
|
||||||
{/* mainContent 为主页面 */}
|
|
||||||
{children}
|
{children}
|
||||||
</Content>
|
</main>
|
||||||
</Layout>
|
</div>
|
||||||
</Layout>
|
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user