You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "SkyeYoung (via GitHub)" <gi...@apache.org> on 2025/08/17 11:55:24 UTC
[PR] feat(LanguageMenu): selected item style [apisix-dashboard]
SkyeYoung opened a new pull request, #3179:
URL: https://github.com/apache/apisix-dashboard/pull/3179
Please answer these questions before submitting a pull request, **or your PR will get closed**.
**Why submit this pull request?**
- [ ] Bugfix
- [x] New feature provided
- [ ] Improve performance
- [ ] Backport patches
**What changes will this PR take into?**
In the development of #3165, I found that the styles for the selected language were not implemented before, which makes it impossible to distinguish which language is currently in use.
|OLD|NEW|
|-|-|
|<img width="344" height="248" alt="image" src="https://github.com/user-attachments/assets/3bd24166-1ce2-4444-99a9-d51b4fca0db4" />|<img width="344" height="248" alt="image" src="https://github.com/user-attachments/assets/2b53cac1-581e-4cc2-9cd8-0a771f86fed1" />|
**Related issues**
fix/resolve #0001
**Checklist:**
- [x] Did you explain what problem does this PR solve? Or what new features have been added?
- [ ] Have you added corresponding test cases?
- [ ] Have you modified the corresponding document?
- [x] Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(LanguageMenu): selected item style [apisix-dashboard]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #3179:
URL: https://github.com/apache/apisix-dashboard/pull/3179#discussion_r2281673441
##########
src/components/Header/LanguageMenu.tsx:
##########
@@ -55,6 +55,13 @@ export const LanguageMenu = () => {
{Object.keys(LangMap).map((lang) => (
<Menu.Item
key={lang}
+ {...(lang === i18n.language && {
Review Comment:
[nitpick] The spread operator with conditional object creation creates unclear code. Consider extracting this logic into a separate function or using clearer conditional rendering for better readability.
##########
src/components/Header/LanguageMenu.tsx:
##########
@@ -55,6 +55,13 @@ export const LanguageMenu = () => {
{Object.keys(LangMap).map((lang) => (
<Menu.Item
key={lang}
+ {...(lang === i18n.language && {
+ disabled: true,
+ style: {
+ backgroundColor:
+ 'var(--menu-item-hover, var(--mantine-color-gray-1))',
Review Comment:
[nitpick] The CSS variable fallback chain 'var(--menu-item-hover, var(--mantine-color-gray-1))' is hardcoded. Consider defining this as a constant or using a theme utility function for better maintainability.
```suggestion
backgroundColor: MENU_ITEM_HOVER_BG,
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(LanguageMenu): selected item style [apisix-dashboard]
Posted by "SkyeYoung (via GitHub)" <gi...@apache.org>.
SkyeYoung merged PR #3179:
URL: https://github.com/apache/apisix-dashboard/pull/3179
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org