@pushwoosh/dumb-components 1.1.133 → 1.1.135
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/AccessForbidden/AccessForbidden.js +10 -2
- package/AccessForbidden/polyglot/index.d.ts +2 -0
- package/AccessForbidden/polyglot/index.js +10 -0
- package/AccessForbidden/polyglot/messages_en.d.ts +3 -0
- package/AccessForbidden/polyglot/messages_en.js +4 -0
- package/AccessForbidden/polyglot/messages_ru.d.ts +3 -0
- package/AccessForbidden/polyglot/messages_ru.js +4 -0
- package/AccessForbidden/polyglot/types.d.ts +5 -0
- package/AccessForbidden/polyglot/types.js +1 -0
- package/Calendar/CalendarDropdown/CalendarDropdown.js +15 -3
- package/Calendar/CalendarSuperForm/components/CalendarTimeAndTimezoneSection/CalendarTimeAndTimezoneSection.js +14 -4
- package/Calendar/polyglot/index.d.ts +2 -0
- package/Calendar/polyglot/index.js +10 -0
- package/Calendar/polyglot/messages_en.d.ts +3 -0
- package/Calendar/polyglot/messages_en.js +11 -0
- package/Calendar/polyglot/messages_ru.d.ts +3 -0
- package/Calendar/polyglot/messages_ru.js +11 -0
- package/Calendar/polyglot/types.d.ts +14 -0
- package/Calendar/polyglot/types.js +1 -0
- package/CrashScreen/CrashScreen.js +6 -1
- package/CrashScreen/polyglot/index.d.ts +2 -0
- package/CrashScreen/polyglot/index.js +10 -0
- package/CrashScreen/polyglot/messages_en.d.ts +3 -0
- package/CrashScreen/polyglot/messages_en.js +4 -0
- package/CrashScreen/polyglot/messages_ru.d.ts +3 -0
- package/CrashScreen/polyglot/messages_ru.js +4 -0
- package/CrashScreen/polyglot/types.d.ts +5 -0
- package/CrashScreen/polyglot/types.js +1 -0
- package/DateTimePicker/components/DatePickerField/DatePickerField.js +4 -1
- package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +4 -1
- package/DateTimePicker/components/Month/Month.js +16 -1
- package/DateTimePicker/polyglot/index.d.ts +2 -0
- package/DateTimePicker/polyglot/index.js +9 -0
- package/DateTimePicker/polyglot/messages_en.d.ts +3 -0
- package/DateTimePicker/polyglot/messages_en.js +11 -0
- package/DateTimePicker/polyglot/messages_ru.d.ts +3 -0
- package/DateTimePicker/polyglot/messages_ru.js +11 -0
- package/DateTimePicker/polyglot/types.d.ts +12 -0
- package/DateTimePicker/polyglot/types.js +1 -0
- package/Drawer/components/DrawerDocs/DrawerDocs.js +9 -3
- package/Drawer/polyglot/index.d.ts +2 -0
- package/Drawer/polyglot/index.js +10 -0
- package/Drawer/polyglot/messages_en.d.ts +3 -0
- package/Drawer/polyglot/messages_en.js +4 -0
- package/Drawer/polyglot/messages_ru.d.ts +3 -0
- package/Drawer/polyglot/messages_ru.js +4 -0
- package/Drawer/polyglot/types.d.ts +5 -0
- package/Drawer/polyglot/types.js +1 -0
- package/EditableField/EditableField.js +7 -2
- package/EditableField/polyglot/index.d.ts +2 -0
- package/EditableField/polyglot/index.js +9 -0
- package/EditableField/polyglot/messages_en.d.ts +3 -0
- package/EditableField/polyglot/messages_en.js +4 -0
- package/EditableField/polyglot/messages_ru.d.ts +3 -0
- package/EditableField/polyglot/messages_ru.js +4 -0
- package/EditableField/polyglot/types.d.ts +5 -0
- package/EditableField/polyglot/types.js +1 -0
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +11 -3
- package/EmailTemplatePreview/polyglot/index.d.ts +2 -0
- package/EmailTemplatePreview/polyglot/index.js +10 -0
- package/EmailTemplatePreview/polyglot/messages_en.d.ts +3 -0
- package/EmailTemplatePreview/polyglot/messages_en.js +5 -0
- package/EmailTemplatePreview/polyglot/messages_ru.d.ts +3 -0
- package/EmailTemplatePreview/polyglot/messages_ru.js +5 -0
- package/EmailTemplatePreview/polyglot/types.d.ts +6 -0
- package/EmailTemplatePreview/polyglot/types.js +1 -0
- package/FrequencyCapping/FrequencyCappingEdit.js +7 -2
- package/FrequencyCapping/FrequencyCappingInApps.js +7 -2
- package/FrequencyCapping/FrequencyCappingReadonly.js +5 -2
- package/FrequencyCapping/components/Description/index.js +3 -1
- package/FrequencyCapping/components/Settings/EditCappingSettings.js +10 -3
- package/FrequencyCapping/components/Settings/EditInAppCappingSettings.js +25 -8
- package/FrequencyCapping/helpers/getCappingChipText.d.ts +2 -1
- package/FrequencyCapping/helpers/getCappingChipText.js +13 -15
- package/FrequencyCapping/helpers/getDescriptionMessages.d.ts +2 -1
- package/FrequencyCapping/helpers/getDescriptionMessages.js +42 -22
- package/FrequencyCapping/helpers/getGlobalCappingLinkText.d.ts +2 -0
- package/FrequencyCapping/helpers/getGlobalCappingLinkText.js +7 -0
- package/FrequencyCapping/helpers/getReadonlyCappingHelpers.d.ts +2 -1
- package/FrequencyCapping/helpers/getReadonlyCappingHelpers.js +27 -15
- package/FrequencyCapping/polyglot/index.d.ts +4 -0
- package/FrequencyCapping/polyglot/index.js +10 -0
- package/FrequencyCapping/polyglot/messages_en.d.ts +3 -0
- package/FrequencyCapping/polyglot/messages_en.js +33 -0
- package/FrequencyCapping/polyglot/messages_ru.d.ts +3 -0
- package/FrequencyCapping/polyglot/messages_ru.js +33 -0
- package/FrequencyCapping/polyglot/types.d.ts +46 -0
- package/FrequencyCapping/polyglot/types.js +1 -0
- package/Modal/components/ModalConfirm/ModalConfirm.js +21 -8
- package/Modal/components/ModalConfirm/types.d.ts +1 -1
- package/Modal/polyglot/index.d.ts +2 -0
- package/Modal/polyglot/index.js +9 -0
- package/Modal/polyglot/messages_en.d.ts +3 -0
- package/Modal/polyglot/messages_en.js +6 -0
- package/Modal/polyglot/messages_ru.d.ts +3 -0
- package/Modal/polyglot/messages_ru.js +6 -0
- package/Modal/polyglot/types.d.ts +7 -0
- package/Modal/polyglot/types.js +1 -0
- package/NotificationInbox/NotificationBell.js +7 -1
- package/NotificationInbox/NotificationInbox.js +19 -5
- package/NotificationInbox/polyglot/index.d.ts +2 -0
- package/NotificationInbox/polyglot/index.js +10 -0
- package/NotificationInbox/polyglot/messages_en.d.ts +3 -0
- package/NotificationInbox/polyglot/messages_en.js +8 -0
- package/NotificationInbox/polyglot/messages_ru.d.ts +3 -0
- package/NotificationInbox/polyglot/messages_ru.js +8 -0
- package/NotificationInbox/polyglot/types.d.ts +11 -0
- package/NotificationInbox/polyglot/types.js +1 -0
- package/PushPreview/components/MissedContentPreview/MissedContentPreview.js +7 -2
- package/PushPreview/polyglot/index.d.ts +2 -0
- package/PushPreview/polyglot/index.js +9 -0
- package/PushPreview/polyglot/messages_en.d.ts +3 -0
- package/PushPreview/polyglot/messages_en.js +4 -0
- package/PushPreview/polyglot/messages_ru.d.ts +3 -0
- package/PushPreview/polyglot/messages_ru.js +4 -0
- package/PushPreview/polyglot/types.d.ts +5 -0
- package/PushPreview/polyglot/types.js +1 -0
- package/SendRate/SendRateEdit.js +7 -2
- package/SendRate/SendRateReadonly.js +5 -2
- package/SendRate/components/Condition/index.js +8 -1
- package/SendRate/components/Description/index.js +20 -6
- package/SendRate/components/Settings/index.js +7 -2
- package/SendRate/helpers/getGlobalSendRateLinkText.d.ts +2 -0
- package/SendRate/helpers/getGlobalSendRateLinkText.js +7 -0
- package/SendRate/helpers/getReadonlySendRateHelpers.d.ts +2 -1
- package/SendRate/helpers/getReadonlySendRateHelpers.js +20 -11
- package/SendRate/polyglot/index.d.ts +4 -0
- package/SendRate/polyglot/index.js +10 -0
- package/SendRate/polyglot/messages_en.d.ts +3 -0
- package/SendRate/polyglot/messages_en.js +20 -0
- package/SendRate/polyglot/messages_ru.d.ts +3 -0
- package/SendRate/polyglot/messages_ru.js +20 -0
- package/SendRate/polyglot/types.d.ts +23 -0
- package/SendRate/polyglot/types.js +1 -0
- package/package.json +1 -1
- package/polyglot/index.d.ts +1 -1
- package/polyglot/index.js +1 -1
- package/polyglot/react.d.ts +12 -2
- package/polyglot/react.js +80 -45
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const messages = {
|
|
2
|
+
'DUMB.FREQUENCY_CAPPING.FIELD_TITLE': 'Ограничение частоты',
|
|
3
|
+
'DUMB.FREQUENCY_CAPPING.LINK.SET_UP': 'Настроить',
|
|
4
|
+
'DUMB.FREQUENCY_CAPPING.LINK.SETTINGS': 'Настройки',
|
|
5
|
+
'DUMB.FREQUENCY_CAPPING.SETTINGS.LIMIT_TO_MAX': 'Не более',
|
|
6
|
+
'DUMB.FREQUENCY_CAPPING.SETTINGS.MESSAGES_PER': 'сообщений за',
|
|
7
|
+
'DUMB.FREQUENCY_CAPPING.SETTINGS.DAYS': 'дн.',
|
|
8
|
+
'DUMB.FREQUENCY_CAPPING.INAPP.LIMIT_DESC': 'Ограничьте частоту показа этого In-App конкретному пользователю',
|
|
9
|
+
'DUMB.FREQUENCY_CAPPING.INAPP.LIMITED_TO': 'Не более',
|
|
10
|
+
'DUMB.FREQUENCY_CAPPING.INAPP.TOTAL_IMPRESSIONS': 'показов всего',
|
|
11
|
+
'DUMB.FREQUENCY_CAPPING.INAPP.IMPRESSIONS_IN': 'показов за',
|
|
12
|
+
'DUMB.FREQUENCY_CAPPING.INAPP.DAYS': 'дн.',
|
|
13
|
+
'DUMB.FREQUENCY_CAPPING.INAPP.ENABLE': 'Включить',
|
|
14
|
+
'DUMB.FREQUENCY_CAPPING.INAPP.DAYS_INTERVAL': 'дн. интервал между показами',
|
|
15
|
+
'DUMB.FREQUENCY_CAPPING.CHIP.UNLIMITED': 'без ограничений',
|
|
16
|
+
'DUMB.FREQUENCY_CAPPING.CHIP.MESSAGE': '{{count}} {{count | pluralize: "сообщение", "сообщения", "сообщений"}} за {{days}} {{days | pluralize: "день", "дня", "дней"}}',
|
|
17
|
+
'DUMB.FREQUENCY_CAPPING.CHIP.INAPP': '{{count}} in-app за {{days}} {{days | pluralize: "день", "дня", "дней"}}',
|
|
18
|
+
'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_INAPP_UNSET': 'Этот in-app будет использовать глобальное ограничение частоты, так как лимит не задан.',
|
|
19
|
+
'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_PREFIX': 'При текущих настройках, если пользователь получит более',
|
|
20
|
+
'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_INAPP_SUFFIX': 'этот in-app не будет доставлен.',
|
|
21
|
+
'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_MSG_UNSET_PREFIX': 'Это сообщение будет использовать',
|
|
22
|
+
'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_MSG_UNSET_SUFFIX': 'глобальное ограничение частоты, так как лимит не задан.',
|
|
23
|
+
'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_MSG_SUFFIX': ', это сообщение не будет доставлено{% if isInJourney == true %}, а пользователь перейдёт к следующему шагу{% endif %}.',
|
|
24
|
+
'DUMB.FREQUENCY_CAPPING.DESC.CUSTOM_INAPP': 'Вместо глобального ограничения частоты будет использован заданный вами лимит показов in-app. Если подписчик превысит лимит полученных in-app, он больше не увидит этот in-app.',
|
|
25
|
+
'DUMB.FREQUENCY_CAPPING.DESC.CUSTOM_MSG': 'Вместо глобального ограничения частоты будет использован заданный вами лимит отправленных сообщений. Если подписчик превысит лимит полученных сообщений, он не получит это сообщение{% if isInJourney == true %} и перейдёт к следующему шагу{% endif %}.',
|
|
26
|
+
'DUMB.FREQUENCY_CAPPING.DESC.IGNORE': 'Пользователь получит это сообщение в любом случае, даже если он превысил установленные лимиты сообщений для канала. Используйте с осторожностью, чтобы не отправлять слишком много сообщений.',
|
|
27
|
+
'DUMB.FREQUENCY_CAPPING.RO.CUSTOM_LABEL': 'Пользовательское ограничение частоты для этого сообщения:',
|
|
28
|
+
'DUMB.FREQUENCY_CAPPING.RO.IGNORE_LABEL': 'Отправлять сообщения без глобального ограничения частоты',
|
|
29
|
+
'DUMB.FREQUENCY_CAPPING.RO.GLOBAL_LABEL': 'Глобальное ограничение частоты:',
|
|
30
|
+
'DUMB.FREQUENCY_CAPPING.RO.BECAUSE_UNSET': 'так как лимит не задан',
|
|
31
|
+
'DUMB.FREQUENCY_CAPPING.RO.TOOLTIP_LIMIT': 'Если подписчик превысит лимит полученных сообщений, он не получит это сообщение{% if isInJourney == true %} и перейдёт к следующему шагу{% endif %}',
|
|
32
|
+
'DUMB.FREQUENCY_CAPPING.RO.TOOLTIP_IGNORE': 'Пользователь получит это сообщение в любом случае, даже если он превысил установленные лимиты для канала'
|
|
33
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { NoParams } from '../../polyglot';
|
|
2
|
+
export type FrequencyCappingMessages = {
|
|
3
|
+
'DUMB.FREQUENCY_CAPPING.FIELD_TITLE': NoParams;
|
|
4
|
+
'DUMB.FREQUENCY_CAPPING.LINK.SET_UP': NoParams;
|
|
5
|
+
'DUMB.FREQUENCY_CAPPING.LINK.SETTINGS': NoParams;
|
|
6
|
+
'DUMB.FREQUENCY_CAPPING.SETTINGS.LIMIT_TO_MAX': NoParams;
|
|
7
|
+
'DUMB.FREQUENCY_CAPPING.SETTINGS.MESSAGES_PER': NoParams;
|
|
8
|
+
'DUMB.FREQUENCY_CAPPING.SETTINGS.DAYS': NoParams;
|
|
9
|
+
'DUMB.FREQUENCY_CAPPING.INAPP.LIMIT_DESC': NoParams;
|
|
10
|
+
'DUMB.FREQUENCY_CAPPING.INAPP.LIMITED_TO': NoParams;
|
|
11
|
+
'DUMB.FREQUENCY_CAPPING.INAPP.TOTAL_IMPRESSIONS': NoParams;
|
|
12
|
+
'DUMB.FREQUENCY_CAPPING.INAPP.IMPRESSIONS_IN': NoParams;
|
|
13
|
+
'DUMB.FREQUENCY_CAPPING.INAPP.DAYS': NoParams;
|
|
14
|
+
'DUMB.FREQUENCY_CAPPING.INAPP.ENABLE': NoParams;
|
|
15
|
+
'DUMB.FREQUENCY_CAPPING.INAPP.DAYS_INTERVAL': NoParams;
|
|
16
|
+
'DUMB.FREQUENCY_CAPPING.CHIP.UNLIMITED': NoParams;
|
|
17
|
+
'DUMB.FREQUENCY_CAPPING.CHIP.MESSAGE': {
|
|
18
|
+
count: number;
|
|
19
|
+
days: number;
|
|
20
|
+
};
|
|
21
|
+
'DUMB.FREQUENCY_CAPPING.CHIP.INAPP': {
|
|
22
|
+
count: number;
|
|
23
|
+
days: number;
|
|
24
|
+
};
|
|
25
|
+
'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_INAPP_UNSET': NoParams;
|
|
26
|
+
'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_PREFIX': NoParams;
|
|
27
|
+
'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_INAPP_SUFFIX': NoParams;
|
|
28
|
+
'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_MSG_UNSET_PREFIX': NoParams;
|
|
29
|
+
'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_MSG_UNSET_SUFFIX': NoParams;
|
|
30
|
+
'DUMB.FREQUENCY_CAPPING.DESC.GLOBAL_MSG_SUFFIX': {
|
|
31
|
+
isInJourney: boolean;
|
|
32
|
+
};
|
|
33
|
+
'DUMB.FREQUENCY_CAPPING.DESC.CUSTOM_INAPP': NoParams;
|
|
34
|
+
'DUMB.FREQUENCY_CAPPING.DESC.CUSTOM_MSG': {
|
|
35
|
+
isInJourney: boolean;
|
|
36
|
+
};
|
|
37
|
+
'DUMB.FREQUENCY_CAPPING.DESC.IGNORE': NoParams;
|
|
38
|
+
'DUMB.FREQUENCY_CAPPING.RO.CUSTOM_LABEL': NoParams;
|
|
39
|
+
'DUMB.FREQUENCY_CAPPING.RO.IGNORE_LABEL': NoParams;
|
|
40
|
+
'DUMB.FREQUENCY_CAPPING.RO.GLOBAL_LABEL': NoParams;
|
|
41
|
+
'DUMB.FREQUENCY_CAPPING.RO.BECAUSE_UNSET': NoParams;
|
|
42
|
+
'DUMB.FREQUENCY_CAPPING.RO.TOOLTIP_LIMIT': {
|
|
43
|
+
isInJourney: boolean;
|
|
44
|
+
};
|
|
45
|
+
'DUMB.FREQUENCY_CAPPING.RO.TOOLTIP_IGNORE': NoParams;
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,22 +2,33 @@ import React, { useState, useCallback } from 'react';
|
|
|
2
2
|
import { Vertical, Horizontal } from '@pushwoosh/kit-helpers';
|
|
3
3
|
import { Banner } from '../../../Banner';
|
|
4
4
|
import { Button } from '../../../Button';
|
|
5
|
+
import { useLang } from '../../polyglot';
|
|
5
6
|
import { Modal } from '../Modal';
|
|
6
7
|
import { ModalHeader, ModalBody, ModalFooter } from '../ModalContent';
|
|
7
8
|
import { ModalTitle } from '../ModalTitle';
|
|
8
9
|
export function ModalConfirm(props) {
|
|
10
|
+
const lang = useLang();
|
|
9
11
|
const {
|
|
10
12
|
isOpen,
|
|
11
|
-
title
|
|
13
|
+
title,
|
|
12
14
|
size = 'small',
|
|
13
15
|
description = '',
|
|
14
|
-
confirmButtonText
|
|
15
|
-
cancelButtonText
|
|
16
|
+
confirmButtonText,
|
|
17
|
+
cancelButtonText,
|
|
16
18
|
confirmButtonColor = 'primary',
|
|
17
19
|
callback,
|
|
18
20
|
onAccept,
|
|
19
21
|
onCancel
|
|
20
22
|
} = props;
|
|
23
|
+
const resolvedTitle = title ?? lang({
|
|
24
|
+
message: 'DUMB.MODAL.CONFIRM_TITLE'
|
|
25
|
+
});
|
|
26
|
+
const resolvedConfirmText = confirmButtonText ?? lang({
|
|
27
|
+
message: 'DUMB.MODAL.CONFIRM'
|
|
28
|
+
});
|
|
29
|
+
const resolvedCancelText = cancelButtonText ?? lang({
|
|
30
|
+
message: 'DUMB.MODAL.CANCEL'
|
|
31
|
+
});
|
|
21
32
|
const [isLoading, setIsLoading] = useState(false);
|
|
22
33
|
const [errorMessage, setErrorMessage] = useState('');
|
|
23
34
|
const handleConfirm = useCallback(async () => {
|
|
@@ -27,18 +38,20 @@ export function ModalConfirm(props) {
|
|
|
27
38
|
await (callback === null || callback === void 0 ? void 0 : callback());
|
|
28
39
|
await onAccept();
|
|
29
40
|
} catch (error) {
|
|
30
|
-
setErrorMessage((error === null || error === void 0 ? void 0 : error.message) ||
|
|
41
|
+
setErrorMessage((error === null || error === void 0 ? void 0 : error.message) || lang({
|
|
42
|
+
message: 'DUMB.MODAL.UNEXPECTED_ERROR'
|
|
43
|
+
}));
|
|
31
44
|
} finally {
|
|
32
45
|
setIsLoading(false);
|
|
33
46
|
}
|
|
34
|
-
}, [callback, onAccept]);
|
|
47
|
+
}, [callback, onAccept, lang]);
|
|
35
48
|
return React.createElement(Modal, {
|
|
36
49
|
size: size,
|
|
37
50
|
isOpen: isOpen,
|
|
38
51
|
onClose: onCancel
|
|
39
52
|
}, React.createElement(ModalHeader, null, React.createElement(Vertical, {
|
|
40
53
|
"$gap": 8
|
|
41
|
-
}, React.createElement(ModalTitle, null,
|
|
54
|
+
}, React.createElement(ModalTitle, null, resolvedTitle), errorMessage && React.createElement(Banner, {
|
|
42
55
|
type: "error",
|
|
43
56
|
title: errorMessage
|
|
44
57
|
}))), description && React.createElement(ModalBody, null, description), React.createElement(ModalFooter, null, React.createElement(Horizontal, {
|
|
@@ -47,9 +60,9 @@ export function ModalConfirm(props) {
|
|
|
47
60
|
}, React.createElement(Button, {
|
|
48
61
|
color: "secondary",
|
|
49
62
|
onClick: onCancel
|
|
50
|
-
},
|
|
63
|
+
}, resolvedCancelText), React.createElement(Button, {
|
|
51
64
|
color: confirmButtonColor,
|
|
52
65
|
isLoading: isLoading,
|
|
53
66
|
onClick: handleConfirm
|
|
54
|
-
},
|
|
67
|
+
}, resolvedConfirmText))));
|
|
55
68
|
}
|
|
@@ -3,7 +3,7 @@ import { type modalSizes } from '../Modal/maps';
|
|
|
3
3
|
export type ConfirmButtonColor = 'primary' | 'secondary' | 'danger';
|
|
4
4
|
export interface ModalConfirmProps {
|
|
5
5
|
isOpen: boolean;
|
|
6
|
-
title
|
|
6
|
+
title?: string;
|
|
7
7
|
size?: keyof typeof modalSizes;
|
|
8
8
|
description?: ReactNode;
|
|
9
9
|
confirmButtonText?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { NotificationIcon } from '@pushwoosh/kit-icons';
|
|
4
|
+
import { useLang } from './polyglot';
|
|
4
5
|
import { NotificationBellButton, NotificationBellBadge, NotificationBellBadgeDot } from './styles';
|
|
5
6
|
export function NotificationBell({
|
|
6
7
|
count = 0,
|
|
@@ -8,6 +9,7 @@ export function NotificationBell({
|
|
|
8
9
|
isOpened = false,
|
|
9
10
|
onClick
|
|
10
11
|
}) {
|
|
12
|
+
const lang = useLang();
|
|
11
13
|
const hasNotifications = count > 0;
|
|
12
14
|
const showBadge = hasNotifications || severity;
|
|
13
15
|
const getBadgeColor = () => {
|
|
@@ -20,7 +22,11 @@ export function NotificationBell({
|
|
|
20
22
|
"$isOpened": isOpened,
|
|
21
23
|
onClick: onClick,
|
|
22
24
|
type: "button",
|
|
23
|
-
"aria-label": hasNotifications ?
|
|
25
|
+
"aria-label": hasNotifications ? lang({
|
|
26
|
+
message: 'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD'
|
|
27
|
+
}) : lang({
|
|
28
|
+
message: 'DUMB.NOTIFICATION_INBOX.TITLE'
|
|
29
|
+
})
|
|
24
30
|
}, React.createElement(NotificationIcon, {
|
|
25
31
|
size: "medium",
|
|
26
32
|
type: "enabled",
|
|
@@ -8,6 +8,7 @@ import { useInfiniteScroll } from './useInfiniteScroll';
|
|
|
8
8
|
import { Badge } from '../Badge';
|
|
9
9
|
import { Spinner } from '../Spinner';
|
|
10
10
|
import emptyNotificationsIcon from './assets/EmptyNotifications.svg?url';
|
|
11
|
+
import { Lang } from './polyglot';
|
|
11
12
|
import { NotificationInboxContainer, NotificationInboxHeader, NotificationInboxTitle, NotificationInboxList, NotificationItem, NotificationIndicator, NotificationHeader, NotificationDescription, NotificationActionLink, NotificationInboxEmptyIcon, NotificationInboxEmptyText } from './styles';
|
|
12
13
|
export function NotificationInbox({
|
|
13
14
|
notifications,
|
|
@@ -51,7 +52,9 @@ export function NotificationInbox({
|
|
|
51
52
|
return React.createElement(NotificationInboxContainer, null, React.createElement(NotificationInboxHeader, null, React.createElement(NotificationInboxTitle, {
|
|
52
53
|
"$variant": "h4",
|
|
53
54
|
"$color": Color.MAIN
|
|
54
|
-
},
|
|
55
|
+
}, React.createElement(Lang, {
|
|
56
|
+
message: "DUMB.NOTIFICATION_INBOX.TITLE"
|
|
57
|
+
}))), React.createElement(Vertical, {
|
|
55
58
|
"$alignItems": "center",
|
|
56
59
|
"$gap": 24,
|
|
57
60
|
"$padding": "24px"
|
|
@@ -76,10 +79,15 @@ export function NotificationInbox({
|
|
|
76
79
|
return React.createElement(NotificationInboxContainer, null, React.createElement(NotificationInboxHeader, null, React.createElement(NotificationInboxTitle, {
|
|
77
80
|
"$variant": "h4",
|
|
78
81
|
"$color": Color.MAIN
|
|
79
|
-
}, React.createElement("span", null,
|
|
82
|
+
}, React.createElement("span", null, React.createElement(Lang, {
|
|
83
|
+
message: "DUMB.NOTIFICATION_INBOX.TITLE"
|
|
84
|
+
})), unreadCount > 0 && React.createElement(React.Fragment, null, ' ', React.createElement(Text, {
|
|
80
85
|
"$variant": "h4",
|
|
81
86
|
"$color": Color.LOCKED
|
|
82
|
-
},
|
|
87
|
+
}, React.createElement(Lang, {
|
|
88
|
+
message: "DUMB.NOTIFICATION_INBOX.UNREAD",
|
|
89
|
+
count: unreadCount
|
|
90
|
+
}))))), React.createElement(NotificationInboxList, {
|
|
83
91
|
"data-notification-list": true
|
|
84
92
|
}, notifications.map(notification => {
|
|
85
93
|
const isRead = notification.isRead ?? false;
|
|
@@ -132,7 +140,11 @@ export function NotificationInbox({
|
|
|
132
140
|
e.stopPropagation();
|
|
133
141
|
setExpandedId(prev => prev === notification.id ? null : notification.id);
|
|
134
142
|
}
|
|
135
|
-
}, expandedId === notification.id ?
|
|
143
|
+
}, expandedId === notification.id ? React.createElement(Lang, {
|
|
144
|
+
message: "DUMB.NOTIFICATION_INBOX.COLLAPSE"
|
|
145
|
+
}) : React.createElement(Lang, {
|
|
146
|
+
message: "DUMB.NOTIFICATION_INBOX.EXPAND"
|
|
147
|
+
})))));
|
|
136
148
|
}), hasMore && isLoading && React.createElement(Horizontal, {
|
|
137
149
|
ref: loadMoreRef,
|
|
138
150
|
"$alignItems": "center",
|
|
@@ -145,7 +157,9 @@ export function NotificationInbox({
|
|
|
145
157
|
}), React.createElement(Text, {
|
|
146
158
|
"$variant": "footnote",
|
|
147
159
|
"$color": Color.LOCKED
|
|
148
|
-
},
|
|
160
|
+
}, React.createElement(Lang, {
|
|
161
|
+
message: "DUMB.NOTIFICATION_INBOX.LOADING_MORE"
|
|
162
|
+
}))), isLoading && notifications.length === 0 && !hasMore && React.createElement(Horizontal, {
|
|
149
163
|
"$justifyContent": "center",
|
|
150
164
|
"$alignItems": "center",
|
|
151
165
|
"$padding": "16px 0"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const messages = {
|
|
2
|
+
'DUMB.NOTIFICATION_INBOX.TITLE': 'Notifications',
|
|
3
|
+
'DUMB.NOTIFICATION_INBOX.UNREAD': '{{count}} unread',
|
|
4
|
+
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Collapse',
|
|
5
|
+
'DUMB.NOTIFICATION_INBOX.EXPAND': 'Expand',
|
|
6
|
+
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Loading more…',
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'You have unread notifications'
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const messages = {
|
|
2
|
+
'DUMB.NOTIFICATION_INBOX.TITLE': 'Уведомления',
|
|
3
|
+
'DUMB.NOTIFICATION_INBOX.UNREAD': '{{count}} {{count | pluralize: "непрочитанное", "непрочитанных", "непрочитанных"}}',
|
|
4
|
+
'DUMB.NOTIFICATION_INBOX.COLLAPSE': 'Свернуть',
|
|
5
|
+
'DUMB.NOTIFICATION_INBOX.EXPAND': 'Развернуть',
|
|
6
|
+
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': 'Загрузка…',
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': 'Есть непрочитанные уведомления'
|
|
8
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NoParams } from '../../polyglot';
|
|
2
|
+
export type NotificationInboxMessages = {
|
|
3
|
+
'DUMB.NOTIFICATION_INBOX.TITLE': NoParams;
|
|
4
|
+
'DUMB.NOTIFICATION_INBOX.UNREAD': {
|
|
5
|
+
count: number;
|
|
6
|
+
};
|
|
7
|
+
'DUMB.NOTIFICATION_INBOX.COLLAPSE': NoParams;
|
|
8
|
+
'DUMB.NOTIFICATION_INBOX.EXPAND': NoParams;
|
|
9
|
+
'DUMB.NOTIFICATION_INBOX.LOADING_MORE': NoParams;
|
|
10
|
+
'DUMB.NOTIFICATION_INBOX.BELL_ARIA_UNREAD': NoParams;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { Vertical } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { CloseIcon } from '@pushwoosh/kit-icons';
|
|
5
|
+
import { Lang } from '../../polyglot';
|
|
5
6
|
import { PushBox, IconContainer, PushTitle, PushDescription } from '../../styles';
|
|
6
7
|
export function MissedContentPreview() {
|
|
7
8
|
return React.createElement(PushBox, {
|
|
@@ -11,7 +12,11 @@ export function MissedContentPreview() {
|
|
|
11
12
|
color: Color.CLEAR
|
|
12
13
|
})), React.createElement(Vertical, null, React.createElement(PushTitle, {
|
|
13
14
|
locked: true
|
|
14
|
-
},
|
|
15
|
+
}, React.createElement(Lang, {
|
|
16
|
+
message: "DUMB.PUSH_PREVIEW.CONTENT_MISSED"
|
|
17
|
+
})), React.createElement(PushDescription, {
|
|
15
18
|
locked: true
|
|
16
|
-
},
|
|
19
|
+
}, React.createElement(Lang, {
|
|
20
|
+
message: "DUMB.PUSH_PREVIEW.HINT"
|
|
21
|
+
}))));
|
|
17
22
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/SendRate/SendRateEdit.js
CHANGED
|
@@ -4,10 +4,12 @@ import { Vertical } from '@pushwoosh/kit-helpers';
|
|
|
4
4
|
import { OpenIcon } from '@pushwoosh/kit-icons';
|
|
5
5
|
import { Description } from './components/Description';
|
|
6
6
|
import { EditSendRateSettings } from './components/Settings';
|
|
7
|
+
import { getGlobalSendRateLinkText } from './helpers/getGlobalSendRateLinkText';
|
|
7
8
|
import { FieldBox } from '../FieldBox';
|
|
8
9
|
import { Link } from '../Link';
|
|
9
10
|
import { Select } from '../Select';
|
|
10
11
|
import { sendRateOptions } from './constants';
|
|
12
|
+
import { useLang } from './polyglot';
|
|
11
13
|
import { Container, LinkWrapper } from './styles';
|
|
12
14
|
export function SendRateEdit({
|
|
13
15
|
sendRate,
|
|
@@ -18,12 +20,13 @@ export function SendRateEdit({
|
|
|
18
20
|
maxValue,
|
|
19
21
|
editGlobalClicked
|
|
20
22
|
}) {
|
|
23
|
+
const lang = useLang();
|
|
21
24
|
const {
|
|
22
25
|
sendRate: count,
|
|
23
26
|
policy
|
|
24
27
|
} = sendRate;
|
|
25
28
|
const isGlobalSendRateDisabled = globalSendRate.count === 0 && globalSendRate.count === 0;
|
|
26
|
-
const globalSendRateLinkText = isGlobalSendRateDisabled
|
|
29
|
+
const globalSendRateLinkText = getGlobalSendRateLinkText(lang, isGlobalSendRateDisabled);
|
|
27
30
|
const onChangeSendRate = React.useCallback(value => {
|
|
28
31
|
if (value === 'CUSTOM') {
|
|
29
32
|
onChange({
|
|
@@ -51,7 +54,9 @@ export function SendRateEdit({
|
|
|
51
54
|
}, React.createElement(Vertical, {
|
|
52
55
|
"$gap": 12
|
|
53
56
|
}, React.createElement(FieldBox, {
|
|
54
|
-
title:
|
|
57
|
+
title: lang({
|
|
58
|
+
message: 'DUMB.SEND_RATE.FIELD_TITLE'
|
|
59
|
+
})
|
|
55
60
|
}, React.createElement(Select, {
|
|
56
61
|
name: "sendRateOption",
|
|
57
62
|
options: sendRateOptions,
|
|
@@ -2,19 +2,22 @@ import React from 'react';
|
|
|
2
2
|
import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
|
|
3
3
|
import { OpenIcon } from '@pushwoosh/kit-icons';
|
|
4
4
|
import { Link } from '../Link';
|
|
5
|
+
import { getGlobalSendRateLinkText } from './helpers/getGlobalSendRateLinkText';
|
|
5
6
|
import { getReadonlySendRateLabel } from './helpers/getReadonlySendRateHelpers';
|
|
7
|
+
import { useLang } from './polyglot';
|
|
6
8
|
export function SendRateReadonly({
|
|
7
9
|
sendRate,
|
|
8
10
|
globalSendRate,
|
|
9
11
|
applicationCode,
|
|
10
12
|
editGlobalClicked
|
|
11
13
|
}) {
|
|
14
|
+
const lang = useLang();
|
|
12
15
|
const {
|
|
13
16
|
policy
|
|
14
17
|
} = sendRate;
|
|
15
18
|
const isGlobalSendRateDisabled = globalSendRate.count === 0 && globalSendRate.seconds === 0;
|
|
16
|
-
const globalSendRateLinkText = isGlobalSendRateDisabled
|
|
17
|
-
const label = getReadonlySendRateLabel(sendRate, isGlobalSendRateDisabled, globalSendRate);
|
|
19
|
+
const globalSendRateLinkText = getGlobalSendRateLinkText(lang, isGlobalSendRateDisabled);
|
|
20
|
+
const label = getReadonlySendRateLabel(sendRate, isGlobalSendRateDisabled, globalSendRate, lang);
|
|
18
21
|
return React.createElement(Vertical, {
|
|
19
22
|
"$gap": 24
|
|
20
23
|
}, React.createElement(Horizontal, {
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ChipWithinTextContainer } from './styles';
|
|
3
3
|
import { Chip } from '../../../Chip';
|
|
4
|
+
import { useLang } from '../../polyglot';
|
|
4
5
|
export function ChipSendRate({
|
|
5
6
|
messages,
|
|
6
7
|
$inText = false
|
|
7
8
|
}) {
|
|
9
|
+
const lang = useLang();
|
|
8
10
|
return React.createElement(ChipWithinTextContainer, {
|
|
9
11
|
"$inText": $inText
|
|
10
12
|
}, React.createElement(Chip, {
|
|
11
13
|
"$variant": "primary",
|
|
12
14
|
"$readOnly": true,
|
|
13
15
|
as: "span"
|
|
14
|
-
}, messages === 0 ?
|
|
16
|
+
}, messages === 0 ? lang({
|
|
17
|
+
message: 'DUMB.SEND_RATE.CHIP.UNLIMITED'
|
|
18
|
+
}) : lang({
|
|
19
|
+
message: 'DUMB.SEND_RATE.CHIP.RATE',
|
|
20
|
+
messages
|
|
21
|
+
})));
|
|
15
22
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Paragraph } from '@pushwoosh/kit-typography';
|
|
3
|
+
import { useLang } from '../../polyglot';
|
|
3
4
|
import { ChipSendRate } from '../Condition';
|
|
4
5
|
export function Description(props) {
|
|
5
6
|
const {
|
|
@@ -8,22 +9,35 @@ export function Description(props) {
|
|
|
8
9
|
seconds,
|
|
9
10
|
children
|
|
10
11
|
} = props;
|
|
12
|
+
const lang = useLang();
|
|
11
13
|
if (sendRateOption === 'GLOBAL') {
|
|
12
14
|
if (messages === 0 && seconds === 0) {
|
|
13
|
-
return React.createElement(Paragraph, null,
|
|
15
|
+
return React.createElement(Paragraph, null, lang({
|
|
16
|
+
message: 'DUMB.SEND_RATE.DESC.GLOBAL_UNSET_PREFIX'
|
|
17
|
+
}), React.createElement(ChipSendRate, {
|
|
14
18
|
messages: 0,
|
|
15
19
|
"$inText": true
|
|
16
|
-
}),
|
|
20
|
+
}), lang({
|
|
21
|
+
message: 'DUMB.SEND_RATE.DESC.GLOBAL_UNSET_SUFFIX'
|
|
22
|
+
}), ' ', children);
|
|
17
23
|
}
|
|
18
|
-
return React.createElement(Paragraph, null,
|
|
24
|
+
return React.createElement(Paragraph, null, lang({
|
|
25
|
+
message: 'DUMB.SEND_RATE.DESC.GLOBAL_SET_PREFIX'
|
|
26
|
+
}), React.createElement(ChipSendRate, {
|
|
19
27
|
messages: messages,
|
|
20
28
|
"$inText": true
|
|
21
|
-
}),
|
|
29
|
+
}), lang({
|
|
30
|
+
message: 'DUMB.SEND_RATE.DESC.GLOBAL_SET_SUFFIX'
|
|
31
|
+
}), ' ', children);
|
|
22
32
|
}
|
|
23
33
|
if (sendRateOption === 'CUSTOM') {
|
|
24
|
-
return React.createElement(Paragraph, null,
|
|
34
|
+
return React.createElement(Paragraph, null, lang({
|
|
35
|
+
message: 'DUMB.SEND_RATE.DESC.CUSTOM'
|
|
36
|
+
}), ' ', children);
|
|
25
37
|
}
|
|
26
38
|
if (sendRateOption === 'IGNORE') {
|
|
27
|
-
return React.createElement(Paragraph, null,
|
|
39
|
+
return React.createElement(Paragraph, null, lang({
|
|
40
|
+
message: 'DUMB.SEND_RATE.DESC.IGNORE'
|
|
41
|
+
}), ' ', children);
|
|
28
42
|
}
|
|
29
43
|
}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
3
3
|
import { Paragraph } from '@pushwoosh/kit-typography';
|
|
4
4
|
import { NumberPicker } from '../../../NumberPicker';
|
|
5
|
+
import { Lang } from '../../polyglot';
|
|
5
6
|
export function EditSendRateSettings(props) {
|
|
6
7
|
const {
|
|
7
8
|
messages,
|
|
@@ -18,10 +19,14 @@ export function EditSendRateSettings(props) {
|
|
|
18
19
|
style: {
|
|
19
20
|
gridTemplateColumns: '145px 70px 150px'
|
|
20
21
|
}
|
|
21
|
-
}, React.createElement(Paragraph, null,
|
|
22
|
+
}, React.createElement(Paragraph, null, React.createElement(Lang, {
|
|
23
|
+
message: "DUMB.SEND_RATE.SETTINGS.LIMIT_TO_MAX"
|
|
24
|
+
})), React.createElement(NumberPicker, {
|
|
22
25
|
onChange: value => onMessagesChange(value),
|
|
23
26
|
value: messages,
|
|
24
27
|
minValue: minValue,
|
|
25
28
|
maxValue: maxValue
|
|
26
|
-
}), React.createElement(Paragraph, null,
|
|
29
|
+
}), React.createElement(Paragraph, null, React.createElement(Lang, {
|
|
30
|
+
message: "DUMB.SEND_RATE.SETTINGS.MESSAGES_PER_SEC"
|
|
31
|
+
})));
|
|
27
32
|
}
|