@shopgate/engage 7.32.0-beta.16 → 7.32.0-beta.17
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.
|
@@ -7,8 +7,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
const useStyles = makeStyles()(theme => ({
|
|
8
8
|
inputStyle: {
|
|
9
9
|
border: 'none',
|
|
10
|
-
background: theme.
|
|
11
|
-
color: theme.
|
|
10
|
+
background: theme.components.input.background,
|
|
11
|
+
color: theme.components.input.text,
|
|
12
12
|
display: 'block',
|
|
13
13
|
fontSize: theme.typography.caption.fontSize,
|
|
14
14
|
textAlign: 'center',
|
|
@@ -10,6 +10,9 @@ const {
|
|
|
10
10
|
currency
|
|
11
11
|
} = appConfig;
|
|
12
12
|
const useStyles = makeStyles()(theme => ({
|
|
13
|
+
priceRange: {
|
|
14
|
+
whiteSpace: 'nowrap'
|
|
15
|
+
},
|
|
13
16
|
editableField: {
|
|
14
17
|
color: theme.palette.text.primary,
|
|
15
18
|
fontWeight: theme.typography.fontWeightMedium,
|
|
@@ -20,6 +23,16 @@ const useStyles = makeStyles()(theme => ({
|
|
|
20
23
|
margin: theme.spacing(0, 0.5),
|
|
21
24
|
border: `1px solid ${theme.components.input.border}`,
|
|
22
25
|
borderRadius: 3,
|
|
26
|
+
appearance: 'textfield',
|
|
27
|
+
WebkitAppearance: 'textfield',
|
|
28
|
+
'&::-webkit-outer-spin-button': {
|
|
29
|
+
WebkitAppearance: 'none',
|
|
30
|
+
margin: 0
|
|
31
|
+
},
|
|
32
|
+
'&::-webkit-inner-spin-button': {
|
|
33
|
+
WebkitAppearance: 'none',
|
|
34
|
+
margin: 0
|
|
35
|
+
},
|
|
23
36
|
':focus': {
|
|
24
37
|
borderColor: theme.components.border.medium
|
|
25
38
|
},
|
|
@@ -124,6 +137,7 @@ function Label(props) {
|
|
|
124
137
|
currency
|
|
125
138
|
}).format('0').replace('0.00', '');
|
|
126
139
|
return /*#__PURE__*/_jsxs("div", {
|
|
140
|
+
className: classes.priceRange,
|
|
127
141
|
children: [/*#__PURE__*/_jsx("span", {
|
|
128
142
|
className: classes.srOnly,
|
|
129
143
|
children: i18n.text('price.range', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/engage",
|
|
3
|
-
"version": "7.32.0-beta.
|
|
3
|
+
"version": "7.32.0-beta.17",
|
|
4
4
|
"description": "Shopgate's ENGAGE library.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Shopgate <support@shopgate.com>",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@emotion/react": "^11.14.0",
|
|
20
20
|
"@shopgate/native-modules": "1.0.0-beta.34",
|
|
21
|
-
"@shopgate/pwa-common": "7.32.0-beta.
|
|
22
|
-
"@shopgate/pwa-common-commerce": "7.32.0-beta.
|
|
23
|
-
"@shopgate/pwa-core": "7.32.0-beta.
|
|
24
|
-
"@shopgate/pwa-ui-ios": "7.32.0-beta.
|
|
25
|
-
"@shopgate/pwa-ui-material": "7.32.0-beta.
|
|
26
|
-
"@shopgate/pwa-ui-shared": "7.32.0-beta.
|
|
21
|
+
"@shopgate/pwa-common": "7.32.0-beta.17",
|
|
22
|
+
"@shopgate/pwa-common-commerce": "7.32.0-beta.17",
|
|
23
|
+
"@shopgate/pwa-core": "7.32.0-beta.17",
|
|
24
|
+
"@shopgate/pwa-ui-ios": "7.32.0-beta.17",
|
|
25
|
+
"@shopgate/pwa-ui-material": "7.32.0-beta.17",
|
|
26
|
+
"@shopgate/pwa-ui-shared": "7.32.0-beta.17",
|
|
27
27
|
"@stripe/react-stripe-js": "^1.16.5",
|
|
28
28
|
"@stripe/stripe-js": "^1.44.1",
|
|
29
29
|
"@virtuous/conductor": "~2.5.0",
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React, { memo, useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
3
4
|
import appConfig from '@shopgate/pwa-common/helpers/config';
|
|
5
|
+
import { getProductRating } from '@shopgate/pwa-common-commerce/product/selectors/product';
|
|
4
6
|
import { RatingStars, SurroundPortals } from '@shopgate/engage/components';
|
|
5
7
|
import { PRODUCT_RATING } from '@shopgate/engage/product/constants';
|
|
6
8
|
import RatingCount from '@shopgate/engage/reviews/components/Reviews/components/RatingCount';
|
|
7
9
|
import { useShowEmptyRatingStars } from '@shopgate/engage/product/hooks';
|
|
8
10
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
9
|
-
import connect from "./connector";
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
const {
|
|
12
13
|
hasReviews
|
|
@@ -37,11 +38,14 @@ const scrollToRating = () => {
|
|
|
37
38
|
* @return {JSX.Element}
|
|
38
39
|
*/
|
|
39
40
|
const Rating = ({
|
|
40
|
-
|
|
41
|
+
productId
|
|
41
42
|
}) => {
|
|
42
43
|
const {
|
|
43
44
|
classes
|
|
44
45
|
} = useStyles();
|
|
46
|
+
const rating = useSelector(state => getProductRating(state, {
|
|
47
|
+
productId
|
|
48
|
+
}));
|
|
45
49
|
const showEmptyRatingStars = useShowEmptyRatingStars();
|
|
46
50
|
const showRatings = useMemo(() => {
|
|
47
51
|
if (hasReviews && (rating?.average ?? 0) > 0) {
|
|
@@ -69,6 +73,6 @@ const Rating = ({
|
|
|
69
73
|
});
|
|
70
74
|
};
|
|
71
75
|
Rating.defaultProps = {
|
|
72
|
-
|
|
76
|
+
productId: null
|
|
73
77
|
};
|
|
74
|
-
export default
|
|
78
|
+
export default /*#__PURE__*/memo(Rating);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { connect } from 'react-redux';
|
|
2
|
-
import { getProductRating } from '@shopgate/pwa-common-commerce/product/selectors/product';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @param {Object} state The current application state.
|
|
6
|
-
* @param {Object} props The component props.
|
|
7
|
-
* @return {Object} The extended component props.
|
|
8
|
-
*/
|
|
9
|
-
const mapStateToProps = (state, props) => ({
|
|
10
|
-
rating: getProductRating(state, props)
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @param {Object} next The next component props.
|
|
15
|
-
* @param {Object} prev The previous component props.
|
|
16
|
-
* @return {boolean}
|
|
17
|
-
*/
|
|
18
|
-
const areStatePropsEqual = (next, prev) => {
|
|
19
|
-
if (!prev.rating && next.rating) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
return true;
|
|
23
|
-
};
|
|
24
|
-
export default connect(mapStateToProps, null, null, {
|
|
25
|
-
areStatePropsEqual
|
|
26
|
-
});
|