@meduza/ui-kit-2 0.1.76 → 0.1.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DonatesTeaser/DonatesTeaser.types.d.ts +1 -0
- package/dist/MaterialNote/MaterialNote.types.d.ts +1 -0
- package/dist/ui-kit-2.cjs.development.js +33 -7
- package/dist/ui-kit-2.cjs.development.js.map +1 -1
- package/dist/ui-kit-2.cjs.production.min.js +1 -1
- package/dist/ui-kit-2.cjs.production.min.js.map +1 -1
- package/dist/ui-kit-2.esm.js +33 -7
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +982 -983
- package/package.json +1 -1
- package/src/DonatesTeaser/DonatesTeaser.module.css +0 -1
- package/src/DonatesTeaser/DonatesTeaser.stories.tsx +2 -1
- package/src/DonatesTeaser/DonatesTeaser.types.ts +1 -0
- package/src/DonatesTeaser/index.tsx +25 -8
- package/src/MaterialNote/MaterialNote.types.ts +1 -0
- package/src/MaterialNote/index.tsx +2 -1
- package/src/RenderBlocks/index.tsx +3 -1
package/package.json
CHANGED
|
@@ -16,7 +16,8 @@ const Example: React.FC = () => {
|
|
|
16
16
|
return (
|
|
17
17
|
<>
|
|
18
18
|
<div className={styles.root}>
|
|
19
|
-
<DonatesTeaser styleContext={['center']} />
|
|
19
|
+
<DonatesTeaser lang="ru" styleContext={['center']} />
|
|
20
|
+
<DonatesTeaser lang="en" styleContext={['center']} />
|
|
20
21
|
</div>
|
|
21
22
|
</>
|
|
22
23
|
)
|
|
@@ -6,7 +6,8 @@ import makeStyleContext from '../utils/makeStyleContext'
|
|
|
6
6
|
import styles from './DonatesTeaser.module.css'
|
|
7
7
|
|
|
8
8
|
export const DonatesTeaser: React.FC<DonatesTeaserProps> = ({
|
|
9
|
-
styleContext
|
|
9
|
+
styleContext,
|
|
10
|
+
lang = 'ru'
|
|
10
11
|
}) => {
|
|
11
12
|
let classNames: ClassNames = [[styles.root, true]]
|
|
12
13
|
|
|
@@ -14,22 +15,38 @@ export const DonatesTeaser: React.FC<DonatesTeaserProps> = ({
|
|
|
14
15
|
classNames = makeStyleContext(classNames, styleContext, styles)
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
const data = {
|
|
19
|
+
ru: {
|
|
20
|
+
title:
|
|
21
|
+
'Вы читали «Медузу». Вы слушали «Медузу». Вы смотрели «Медузу»',
|
|
22
|
+
subtitle: 'Помогите нам спасти «Медузу»',
|
|
23
|
+
button: 'Дать денег',
|
|
24
|
+
href: 'https://support.meduza.io'
|
|
25
|
+
},
|
|
26
|
+
en: {
|
|
27
|
+
title: 'You read Meduza. You listen to Meduza. You follow Meduza',
|
|
28
|
+
subtitle: 'Help save Meduza',
|
|
29
|
+
button: 'Pledge today',
|
|
30
|
+
href: 'https://support.meduza.io/en'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
17
34
|
return (
|
|
18
35
|
<div data-testid="donates-teaser" className={makeClassName(classNames)}>
|
|
19
36
|
<div className={styles.main}>
|
|
20
37
|
<h3 className={styles.title}>
|
|
21
|
-
|
|
22
|
-
«Медузу». Вы смотрели «Медузу»
|
|
38
|
+
<span dangerouslySetInnerHTML={{ __html: data[lang].title }} />
|
|
23
39
|
{` `}
|
|
24
|
-
<span
|
|
25
|
-
|
|
26
|
-
|
|
40
|
+
<span
|
|
41
|
+
className={styles.text}
|
|
42
|
+
dangerouslySetInnerHTML={{ __html: data[lang].subtitle }}
|
|
43
|
+
/>
|
|
27
44
|
</h3>
|
|
28
45
|
</div>
|
|
29
46
|
|
|
30
47
|
<div className={styles.cta}>
|
|
31
|
-
<a href=
|
|
32
|
-
<span className={styles.ctaInner}
|
|
48
|
+
<a href={data[lang].href} target="_blank" rel="noreferrer">
|
|
49
|
+
<span className={styles.ctaInner}>{data[lang].button}</span>
|
|
33
50
|
</a>
|
|
34
51
|
</div>
|
|
35
52
|
</div>
|
|
@@ -9,6 +9,7 @@ import styles from './MaterialNote.module.css'
|
|
|
9
9
|
|
|
10
10
|
export const MaterialNote: React.FC<MaterialNoteProps> = ({
|
|
11
11
|
block: { data },
|
|
12
|
+
lang,
|
|
12
13
|
styleContext
|
|
13
14
|
}) => {
|
|
14
15
|
let classNames: ClassNames = [[styles.root, true]]
|
|
@@ -19,7 +20,7 @@ export const MaterialNote: React.FC<MaterialNoteProps> = ({
|
|
|
19
20
|
|
|
20
21
|
return (
|
|
21
22
|
<>
|
|
22
|
-
<DonatesTeaser styleContext={styleContext} />
|
|
23
|
+
<DonatesTeaser styleContext={styleContext} lang={lang} />
|
|
23
24
|
<div data-testid="material-note" className={makeClassName(classNames)}>
|
|
24
25
|
{data &&
|
|
25
26
|
data.map((item) => (
|
|
@@ -120,7 +120,9 @@ export const RenderBlocks: React.FC<RenderBlocksProps> = ({
|
|
|
120
120
|
return <GroupedBlock block={block} styleContext={styleContext} />
|
|
121
121
|
|
|
122
122
|
case 'material_note':
|
|
123
|
-
return
|
|
123
|
+
return (
|
|
124
|
+
<MaterialNote block={block} lang={lang} styleContext={styleContext} />
|
|
125
|
+
)
|
|
124
126
|
|
|
125
127
|
default: {
|
|
126
128
|
return null
|