I want the breadcrumb menu to look like a Linux path. All that needs to happen here is
- Adding
~/
to the beginning of the menu - Lower-case every character
- Replace all spaces with underscores
- Replace the default separator with
/
And when all that is done I should upstream my changes.
Steps
Support new preSymbol
prop in Breadcrumb
component
Todo
- Add support for new optional
preSymbol
prop in theBreadcrumb
component
This will allow me to add ~/
to the beginning of the breadcrumb menu.
I need to add a new optional prop to Breadcrumb
called preSymbol
. If set, simply add a separator to the beginning using the value defined in the prop.
I actually already did this, but I copy+pasted the Breadcrumb
component to a custom MyBreadcrumb
component, so I just need to port the changes to the official component, replace my custom component in quartz.layout.ts
, and delete the MyBreadcrumb
component.
Support new formatCrumb
prop to allow formatting each crumbs’ display name
Todo
- Add support for new optional
formatCrumb
callback prop in the breadcrumb component
This callback just needs to take in a string and return a string. This function should be used to generate the text displayed for each crumb.
formatCrumb
will allow me to lowercase all crumbs and replace all spaces with underscores.
Clean up custom MyBreadcrumb
component
Todo
- Delete my custom
MyBreadcrumb
component and replace with updatedBreadcrumb
- Set
preSymbol
to~/
in eachBreadcrumb
instantiation inquartz.layout.ts
- Set
formatCrumb
prop in eachBreadcrumb
instantiation inquartz.layout.ts
to lowercase all crumbs and replace all spaces with underscores- Set
separator
prop in eachBreadcrumb
to/
Since I already implemented all of this in a custom component and am now porting it to the official component, I need to delete the custom component and replace its’ usage in quartz.layout.ts
with the official component.
Upstream changes
Todo
- Upstream
preSymbol
prop inBreadcrumb
component- Upstream
formatCrumb
prop inBreadcrumb
component