Skip to content

Commit

Permalink
fix(ObjectPage): Don't wrap header content if image is an avatar (#277)
Browse files Browse the repository at this point in the history
Closes #273
  • Loading branch information
MarcusNotheis authored Jan 21, 2020
1 parent 624e84f commit bd87102
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/main/src/components/ObjectPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { ObjectPageAnchorButton } from './ObjectPageAnchorButton';
export interface ObjectPagePropTypes extends CommonProps {
title?: string;
subTitle?: string;
image?: string | ReactNode;
image?: string | ReactElement<any>;
imageShapeCircle?: boolean;
headerActions?: Array<ReactElement<any>>;
renderHeaderContent?: () => JSX.Element;
Expand Down Expand Up @@ -262,9 +262,9 @@ const ObjectPage: FC<ObjectPagePropTypes> = forwardRef((props: ObjectPagePropTyp
</span>
);
} else {
// @ts-ignore
avatar = React.cloneElement(image, {
size: AvatarSize.L
size: AvatarSize.L,
className: image.props?.className ? `${classes.headerImage} ${image.props?.className}` : classes.headerImage
});
}
}
Expand All @@ -283,7 +283,7 @@ const ObjectPage: FC<ObjectPagePropTypes> = forwardRef((props: ObjectPagePropTyp
<div className={classes.contentHeader}>
<div className={classes.headerContent}>
<div className={classes.flexBoxRow}>
<div>{avatar}</div>
{avatar}
<div className={classes.flexBoxColumn}>
<div>{renderBreadcrumbs && renderBreadcrumbs()}</div>
<div className={classes.flexBoxRow}>
Expand Down

0 comments on commit bd87102

Please sign in to comment.