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

feat: add onClick prop to breadcrumb [CFCX-1433] #2708

Merged
merged 8 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add no-wrap to title on header
  • Loading branch information
massao committed Apr 11, 2024
commit c78c55e9f6bcc28992cb0756bf79c07730571dc8
4 changes: 4 additions & 0 deletions packages/components/header/src/Header.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,8 @@ export const getHeaderStyles = () => ({
marginLeft: tokens.spacingXs,
},
}),
noWrap: css({
textWrap: 'nowrap',
marginLeft: tokens.spacingXs,
}),
});
11 changes: 10 additions & 1 deletion packages/components/header/src/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, {
type Ref,
type ReactElement,
type ReactNode,
isValidElement,
} from 'react';
import { cx } from 'emotion';
import {
Expand Down Expand Up @@ -87,7 +88,15 @@ function _Header<E extends ElementType = typeof HEADER_DEFAULT_TAG>(
<Segmentation>
{withBackButton && <BackButton {...backButtonProps} />}
{breadcrumbs && <Breadcrumb breadcrumbs={breadcrumbs} />}
{title && <Subheading className={styles.title}>{title}</Subheading>}
{title && (
<div className={styles.noWrap}>
{isValidElement(title) ? (
title
) : (
<Subheading className={styles.title}>{title}</Subheading>
)}
</div>
)}
</Segmentation>
{metadata && (
<Flex alignItems="center" gap="spacing2Xs">
Expand Down