From 2390740142061ac322877b8892034a5283600e93 Mon Sep 17 00:00:00 2001 From: Nikolay Tverdokhlebov Date: Fri, 20 Dec 2024 18:03:13 +0500 Subject: [PATCH] fix: review replies --- src/blocks/ExtendedFeatures/ExtendedFeatures.tsx | 2 +- src/blocks/Header/Header.tsx | 4 ++-- src/components/HTML/HTML.tsx | 14 +++++++------- src/components/Table/Table.tsx | 2 +- src/models/common.ts | 2 ++ src/sub-blocks/BannerCard/BannerCard.tsx | 2 +- src/sub-blocks/Quote/Quote.tsx | 2 +- src/utils/blocks.ts | 10 +++++----- 8 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/blocks/ExtendedFeatures/ExtendedFeatures.tsx b/src/blocks/ExtendedFeatures/ExtendedFeatures.tsx index e39d85611..a3c894118 100644 --- a/src/blocks/ExtendedFeatures/ExtendedFeatures.tsx +++ b/src/blocks/ExtendedFeatures/ExtendedFeatures.tsx @@ -65,7 +65,7 @@ export const ExtendedFeaturesBlock = ({
{itemTitle && ( {overtitle && ( constructor: true, constructorTheme: textTheme, }} - variant="h1" + tagName="h1" contentPosition="end" > {status} diff --git a/src/components/HTML/HTML.tsx b/src/components/HTML/HTML.tsx index 078e20b5e..b27fb5b22 100644 --- a/src/components/HTML/HTML.tsx +++ b/src/components/HTML/HTML.tsx @@ -1,10 +1,10 @@ import React, {PropsWithChildren, useMemo} from 'react'; -import {ClassNameProps, QAProps} from '../../models/common'; -import {selectVariant} from '../../utils'; +import {ClassNameProps, QAProps, TagName} from '../../models/common'; +import {selectTagName} from '../../utils'; export interface HTMLExtraProps { - variant?: 'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'section' | 'p'; + tagName?: TagName; contentPosition?: 'start' | 'end'; contentClassName?: string; onlyContent?: boolean; @@ -24,20 +24,20 @@ const HTML = ({ contentClassName, qa, contentPosition = 'start', - variant = 'span', + tagName = 'span', onlyContent = false, ...rest }: HTMLProps) => { const renderedContent = useMemo(() => { return content - ? React.createElement(selectVariant({content, block, variant, children}), { + ? React.createElement(selectTagName({content, block, tagName, children}), { dangerouslySetInnerHTML: {__html: content}, className: contentClassName, 'data-qa': qa, ...rest, }) : null; - }, [block, children, content, contentClassName, qa, rest, variant]); + }, [block, children, content, contentClassName, qa, rest, tagName]); if (onlyContent) { return renderedContent; @@ -45,7 +45,7 @@ const HTML = ({ if (children) { return React.createElement( - variant, + tagName, { className, }, diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx index 304aab3d7..0262f1421 100644 --- a/src/components/Table/Table.tsx +++ b/src/components/Table/Table.tsx @@ -48,7 +48,7 @@ export default class Table extends React.Component this.renderMarker(marker, cell) ) : ( {
{
{textLocal && (