@mychoice/mychoice-sdk-modules 2.2.1 → 2.2.3

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/esm/index.js CHANGED
@@ -507,7 +507,7 @@ const HeaderBeginInsurance = ({ className }) => {
507
507
  const { appConfigState: { insuranceType }, } = useStoreAppConfig();
508
508
  const insuranceTypeCls = insuranceType !== InsuranceTypes.Car && insuranceType !== InsuranceTypes.Life ? InsuranceTypes.Home : insuranceType;
509
509
  const { externalPathGroup } = usePathGroups(insuranceTypeCls);
510
- return (jsx("div", { className: `${className} primary-header`, children: jsxs("div", { className: "content", children: [jsx("div", { className: "logo", children: jsx("a", { href: "https://www.begininsurance.com/", rel: "noreferrer", children: jsx("img", { src: logo, alt: "Begin Insurance" }) }) }), jsx("div", { className: "nav-links", children: jsx(HeaderNavGroup, { className: insuranceTypeCls, navItems: externalPathGroup, isExternal: true }) }), jsx("div", { className: "empty-box" })] }) }));
510
+ return (jsx("div", { className: `${className} primary-header`, children: jsxs("div", { className: "content", children: [jsx("div", { className: "logo", children: jsx("a", { href: "https://begininsurance.ca/en", rel: "noreferrer", children: jsx("img", { src: logo, alt: "Begin Insurance" }) }) }), jsx("div", { className: "nav-links", children: jsx(HeaderNavGroup, { className: insuranceTypeCls, navItems: externalPathGroup, isExternal: true }) }), jsx("div", { className: "empty-box" })] }) }));
511
511
  };
