Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7f8187b

Browse files
style(布局): 🎨 调整布局
1 parent 6d836b3 commit 7f8187b

File tree

5 files changed

+57
-8
lines changed

5 files changed

+57
-8
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.ant-layout .ant-layout-sider {
2+
background-color: var(--yz-background-color);
3+
border-right: 1px solid var(--yz-border-color);
4+
.logo {
5+
color: var(--yz-font-color);
6+
}
7+
}

‎src/components/layouts/components/Sidebar/index.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { useNavigate, useLocation } from "react-router-dom";
1313

1414
import logo from "@/assets/logo.svg";
1515
import { useSelector } from "@/store";
16+
import "./index.less";
1617

1718
const { Sider } = Layout;
1819

@@ -31,7 +32,6 @@ function Sidebar() {
3132

3233
return (
3334
<Sider trigger={null} collapsible collapsed={isCollapsed}>
34-
<div className="demo-logo-vertical" />
3535
{/* logo */}
3636
<div className="logo">
3737
<img src={logo} alt="logo" />
@@ -40,7 +40,7 @@ function Sidebar() {
4040

4141
{/* 菜单 */}
4242
<Menu
43-
theme="dark"
43+
theme="light"
4444
mode="inline"
4545
onClick={menuHandle}
4646
defaultSelectedKeys={[pathname]}

‎src/components/layouts/components/theme/index.tsx‎

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const ThemeComp = (props: props) => {
3434
setColorHex("#a855f7");
3535
};
3636

37-
const { themeMode, isDark } = useSelector(state => state.global);
37+
const { themeMode, isDark, themeColor } = useSelector(state => state.global);
3838
const changeTheme = (checked: boolean, mode: "" | "gray" | "week") => {
3939
checked ? dispatch(setThemeMode(mode)) : dispatch(setThemeMode(""));
4040
};
@@ -44,11 +44,54 @@ const ThemeComp = (props: props) => {
4444
<Drawer className="theme" title="主题配置🎨" placement="right" onClose={onClose} open={open}>
4545
<div className="flx-justify-between">
4646
<p className="theme-color">主题颜色:</p>
47-
<ColorPicker format={formatHex} showText value={themeVal} onFormatChange={setFormatHex} onChange={setColorHex} />
47+
<ColorPicker
48+
format={formatHex}
49+
presets={[
50+
{
51+
label: "推荐",
52+
colors: [
53+
"#000000",
54+
"#000000E0",
55+
"#000000A6",
56+
"#00000073",
57+
"#00000040",
58+
"#00000026",
59+
"#0000001A",
60+
"#00000012",
61+
"#0000000A",
62+
"#00000005",
63+
"#F5222D",
64+
"#FA8C16",
65+
"#FADB14",
66+
"#8BBB11",
67+
"#52C41A",
68+
"#13A8A8",
69+
"#1677FF",
70+
"#2F54EB",
71+
"#722ED1",
72+
"#EB2F96",
73+
"#F5222D4D",
74+
"#FA8C164D",
75+
"#FADB144D",
76+
"#8BBB114D",
77+
"#52C41A4D",
78+
"#13A8A84D",
79+
"#1677FF4D",
80+
"#2F54EB4D",
81+
"#722ED14D",
82+
"#EB2F964D"
83+
]
84+
}
85+
]}
86+
showText
87+
value={themeVal}
88+
onFormatChange={setFormatHex}
89+
onChange={setColorHex}
90+
/>
4891
</div>
4992
<div className="flx-justify-between" style={{ marginTop: "20px" }}>
5093
<p className="theme-color">重置主题:</p>
51-
<Button type="primary" style={{ backgroundColor: "#a855f7" }} onClick={resetTheme}>
94+
<Button type="primary" style={{ backgroundColor: themeColor }} onClick={resetTheme}>
5295
重置
5396
</Button>
5497
</div>

‎src/components/layouts/index.less‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@
4949
.content-stage {
5050
overflow: auto;
5151
.child-stage {
52-
height: 100%;
53-
margin: 10px 12px;
52+
margin: 12px;
5453
}
5554
}
5655
}

‎src/views/theme/index.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ const Theme: React.FC = () => {
213213
};
214214

215215
return (
216-
<Card bordered={false}style={{ margin: "16px 0" }}>
216+
<Card style={{ margin: "16px 0" }}>
217217
<div style={{ marginBottom: 16 }}>
218218
{/* 国际化配置 */}
219219
<Divider>国际化配置</Divider>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /