@mychoice/mychoice-sdk-modules 2.1.61 → 2.1.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.
package/dist/cjs/index.js CHANGED
@@ -199,19 +199,15 @@ const NoQuotesMessage = ({ type }) => {
199
199
  const usePathGroups = (insuranceType) => {
200
200
  const { appConfigState } = mychoiceSdkStore.useStoreAppConfig();
201
201
  const insurancePathGroup = {
202
- [`${mychoiceSdkComponents.InsuranceTypes.Car}`]: [
203
- { name: 'Car', link: `/${appConfigState.localIndex}/car` },
204
- ],
205
- [`${mychoiceSdkComponents.InsuranceTypes.Home}`]: [
206
- { name: 'Home', link: `/${appConfigState.localIndex}/home` },
207
- ],
202
+ [`${mychoiceSdkComponents.InsuranceTypes.Car}`]: [{ name: 'Car', link: `/${appConfigState.localIndex}/car` }],
203
+ [`${mychoiceSdkComponents.InsuranceTypes.Home}`]: [{ name: 'Home', link: `/${appConfigState.localIndex}/home` }],
208
204
  // @todo: will be used in future
209
205
  // [`${InsuranceTypes.Life}`]: [{ name: 'Life', link: `/${appConfigState.localIndex}/life` }],
210
206
  };
211
207
  const externalPathGroup = [
212
- { name: 'Car', link: 'https://quote.mychoice.ca/insurance/car' },
213
- { name: 'Home', link: 'https://quote.mychoice.ca/insurance/home' },
214
- { name: 'Life', link: 'https://quote.mychoice.ca/insurance/life' },
208
+ { name: 'Car', link: '/insurance/car' },
209
+ { name: 'Home', link: '/insurance/home' },
210
+ { name: 'Life', link: '/insurance/life' },
215
211
  { name: 'Learn', link: 'https://www.mychoice.ca/blog/' },
216
212
  ];
217
213
  // @todo: use in future.
@@ -3019,6 +3015,11 @@ const SectionCoverage = () => {
3019
3015
  });
3020
3016
  };
