Skip to content
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

[PageHeader] Allow multiple breadcrumbs that are not links #4571

Merged
merged 10 commits into from
Jan 9, 2025

Conversation

null93
Copy link
Contributor

@null93 null93 commented Dec 29, 2024

  • I've read and followed the contributing guide on how to create great pull requests.
  • I've updated the relevant documentation for any new or updated feature.
  • I've linked relevant GitHub issue with "Closes #".
  • I've added a visual demonstration in the form of a screenshot or video.

Simply allows multiple breadcrumbs to exist that are not links. An application of this would be having a top level breadcrumb that you would not want to be a link but instead be static text.

For example, given this definition for breadcrumbs:

[
    { title: "UOW" },
    { title: "Teams", path: "/teams" },
    { title: "New" },
]

Before, the last breadcrumb was always static text and all breadcrumbs before it were links.

Before

After, the breadcrumb is a link if it has a truthy value for path and it is static text if that value of path is falsy.

After

Signed-off-by: Rafael Grigorian <[email protected]>
@null93 null93 changed the title Update PageHeader.tsx [PageHeader] Allow multiple breadcrumbs that are not links Dec 29, 2024
Signed-off-by: Rafael Grigorian <[email protected]>
Signed-off-by: Rafael Grigorian <[email protected]>
@null93 null93 marked this pull request as ready for review December 29, 2024 05:04
Changing key for Typography breadcrumb from `item.title` to `index`

Signed-off-by: Rafael Grigorian <[email protected]>
@null93 null93 requested a review from Janpot January 7, 2025 04:34
@mui-bot
Copy link

mui-bot commented Jan 7, 2025

Netlify deploy preview

https://deploy-preview-4571--mui-toolpad-docs.netlify.app/

Generated by 🚫 dangerJS against bc006b8

Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, approved too fast. Let's use the same key everywhere. Also, can the path property be made optional now in the BreadCrumb type?

packages/toolpad-core/src/PageContainer/PageHeader.tsx Outdated Show resolved Hide resolved
@null93 null93 requested a review from Janpot January 8, 2025 05:33
Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

@Janpot Janpot merged commit 8ab17a3 into mui:master Jan 9, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

4 participants