@pushwoosh/smart-components-kit 1.0.49 → 1.0.50
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.
|
@@ -7,7 +7,7 @@ import { PlatformLogoIcon } from '@pushwoosh/kit-icons';
|
|
|
7
7
|
import { Text } from '@pushwoosh/kit-typography';
|
|
8
8
|
import { LinkRow, ClickActionSection } from './styles';
|
|
9
9
|
import { useSPAContext } from '../../../context';
|
|
10
|
-
import { getSafariUrl } from '../../helpers';
|
|
10
|
+
import { getSafariUrl, isWebLink } from '../../helpers';
|
|
11
11
|
export const OpenActionsSummary = ({
|
|
12
12
|
openActions
|
|
13
13
|
}) => {
|
|
@@ -68,7 +68,7 @@ export const OpenActionsSummary = ({
|
|
|
68
68
|
};
|
|
69
69
|
return React.createElement(Vertical, {
|
|
70
70
|
"$gap": 8
|
|
71
|
-
}, openActions ? React.createElement(React.Fragment, null, showRichmedia && renderInfoBlock('mobile', 'open in-app banner', getRichmediaLink(showRichmedia), showRichmedia.name || showRichmedia.code), !showRichmedia && hasCustomPlatformsDeeplink && renderInfoBlock('mobile', 'follow the Deep link'), !showRichmedia && Object.entries(platformsDeeplinkUrls).map(([platformKey, url]) => renderPlatformDeepLink(+platformKey, url)), !showRichmedia && allPlatformsDeeplinkUrl && hasCustomPlatformsDeeplink && renderPlatformDeepLink('Other platforms', allPlatformsDeeplinkUrl), !showRichmedia && allPlatformsDeeplinkUrl && !hasCustomPlatformsDeeplink && renderInfoBlock('mobile', 'follow the Deep link', allPlatformsDeeplinkUrl), !showRichmedia && !allPlatformsDeeplinkUrl && !hasCustomPlatformsDeeplink && renderInfoBlock('mobile', 'open home page in application'), webPageUrl && renderInfoBlock('web', 'open URL in browser', webPageUrl), webPageUrl && safariUrl && renderInfoBlock('Safari', 'open URL in Safari browser', safariUrl), !webPageUrl && renderInfoBlock('web', 'open home page in browser')) : React.createElement(Spinner, {
|
|
71
|
+
}, openActions ? React.createElement(React.Fragment, null, showRichmedia && renderInfoBlock('mobile', 'open in-app banner', getRichmediaLink(showRichmedia), showRichmedia.name || showRichmedia.code), !showRichmedia && hasCustomPlatformsDeeplink && renderInfoBlock('mobile', 'follow the Deep link'), !showRichmedia && Object.entries(platformsDeeplinkUrls).map(([platformKey, url]) => renderPlatformDeepLink(+platformKey, url)), !showRichmedia && allPlatformsDeeplinkUrl && hasCustomPlatformsDeeplink && renderPlatformDeepLink('Other platforms', allPlatformsDeeplinkUrl, isWebLink(allPlatformsDeeplinkUrl) ? 'open URL in browser' : 'deep link'), !showRichmedia && allPlatformsDeeplinkUrl && !hasCustomPlatformsDeeplink && renderInfoBlock('mobile', isWebLink(allPlatformsDeeplinkUrl) ? 'open URL in browser' : 'follow the Deep link', allPlatformsDeeplinkUrl), !showRichmedia && !allPlatformsDeeplinkUrl && !hasCustomPlatformsDeeplink && renderInfoBlock('mobile', 'open home page in application'), webPageUrl && renderInfoBlock('web', 'open URL in browser', webPageUrl), webPageUrl && safariUrl && renderInfoBlock('Safari', 'open URL in Safari browser', safariUrl), !webPageUrl && renderInfoBlock('web', 'open home page in browser')) : React.createElement(Spinner, {
|
|
72
72
|
color: Color.MAIN,
|
|
73
73
|
size: "medium"
|
|
74
74
|
}));
|
|
@@ -33,7 +33,7 @@ export const usePresetOpenActions = pushPreset => {
|
|
|
33
33
|
platformsDeeplinkUrls,
|
|
34
34
|
showRichmedia
|
|
35
35
|
} = await getPlatformDeeplinksByOpenActions(pushPreset, getDeeplinkUrl);
|
|
36
|
-
let defaultDeeplinkUrl = null;
|
|
36
|
+
let defaultDeeplinkUrl = pushPreset.url ?? null;
|
|
37
37
|
// openAction - for common all mobile deeplink; web url is located in 'url' prop, openActions - map with mobile deeplink platform as a key (0 we should ignore)
|
|
38
38
|
if (((_pushPreset$openActio = pushPreset.openAction) === null || _pushPreset$openActio === void 0 || (_pushPreset$openActio = _pushPreset$openActio.kind) === null || _pushPreset$openActio === void 0 ? void 0 : _pushPreset$openActio.type) === 'deepLink') {
|
|
39
39
|
const deeplinkCommonInfo = pushPreset.openAction.kind.data;
|
|
@@ -101,7 +101,7 @@ const getPlatformDeeplinksByOpenActions = async (pushPreset, getDeeplinkUrl) =>
|
|
|
101
101
|
const getOpenActionsFromV1Preset = async pushPreset => {
|
|
102
102
|
var _pushPreset$localized2, _pushPreset$localized3;
|
|
103
103
|
const webPageUrl = !pushPreset.deeplink && isWebLink(pushPreset.url) ? pushPreset.url : null;
|
|
104
|
-
const defaultDeeplinkUrl = pushPreset.
|
|
104
|
+
const defaultDeeplinkUrl = pushPreset.url ?? null;
|
|
105
105
|
const showRichmedia = pushPreset.richmedia ? {
|
|
106
106
|
code: pushPreset.richmedia
|
|
107
107
|
} : null;
|
package/package.json
CHANGED