Skip to content

Commit

Permalink
(feat) Extend PageHeader component to accept additional HTML attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen committed Aug 26, 2024
1 parent 4a8326d commit 886629e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/framework/esm-framework/docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2042,7 +2042,7 @@ on its own, and the PageHeaderContent component is not needed.

#### Defined in

[packages/framework/esm-styleguide/src/page-header/page-header.component.tsx:85](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/page-header/page-header.component.tsx#L85)
[packages/framework/esm-styleguide/src/page-header/page-header.component.tsx:89](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/page-header/page-header.component.tsx#L89)

___

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,16 @@ const isPageHeaderWrapperProps = (props: any): props is PageHeaderWrapperProps =
*/
export const PageHeader: React.FC<PageHeaderProps> = (props) => {
if (isPageHeaderWrapperProps(props)) {
const { children, className } = props;
return <div className={classNames(styles.pageHeader, className)}>{children}</div>;
const { children, className, ...rest } = props;
return (
<div className={classNames(styles.pageHeader, className)} {...rest}>
{children}
</div>
);
} else {
const { title, illustration, className } = props;
const { title, illustration, className, ...rest } = props;
return (
<div className={classNames(styles.pageHeader, className)}>
<div className={classNames(styles.pageHeader, className)} {...rest}>
<PageHeaderContent title={title} illustration={illustration} />
</div>
);
Expand Down

0 comments on commit 886629e

Please sign in to comment.