Skip to content

Commit

Permalink
feat: support JSX.Element type of header`s overtitle props (#1115)
Browse files Browse the repository at this point in the history
  • Loading branch information
benax-se authored Feb 4, 2025
1 parent 3b73f2b commit 39307f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/blocks/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ export const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>
<Col sizes={titleSizes} className={b('content-inner')}>
{overtitle && (
<div className={b('overtitle')}>
<HTML>{overtitle}</HTML>
{typeof overtitle === 'string' ? (
<HTML>{overtitle}</HTML>
) : (
overtitle
)}
</div>
)}
<h1 className={b('title')} id={titleId}>
Expand Down
2 changes: 1 addition & 1 deletion src/models/constructor-items/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>

export interface HeaderBlockProps {
title: string;
overtitle?: string;
overtitle?: string | JSX.Element;
description?: string;
buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];
width?: HeaderWidth;
Expand Down

0 comments on commit 39307f6

Please sign in to comment.