@pushwoosh/dumb-components 1.0.78 → 1.0.80
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.
|
@@ -6,7 +6,8 @@ export const DropdownMenuItem = ({
|
|
|
6
6
|
onClick,
|
|
7
7
|
isActive,
|
|
8
8
|
isDanger,
|
|
9
|
-
disabled
|
|
9
|
+
disabled,
|
|
10
|
+
closeOnClick = true
|
|
10
11
|
}) => {
|
|
11
12
|
const onClickContext = useContext(DropdownContext);
|
|
12
13
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -18,7 +19,9 @@ export const DropdownMenuItem = ({
|
|
|
18
19
|
"$active": isActive,
|
|
19
20
|
"$danger": isDanger,
|
|
20
21
|
onClick: () => {
|
|
21
|
-
|
|
22
|
+
if (closeOnClick) {
|
|
23
|
+
onClickContext === null || onClickContext === void 0 || onClickContext(false);
|
|
24
|
+
}
|
|
22
25
|
onClick();
|
|
23
26
|
},
|
|
24
27
|
disabled: disabled
|
|
@@ -16,6 +16,7 @@ export function PushPreview({
|
|
|
16
16
|
width
|
|
17
17
|
}) {
|
|
18
18
|
const title = getLocalizedContent((pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.title) || (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.localizedTitle), language) || appTitle;
|
|
19
|
+
const subtitle = getLocalizedContent((pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.subtitle) || (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.localizedSubtitle), language);
|
|
19
20
|
const content = getLocalizedContent((pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.content) || (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.localizedContent), language);
|
|
20
21
|
const icon = (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.icon) || appIcon || PREVIEW_ICON_URL;
|
|
21
22
|
if (isLoading) {
|
|
@@ -40,6 +41,9 @@ export function PushPreview({
|
|
|
40
41
|
}), React.createElement(Vertical, null, React.createElement(PushTitle, null, React.createElement(RichMessageViewer, {
|
|
41
42
|
value: title,
|
|
42
43
|
flat: true
|
|
44
|
+
})), view === 'extended' && React.createElement(PushTitle, null, React.createElement(RichMessageViewer, {
|
|
45
|
+
value: subtitle,
|
|
46
|
+
flat: true
|
|
43
47
|
})), React.createElement(PushDescription, {
|
|
44
48
|
view: view,
|
|
45
49
|
locked: !pushPreset || !content
|
package/PushPreview/types.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export type PushPreviewView = 'compact' | 'extended' | 'silent' | 'missed-content' | 'empty';
|
|
2
2
|
export interface PushBasicData {
|
|
3
3
|
title?: Record<string, string>;
|
|
4
|
+
subtitle?: Record<string, string>;
|
|
4
5
|
content?: Record<string, string>;
|
|
5
6
|
localizedTitle?: Record<string, string>;
|
|
7
|
+
localizedSubtitle?: Record<string, string>;
|
|
6
8
|
localizedContent?: Record<string, string>;
|
|
7
9
|
icon?: string;
|
|
8
10
|
}
|