|
|
@ -72,31 +72,36 @@ const renderTitle = (prefixCls: string, props: PageHeaderProps, direction: strin |
|
|
|
if (title || subTitle || tags || extra) { |
|
|
|
const backIcon = getBackIcon(props, direction); |
|
|
|
const backIconDom = renderBack(prefixCls, backIcon, onBack); |
|
|
|
const hasTitle = backIconDom || avatar || title || subTitle || tags || extra; |
|
|
|
return ( |
|
|
|
<div className={headingPrefixCls}> |
|
|
|
<div className={`${headingPrefixCls}-left`}> |
|
|
|
{backIconDom} |
|
|
|
{avatar && <Avatar {...avatar} />} |
|
|
|
{title && ( |
|
|
|
<span |
|
|
|
className={`${headingPrefixCls}-title`} |
|
|
|
title={typeof title === 'string' ? title : undefined} |
|
|
|
> |
|
|
|
{title} |
|
|
|
</span> |
|
|
|
)} |
|
|
|
{subTitle && ( |
|
|
|
<span |
|
|
|
className={`${headingPrefixCls}-sub-title`} |
|
|
|
title={typeof subTitle === 'string' ? subTitle : undefined} |
|
|
|
> |
|
|
|
{subTitle} |
|
|
|
</span> |
|
|
|
hasTitle && ( |
|
|
|
<div className={headingPrefixCls}> |
|
|
|
{hasTitle && ( |
|
|
|
<div className={`${headingPrefixCls}-left`}> |
|
|
|
{backIconDom} |
|
|
|
{avatar && <Avatar {...avatar} />} |
|
|
|
{title && ( |
|
|
|
<span |
|
|
|
className={`${headingPrefixCls}-title`} |
|
|
|
title={typeof title === 'string' ? title : undefined} |
|
|
|
> |
|
|
|
{title} |
|
|
|
</span> |
|
|
|
)} |
|
|
|
{subTitle && ( |
|
|
|
<span |
|
|
|
className={`${headingPrefixCls}-sub-title`} |
|
|
|
title={typeof subTitle === 'string' ? subTitle : undefined} |
|
|
|
> |
|
|
|
{subTitle} |
|
|
|
</span> |
|
|
|
)} |
|
|
|
{tags && <span className={`${headingPrefixCls}-tags`}>{tags}</span>} |
|
|
|
</div> |
|
|
|
)} |
|
|
|
{tags && <span className={`${headingPrefixCls}-tags`}>{tags}</span>} |
|
|
|
{extra && <span className={`${headingPrefixCls}-extra`}>{extra}</span>} |
|
|
|
</div> |
|
|
|
{extra && <span className={`${headingPrefixCls}-extra`}>{extra}</span>} |
|
|
|
</div> |
|
|
|
) |
|
|
|
); |
|
|
|
} |
|
|
|
return null; |
|
|
|