Skip to content

Commit

Permalink
fix(SplitPageLayout): add className prop (#5737)
Browse files Browse the repository at this point in the history
  • Loading branch information
hussam-i-am authored Mar 5, 2025
1 parent 2646c12 commit 454ff20
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/three-lobsters-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

fix(SplitPageLayout): add className prop
15 changes: 15 additions & 0 deletions packages/react/src/SplitPageLayout/SplitPageLayout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,19 @@ describe('SplitPageLayout', () => {

expect(pane.getAttribute('id')).toBe('customId')
})

it('applies custom className', () => {
const {container} = render(
<ThemeProvider>
<SplitPageLayout className="custom-class">
<SplitPageLayout.Header>Header</SplitPageLayout.Header>
<SplitPageLayout.Content>Content</SplitPageLayout.Content>
<SplitPageLayout.Pane>Pane</SplitPageLayout.Pane>
<SplitPageLayout.Footer>Footer</SplitPageLayout.Footer>
</SplitPageLayout>
</ThemeProvider>,
)

expect(container.firstChild).toHaveClass('custom-class')
})
})
2 changes: 1 addition & 1 deletion packages/react/src/SplitPageLayout/SplitPageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {PageLayout} from '../PageLayout'
// ----------------------------------------------------------------------------
// SplitPageLayout

export type SplitPageLayoutProps = SxProp
export type SplitPageLayoutProps = SxProp & {className?: string}

export const Root: React.FC<React.PropsWithChildren<SplitPageLayoutProps>> = props => {
return (
Expand Down

0 comments on commit 454ff20

Please sign in to comment.