@meduza/ui-kit-2 0.1.54 → 0.1.55
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/ui-kit-2.cjs.development.js +5 -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 +5 -7
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +1234 -1234
- package/package.json +6 -2
- package/src/RelatedBlock/index.tsx +4 -6
- package/src/RelatedRichBlock/index.tsx +5 -4
- package/src/_storybook/PreviewWrapper/PreviewWrapper.module.css +2 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.55",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"description": "UIKit for Meduza",
|
|
5
5
|
"repository": "https://github.com/meduza-corp/ui-kit-2.git",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"dayjs": "^1.10.3",
|
|
32
32
|
"react": ">=16",
|
|
33
|
-
"react-intersection-observer": "^8.31.0"
|
|
33
|
+
"react-intersection-observer": "^8.31.0",
|
|
34
|
+
"react-router-dom": "^5.2.0"
|
|
34
35
|
},
|
|
35
36
|
"lint-staged": {
|
|
36
37
|
"**/*.ts?(x)": [
|
|
@@ -75,6 +76,7 @@
|
|
|
75
76
|
"@typescript-eslint/eslint-plugin": "^4.2.0",
|
|
76
77
|
"@typescript-eslint/parser": "^4.2.0",
|
|
77
78
|
"babel-loader": "^8.1.0",
|
|
79
|
+
"dayjs": "^1.10.3",
|
|
78
80
|
"eslint": "^7.9.0",
|
|
79
81
|
"eslint-config-prettier": "^6.11.0",
|
|
80
82
|
"eslint-plugin-jsx-a11y": "^6.3.1",
|
|
@@ -96,7 +98,9 @@
|
|
|
96
98
|
"react-dom": "^16.13.1",
|
|
97
99
|
"react-intersection-observer": "^8.31.0",
|
|
98
100
|
"react-is": "^16.13.1",
|
|
101
|
+
"react-router-dom": "^5.2.0",
|
|
99
102
|
"rollup-plugin-postcss": "^3.1.3",
|
|
103
|
+
"storybook-react-router": "^1.0.8",
|
|
100
104
|
"stylelint": "^13.6.1",
|
|
101
105
|
"stylelint-config-rational-order": "^0.1.2",
|
|
102
106
|
"stylelint-config-sass-guidelines": "^7.0.0",
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
import { Link } from 'react-router-dom'
|
|
3
|
+
|
|
2
4
|
import { RelatedBlockProps } from './RelatedBlock.types'
|
|
3
5
|
import { makeClassName, ClassNames } from '../utils/makeClassName'
|
|
4
6
|
|
|
@@ -28,15 +30,11 @@ export const RelatedBlock: React.FC<RelatedBlockProps> = ({
|
|
|
28
30
|
<ul className={styles.items}>
|
|
29
31
|
{related.map((item, index) => (
|
|
30
32
|
<li key={item.id || index} className={styles[item.layout]}>
|
|
31
|
-
<
|
|
32
|
-
href={item.full_url || `/${item.url}`}
|
|
33
|
-
target="_blank"
|
|
34
|
-
rel="noopener noreferrer"
|
|
35
|
-
>
|
|
33
|
+
<Link to={item.full_url || `/${item.url}`}>
|
|
36
34
|
<span className={styles.first}>{item.title}</span>
|
|
37
35
|
{item.second_title && ' '}
|
|
38
36
|
{item.second_title && <span>{item.second_title}</span>}
|
|
39
|
-
</
|
|
37
|
+
</Link>
|
|
40
38
|
</li>
|
|
41
39
|
))}
|
|
42
40
|
</ul>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-no-target-blank */
|
|
2
2
|
import React, { useEffect } from 'react'
|
|
3
|
+
import { Link } from 'react-router-dom'
|
|
4
|
+
|
|
3
5
|
import { useInView } from 'react-intersection-observer'
|
|
4
6
|
import { RelatedRichBlockProps } from './RelatedRichBlock.types'
|
|
5
7
|
|
|
@@ -85,11 +87,10 @@ export const RelatedRichBlock: React.FC<RelatedRichBlockProps> = ({
|
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
return (
|
|
88
|
-
<
|
|
90
|
+
<Link
|
|
89
91
|
data-testid="related-rich-block"
|
|
90
92
|
className={makeClassName(classNames)}
|
|
91
|
-
|
|
92
|
-
target="_blank"
|
|
93
|
+
to={`/${url}`}
|
|
93
94
|
onClick={(): void => handleClick()}
|
|
94
95
|
ref={ref}
|
|
95
96
|
>
|
|
@@ -115,6 +116,6 @@ export const RelatedRichBlock: React.FC<RelatedRichBlockProps> = ({
|
|
|
115
116
|
<RenderBlocks key={item.id} block={item} styleContext={context} />
|
|
116
117
|
))}
|
|
117
118
|
</div>
|
|
118
|
-
</
|
|
119
|
+
</Link>
|
|
119
120
|
)
|
|
120
121
|
}
|