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
feat(main-nav): Main nav refactoring, change links order #20275
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
We're gonna look for a better, more complete & extensible way to manage all this. |
Size Change: -14 B (0%) Total Size: 2.52 MB
ℹ️ View Unchanged
|
I find this quite confusing, are you using the value to on all MenuItems? or just Plugins? IMO it should be all of them for clarity, which then feels like we should just have the items number 0-X, if you don't specify it gets rendered where it would normally? If you set the CM plugin to position Maybe i've misunderstood you and this is what you've implemented though? |
… into feat/main-nav-change-order
You are right, my previous solution was a little bit confusing We are sorting ALL the menu items (not just the plugins ), and the logic is this one
Let me know if it seems better now, thanks |
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.
Logic makes loads more sense ⭐ just need to tidy it up a bit
const NavLinkBadgeLock = styled(NavLink.Badge)` | ||
background-color: transparent; | ||
`; |
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.
You should be able to inline this by passing the backgroundColor
prop?
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.
transparent is not in the possible backgroundColor for the Badge component, I have a type error
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.
does it work though? cause if so, we can fix the type 🤔
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.
I think theres improvements on the Badge component to be made if you want to add bug reports to the DS 👍🏼
@simotae14 can you double check if the docs need an update? I think we document adding plugin links quite well, and this is very valuable to individuals! |
Yeah I suppose they need an update, I am gonna talk about it with Piwi on Monday |
We need to add the position parameter here https://docs.strapi.io/dev-docs/api/plugins/admin-panel-api#menu-api |
What does it do?
It changes the main nav links order based on the specifications on the figma file
I added a position property, which is a numeric and can help us to reorder the plugins.
The links in the main nav are all sorted by position starting from 0 to the last one, the links with the same position number are sorted by link label
If you don't specify the link position then its position is in the middle of the main nav, before the plugin list
Why is it needed?
To give more visibility to the most used links
How to test it?
Just check the new main nav and check the figma file (you can find it in the jira ticket)
Related issue(s)/PR(s)
CS-768