Skip to content

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

Merged
Janpot merged 10 commits into
mui:masterfrom
null93:patch-1
Jan 9, 2025
Merged

[PageHeader] Allow multiple breadcrumbs that are not links#4571
Janpot merged 10 commits into
mui:masterfrom
null93:patch-1

Conversation

@null93

@null93 null93 commented Dec 29, 2024

Copy link
Copy Markdown
Contributor
  • 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 <5500199+null93@users.noreply.github.com>
@null93 null93 changed the title Update PageHeader.tsx [PageHeader] Allow multiple breadcrumbs that are not links Dec 29, 2024
Signed-off-by: Rafael Grigorian <5500199+null93@users.noreply.github.com>
Signed-off-by: Rafael Grigorian <5500199+null93@users.noreply.github.com>
@null93
null93 marked this pull request as ready for review December 29, 2024 05:04
Comment thread packages/toolpad-core/src/PageContainer/PageHeader.tsx Outdated
Changing key for Typography breadcrumb from `item.title` to `index`

Signed-off-by: Rafael Grigorian <5500199+null93@users.noreply.github.com>
@null93
null93 requested a review from Janpot January 7, 2025 04:34
@mui-bot

mui-bot commented Jan 7, 2025

Copy link
Copy Markdown

Netlify deploy preview

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

Generated by 🚫 dangerJS against bc006b8

@Janpot Janpot left a comment

Copy link
Copy Markdown
Member

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?

Comment thread packages/toolpad-core/src/PageContainer/PageHeader.tsx Outdated
null93 and others added 3 commits January 7, 2025 09:35
Co-authored-by: Jan Potoms <2109932+Janpot@users.noreply.github.com>
Signed-off-by: Rafael Grigorian <5500199+null93@users.noreply.github.com>
@null93
null93 requested a review from Janpot January 8, 2025 05:33

@Janpot Janpot left a comment

Copy link
Copy Markdown
Member

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants