@@ -11,6 +11,16 @@ import './Questions.scss';
1111
1212const b = block ( 'QuestionsBlock' ) ;
1313
14+ const FaqMicrodataValues = {
15+ PageType : 'https://schema.org/FAQPage' ,
16+ QuestionType : 'https://schema.org/Question' ,
17+ QuestionProp : 'mainEntity' ,
18+ QuestionTextProp : 'name' ,
19+ AnswerType : 'https://schema.org/Answer' ,
20+ AnswerProp : 'acceptedAnswer' ,
21+ AnswerTextProp : 'text' ,
22+ } as const ;
23+
1424const QuestionsBlock = ( props : QuestionsProps ) => {
1525 const { title, text, additionalInfo, links, buttons, items} = props ;
1626 const [ opened , setOpened ] = useState < number [ ] > ( [ 0 ] ) ;
@@ -28,7 +38,7 @@ const QuestionsBlock = (props: QuestionsProps) => {
2838 } ;
2939
3040 return (
31- < div className = { b ( ) } >
41+ < div className = { b ( ) } itemScope itemType = { FaqMicrodataValues . PageType } >
3242 < Row >
3343 < Col sizes = { { all : 12 , md : 4 } } >
3444 < div className = { b ( 'title' ) } >
@@ -48,12 +58,20 @@ const QuestionsBlock = (props: QuestionsProps) => {
4858 const isOpened = opened . includes ( index ) ;
4959
5060 return (
51- < div key = { itemTitle } className = { b ( 'item' ) } >
61+ < div
62+ key = { itemTitle }
63+ className = { b ( 'item' ) }
64+ itemScope
65+ itemProp = { FaqMicrodataValues . QuestionProp }
66+ itemType = { FaqMicrodataValues . QuestionType }
67+ >
5268 < h4
5369 className = { b ( 'item-title' ) }
5470 onClick = { ( ) => toggleItem ( index ) }
5571 >
56- < HTML > { itemTitle } </ HTML >
72+ < HTML itemProp = { FaqMicrodataValues . QuestionTextProp } >
73+ { itemTitle }
74+ </ HTML >
5775 < ToggleArrow
5876 open = { isOpened }
5977 size = { 16 }
@@ -63,14 +81,20 @@ const QuestionsBlock = (props: QuestionsProps) => {
6381 />
6482 </ h4 >
6583 < Foldable isOpened = { isOpened } >
66- < div className = { b ( 'text' ) } >
84+ < div
85+ className = { b ( 'text' ) }
86+ itemScope
87+ itemProp = { FaqMicrodataValues . AnswerProp }
88+ itemType = { FaqMicrodataValues . AnswerType }
89+ >
6790 < YFMWrapper
6891 content = { itemText }
6992 modifiers = { {
7093 constructor : true ,
7194 constructorListStyle : true ,
7295 constructorListStyleDash : listStyle === 'dash' ,
7396 } }
97+ itemProp = { FaqMicrodataValues . QuestionTextProp }
7498 />
7599 { link && < Link { ...link } className = { b ( 'link' ) } /> }
76100 </ div >
0 commit comments