@shopgate/pwa-ui-shared 7.31.0-beta.1 → 7.31.1-alpha.1

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,4 +1,4 @@
1
- import React, { useCallback } from 'react';
1
+ import React, { useCallback, useMemo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import times from 'lodash/times';
4
4
  import { i18n } from '@shopgate/engage/core/helpers';
@@ -85,7 +85,7 @@ const RatingStars = ({
85
85
  }, [onSelection]);
86
86
  const iconClassName = cx(classes.icon, display === 'small' && classes.iconGapSmall, display === 'big' && classes.iconGapBig, display === 'large' && classes.iconGapLarge);
87
87
  const rootClassName = cx(classes.container, className, 'ui-shared__rating-stars');
88
- const emptyStars = [].concat(times(numStars, i => {
88
+ const emptyStars = useMemo(() => [].concat(times(numStars, i => {
89
89
  const pos = i + 1;
90
90
  const starProps = {
91
91
  className: iconClassName,
@@ -102,8 +102,8 @@ const RatingStars = ({
102
102
  size: size
103
103
  })
104
104
  });
105
- }));
106
- const filledStars = [].concat(times(numFullStars, i => {
105
+ })), [iconClassName, isSelectable, getTextualCTA, handleSelection, size]);
106
+ const filledStars = useMemo(() => [].concat(times(numFullStars, i => {
107
107
  const pos = i + 1;
108
108
  const starProps = {
109
109
  className: iconClassName,
@@ -125,7 +125,7 @@ const RatingStars = ({
125
125
  children: /*#__PURE__*/_jsx(StarHalfIcon, {
126
126
  size: size
127
127
  })
128
- }, i + numFullStars)));
128
+ }, i + numFullStars))), [iconClassName, numFullStars, numHalfStars, size, handleSelection, isSelectable]);
129
129
  return /*#__PURE__*/_jsxs("div", {
130
130
  role: isSelectable ? undefined : 'img',
131
131
  className: rootClassName,
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@shopgate/pwa-ui-shared",
3
- "version": "7.31.0-beta.1",
3
+ "version": "7.31.1-alpha.1",
4
4
  "description": "Shopgate's shared UI components.",
5
5
  "main": "index.js",
6
6
  "license": "Apache-2.0",
7
7
  "dependencies": {
8
- "@shopgate/pwa-ui-ios": "7.31.0-beta.1",
9
- "@shopgate/pwa-ui-material": "7.31.0-beta.1"
8
+ "@shopgate/pwa-ui-ios": "7.31.1-alpha.1",
9
+ "@shopgate/pwa-ui-material": "7.31.1-alpha.1"
10
10
  },
11
11
  "devDependencies": {
12
- "@shopgate/pwa-common": "7.31.0-beta.1",
13
- "@shopgate/pwa-common-commerce": "7.31.0-beta.1",
12
+ "@shopgate/pwa-common": "7.31.1-alpha.1",
13
+ "@shopgate/pwa-common-commerce": "7.31.1-alpha.1",
14
14
  "classnames": "2.5.1",
15
15
  "react": "^17.0.2"
16
16
  },