ordering-ui-external 2.7.0 → 2.7.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.
|
@@ -31,7 +31,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
31
31
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
32
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
33
|
var BusinessReviewsUI = function BusinessReviewsUI(props) {
|
|
34
|
-
var
|
|
34
|
+
var _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$business_view$3, _theme$business_view$4, _theme$business_view2, _theme$business_view3, _theme$business_view4, _theme$business_view5, _theme$business_view6, _theme$business_view7, _theme$business_view8, _theme$business_view9, _theme$business_view10, _theme$business_view11, _theme$business_view12, _theme$business_view13, _theme$business_view14, _theme$business_view15, _theme$business_view16, _props$beforeElements, _props$beforeComponen, _theme$images, _theme$images$general, _props$afterComponent, _props$afterElements;
|
|
35
35
|
var stars = props.stars,
|
|
36
36
|
reviewsList = props.reviewsList,
|
|
37
37
|
handleClickOption = props.handleClickOption,
|
|
@@ -42,19 +42,16 @@ var BusinessReviewsUI = function BusinessReviewsUI(props) {
|
|
|
42
42
|
var _useTheme = (0, _ThemeContext.useTheme)(),
|
|
43
43
|
_useTheme2 = _slicedToArray(_useTheme, 1),
|
|
44
44
|
theme = _useTheme2[0];
|
|
45
|
-
var _useOrderingTheme = (0, _orderingComponentsExternal.useOrderingTheme)(),
|
|
46
|
-
_useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
|
|
47
|
-
orderingTheme = _useOrderingTheme2[0];
|
|
48
45
|
var handleOnChange = function handleOnChange(evt) {
|
|
49
46
|
if (evt.target.value) onChangeReview(evt.target.value);else onChangeReview('');
|
|
50
47
|
};
|
|
51
48
|
var handleClickRaiting = function handleClickRaiting(raiting) {
|
|
52
49
|
if (raiting) handleClickOption(raiting);
|
|
53
50
|
};
|
|
54
|
-
var showRanking = !(
|
|
55
|
-
var showReviewDate = !(
|
|
56
|
-
var showCustomerComments = !(
|
|
57
|
-
var showSearch = !(
|
|
51
|
+
var showRanking = !(theme !== null && theme !== void 0 && (_theme$business_view = theme.business_view) !== null && _theme$business_view !== void 0 && (_theme$business_view$ = _theme$business_view.components) !== null && _theme$business_view$ !== void 0 && (_theme$business_view$2 = _theme$business_view$.review) !== null && _theme$business_view$2 !== void 0 && (_theme$business_view$3 = _theme$business_view$2.components) !== null && _theme$business_view$3 !== void 0 && (_theme$business_view$4 = _theme$business_view$3.ranking) !== null && _theme$business_view$4 !== void 0 && _theme$business_view$4.hidden);
|
|
52
|
+
var showReviewDate = !(theme !== null && theme !== void 0 && (_theme$business_view2 = theme.business_view) !== null && _theme$business_view2 !== void 0 && (_theme$business_view3 = _theme$business_view2.components) !== null && _theme$business_view3 !== void 0 && (_theme$business_view4 = _theme$business_view3.review) !== null && _theme$business_view4 !== void 0 && (_theme$business_view5 = _theme$business_view4.components) !== null && _theme$business_view5 !== void 0 && (_theme$business_view6 = _theme$business_view5.review_date) !== null && _theme$business_view6 !== void 0 && _theme$business_view6.hidden);
|
|
53
|
+
var showCustomerComments = !(theme !== null && theme !== void 0 && (_theme$business_view7 = theme.business_view) !== null && _theme$business_view7 !== void 0 && (_theme$business_view8 = _theme$business_view7.components) !== null && _theme$business_view8 !== void 0 && (_theme$business_view9 = _theme$business_view8.review) !== null && _theme$business_view9 !== void 0 && (_theme$business_view10 = _theme$business_view9.components) !== null && _theme$business_view10 !== void 0 && (_theme$business_view11 = _theme$business_view10.customer_comments) !== null && _theme$business_view11 !== void 0 && _theme$business_view11.hidden);
|
|
54
|
+
var showSearch = !(theme !== null && theme !== void 0 && (_theme$business_view12 = theme.business_view) !== null && _theme$business_view12 !== void 0 && (_theme$business_view13 = _theme$business_view12.components) !== null && _theme$business_view13 !== void 0 && (_theme$business_view14 = _theme$business_view13.review) !== null && _theme$business_view14 !== void 0 && (_theme$business_view15 = _theme$business_view14.components) !== null && _theme$business_view15 !== void 0 && (_theme$business_view16 = _theme$business_view15.search) !== null && _theme$business_view16 !== void 0 && _theme$business_view16.hidden);
|
|
58
55
|
var hideElement = !(!showReviewDate && !showCustomerComments);
|
|
59
56
|
var reviewPoints = [1, 2, 3, 4, 5];
|
|
60
57
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (_props$beforeElements = props.beforeElements) === null || _props$beforeElements === void 0 ? void 0 : _props$beforeElements.map(function (BeforeElement, i) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import Skeleton from 'react-loading-skeleton'
|
|
3
|
-
import { BusinessReviews as BusinessReviewController, useLanguage
|
|
3
|
+
import { BusinessReviews as BusinessReviewController, useLanguage } from 'ordering-components-external'
|
|
4
4
|
import { useTheme } from '../../../../../contexts/ThemeContext'
|
|
5
5
|
import moment from 'moment'
|
|
6
6
|
|
|
@@ -30,7 +30,6 @@ export const BusinessReviewsUI = (props) => {
|
|
|
30
30
|
const { stars, reviewsList, handleClickOption, onChangeReview } = props
|
|
31
31
|
const [, t] = useLanguage()
|
|
32
32
|
const [theme] = useTheme()
|
|
33
|
-
const [orderingTheme] = useOrderingTheme()
|
|
34
33
|
const handleOnChange = (evt) => {
|
|
35
34
|
if (evt.target.value) onChangeReview(evt.target.value)
|
|
36
35
|
else onChangeReview('')
|
|
@@ -39,10 +38,10 @@ export const BusinessReviewsUI = (props) => {
|
|
|
39
38
|
if (raiting) handleClickOption(raiting)
|
|
40
39
|
}
|
|
41
40
|
|
|
42
|
-
const showRanking = !
|
|
43
|
-
const showReviewDate = !
|
|
44
|
-
const showCustomerComments = !
|
|
45
|
-
const showSearch = !
|
|
41
|
+
const showRanking = !theme?.business_view?.components?.review?.components?.ranking?.hidden
|
|
42
|
+
const showReviewDate = !theme?.business_view?.components?.review?.components?.review_date?.hidden
|
|
43
|
+
const showCustomerComments = !theme?.business_view?.components?.review?.components?.customer_comments?.hidden
|
|
44
|
+
const showSearch = !theme?.business_view?.components?.review?.components?.search?.hidden
|
|
46
45
|
const hideElement = !(!showReviewDate && !showCustomerComments)
|
|
47
46
|
|
|
48
47
|
const reviewPoints = [1, 2, 3, 4, 5]
|