Skip to content

Commit

Permalink
feat: Allow configuring Breadcrumbs that when should it collapse (#2520)
Browse files Browse the repository at this point in the history
* Allow configuring Breadcrumbs that when should it collapse

* Update Label.tsx
  • Loading branch information
zsolt-sbx authored Dec 6, 2023
1 parent f495692 commit 1c1ab3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions workspaces/core/src/breadcrumb/Breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import Collapsed from './private/Collapsed';
import Extended from './private/Extended';
import type Props from './private/types/Props';

const Breadcrumb = ({ breadcrumbs, divider }: Props) => {
const Breadcrumb = ({ breadcrumbs, divider, collapseAfter = 4}: Props) => {
if (!breadcrumbs) return null;
const isCollapse = breadcrumbs?.length > 4;
const isCollapse = breadcrumbs?.length > collapseAfter;
return isCollapse ? (
<Collapsed breadcrumbs={breadcrumbs} divider={divider} />
) : (
Expand Down
1 change: 1 addition & 0 deletions workspaces/core/src/breadcrumb/private/types/Props.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
type Props = {
breadcrumbs: React.ReactNode[];
divider?: React.ReactNode;
collapseAfter?: number;
};

export default Props;

0 comments on commit 1c1ab3e

Please sign in to comment.