From bd871023f902027b87ef848e13d79c86e3321d4f Mon Sep 17 00:00:00 2001 From: Marcus Notheis Date: Tue, 21 Jan 2020 13:39:33 +0100 Subject: [PATCH] fix(ObjectPage): Don't wrap header content if image is an avatar (#277) Closes #273 --- packages/main/src/components/ObjectPage/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/main/src/components/ObjectPage/index.tsx b/packages/main/src/components/ObjectPage/index.tsx index 72e5dfffdb3..afe0df4b4af 100644 --- a/packages/main/src/components/ObjectPage/index.tsx +++ b/packages/main/src/components/ObjectPage/index.tsx @@ -39,7 +39,7 @@ import { ObjectPageAnchorButton } from './ObjectPageAnchorButton'; export interface ObjectPagePropTypes extends CommonProps { title?: string; subTitle?: string; - image?: string | ReactNode; + image?: string | ReactElement; imageShapeCircle?: boolean; headerActions?: Array>; renderHeaderContent?: () => JSX.Element; @@ -262,9 +262,9 @@ const ObjectPage: FC = forwardRef((props: ObjectPagePropTyp ); } else { - // @ts-ignore avatar = React.cloneElement(image, { - size: AvatarSize.L + size: AvatarSize.L, + className: image.props?.className ? `${classes.headerImage} ${image.props?.className}` : classes.headerImage }); } } @@ -283,7 +283,7 @@ const ObjectPage: FC = forwardRef((props: ObjectPagePropTyp
-
{avatar}
+ {avatar}
{renderBreadcrumbs && renderBreadcrumbs()}