Skip to content

Commit 91657e1

Browse files
committed
feat: replace HTML on YFMWrapper
1 parent 438c9cc commit 91657e1

File tree

12 files changed

+56
-36
lines changed

12 files changed

+56
-36
lines changed

src/blocks/Contributors/Contributors.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Animatable, AnimateBlock, HTML} from '@gravity-ui/page-constructor';
1+
import {Animatable, AnimateBlock, YFMWrapper} from '@gravity-ui/page-constructor';
22
import {Button} from '@gravity-ui/uikit';
33
import React from 'react';
44

@@ -36,7 +36,7 @@ export const ContributorsBlock: React.FC<ContributorsProps> = ({
3636
<AnimateBlock className={b()} animate={animated}>
3737
<div className={b('header-wrapper')}>
3838
<h2 className={b('header-title')}>
39-
<HTML>{title}</HTML>
39+
<YFMWrapper content={title} modifiers={{constructor: true}} />
4040
</h2>
4141
<div className={b('header-count')}>{contributors.length}</div>
4242
<div>

src/blocks/CustomHeader/CustomHeader.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {ChevronRight} from '@gravity-ui/icons';
2-
import {Animatable, AnimateBlock, Col, Grid, HTML, Row} from '@gravity-ui/page-constructor';
2+
import {Animatable, AnimateBlock, Col, Grid, Row, YFMWrapper} from '@gravity-ui/page-constructor';
33
import {Button, ButtonProps, Flex, Icon, IconData, Text} from '@gravity-ui/uikit';
44
import React from 'react';
55
import ReactTimeAgo from 'react-time-ago';
@@ -99,7 +99,7 @@ export const CustomHeader: React.FC<CustomHeaderProps> = ({
9999
)}
100100
<div className={b('title-col')}>
101101
<h1 className={b('title')}>
102-
<HTML>{title}</HTML>
102+
<YFMWrapper content={title} modifiers={{constructor: true}} />
103103
</h1>
104104
{buttons?.length > 0 ? (
105105
<div className={b('buttons')}>
@@ -147,7 +147,10 @@ export const CustomHeader: React.FC<CustomHeaderProps> = ({
147147
/>
148148
</div>
149149
<div className={b('news-item-content')}>
150-
<HTML>{newsItem.content}</HTML>
150+
<YFMWrapper
151+
content={newsItem.content}
152+
modifiers={{constructor: true}}
153+
/>
151154
</div>
152155
</div>
153156
) : null,

src/blocks/Examples/Examples.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Animatable, AnimateBlock, HTML} from '@gravity-ui/page-constructor';
1+
import {Animatable, AnimateBlock, YFMWrapper} from '@gravity-ui/page-constructor';
22
import {Button, Icon, SegmentedRadioGroup, Select, SelectOption, Theme} from '@gravity-ui/uikit';
33
import {useTranslation} from 'next-i18next';
44
import React from 'react';
@@ -55,7 +55,7 @@ export const Examples: React.FC<ExamplesProps> = ({animated, title, colors}) =>
5555
<AnimateBlock className={b()} animate={animated}>
5656
<div className={b('header-wrapper')}>
5757
<h2 className={b('header-title')}>
58-
<HTML>{title}</HTML>
58+
<YFMWrapper content={title} modifiers={{constructor: true}} />
5959
</h2>
6060
<div className={b('controls')}>
6161
<div className={b('control', {type: 'color'})}>

src/blocks/GithubStarsBlock/GithubStarsBlock.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {ChevronRight} from '@gravity-ui/icons';
2-
import {Animatable, HTML} from '@gravity-ui/page-constructor';
2+
import {Animatable, YFMWrapper} from '@gravity-ui/page-constructor';
33
import {Icon, Text} from '@gravity-ui/uikit';
44
import {useTranslation} from 'next-i18next';
55
import {useRouter} from 'next/router';
@@ -43,7 +43,10 @@ export const GithubStarsBlock: React.FC<GithubStarsBlockProps> = ({device}) => {
4343
<div className={b('wrapper')} data-hide={hide} data-device={device}>
4444
<a className={b()} href={GITHUB_UI_KIT_URL} target="_blank" onClick={hideBlock}>
4545
<Text color="dark-primary" variant="body-2" className={b('text')}>
46-
<HTML>{t('home:github_stars-text')}</HTML>
46+
<YFMWrapper
47+
content={t('home:github_stars-text')}
48+
modifiers={{constructor: true}}
49+
/>
4750
<Icon data={ChevronRight} size="16" />
4851
</Text>
4952
</a>

src/blocks/Libraries/components/LibraryPreview/LibraryPreview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {HTML} from '@gravity-ui/page-constructor';
1+
import {YFMWrapper} from '@gravity-ui/page-constructor';
22
import {Icon} from '@gravity-ui/uikit';
33
import {useTranslation} from 'next-i18next';
44
import Image from 'next/image';
@@ -85,7 +85,7 @@ export const LibraryPreview: React.FC<LibraryPreviewProps> = ({lib, contentStyle
8585
<div className={b('header')}>
8686
{title ? (
8787
<h5 className={b('title')}>
88-
<HTML>{title}</HTML>
88+
<YFMWrapper content={title} modifiers={{constructor: true}} />
8989
</h5>
9090
) : null}
9191
{stars ? (

src/blocks/RoadmapBlock/RoadmapBlock.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Animatable, AnimateBlock, HTML} from '@gravity-ui/page-constructor';
1+
import {Animatable, AnimateBlock, YFMWrapper} from '@gravity-ui/page-constructor';
22
import React from 'react';
33

44
import {Roadmap, RoadmapTask} from '../../components/Roadmap';
@@ -22,7 +22,7 @@ export const RoadmapBlock: React.FC<RoadmapProps> = ({animated, title, tasks}) =
2222
return (
2323
<AnimateBlock className={b()} animate={animated}>
2424
<h2 className={b('title')} data-section="roadmap">
25-
<HTML>{title}</HTML>
25+
<YFMWrapper content={title} modifiers={{constructor: true}} />
2626
</h2>
2727
<Roadmap tasks={tasks} />
2828
</AnimateBlock>

src/blocks/TemplatesBlock/TemplatesBlock.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Animatable, AnimateBlock, HTML} from '@gravity-ui/page-constructor';
1+
import {Animatable, AnimateBlock, YFMWrapper} from '@gravity-ui/page-constructor';
22
import React from 'react';
33

44
import {Templates} from '../../components/Templates';
@@ -40,7 +40,7 @@ export const TemplatesBlock: React.FC<TemplatesProps> = ({animated, title, tabs}
4040
<div ref={blockRef} />
4141
<AnimateBlock className={b()} animate={animated}>
4242
<h2 className={b('title')} data-section="templates">
43-
<HTML>{title}</HTML>
43+
<YFMWrapper content={title} modifiers={{constructor: true}} />
4444
</h2>
4545
<Templates tabs={tabs} />
4646
</AnimateBlock>

src/blocks/UISamples/UISamples.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Animatable, AnimateBlock, HTML} from '@gravity-ui/page-constructor';
1+
import {Animatable, AnimateBlock, YFMWrapper} from '@gravity-ui/page-constructor';
22
import React from 'react';
33
import {block} from 'src/utils';
44

@@ -22,7 +22,7 @@ export const UISamplesBlock: React.FC<UISamplesProps> = ({title}) => {
2222
return (
2323
<AnimateBlock className={b()} animate={false}>
2424
<h2 className={b('title')} data-section="ui-samples">
25-
<HTML>{title}</HTML>
25+
<YFMWrapper content={title} modifiers={{constructor: true}} />
2626
</h2>
2727
<UISamplesMobile />
2828
<UISamplesDesktop />

src/components/Libraries/Libraries.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Col, Grid, HTML, Row} from '@gravity-ui/page-constructor';
1+
import {Col, Grid, Row, YFMWrapper} from '@gravity-ui/page-constructor';
22
import {Icon, TextInput} from '@gravity-ui/uikit';
33
import {useTranslation} from 'next-i18next';
44
import React from 'react';
@@ -101,7 +101,10 @@ export const Libraries = ({libs}: Props) => {
101101
>
102102
<div className={b('library-header')}>
103103
<h5 className={b('library-title')}>
104-
<HTML>{lib.config.title}</HTML>
104+
<YFMWrapper
105+
content={lib.config.title}
106+
modifiers={{constructor: true}}
107+
/>
105108
</h5>
106109
{lib.metadata.stars ? (
107110
<div className={b('stars')}>

src/components/Library/Library.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Col, Grid, HTML, Row} from '@gravity-ui/page-constructor';
1+
import {Col, Grid, Row, YFMWrapper} from '@gravity-ui/page-constructor';
22
import {Button, Icon, Tab, TabList, TabProvider} from '@gravity-ui/uikit';
33
import {useTranslation} from 'next-i18next';
44
import React from 'react';
@@ -140,11 +140,18 @@ export const Library: React.FC<Props> = ({lib}) => {
140140
<Link href="/libraries" className={b('breadcrumbs-link')}>
141141
{t('library:libraries')}
142142
</Link>{' '}
143-
/ <HTML className={b('breadcrumbs-item')}>{lib.config.title}</HTML>
143+
/{' '}
144+
<YFMWrapper
145+
content={lib.config.title}
146+
modifiers={{constructor: true}}
147+
/>
144148
</div>
145149

146150
<h1 className={b('title')}>
147-
<HTML>{lib.config.title}</HTML>
151+
<YFMWrapper
152+
content={lib.config.title}
153+
modifiers={{constructor: true}}
154+
/>
148155
</h1>
149156

150157
<div className={b('description')}>

0 commit comments

Comments
 (0)