@ndla/ui 5.0.0 → 5.0.1

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.
@@ -48,10 +48,12 @@ var FigureNotion = function FigureNotion(_ref) {
48
48
  id: figureId,
49
49
  type: 'full-column'
50
50
  }, function (_ref3) {
51
+ var _copyright$license;
52
+
51
53
  var typeClass = _ref3.typeClass;
52
54
  return ___EmotionJSX(React.Fragment, null, typeof children === 'function' ? children({
53
55
  typeClass: typeClass
54
- }) : children, ___EmotionJSX(FigureCaption, {
56
+ }) : children, (copyright === null || copyright === void 0 ? void 0 : (_copyright$license = copyright.license) === null || _copyright$license === void 0 ? void 0 : _copyright$license.license) && ___EmotionJSX(FigureCaption, {
55
57
  hideFigcaption: hideFigCaption,
56
58
  figureId: figureId,
57
59
  id: id,
@@ -62,10 +62,12 @@ var FigureNotion = function FigureNotion(_ref) {
62
62
  id: figureId,
63
63
  type: 'full-column'
64
64
  }, function (_ref3) {
65
+ var _copyright$license;
66
+
65
67
  var typeClass = _ref3.typeClass;
66
68
  return (0, _core.jsx)(_react["default"].Fragment, null, typeof children === 'function' ? children({
67
69
  typeClass: typeClass
68
- }) : children, (0, _core.jsx)(_.FigureCaption, {
70
+ }) : children, (copyright === null || copyright === void 0 ? void 0 : (_copyright$license = copyright.license) === null || _copyright$license === void 0 ? void 0 : _copyright$license.license) && (0, _core.jsx)(_.FigureCaption, {
69
71
  hideFigcaption: hideFigCaption,
70
72
  figureId: figureId,
71
73
  id: id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "UI component library for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -81,5 +81,5 @@
81
81
  "publishConfig": {
82
82
  "access": "public"
83
83
  },
84
- "gitHead": "bf0e9abb4b4533a54b6c9efda0465b5a27072921"
84
+ "gitHead": "43a6444a198b56add3ab80245b26f075c20b465e"
85
85
  }
@@ -52,31 +52,33 @@ const FigureNotion = ({
52
52
  {({ typeClass }) => (
53
53
  <>
54
54
  {typeof children === 'function' ? children({ typeClass }) : children}
55
- <FigureCaption
56
- hideFigcaption={hideFigCaption}
57
- figureId={figureId}
58
- id={id}
59
- caption={title}
60
- reuseLabel={t(`${type}.reuse`)}
61
- authors={contributors}
62
- licenseRights={license.rights}>
63
- <FigureLicenseDialog
55
+ {copyright?.license?.license && (
56
+ <FigureCaption
57
+ hideFigcaption={hideFigCaption}
58
+ figureId={figureId}
64
59
  id={id}
60
+ caption={title}
61
+ reuseLabel={t(`${type}.reuse`)}
65
62
  authors={contributors}
66
- locale={i18n.language}
67
- title={title}
68
- origin={copyright?.origin}
69
- license={license}
70
- messages={{
71
- close: t('close'),
72
- rulesForUse: t('license.concept.rules'),
73
- source: t('source'),
74
- learnAboutLicenses: t('license.learnMore'),
75
- title: t('title'),
76
- }}>
77
- {type === 'image' && <Button outline>{t('license.copyTitle')}</Button>}
78
- </FigureLicenseDialog>
79
- </FigureCaption>
63
+ licenseRights={license.rights}>
64
+ <FigureLicenseDialog
65
+ id={id}
66
+ authors={contributors}
67
+ locale={i18n.language}
68
+ title={title}
69
+ origin={copyright?.origin}
70
+ license={license}
71
+ messages={{
72
+ close: t('close'),
73
+ rulesForUse: t('license.concept.rules'),
74
+ source: t('source'),
75
+ learnAboutLicenses: t('license.learnMore'),
76
+ title: t('title'),
77
+ }}>
78
+ {type === 'image' && <Button outline>{t('license.copyTitle')}</Button>}
79
+ </FigureLicenseDialog>
80
+ </FigureCaption>
81
+ )}
80
82
  </>
81
83
  )}
82
84
  </Figure>