[DashboardLayout] Allow custom navigation page items - #4809
Conversation
Netlify deploy preview |
|
I'm awaiting this!!! |
| @@ -0,0 +1,31 @@ | |||
| { | |||
| "props": { | |||
There was a problem hiding this comment.
🤔 I would have expect this to just have a item prop. Does it need all these other props? This is just to render the default item right? I'm not sure we should expose more API on it.
There was a problem hiding this comment.
If you look at the expanded demo here I was just trying to make this type of changes as easy as possible as well as reusing the existing component. Some of these are things that some users already asked to be able to override.
Would it help if these props were additional options maybe? And the first parameter was the item?
|
I've changed the It's using context under the hood to pass default values to the page item component without exposing all that API to the users, who can only set a few simple optional props now if they wish to override certain behaviors. |
|
👍
I suppose the alternative would be |
That should work too if we don't mind the extra property, I'll change it. |
for the record, that's not the propose of my comment. I'm fine with what there is |
Ok, I didn't have a huge preference between the 2 solutions but I guess that as a user I would prefer a single function prop, not to have to use 2 separate ones. So if it's ok I guess we can go with this. Just need an approval and I can merge! |
bharatkashyap
left a comment
There was a problem hiding this comment.
Big improvement! Looks good in the demo/docs 👍🏻
Closes #4413.
Closes #4607 both for the hidden and disabled cases.
Also helps with #4733 but additional state management would be needed from the user, so maybe there is a better solution for that in the future.
Also makes it possible to easily mark items as
expanded,selectedordisabled, or use external links with a customhref.Check the new documentation here: