From 42448fab99f7163002ed7f897b5792145b259b78 Mon Sep 17 00:00:00 2001 From: Kyzyl-ool Kezhik Date: Mon, 21 Aug 2023 14:52:01 +0300 Subject: [PATCH] fix: correct usage of heading levels fix: correct usage of heading levels --- .../ExtendedFeatures/ExtendedFeatures.tsx | 24 ++++++++++++------- .../PromoFeaturesBlock/PromoFeaturesBlock.tsx | 2 +- src/blocks/Questions/Questions.tsx | 4 ++-- .../Content/ContentList/ContentList.tsx | 17 ++++++++++++- src/utils/blocks.ts | 4 ++-- 5 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/blocks/ExtendedFeatures/ExtendedFeatures.tsx b/src/blocks/ExtendedFeatures/ExtendedFeatures.tsx index 8eec7086c..568b6ba26 100644 --- a/src/blocks/ExtendedFeatures/ExtendedFeatures.tsx +++ b/src/blocks/ExtendedFeatures/ExtendedFeatures.tsx @@ -27,6 +27,7 @@ export const ExtendedFeaturesBlock = ({ animated, }: ExtendedFeaturesProps) => { const theme = useTheme(); + const itemTitleHeadingTag = title ? 'h3' : 'h2'; return ( @@ -57,14 +58,21 @@ export const ExtendedFeaturesBlock = ({ {iconData && }
- {itemTitle && ( -
- {itemTitle} - {label && ( - {label} - )} -
- )} + {itemTitle && + React.createElement( + itemTitleHeadingTag, + { + className: b('item-title'), + }, + + {itemTitle} + {label && ( + + {label} + + )} + , + )} { })} >
-

{cardTitle}

+

{cardTitle}

diff --git a/src/blocks/Questions/Questions.tsx b/src/blocks/Questions/Questions.tsx index f4ad8a695..d63043776 100644 --- a/src/blocks/Questions/Questions.tsx +++ b/src/blocks/Questions/Questions.tsx @@ -66,7 +66,7 @@ const QuestionsBlock = (props: QuestionsProps) => { itemProp={FaqMicrodataValues.QuestionProp} itemType={FaqMicrodataValues.QuestionType} > -

toggleItem(index)} > @@ -80,7 +80,7 @@ const QuestionsBlock = (props: QuestionsProps) => { iconType="navigation" className={b('arrow')} /> -

+
{
- {title &&

{title}

} + {title && + React.createElement( + getHeadingLevel(size), + {className: b('title')}, + title, + )} {text && (