@bigbinary/neeto-molecules 3.16.94 → 3.16.95
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/ShareViaLink.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isPresent, noop, isNotPresent, slugify } from '@bigbinary/neeto-cist';
|
|
1
|
+
import { isPresent, noop, isNotEmpty, isNotPresent, slugify } from '@bigbinary/neeto-cist';
|
|
2
2
|
import PrivateRoute from '@bigbinary/neeto-commons-frontend/react-utils/PrivateRoute';
|
|
3
3
|
import { Link as Link$1, useLocation, useHistory, useRouteMatch, Switch, Route } from 'react-router-dom';
|
|
4
4
|
import ErrorPage from './ErrorPage.js';
|
|
@@ -587,7 +587,8 @@ var ShareBlock = function ShareBlock(_ref) {
|
|
|
587
587
|
disableQRDownload = _ref.disableQRDownload,
|
|
588
588
|
socialMediaProps = _ref.socialMediaProps,
|
|
589
589
|
qrCodeProps = _ref.qrCodeProps,
|
|
590
|
-
entity = _ref.entity
|
|
590
|
+
entity = _ref.entity,
|
|
591
|
+
urls = _ref.urls;
|
|
591
592
|
var location = useLocation();
|
|
592
593
|
var history = useHistory();
|
|
593
594
|
var _useTranslation = useTranslation(),
|
|
@@ -598,7 +599,9 @@ var ShareBlock = function ShareBlock(_ref) {
|
|
|
598
599
|
};
|
|
599
600
|
var hasMoreOptions = isPresent(moreOptions);
|
|
600
601
|
return /*#__PURE__*/jsxs("div", {
|
|
601
|
-
className: "
|
|
602
|
+
className: classnames("grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3", {
|
|
603
|
+
"neeto-ui-border-gray-200 mt-8 border-t pt-8": isNotEmpty(urls)
|
|
604
|
+
}),
|
|
602
605
|
children: [hasMoreOptions && moreOptions.filter(function (_ref2) {
|
|
603
606
|
var permissions = _ref2.permissions;
|
|
604
607
|
return isNotPresent(permissions) || globalProps.permissions.some(includes(__, permissions));
|
|
@@ -644,6 +647,7 @@ var ShareBlock = function ShareBlock(_ref) {
|
|
|
644
647
|
};
|
|
645
648
|
|
|
646
649
|
var MainPanel = function MainPanel(_ref) {
|
|
650
|
+
var _urls$;
|
|
647
651
|
var title = _ref.title,
|
|
648
652
|
description = _ref.description,
|
|
649
653
|
qrCodeProps = _ref.qrCodeProps,
|
|
@@ -699,11 +703,11 @@ var MainPanel = function MainPanel(_ref) {
|
|
|
699
703
|
}), /*#__PURE__*/jsxs("div", {
|
|
700
704
|
className: "neeto-ui-rounded-lg neeto-ui-bg-white p-6 sm:p-8",
|
|
701
705
|
"data-testid": "share-via-link",
|
|
702
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
706
|
+
children: [isNotEmpty(urls) && /*#__PURE__*/jsxs("div", {
|
|
703
707
|
className: "space-y-1",
|
|
704
708
|
children: [/*#__PURE__*/jsx("div", {
|
|
705
709
|
className: "inline-flex max-w-full flex-col space-y-4",
|
|
706
|
-
children: urls.map(function (urlOption) {
|
|
710
|
+
children: urls === null || urls === void 0 ? void 0 : urls.map(function (urlOption) {
|
|
707
711
|
return /*#__PURE__*/createElement(Link, {
|
|
708
712
|
enabledOptions: enabledOptions,
|
|
709
713
|
entityName: entityName,
|
|
@@ -726,7 +730,8 @@ var MainPanel = function MainPanel(_ref) {
|
|
|
726
730
|
moreOptions: moreOptions,
|
|
727
731
|
qrCodeProps: qrCodeProps,
|
|
728
732
|
socialMediaProps: socialMediaProps,
|
|
729
|
-
|
|
733
|
+
urls: urls,
|
|
734
|
+
url: (_urls$ = urls[0]) === null || _urls$ === void 0 ? void 0 : _urls$.url
|
|
730
735
|
})]
|
|
731
736
|
}), customBottomContent]
|
|
732
737
|
})
|
|
@@ -1789,21 +1794,23 @@ var ShareViaLink = function ShareViaLink(_ref) {
|
|
|
1789
1794
|
exact: true,
|
|
1790
1795
|
path: "".concat(sharePath, "/qrcode"),
|
|
1791
1796
|
render: function render() {
|
|
1797
|
+
var _urls$;
|
|
1792
1798
|
return /*#__PURE__*/jsx(QRCode, {
|
|
1793
1799
|
entity: entity,
|
|
1794
1800
|
qrCodeProps: qrCodeProps,
|
|
1795
1801
|
shareUrl: shareUrl,
|
|
1796
|
-
url: urls[0]
|
|
1802
|
+
url: (_urls$ = urls[0]) === null || _urls$ === void 0 ? void 0 : _urls$.url
|
|
1797
1803
|
});
|
|
1798
1804
|
}
|
|
1799
1805
|
}), /*#__PURE__*/jsx(Route, {
|
|
1800
1806
|
exact: true,
|
|
1801
1807
|
path: "".concat(sharePath, "/social-media"),
|
|
1802
1808
|
render: function render() {
|
|
1809
|
+
var _urls$2;
|
|
1803
1810
|
return /*#__PURE__*/jsx(SocialMedia, {
|
|
1804
1811
|
shareUrl: shareUrl,
|
|
1805
1812
|
socialMediaProps: socialMediaProps,
|
|
1806
|
-
url: urls[0].url
|
|
1813
|
+
url: (_urls$2 = urls[0]) === null || _urls$2 === void 0 ? void 0 : _urls$2.url
|
|
1807
1814
|
});
|
|
1808
1815
|
}
|
|
1809
1816
|
}), isPresent(moreOptions) && moreOptions.map(function (_ref2) {
|