@ndla/ui 8.1.2 → 8.2.0
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/es/Topic/Topic.js +25 -21
- package/lib/Topic/Topic.d.ts +2 -1
- package/lib/Topic/Topic.js +26 -21
- package/package.json +2 -2
- package/src/Topic/Topic.tsx +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "76d43c9fc110d7dcd1ab0f46e0f3c7ddd3d313b2"
|
|
84
84
|
}
|
package/src/Topic/Topic.tsx
CHANGED
|
@@ -21,6 +21,7 @@ import Loader from './Loader';
|
|
|
21
21
|
import { ItemProps } from '../Navigation/NavigationBox';
|
|
22
22
|
import { NavigationBox } from '../Navigation';
|
|
23
23
|
import { makeSrcQueryString, ImageCrop, ImageFocalPoint } from '../Image';
|
|
24
|
+
import { MessageBox, MessageBoxType } from '../MessageBox';
|
|
24
25
|
|
|
25
26
|
type InvertItProps = {
|
|
26
27
|
invertedStyle?: boolean;
|
|
@@ -235,6 +236,7 @@ export type TopicProps = {
|
|
|
235
236
|
showContent?: boolean;
|
|
236
237
|
isAdditionalTopic?: boolean;
|
|
237
238
|
frame?: boolean;
|
|
239
|
+
messageBox?: string;
|
|
238
240
|
children?: ReactNode;
|
|
239
241
|
};
|
|
240
242
|
|
|
@@ -249,6 +251,7 @@ const Topic = ({
|
|
|
249
251
|
showContent,
|
|
250
252
|
isAdditionalTopic,
|
|
251
253
|
frame,
|
|
254
|
+
messageBox,
|
|
252
255
|
children,
|
|
253
256
|
}: TopicProps) => {
|
|
254
257
|
const { t } = useTranslation();
|
|
@@ -328,6 +331,7 @@ const Topic = ({
|
|
|
328
331
|
</StyledAdditionalResource>
|
|
329
332
|
)}
|
|
330
333
|
</TopicHeading>
|
|
334
|
+
{messageBox && <MessageBox type={MessageBoxType.medium}>{messageBox}</MessageBox>}
|
|
331
335
|
<TopicIntroduction invertedStyle={invertedStyle}>
|
|
332
336
|
{renderMarkdown ? parse(renderMarkdown(topic.introduction)) : topic.introduction}
|
|
333
337
|
</TopicIntroduction>
|