3021
3017
  const newLifeOptions = React.useMemo(() => {
3018
+ if (process.env.REACT_APP_ENV !== 'production') {
3019
+ return {
3020
+ options: mychoiceSdkComponents.lifeInsuranceTypeOptions,
3021
+ };
3022
+ }
3022
3023
  // Use different set for Ontario
3023
3024
  if (isMychoice && province === '9') {
3024
3025
  return {
@@ -3643,7 +3644,7 @@ NavigationBottomTheBig.defaultProps = {
3643
3644
 
3644
3645
  const NavigationTab = React__default["default"].memo((props) => {
3645
3646
  const { className, name, addButtonLabel, items, selectItem, removeItem, createItem, activeItemIndex = 0, maxItemCount = 5, readOnly, } = props;
3646
- const { appConfigState: { appType } } = mychoiceSdkStore.useStoreAppConfig();
3647
+ const { appConfigState: { appType }, } = mychoiceSdkStore.useStoreAppConfig();
3647
3648
  const isThebig = appType === mychoiceSdkComponents.AppTypes.TheBig;
3648
3649
  const handleButtonClick = (index) => () => {
3649
3650
  if (selectItem) {
@@ -3659,20 +3660,18 @@ const NavigationTab = React__default["default"].memo((props) => {
3659
3660
  const handleArrowClick = (direction) => {
3660
3661
  if (selectItem) {
3661
3662
  if (direction === mychoiceSdkComponents.DirectionTypes.Left) {
3662
- selectItem(((activeItemIndex - 1) > -1) ? activeItemIndex - 1 : 0);
3663
+ selectItem(activeItemIndex - 1 > -1 ? activeItemIndex - 1 : 0);
3663
3664
  }
3664
3665
  if (direction === mychoiceSdkComponents.DirectionTypes.Right) {
3665
- selectItem(((activeItemIndex + 1) < maxItemCount) ? activeItemIndex + 1 : maxItemCount);
3666
+ selectItem(activeItemIndex + 1 < maxItemCount ? activeItemIndex + 1 : maxItemCount);
3666
3667
  }
3667
3668
  }
3668
3669
  };
3669
3670
  const reduceCount = activeItemIndex === 4 ? 2 : 1;
3670
- return (jsxRuntime.jsxs("div", { className: `navigation-tab-box ${className}`, children: [(activeItemIndex > 1) && jsxRuntime.jsx(mychoiceSdkComponents.ButtonTabArrow, { onClick: () => handleArrowClick(mychoiceSdkComponents.DirectionTypes.Left) }), (activeItemIndex <= items.length - 2
3671
- && activeItemIndex < 3
3672
- && ((items.length > 2 && createItem) || (items.length > 3 && !createItem)))
3673
- && jsxRuntime.jsx(mychoiceSdkComponents.ButtonTabArrow, { onClick: () => handleArrowClick(mychoiceSdkComponents.DirectionTypes.Right), direction: mychoiceSdkComponents.DirectionTypes.Right }), jsxRuntime.jsxs("div", { className: "navigation-tab-container", style: { marginLeft: `${activeItemIndex > 1 ? `-${(activeItemIndex - reduceCount) * 9.875}rem` : '0'}` }, children: [items.map((tab, index) => (jsxRuntime.jsx(mychoiceSdkComponents.ButtonTab, { className: `${activeItemIndex === index ? 'active-tab' : 'inactive-tab'} ${isThebig ? 'thebig-bold' : 'mychoice'}`, label: tab.name, buttonClick: handleButtonClick(index), iconClick: handleIconClick(index), selfDelete: index !== 0 && !readOnly }, `${name}-${index}`))), (items.length < maxItemCount && createItem) && (jsxRuntime.jsx(mychoiceSdkComponents.ButtonTab, { className: isThebig ? 'add-thebig-medium' : 'add mychoice', label: addButtonLabel, buttonClick: createItem, selfDelete: false }))] })] }));
3674
- }, (prevProps, nextProps) => !((prevProps.items !== nextProps.items
3675
- || prevProps.activeItemIndex !== nextProps.activeItemIndex)));
3671
+ return (jsxRuntime.jsxs("div", { className: `navigation-tab-box ${className}`, children: [activeItemIndex > 1 && jsxRuntime.jsx(mychoiceSdkComponents.ButtonTabArrow, { onClick: () => handleArrowClick(mychoiceSdkComponents.DirectionTypes.Left) }), activeItemIndex <= items.length - 2 &&
3672
+ activeItemIndex < 3 &&
3673
+ ((items.length > 2 && createItem) || (items.length > 3 && !createItem)) && (jsxRuntime.jsx(mychoiceSdkComponents.ButtonTabArrow, { onClick: () => handleArrowClick(mychoiceSdkComponents.DirectionTypes.Right), direction: mychoiceSdkComponents.DirectionTypes.Right })), jsxRuntime.jsxs("div", { className: "navigation-tab-container", style: { marginLeft: `${activeItemIndex > 1 ? `-${(activeItemIndex - reduceCount) * 9.875}rem` : '0'}` }, children: [items.map((tab, index) => (jsxRuntime.jsx(mychoiceSdkComponents.ButtonTab, { className: `${activeItemIndex === index ? 'active-tab' : 'inactive-tab'} ${isThebig ? 'thebig-bold' : 'mychoice'}`, label: tab.name, buttonClick: handleButtonClick(index), iconClick: handleIconClick(index), selfDelete: index !== 0 && !readOnly }, `${name}-${index}`))), items.length < maxItemCount && createItem && (jsxRuntime.jsx(mychoiceSdkComponents.ButtonTab, { className: isThebig ? 'add-thebig-medium' : 'add mychoice', label: addButtonLabel, buttonClick: createItem, selfDelete: false }))] })] }));
3674
+ }, (prevProps, nextProps) => !(prevProps.items !== nextProps.items || prevProps.activeItemIndex !== nextProps.activeItemIndex));
3676
3675
  NavigationTab.defaultProps = {
3677
3676
  className: '',
3678
3677
  items: [],