Skip to content

Commit e73d6e1

Browse files
wilcorreaCopilot
andcommitted
feat(react-web): add className prop to DataPage and remove layout constraints from flatContainer
- Add `className?: string` to `PageProps` interface - Propagate `className` to the root element in both normal and flat modes - Remove `width: 100%` and `margin: 0 auto` from `flatContainer` style, giving layout control to the host app Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8773a6b commit e73d6e1

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

packages/react-web/src/components/DataPage.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ interface PageProps {
2222
title?: string;
2323
subtitle?: string;
2424
headerEnd?: ReactNode;
25+
className?: string;
2526
}
2627

2728
export function DataPage (props: PageProps) {
@@ -37,6 +38,7 @@ export function DataPage (props: PageProps) {
3738
title,
3839
subtitle,
3940
headerEnd,
41+
className,
4042
children
4143
} = props
4244
const { t } = useTranslation()
@@ -74,8 +76,8 @@ export function DataPage (props: PageProps) {
7476
const resolvedHeaderEnd = headerEnd ?? registeredActions
7577
return (
7678
<PageActionsContext.Provider value={contextValue}>
77-
<div style={styles.flatScroll}>
78-
<div style={{ ...styles.flatContainer, maxWidth }}>
79+
<div style={styles.flatScroll} className={className}>
80+
<div>
7981
<div style={styles.flatHeader}>
8082
<div>
8183
<div style={styles.flatTitle}>{resolvedTitle}</div>
@@ -91,7 +93,7 @@ export function DataPage (props: PageProps) {
9193
}
9294

9395
return (
94-
<div style={styles.scroll}>
96+
<div style={styles.scroll} className={className}>
9597
<div style={{ ...styles.container, maxWidth }}>
9698
<div style={styles.title}>{t(`${domain}.title`)} / {t(`common.scopes.${scope}`)}</div>
9799
{children}
@@ -124,10 +126,7 @@ const createStyles = (theme: Theme) => ({
124126
flatScroll: {
125127
// No minHeight/backgroundColor/padding — host app controls layout
126128
},
127-
flatContainer: {
128-
width: '100%',
129-
margin: '0 auto',
130-
},
129+
flatContainer: {},
131130
flatHeader: {
132131
display: 'flex',
133132
alignItems: 'flex-start',

0 commit comments

Comments
 (0)