ordering-ui-admin-external 1.43.62 → 1.43.63

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.
@@ -59,7 +59,8 @@ var BusinessDeliveryPickupMore = exports.BusinessDeliveryPickupMore = function B
59
59
  };
60
60
  (0, _react.useEffect)(function () {
61
61
  var tab = query.get('tab');
62
- if (tab) {
62
+ var tabs = ['delivery', 'pickup', 'driver_delivery_group', 'advanced_eta'];
63
+ if (tab && tabs.includes(tab)) {
63
64
  handleTabClick(tab, true);
64
65
  } else {
65
66
  handleTabClick('delivery');
@@ -60,7 +60,8 @@ var BusinessDetail = exports.BusinessDetail = function BusinessDetail(props) {
60
60
  }, [selectedInfoItem]);
61
61
  (0, _react.useEffect)(function () {
62
62
  var tab = query.get('tab');
63
- if (tab) {
63
+ var tabs = ['information', 'owner', 'categories', 'location', 'images', 'videos', 'seo_options'];
64
+ if (tab && tabs.includes(tab)) {
64
65
  setSelctedInfoItem(tab);
65
66
  } else {
66
67
  handleSelectInfoItem('information');
@@ -95,7 +95,8 @@ var BusinessOrderingChannels = exports.BusinessOrderingChannels = function Busin
95
95
  }, [business]);
96
96
  (0, _react.useEffect)(function () {
97
97
  var tab = query.get('tab');
98
- if (tab) {
98
+ var tabs = ['custom_slug', 'widgets'];
99
+ if (tab && tabs.includes(tab)) {
99
100
  handleChangeOption(tab, true);
100
101
  } else {
101
102
  handleChangeOption('custom_slug');
@@ -10,8 +10,6 @@ var _orderingComponentsAdminExternal = require("ordering-components-admin-extern
10
10
  var _reactBootstrapIcons = require("react-bootstrap-icons");
11
11
  var _styledComponents = require("styled-components");
12
12
  var _styles = require("../../../styles");
13
- var _MdRadioButtonChecked = _interopRequireDefault(require("@meronex/icons/md/MdRadioButtonChecked"));
14
- var _MdRadioButtonUnchecked = _interopRequireDefault(require("@meronex/icons/md/MdRadioButtonUnchecked"));
15
13
  var _BsDashCircle = _interopRequireDefault(require("@meronex/icons/bs/BsDashCircle"));
16
14
  var _BsPlusCircle = _interopRequireDefault(require("@meronex/icons/bs/BsPlusCircle"));
17
15
  var _BsCircleHalf = _interopRequireDefault(require("@meronex/icons/bs/BsCircleHalf"));
@@ -35,7 +33,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
35
33
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
36
34
  _swiper.default.use([_swiper.Navigation, _swiper.Thumbs]);
37
35
  var ProductDesktopPreview = exports.ProductDesktopPreview = function ProductDesktopPreview(props) {
38
- var _product$product, _product$product2, _theme$defaultLanguag, _product$ingredients, _product$extras, _product$ingredients2, _product$extras2, _product$ingredients3, _theme$defaultLanguag2, _product$extras3;
36
+ var _product$product, _product$product2, _theme$defaultLanguag, _product$ingredients, _product$extras, _product$ingredients2, _product$extras2, _product$ingredients3, _theme$defaultLanguag2, _product$extras3, _productCart$quantity;
39
37
  var product = props.product,
40
38
  productCart = props.productCart,
41
39
  showProductOption = props.showProductOption,
@@ -238,15 +236,19 @@ var ProductDesktopPreview = exports.ProductDesktopPreview = function ProductDesk
238
236
  var _productCart$options;
239
237
  var currentState = ((_productCart$options = productCart.options["id:".concat(option === null || option === void 0 ? void 0 : option.id)]) === null || _productCart$options === void 0 ? void 0 : _productCart$options.suboptions["id:".concat(suboption === null || suboption === void 0 ? void 0 : suboption.id)]) || {};
240
238
  var price = option !== null && option !== void 0 && option.with_half_option && suboption !== null && suboption !== void 0 && suboption.half_price && currentState.position !== 'whole' ? suboption === null || suboption === void 0 ? void 0 : suboption.half_price : suboption === null || suboption === void 0 ? void 0 : suboption.price;
239
+ var inputId = "".concat(suboption.id);
241
240
  return suboption !== null && suboption !== void 0 && suboption.enabled ? /*#__PURE__*/_react.default.createElement(_styles2.ProductSuboptionContainer, {
242
241
  key: suboption === null || suboption === void 0 ? void 0 : suboption.id
243
242
  }, /*#__PURE__*/_react.default.createElement(_styles2.IconControl, null, (option === null || option === void 0 ? void 0 : option.min) === 0 && (option === null || option === void 0 ? void 0 : option.max) === 1 || (option === null || option === void 0 ? void 0 : option.max) > 1 ? /*#__PURE__*/_react.default.createElement(_styles.Checkbox, {
243
+ id: inputId,
244
244
  defaultChecked: currentState === null || currentState === void 0 ? void 0 : currentState.selected
245
- }) : currentState !== null && currentState !== void 0 && currentState.selected ? /*#__PURE__*/_react.default.createElement(_MdRadioButtonChecked.default, null) : /*#__PURE__*/_react.default.createElement(_MdRadioButtonUnchecked.default, {
246
- disabled: true
245
+ }) : /*#__PURE__*/_react.default.createElement(_styles.RadioButton, {
246
+ id: inputId
247
247
  })), suboption.image && suboption.image !== '-' && /*#__PURE__*/_react.default.createElement(_styles2.SubOptionThumbnail, {
248
248
  src: suboption.image
249
- }), /*#__PURE__*/_react.default.createElement(_styles2.SuoptionText, null, /*#__PURE__*/_react.default.createElement("div", null, suboption === null || suboption === void 0 ? void 0 : suboption.name)), (option === null || option === void 0 ? void 0 : option.allow_suboption_quantity) && /*#__PURE__*/_react.default.createElement(_styles2.QuantityControl, null, /*#__PURE__*/_react.default.createElement(_BsDashCircle.default, null), currentState.quantity, /*#__PURE__*/_react.default.createElement(_BsPlusCircle.default, null)), (option === null || option === void 0 ? void 0 : option.with_half_option) && /*#__PURE__*/_react.default.createElement(_styles2.PositionControl, null, /*#__PURE__*/_react.default.createElement(_BsCircleHalf.default, {
249
+ }), /*#__PURE__*/_react.default.createElement(_styles2.SuoptionText, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("label", {
250
+ htmlFor: inputId
251
+ }, suboption === null || suboption === void 0 ? void 0 : suboption.name))), (option === null || option === void 0 ? void 0 : option.allow_suboption_quantity) && /*#__PURE__*/_react.default.createElement(_styles2.QuantityControl, null, /*#__PURE__*/_react.default.createElement(_BsDashCircle.default, null), currentState.quantity || 1, /*#__PURE__*/_react.default.createElement(_BsPlusCircle.default, null)), (option === null || option === void 0 ? void 0 : option.with_half_option) && /*#__PURE__*/_react.default.createElement(_styles2.PositionControl, null, /*#__PURE__*/_react.default.createElement(_BsCircleHalf.default, {
250
252
  className: ['reverse', currentState.selected && currentState.position === 'left' ? 'selected' : null].filter(function (classname) {
251
253
  return classname;
252
254
  }).join(' ')
@@ -273,7 +275,7 @@ var ProductDesktopPreview = exports.ProductDesktopPreview = function ProductDesk
273
275
  className: "incdec-control"
274
276
  }, /*#__PURE__*/_react.default.createElement(_FiMinusCircle.default, {
275
277
  className: "".concat(productCart.quantity === 1 || isSoldOut ? 'disabled' : '')
276
- }), /*#__PURE__*/_react.default.createElement("span", null, productCart.quantity), /*#__PURE__*/_react.default.createElement(_FiPlusCircle.default, {
278
+ }), /*#__PURE__*/_react.default.createElement("span", null, (_productCart$quantity = productCart.quantity) !== null && _productCart$quantity !== void 0 ? _productCart$quantity : 1), /*#__PURE__*/_react.default.createElement(_FiPlusCircle.default, {
277
279
  className: "".concat(isSoldOut ? 'disabled' : '')
278
280
  })), productCart && !isSoldOut && /*#__PURE__*/_react.default.createElement(_styles.Button, {
279
281
  color: "primary",
@@ -26,7 +26,7 @@ var DesktopBackground = exports.DesktopBackground = _styledComponents.default.di
26
26
  return props.theme.colors.gray;
27
27
  });
28
28
  });
29
- var ProductInfoModalPreview = exports.ProductInfoModalPreview = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n max-width: 500px;\n width: 100%;\n height: 100%;\n border-radius: 8px;\n position: relative;\n \n ", "\n\n ", "\n"])), function (_ref3) {
29
+ var ProductInfoModalPreview = exports.ProductInfoModalPreview = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n max-width: 500px;\n width: 100%;\n height: 100%;\n border-radius: 8px;\n position: relative;\n\n ", "\n\n ", "\n"])), function (_ref3) {
30
30
  var isMobileView = _ref3.isMobileView;
31
31
  return !isMobileView && (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n background: ", ";\n "])), function (props) {
32
32
  return props.theme.colors.backgroundPage;
@@ -109,7 +109,7 @@ var OptionWrapHeader = exports.OptionWrapHeader = _styledComponents.default.div(
109
109
  var _props$theme$colors2;
110
110
  return ((_props$theme$colors2 = props.theme.colors) === null || _props$theme$colors2 === void 0 ? void 0 : _props$theme$colors2.backgroundPage) || '#FFF';
111
111
  });
112
- var OptionTitleContainer = exports.OptionTitleContainer = _styledComponents.default.div(_templateObject36 || (_templateObject36 = _taggedTemplateLiteral(["\n margin: 0px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n width: 70%;\n display: flex;\n align-items: center; \n\n *:first-child {\n margin-right: 8px;\n }\n"])));
112
+ var OptionTitleContainer = exports.OptionTitleContainer = _styledComponents.default.div(_templateObject36 || (_templateObject36 = _taggedTemplateLiteral(["\n margin: 0px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n width: 70%;\n display: flex;\n align-items: center;\n\n *:first-child {\n margin-right: 8px;\n }\n"])));
113
113
  var OptionTitle = exports.OptionTitle = _styledComponents.default.h3(_templateObject37 || (_templateObject37 = _taggedTemplateLiteral(["\n font-size: 14px;\n display: flex;\n flex-direction: column;\n margin-bottom: 0;\n\n span {\n &:not(:first-child) {\n color: ", ";\n font-size: 12px;\n font-weight: 400;\n }\n }\n"])), function (props) {
114
114
  return props.theme.colors.grayTextColor;
115
115
  });
@@ -130,11 +130,11 @@ var SubOptionThumbnail = exports.SubOptionThumbnail = _styledComponents.default.
130
130
  var src = _ref12.src;
131
131
  return src;
132
132
  });
133
- var SuoptionText = exports.SuoptionText = _styledComponents.default.div(_templateObject45 || (_templateObject45 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n display: flex;\n font-weight: 300;\n color: #555;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0 5px;\n font-size: 12px;\n\n div {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n span {\n margin-left: 10px;\n font-weight: 500;\n color: ", ";\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n ", "\n }\n"])), function (props) {
133
+ var SuoptionText = exports.SuoptionText = _styledComponents.default.div(_templateObject45 || (_templateObject45 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n display: flex;\n font-weight: 300;\n color: #555;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0 5px;\n font-size: 12px;\n\n div {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n span {\n margin-left: 10px;\n font-weight: 500;\n color: ", ";\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n ", "\n }\n label {\n margin: 0;\n }\n"])), function (props) {
134
134
  return props.theme.colors.primary;
135
135
  }, function (props) {
136
136
  var _props$theme4;
137
- return ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.rtl) && (0, _styledComponents.css)(_templateObject46 || (_templateObject46 = _taggedTemplateLiteral(["\n margin-left: 0;\n margin-right: 10px; \n "])));
137
+ return ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.rtl) && (0, _styledComponents.css)(_templateObject46 || (_templateObject46 = _taggedTemplateLiteral(["\n margin-left: 0;\n margin-right: 10px;\n "])));
138
138
  });
139
139
  var QuantityControl = exports.QuantityControl = _styledComponents.default.div(_templateObject47 || (_templateObject47 = _taggedTemplateLiteral(["\n display: flex;\n color: #555;\n align-items: center;\n font-weight: 300;\n font-size: 12px;\n margin: 0 5px;\n\n svg {\n color: ", ";\n font-size: 16px;\n margin-right: 3px;\n ", "\n }\n\n svg[disabled] {\n color: #CBCBCB;\n }\n\n svg:last-child {\n margin-left: 3px;\n margin-right: 0;\n ", "\n }\n"])), function (props) {
140
140
  return props.theme.colors.primary;
@@ -43,7 +43,8 @@ var ProductSummary = exports.ProductSummary = function ProductSummary(props) {
43
43
  showProductOption = props.showProductOption,
44
44
  isExpand = props.isExpand,
45
45
  setIsExpand = props.setIsExpand,
46
- handleDuplicateProduct = props.handleDuplicateProduct;
46
+ handleDuplicateProduct = props.handleDuplicateProduct,
47
+ getProduct = props.getProduct;
47
48
  var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
48
49
  _useLanguage2 = _slicedToArray(_useLanguage, 2),
49
50
  t = _useLanguage2[1];
@@ -234,7 +235,13 @@ var ProductSummary = exports.ProductSummary = function ProductSummary(props) {
234
235
  setIsProductPreview(false);
235
236
  setSelectedView('desktop');
236
237
  }
237
- }, /*#__PURE__*/_react.default.createElement(_styles2.ProductPreviewHeader, null, /*#__PURE__*/_react.default.createElement("h1", null, t('PREVIEW', 'Preview')), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_styles.IconButton, {
238
+ }, /*#__PURE__*/_react.default.createElement(_styles2.ProductPreviewHeader, null, /*#__PURE__*/_react.default.createElement("h1", null, t('PREVIEW', 'Preview')), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_styles.Button, {
239
+ color: "primary",
240
+ borderRadius: "7.6px",
241
+ onClick: function onClick() {
242
+ return getProduct();
243
+ }
244
+ }, t('RELOAD', 'Reload')), /*#__PURE__*/_react.default.createElement(_styles.IconButton, {
238
245
  color: selectedView === 'desktop' ? 'primary' : 'black',
239
246
  onClick: function onClick() {
240
247
  return setSelectedView('desktop');
@@ -4,9 +4,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.Checkbox = void 0;
7
+ exports.RadioButton = exports.Checkbox = void 0;
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
9
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
10
10
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
11
11
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
12
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
@@ -23,4 +23,18 @@ var Checkbox = exports.Checkbox = _styledComponents.default.input.attrs({
23
23
  }, function (props) {
24
24
  var _props$theme2;
25
25
  return (_props$theme2 = props.theme) !== null && _props$theme2 !== void 0 && _props$theme2.rtl ? (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n right: 7px;\n "]))) : (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n left: 7px;\n "])));
26
+ });
27
+ var RadioButton = exports.RadioButton = _styledComponents.default.input.attrs({
28
+ type: 'checkbox'
29
+ })(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: relative;\n cursor: pointer;\n width: 18px;\n height: 18px;\n border: none;\n appearance: none;\n\n &:before {\n content: \"\";\n display: block;\n position: absolute;\n width: 18px;\n height: 18px;\n top: 0;\n left: 0;\n border: 1px solid #B1BCCC;\n border-radius: 50%;\n background: ", ";\n }\n\n &:checked:before {\n content: \"\";\n display: block;\n position: absolute;\n width: 18px;\n height: 18px;\n top: 0;\n ", "\n background-color: ", ";\n border: none;\n }\n\n &:checked:after {\n content: \"\";\n display: block;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: white;\n position: absolute;\n top: 5.2px;\n ", "\n }\n"])), function (props) {
30
+ var _props$theme$colors2;
31
+ return ((_props$theme$colors2 = props.theme.colors) === null || _props$theme$colors2 === void 0 ? void 0 : _props$theme$colors2.backgroundPage) || '#FFF';
32
+ }, function (props) {
33
+ var _props$theme3;
34
+ return (_props$theme3 = props.theme) !== null && _props$theme3 !== void 0 && _props$theme3.rtl ? (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n right: 0;\n "]))) : (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n left: 0;\n "])));
35
+ }, function (props) {
36
+ return props.theme.colors.primary;
37
+ }, function (props) {
38
+ var _props$theme4;
39
+ return (_props$theme4 = props.theme) !== null && _props$theme4 !== void 0 && _props$theme4.rtl ? (0, _styledComponents.css)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n right: 5.1px;\n "]))) : (0, _styledComponents.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n left: 5.1px;\n "])));
26
40
  });
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "MultiSelect", {
45
45
  return _MultiSelect.MultiSelect;
46
46
  }
47
47
  });
48
+ Object.defineProperty(exports, "RadioButton", {
49
+ enumerable: true,
50
+ get: function get() {
51
+ return _Checkbox.RadioButton;
52
+ }
53
+ });
48
54
  Object.defineProperty(exports, "SecondSelect", {
49
55
  enumerable: true,
50
56
  get: function get() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-admin-external",
3
- "version": "1.43.62",
3
+ "version": "1.43.63",
4
4
  "description": "Ordering UI Admin Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -83,7 +83,7 @@
83
83
  "lodash": "^4.17.20",
84
84
  "moment": "^2.29.1",
85
85
  "moment-range": "^4.0.2",
86
- "ordering-components-admin-external": "1.43.39",
86
+ "ordering-components-admin-external": "1.43.40",
87
87
  "polished": "^3.6.7",
88
88
  "prop-types": "^15.7.2",
89
89
  "react-big-calendar": "^1.4.2",
@@ -43,7 +43,8 @@ export const BusinessDeliveryPickupMore = (props) => {
43
43
 
44
44
  useEffect(() => {
45
45
  const tab = query.get('tab')
46
- if (tab) {
46
+ const tabs = ['delivery', 'pickup', 'driver_delivery_group', 'advanced_eta']
47
+ if (tab && tabs.includes(tab)) {
47
48
  handleTabClick(tab, true)
48
49
  } else {
49
50
  handleTabClick('delivery')
@@ -49,7 +49,8 @@ export const BusinessDetail = (props) => {
49
49
 
50
50
  useEffect(() => {
51
51
  const tab = query.get('tab')
52
- if (tab) {
52
+ const tabs = ['information', 'owner', 'categories', 'location', 'images', 'videos', 'seo_options']
53
+ if (tab && tabs.includes(tab)) {
53
54
  setSelctedInfoItem(tab)
54
55
  } else {
55
56
  handleSelectInfoItem('information')
@@ -76,7 +76,8 @@ export const BusinessOrderingChannels = (props) => {
76
76
 
77
77
  useEffect(() => {
78
78
  const tab = query.get('tab')
79
- if (tab) {
79
+ const tabs = ['custom_slug', 'widgets']
80
+ if (tab && tabs.includes(tab)) {
80
81
  handleChangeOption(tab, true)
81
82
  } else {
82
83
  handleChangeOption('custom_slug')
@@ -2,9 +2,7 @@ import React, { useState, useEffect, useRef } from 'react'
2
2
  import { useLanguage, useUtils } from 'ordering-components-admin-external'
3
3
  import { XLg } from 'react-bootstrap-icons'
4
4
  import { useTheme } from 'styled-components'
5
- import { Checkbox, TextArea, Button } from '../../../styles'
6
- import MdRadioButtonChecked from '@meronex/icons/md/MdRadioButtonChecked'
7
- import MdRadioButtonUnchecked from '@meronex/icons/md/MdRadioButtonUnchecked'
5
+ import { Checkbox, TextArea, Button, RadioButton } from '../../../styles'
8
6
  import BsDashCircle from '@meronex/icons/bs/BsDashCircle'
9
7
  import BsPlusCircle from '@meronex/icons/bs/BsPlusCircle'
10
8
  import BsCircleHalf from '@meronex/icons/bs/BsCircleHalf'
@@ -311,31 +309,28 @@ export const ProductDesktopPreview = (props) => {
311
309
  option.suboptions.map(suboption => {
312
310
  const currentState = productCart.options[`id:${option?.id}`]?.suboptions[`id:${suboption?.id}`] || {}
313
311
  const price = option?.with_half_option && suboption?.half_price && currentState.position !== 'whole' ? suboption?.half_price : suboption?.price
312
+ const inputId = `${suboption.id}`
314
313
  return suboption?.enabled ? (
315
314
  <ProductSuboptionContainer
316
315
  key={suboption?.id}
317
316
  >
318
317
  <IconControl>
319
318
  {((option?.min === 0 && option?.max === 1) || option?.max > 1) ? (
320
- <Checkbox defaultChecked={currentState?.selected} />
319
+ <Checkbox id={inputId} defaultChecked={currentState?.selected} />
321
320
  ) : (
322
- currentState?.selected ? (
323
- <MdRadioButtonChecked />
324
- ) : (
325
- <MdRadioButtonUnchecked disabled />
326
- )
321
+ <RadioButton id={inputId} />
327
322
  )}
328
323
  </IconControl>
329
324
  {suboption.image && suboption.image !== '-' && (
330
325
  <SubOptionThumbnail src={suboption.image} />
331
326
  )}
332
327
  <SuoptionText>
333
- <div>{suboption?.name}</div>
328
+ <div><label htmlFor={inputId}>{suboption?.name}</label></div>
334
329
  </SuoptionText>
335
330
  {option?.allow_suboption_quantity && (
336
331
  <QuantityControl>
337
332
  <BsDashCircle />
338
- {currentState.quantity}
333
+ {currentState.quantity || 1}
339
334
  <BsPlusCircle />
340
335
  </QuantityControl>
341
336
  )}
@@ -388,7 +383,7 @@ export const ProductDesktopPreview = (props) => {
388
383
  <FiMinusCircle
389
384
  className={`${productCart.quantity === 1 || isSoldOut ? 'disabled' : ''}`}
390
385
  />
391
- <span>{productCart.quantity}</span>
386
+ <span>{productCart.quantity ?? 1}</span>
392
387
  <FiPlusCircle
393
388
  className={`${isSoldOut ? 'disabled' : ''}`}
394
389
  />
@@ -38,7 +38,7 @@ export const ProductInfoModalPreview = styled.div`
38
38
  height: 100%;
39
39
  border-radius: 8px;
40
40
  position: relative;
41
-
41
+
42
42
  ${({ isMobileView }) => !isMobileView && css`
43
43
  background: ${props => props.theme.colors.backgroundPage};
44
44
  `}
@@ -314,7 +314,7 @@ export const OptionTitleContainer = styled.div`
314
314
  white-space: nowrap;
315
315
  width: 70%;
316
316
  display: flex;
317
- align-items: center;
317
+ align-items: center;
318
318
 
319
319
  *:first-child {
320
320
  margin-right: 8px;
@@ -434,9 +434,12 @@ export const SuoptionText = styled.div`
434
434
  text-overflow: ellipsis;
435
435
  ${props => props.theme?.rtl && css`
436
436
  margin-left: 0;
437
- margin-right: 10px;
437
+ margin-right: 10px;
438
438
  `}
439
439
  }
440
+ label {
441
+ margin: 0;
442
+ }
440
443
  `
441
444
 
442
445
  export const QuantityControl = styled.div`
@@ -4,7 +4,7 @@ import BsChevronRight from '@meronex/icons/bs/BsChevronRight'
4
4
  import BiImage from '@meronex/icons/bi/BiImage'
5
5
  import { XLg, ThreeDots, Laptop, Phone, ArrowsAngleContract, ArrowsAngleExpand } from 'react-bootstrap-icons'
6
6
  import { Switch } from '../../../styles/Switch'
7
- import { IconButton } from '../../../styles'
7
+ import { IconButton, Button } from '../../../styles'
8
8
  import { DropdownButton, Dropdown } from 'react-bootstrap'
9
9
  import { useTheme } from 'styled-components'
10
10
  import { Confirm, Modal, ProgressRing } from '../../Shared'
@@ -45,7 +45,8 @@ export const ProductSummary = (props) => {
45
45
  showProductOption,
46
46
  isExpand,
47
47
  setIsExpand,
48
- handleDuplicateProduct
48
+ handleDuplicateProduct,
49
+ getProduct
49
50
  } = props
50
51
 
51
52
  const [, t] = useLanguage()
@@ -318,6 +319,13 @@ export const ProductSummary = (props) => {
318
319
  <ProductPreviewHeader>
319
320
  <h1>{t('PREVIEW', 'Preview')}</h1>
320
321
  <div>
322
+ <Button
323
+ color='primary'
324
+ borderRadius='7.6px'
325
+ onClick={() => getProduct()}
326
+ >
327
+ {t('RELOAD', 'Reload')}
328
+ </Button>
321
329
  <IconButton
322
330
  color={selectedView === 'desktop' ? 'primary' : 'black'}
323
331
  onClick={() => setSelectedView('desktop')}
@@ -54,3 +54,56 @@ export const Checkbox = styled.input.attrs({ type: 'checkbox' })`
54
54
  `}
55
55
  }
56
56
  `
57
+ export const RadioButton = styled.input.attrs({ type: 'checkbox' })`
58
+ position: relative;
59
+ cursor: pointer;
60
+ width: 18px;
61
+ height: 18px;
62
+ border: none;
63
+ appearance: none;
64
+
65
+ &:before {
66
+ content: "";
67
+ display: block;
68
+ position: absolute;
69
+ width: 18px;
70
+ height: 18px;
71
+ top: 0;
72
+ left: 0;
73
+ border: 1px solid #B1BCCC;
74
+ border-radius: 50%;
75
+ background: ${props => props.theme.colors?.backgroundPage || '#FFF'};
76
+ }
77
+
78
+ &:checked:before {
79
+ content: "";
80
+ display: block;
81
+ position: absolute;
82
+ width: 18px;
83
+ height: 18px;
84
+ top: 0;
85
+ ${props => props.theme?.rtl ? css`
86
+ right: 0;
87
+ ` : css`
88
+ left: 0;
89
+ `}
90
+ background-color: ${props => props.theme.colors.primary};
91
+ border: none;
92
+ }
93
+
94
+ &:checked:after {
95
+ content: "";
96
+ display: block;
97
+ width: 8px;
98
+ height: 8px;
99
+ border-radius: 50%;
100
+ background: white;
101
+ position: absolute;
102
+ top: 5.2px;
103
+ ${props => props.theme?.rtl ? css`
104
+ right: 5.1px;
105
+ ` : css`
106
+ left: 5.1px;
107
+ `}
108
+ }
109
+ `
@@ -1,5 +1,5 @@
1
1
  import { Button, IconButton, LinkButton } from './Buttons'
2
- import { Checkbox } from './Checkbox'
2
+ import { Checkbox, RadioButton } from './Checkbox'
3
3
  import { Input, TextArea } from './Inputs'
4
4
  import { MultiSelect } from './MultiSelect'
5
5
  import { Select as SecondSelect } from './Select'
@@ -12,6 +12,7 @@ export {
12
12
  IconButton,
13
13
  LinkButton,
14
14
  Checkbox,
15
+ RadioButton,
15
16
  Input,
16
17
  MultiSelect,
17
18
  Switch,