-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ab 219 support right components in sectionheader (#322)
* allow for a right element in section header * add story for right header * fix import order * apply review feedback
- Loading branch information
Showing
2 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
import { ReactNode } from 'react' | ||
import { SectionHeaderArea } from './SectionHeaderArea' | ||
import { SectionHeaderRow, SectionHeaderRowLayout } from './SectionHeaderRow' | ||
import { SectionHeaderTitle } from './SectionHeaderTitle' | ||
|
||
export type SectionHeaderProps = { | ||
title: ReactNode | ||
className?: string | ||
rightArea?: ReactNode | ||
} | ||
|
||
export function SectionHeader({ className, title }: SectionHeaderProps) { | ||
export function SectionHeader({ | ||
className, | ||
title, | ||
rightArea, | ||
}: SectionHeaderProps) { | ||
return ( | ||
<SectionHeaderArea className={className}> | ||
<SectionHeaderTitle>{title}</SectionHeaderTitle> | ||
<SectionHeaderRow layout={SectionHeaderRowLayout.SpaceBetween}> | ||
<SectionHeaderTitle>{title}</SectionHeaderTitle> | ||
<div>{rightArea}</div> | ||
</SectionHeaderRow> | ||
</SectionHeaderArea> | ||
) | ||
} |