512
512
  HeaderBeginInsurance.defaultProps = {
513
513
  className: '',
@@ -533,7 +533,7 @@ const HeaderBeginInsuranceMobile = ({ className }) => {
533
533
  const handleMenuClick = () => {
534
534
  setIsMenuOpen(!isMenuOpen);
535
535
  };
536
- return (jsxs("div", { className: `${className} ${isMenuOpen ? 'open' : ''} primary-header-mobile`, children: [jsxs("div", { className: "content-mobile", children: [jsx("div", { className: "logo", children: jsx("a", { href: "https://www.begininsurance.com/", target: "_blank", rel: "noreferrer", children: jsx("img", { src: logo, alt: "Begin Insurance" }) }) }), jsx(ButtonMenu, { className: `${className} ${isMenuOpen ? 'is-active' : ''}`, onClick: handleMenuClick })] }), isMenuOpen && (jsx("div", { className: "menu-items", children: jsx("div", { className: "nav-links", children: jsx(HeaderNavGroup, { className: insuranceType, navItems: externalPathGroup, isExternal: true }) }) }))] }));
536
+ return (jsxs("div", { className: `${className} ${isMenuOpen ? 'open' : ''} primary-header-mobile`, children: [jsxs("div", { className: "content-mobile", children: [jsx("div", { className: "logo", children: jsx("a", { href: "https://begininsurance.ca/en", target: "_blank", rel: "noreferrer", children: jsx("img", { src: logo, alt: "Begin Insurance" }) }) }), jsx(ButtonMenu, { className: `${className} ${isMenuOpen ? 'is-active' : ''}`, onClick: handleMenuClick })] }), isMenuOpen && (jsx("div", { className: "menu-items", children: jsx("div", { className: "nav-links", children: jsx(HeaderNavGroup, { className: insuranceType, navItems: externalPathGroup, isExternal: true }) }) }))] }));
537
537
  };
538
538
  HeaderBeginInsuranceMobile.defaultProps = {
539
539
  className: '',
@@ -3620,7 +3620,7 @@ StepsBox.defaultProps = {
3620
3620
  activeIndex: 0,
3621
3621
  };
3622
3622
 
3623
- const ButtonsBox = ({ formSteps, validationHooks, clearForm, }) => {
3623
+ const ButtonsBox = ({ formSteps, validationHooks, clearForm }) => {
3624
3624
  const { pathname } = useLocation();
3625
3625
  const navigate = useNavigate();
3626
3626
  const { appConfigState } = useStoreAppConfig();
@@ -3641,7 +3641,7 @@ const ButtonsBox = ({ formSteps, validationHooks, clearForm, }) => {
3641
3641
  let activeIndex = formSteps.indexOf(activeStep);
3642
3642
  activeIndex = activeIndex === -1 ? 0 : activeIndex;
3643
3643
  const onForwardClick = () => {
3644
- const { validateOptions: { validate, isValid }, requestFn } = validationHooks[activeIndex] || { validateOptions: { isValid: true } };
3644
+ const { validateOptions: { validate, isValid }, requestFn, } = validationHooks[activeIndex] || { validateOptions: { isValid: true } };
3645
3645
  const formIsValid = !isValid ? validate && validate() : isValid;
3646
3646
  if (activeIndex < formSteps.length && formIsValid) {
3647
3647
  if (requestFn) {
@@ -3660,11 +3660,12 @@ const ButtonsBox = ({ formSteps, validationHooks, clearForm, }) => {
3660
3660
  }
3661
3661
  };
3662
3662
  const onFinishClick = () => {
3663
+ const companyName = appType === AppTypes.BeginInsurance ? 'Begin Insurance' : 'My Choice';
3663
3664
  dispatchAppModalState({
3664
3665
  type: StoreConfigAppModalActionTypes.AppModalFinaleModal,
3665
3666
  payload: {
3666
3667
  title: 'Thank You!',
3667
- description: 'Thanks for using My Choice to compare car insurance rates.',
3668
+ description: `Thanks for using ${companyName} to compare insurance rates.`,
3668
3669
  submitCallBack: () => {
3669
3670
  navigate(`/${localIndex}/${insuranceType}${formSteps[0].path}`);
3670
3671
  if (clearForm) {
@@ -3689,8 +3690,7 @@ const ButtonsBox = ({ formSteps, validationHooks, clearForm, }) => {
3689
3690
  },
3690
3691
  });
3691
3692
  };
3692
- return (jsxs("div", { className: "buttons-box", children: [activeIndex === 0 ? (jsx(ButtonBase, { size: isMobile ? SizeTypes.Small : SizeTypes.Medium, category: CategoryTypes.Outlined, color: ColorTypes.Secondary, variant: ButtonVariantTypes.Circle, className: "button-arrow button-with-text", onClick: onClearClick, children: jsx("span", { children: "Clear Form" }) }))
3693
- : (jsx(ButtonArrow, { direction: DirectionTypes.Left, category: CategoryTypes.Outlined, color: ColorTypes.Secondary, size: isMobile ? SizeTypes.Small : SizeTypes.Medium, onClick: onBackClick })), activeIndex === formSteps.length - 1 ? (jsx(Fragment, { children: !isTheBig && (jsx(ButtonBase, { size: isMobile ? SizeTypes.Small : SizeTypes.Medium, category: CategoryTypes.Filled, color: ColorTypes.Secondary, variant: ButtonVariantTypes.Circle, className: "button-arrow button-with-text", onClick: onFinishClick, children: jsx("span", { children: "Finish" }) })) })) : (jsx(ButtonArrow, { direction: DirectionTypes.Right, category: CategoryTypes.Filled, color: ColorTypes.Secondary, size: isMobile ? SizeTypes.Small : SizeTypes.Medium, onClick: onForwardClick }))] }));
3693
+ return (jsxs("div", { className: "buttons-box", children: [activeIndex === 0 ? (jsx(ButtonBase, { size: isMobile ? SizeTypes.Small : SizeTypes.Medium, category: CategoryTypes.Outlined, color: ColorTypes.Secondary, variant: ButtonVariantTypes.Circle, className: "button-arrow button-with-text", onClick: onClearClick, children: jsx("span", { children: "Clear Form" }) })) : (jsx(ButtonArrow, { direction: DirectionTypes.Left, category: CategoryTypes.Outlined, color: ColorTypes.Secondary, size: isMobile ? SizeTypes.Small : SizeTypes.Medium, onClick: onBackClick })), activeIndex === formSteps.length - 1 ? (jsx(Fragment, { children: !isTheBig && (jsx(ButtonBase, { size: isMobile ? SizeTypes.Small : SizeTypes.Medium, category: CategoryTypes.Filled, color: ColorTypes.Secondary, variant: ButtonVariantTypes.Circle, className: "button-arrow button-with-text", onClick: onFinishClick, children: jsx("span", { children: "Finish" }) })) })) : (jsx(ButtonArrow, { direction: DirectionTypes.Right, category: CategoryTypes.Filled, color: ColorTypes.Secondary, size: isMobile ? SizeTypes.Small : SizeTypes.Medium, onClick: onForwardClick }))] }));
3694
3694
  };
3695
3695
  ButtonsBox.defaultProps = {
3696
3696
  isMobile: false,
@@ -4518,6 +4518,10 @@ const AppConfig = (props) => {
4518
4518
  const localIndex = window.location.pathname.split('/')[1];
4519
4519
  const authHandler = useHandlerAuth();
4520
4520
  const partnerHandler = useHandlerPartner();
4521
+ // Check if localIndex is actually an insurance type (car, home, condo, tenant, life)
4522
+ // In that case, it should not be treated as a partner ID
4523
+ const insuranceTypeValues = Object.values(InsuranceTypes);
4524
+ const isInsuranceTypePath = insuranceTypeValues.includes(localIndex);
4521
4525
  const windowResize = () => {
4522
4526
  dispatchDeviceState({
4523
4527
  type: StoreConfigAppDeviceActionTypes.AppDeviceSetSize,
@@ -4536,7 +4540,7 @@ const AppConfig = (props) => {
4536
4540
  payload: appType,
4537
4541
  });
4538
4542
  }
4539
- if (appType !== AppTypes.TheBig && localIndex !== defaultLocalIndex && localIndex !== '') {
4543
+ if (appType !== AppTypes.TheBig && localIndex !== defaultLocalIndex && localIndex !== '' && !isInsuranceTypePath) {
4540
4544
  partnerHandler.getPartner(localIndex);
4541
4545
  }
4542
4546
  else {