@pushwoosh/smart-components-kit 1.3.18 → 1.3.19

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.
@@ -1,5 +1,5 @@
1
1
  import type { AlertStatus, AlertType, OrderBy, OrderDirection } from '@pushwoosh/rpc-v2-http-api-data/pushwoosh_accounts_alerts_v1';
2
- export declare const UPDATES_PER_PAGE = 20;
2
+ export declare const MAX_VISIBLE_UPDATES = 10;
3
3
  export declare const ALERT_TYPE_PRODUCT_UPDATE: AlertType;
4
4
  export declare const ALERT_STATUS_READ: AlertStatus;
5
5
  export declare const ALERT_STATUS_UNREAD: AlertStatus;
@@ -1,4 +1,6 @@
1
- export const UPDATES_PER_PAGE = 20;
1
+ // Product updates carry no expiry, so the feed only grows. The modal shows the newest
2
+ // slice and never paginates into the past: older ones stay in the notification history.
3
+ export const MAX_VISIBLE_UPDATES = 10;
2
4
  export const ALERT_TYPE_PRODUCT_UPDATE = 'ALERT_TYPE_PRODUCT_UPDATE';
3
5
  export const ALERT_STATUS_READ = 'ALERT_STATUS_READ';
4
6
  export const ALERT_STATUS_UNREAD = 'ALERT_STATUS_UNREAD';
@@ -1,7 +1,7 @@
1
1
  import { useCallback, useRef, useState } from 'react';
2
2
  import { useAsync } from '@pushwoosh/kit-helpers';
3
3
  import { useSPAContext } from '@pushwoosh/spa-context';
4
- import { ALERT_STATUS_READ, ALERT_STATUS_UNREAD, ALERT_TYPE_PRODUCT_UPDATE, ORDER_BY_CREATED, ORDER_DIRECTION_DESC, UPDATES_PER_PAGE } from '../constants';
4
+ import { ALERT_STATUS_READ, ALERT_STATUS_UNREAD, ALERT_TYPE_PRODUCT_UPDATE, ORDER_BY_CREATED, ORDER_DIRECTION_DESC, MAX_VISIBLE_UPDATES } from '../constants';
5
5
  import { useIsAllowProductUpdates } from './useIsAllowProductUpdates';
6
6
  const EMPTY = [];
7
7
  export function useProductUpdates() {
@@ -18,7 +18,7 @@ export function useProductUpdates() {
18
18
  const response = await rpcGateway.internalAlerts.List({
19
19
  type: ALERT_TYPE_PRODUCT_UPDATE,
20
20
  page: 0,
21
- perPage: UPDATES_PER_PAGE,
21
+ perPage: MAX_VISIBLE_UPDATES,
22
22
  orderBy: ORDER_BY_CREATED,
23
23
  orderDirection: ORDER_DIRECTION_DESC
24
24
  });
package/package.json CHANGED
@@ -52,5 +52,5 @@
52
52
  "react": "^16.14.0 || ^18.0.0",
53
53
  "react-dom": "^16.14.0 || ^18.0.0"
54
54
  },
55
- "version": "1.3.18"
55
+ "version": "1.3.19"
56
56
  }