Skip to content

Commit 7e4727e

Browse files
committed
feat: replace HTML with YFMWrapper
1 parent aba9dc8 commit 7e4727e

3 files changed

Lines changed: 23 additions & 15 deletions

File tree

src/blocks/YFM/YFM.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const YFM = (props: YFMProps) => {
2828
blog: true,
2929
resetPaddings: true,
3030
}}
31-
className={b({'no-list-reset': true})}
31+
contentClassName={b({'no-list-reset': true})}
3232
/>
3333
</Wrapper>
3434
);

src/components/PostCard/PostCard.scss

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,18 @@ $block: '.#{$namespace}post-card';
3636
}
3737

3838
&__title {
39-
margin-bottom: $indentXXXS;
40-
4139
&_size_s {
42-
@include heading4();
40+
@include add-specificity(&) {
41+
@include heading4();
42+
margin-bottom: $indentXXXS;
43+
}
4344
}
4445

4546
&_size_m {
46-
@include heading2();
47+
@include add-specificity(&) {
48+
@include heading2();
49+
margin-bottom: $indentXXXS;
50+
}
4751
}
4852
}
4953

src/components/PostCard/PostCard.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, {useContext, useMemo} from 'react';
2-
import {AnalyticsEventsProp, CardBase, HTML, YFMWrapper} from '@gravity-ui/page-constructor';
2+
import {AnalyticsEventsProp, CardBase, YFMWrapper} from '@gravity-ui/page-constructor';
33
import {useUniqId} from '@gravity-ui/uikit';
44

55
import {LikesContext} from '../../contexts/LikesContext';
@@ -91,17 +91,21 @@ export const PostCard = ({
9191
{tags[0].name}
9292
</div>
9393
)}
94-
{title &&
95-
React.createElement(
96-
titleHeadingLevel,
97-
{className: b('title', {size})},
98-
<span>
99-
<HTML id={titleId}>{title}</HTML>
100-
</span>,
101-
)}
94+
{title && (
95+
<YFMWrapper
96+
contentClassName={b('title', {size})}
97+
content={title}
98+
modifiers={{
99+
blog: true,
100+
blogCard: true,
101+
}}
102+
id={titleId}
103+
variant={titleHeadingLevel}
104+
/>
105+
)}
102106
{description && (
103107
<YFMWrapper
104-
className={b('description')}
108+
contentClassName={b('description')}
105109
content={description}
106110
modifiers={{
107111
blog: size === 'm',

0 commit comments

Comments
 (0)