Skip to content

Commit

Permalink
Ability to pass in right justified title content for PageSectionBoxAc…
Browse files Browse the repository at this point in the history
…tionRow (#14439)

GitOrigin-RevId: 4e83b8ba47e14577513bc1820dc89ed4f61bd3d6
  • Loading branch information
carsonp6 authored and Lightspark Eng committed Dec 18, 2024
1 parent 517b346 commit 7c1d5b1
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions packages/ui/src/components/PageSection/PageSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ type PageSectionBoxActionRowProps = {
title?: string;
titleBadge?: string | undefined;
titleBadgeKind?: BadgeKind | undefined;
titleRightContent?: React.ReactNode;
description?: string;
separator?: boolean;
children?: React.ReactNode;
Expand All @@ -203,6 +204,7 @@ export const PageSectionBoxActionRow = ({
title,
titleBadge,
titleBadgeKind = "default",
titleRightContent,
description,
separator,
children,
Expand All @@ -216,12 +218,15 @@ export const PageSectionBoxActionRow = ({
smFlexColumn={Boolean(smFlexColumn)}
>
{title ? (
<div>
<div css={{ flex: 1 }}>
<PageSectionBoxTitle>
{title}
{titleBadge ? (
<Badge content={titleBadge} ml={4} kind={titleBadgeKind} />
) : null}
<div>
{title}
{titleBadge ? (
<Badge content={titleBadge} ml={4} kind={titleBadgeKind} />
) : null}
</div>
{titleRightContent}
</PageSectionBoxTitle>
{description ? (
<PageSectionBoxDescription>
Expand Down Expand Up @@ -374,6 +379,8 @@ export const StyledPageSectionBox = styled.div`
export const PageSectionBoxTitle = styled.div<{ lg?: boolean }>`
display: flex;
align-items: center;
width: 100%;
justify-content: space-between;
font-size: ${({ lg }) => (lg ? 14 : 12)}px;
font-weight: 600;
line-height: ${({ lg }) =>
Expand Down

0 comments on commit 7c1d5b1

Please sign in to comment.