@pushwoosh/dumb-components 1.1.96 → 1.1.97

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.
@@ -2,8 +2,9 @@ import React from 'react';
2
2
  import { Color } from '@pushwoosh/kit-constants';
3
3
  import { NotificationIcon } from '@pushwoosh/kit-icons';
4
4
  import { NotificationBarButton, NotificationBarIcon, NotificationBarBadge, NotificationBarText, NotificationBarBadgeText } from './styles';
5
- function getIconView(isOpened, filled) {
6
- if (isOpened) return 'lined';
5
+ function getIconView(isOpened, filled, hasNotifications) {
6
+ if (isOpened && !hasNotifications) return 'lined';
7
+ if (isOpened) return 'filled';
7
8
  if (filled) return 'filled';
8
9
  return 'lined';
9
10
  }
@@ -15,7 +16,7 @@ export function NotificationBar({
15
16
  onClick,
16
17
  className
17
18
  }) {
18
- const showBadge = count > 0 && type !== 'no-notifications';
19
+ const hasNotifications = count > 0 && type !== 'no-notifications';
19
20
  const shouldUseFilledIcon = !isOpened && (!read && type !== 'no-notifications' || read);
20
21
  const getIconColor = () => {
21
22
  if (isOpened) return Color.CLEAR;
@@ -38,9 +39,9 @@ export function NotificationBar({
38
39
  }, React.createElement(NotificationBarIcon, null, React.createElement(NotificationIcon, {
39
40
  type: "enabled",
40
41
  size: "small",
41
- view: getIconView(isOpened, shouldUseFilledIcon),
42
+ view: getIconView(isOpened, shouldUseFilledIcon, hasNotifications),
42
43
  color: getIconColor()
43
- })), React.createElement(NotificationBarText, null, "Notification center"), showBadge && React.createElement(NotificationBarBadge, null, React.createElement(NotificationBarBadgeText, {
44
+ })), React.createElement(NotificationBarText, null, "Notification center"), hasNotifications && React.createElement(NotificationBarBadge, null, React.createElement(NotificationBarBadgeText, {
44
45
  "$variant": "h5"
45
46
  }, count)));
46
47
  }
@@ -139,7 +139,7 @@ export function NotificationInbox({
139
139
  }), hasMore && isLoading && React.createElement(Horizontal, {
140
140
  ref: loadMoreRef,
141
141
  "$alignItems": "center",
142
- "$justifyContent": "start",
142
+ "$justifyContent": "center",
143
143
  "$padding": 16,
144
144
  "$gap": 8
145
145
  }, React.createElement(Spinner, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.96",
3
+ "version": "1.1.97",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",