Repository navigation
feat(new-webui): Add global theming config and adjust sider appearance. #937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
36ada83
ff6bcb3
59557f7
ac7f02b
f7914a9
107f394
9b2c64d
606be32
5635251
b840845
2a35ec9
624be62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,9 @@ | ||
| import {RouterProvider} from "react-router"; | ||
|
|
||
| import {ConfigProvider} from "antd"; | ||
|
|
||
| import router from "./router"; | ||
| import THEME_CONFIG from "./theme"; | ||
|
|
||
| import "@ant-design/v5-patch-for-react-19"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Ensure patch import precedence 🤖 Prompt for AI Agents |
||
|
|
||
|
|
@@ -11,7 +14,13 @@ import "@ant-design/v5-patch-for-react-19"; | |
| * @return | ||
| */ | ||
| const AntApp = () => { | ||
| return <RouterProvider router={router}/>; | ||
| return ( | ||
| <ConfigProvider | ||
| theme={THEME_CONFIG} | ||
| > | ||
| <RouterProvider router={router}/> | ||
| </ConfigProvider> | ||
| ); | ||
| }; | ||
|
Comment on lines
16
to
24
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Add explicit component return type const AntApp = (): JSX.Element => { … }🤖 Prompt for AI Agents
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unnecessary for components in JSX / TSX sources
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @junhaoliao, understood! I'll remember this preference for future reviews of React components in your codebase. ✏️ Learnings added
|
||
|
|
||
| export default AntApp; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import type {ThemeConfig} from "antd/es/config-provider/context"; | ||
|
|
||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| /** | ||
| * Ant Design theme configuration. | ||
| */ | ||
| const THEME_CONFIG: ThemeConfig = Object.freeze({ | ||
| token: { | ||
| fontFamily: "'Inter', sans-serif", | ||
| colorPrimary: "#2a8efa", | ||
| borderRadius: 3, | ||
| }, | ||
| cssVar: true, | ||
| hashed: false, | ||
| }); | ||
|
|
||
|
|
||
| export default THEME_CONFIG; | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Improve import grouping
Group external dependencies (e.g.
react-router,antd) separately from local imports (./router,./theme) and maintain a consistent ordering (alphabetical or logical) to enhance readability.🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be fixed in https://github.com/y-scope/eslint-config-yscope
@coderabbitai create an issue there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain