@mychoice/mychoice-sdk-modules 2.1.18 → 2.1.20

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.
Files changed (27) hide show
  1. package/dist/cjs/index.js +12 -7
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/init/StoryAppWrapper/StoryAppWrapper.d.ts +1 -1
  4. package/dist/cjs/init/StoryAppWrapper/interfaces.d.ts +1 -1
  5. package/dist/cjs/insurances/car/pages/{quote/PageAllQuotes.d.ts → three-point-five/BestOfferFirst.d.ts} +1 -1
  6. package/dist/cjs/insurances/car/pages/three-point-five/index.d.ts +1 -0
  7. package/dist/cjs/insurances/car/pages/three-point-five/sections/OfferSectionCopy.d.ts +3 -0
  8. package/dist/cjs/insurances/car/pages/three-point-five/sections/OfferSectionDupe.d.ts +3 -0
  9. package/dist/cjs/insurances/car/pages/three-point-five/sections/index.d.ts +1 -0
  10. package/dist/esm/index.js +12 -7
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/esm/init/StoryAppWrapper/StoryAppWrapper.d.ts +1 -1
  13. package/dist/esm/init/StoryAppWrapper/interfaces.d.ts +1 -1
  14. package/dist/esm/insurances/car/pages/{quote/PageAllQuotes.d.ts → three-point-five/BestOfferFirst.d.ts} +1 -1
  15. package/dist/esm/insurances/car/pages/three-point-five/index.d.ts +1 -0
  16. package/dist/esm/insurances/car/pages/three-point-five/sections/OfferSectionCopy.d.ts +3 -0
  17. package/dist/esm/insurances/car/pages/three-point-five/sections/OfferSectionDupe.d.ts +3 -0
  18. package/dist/esm/insurances/car/pages/three-point-five/sections/index.d.ts +1 -0
  19. package/package.json +3 -3
  20. package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +0 -1
  21. package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +0 -2
  22. package/dist/cjs/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +0 -3
  23. package/dist/cjs/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +0 -3
  24. package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +0 -1
  25. package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +0 -2
  26. package/dist/esm/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +0 -3
  27. package/dist/esm/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +0 -3
@@ -1,3 +1,3 @@
1
- import { SdkFC } from '@mychoice/mychoice-sdk-components';
1
+ import { SdkFC } from '@groksmith/mychoice-sdk-components';
2
2
  import { StoryAppWrapperInterface } from './interfaces';
3
3
  export declare const StoryAppWrapper: SdkFC<StoryAppWrapperInterface>;
@@ -1,4 +1,4 @@
1
- import { AppTypes } from '@mychoice/mychoice-sdk-components';
1
+ import { AppTypes } from '@groksmith/mychoice-sdk-components';
2
2
  export interface StoryAppWrapperInterface {
3
3
  appType?: AppTypes;
4
4
  }
@@ -1,2 +1,2 @@
1
1
  import { SdkFC } from '@groksmith/mychoice-sdk-components';
2
- export declare const PageAllQuotes: SdkFC;
2
+ export declare const BestOfferFirst: SdkFC;
@@ -0,0 +1 @@
1
+ export { BestOfferFirst } from './BestOfferFirst';
@@ -0,0 +1,3 @@
1
+ import { SdkFC } from '@groksmith/mychoice-sdk-components';
2
+ import { OfferSectionProps } from '../../../../../shared/sections/quotes/interfaces';
3
+ export declare const OfferSection: SdkFC<OfferSectionProps>;
@@ -0,0 +1,3 @@
1
+ import { SdkFC } from '@groksmith/mychoice-sdk-components';
2
+ import { OfferSectionDupeProps } from '../../../../../shared/sections/quotes/interfaces';
3
+ export declare const OfferSectionDupe: SdkFC<OfferSectionDupeProps>;
@@ -0,0 +1 @@
1
+ export { OfferSectionDupe } from './OfferSectionDupe';
package/dist/esm/index.js CHANGED
@@ -145,7 +145,7 @@ const OfferSection = ({ offerCompany, brokerCompany, offerPrice, phoneNumber, is
145
145
  const isTheBig = appType === AppTypes.TheBig;
146
146
  const mychoiceCls = appType === AppTypes.MyChoice ? 'mychoice' : '';
147
147
  const { weekdayHours, saturdayHours, sundayHours } = operationHours;
148
- const [detailsIsOpen, setDetailsIsOpenIsOpen] = useState(false);
148
+ const [detailsIsOpen, setDetailsIsOpenIsOpen] = useState(isBestOffer ?? false);
149
149
  const handleDropdownClick = () => {
150
150
  setDetailsIsOpenIsOpen(!detailsIsOpen);
151
151
  };
@@ -245,9 +245,7 @@ jsx("video", { src: "https://mychoice.ca/wp-content/uploads/2023/05/Pig-Video.mp
245
245
  const LoaderPrimary = () => {
246
246
  const { appLoaderState } = useStoreAppLoader();
247
247
  const { appConfigState } = useStoreAppConfig();
248
- console.log(window.location.pathname);
249
- const isLastPage = window.location.pathname.includes('discount') || window.location.pathname.includes('applicant');
250
- console.log(isLastPage);
248
+ const isLastPage = window.location.pathname.includes('discount') || window.location.pathname.includes('/life/applicant');
251
249
  return (jsxs("div", { className: "loader-wrapper", children: [appConfigState.appType === AppTypes.TheBig || !isLastPage ? jsx(IconLoaderPrimary, {}) : jsx(LoaderVid, {}), !!appLoaderState.description && (jsx("h4", { children: appLoaderState.description.split('\n').map((line, index) => (jsxs("div", { children: [line, jsx("br", {})] }, index))) }))] }));
252
250
  };
253
251
 
@@ -1834,11 +1832,13 @@ const PageCarQuote = () => {
1834
1832
  const { postRequestQuote } = CarQuoteDataHandler();
1835
1833
  const { appLoaderState } = useStoreAppLoader();
1836
1834
  const { appDeviceType } = useStoreDeviceType();
1835
+ const { appConfigState: { localIndex, insuranceType } } = useStoreAppConfig();
1837
1836
  const { items, quoteConfirm } = quoteState;
1838
1837
  const isTheBig = appType === AppTypes.TheBig;
1839
1838
  const hasConfirmStep = !!(items?.length && !isTheBig && items[0]?.confirmQuote && quoteConfirm);
1840
1839
  const quoteItems = hasConfirmStep ? items?.slice(0, 2) : items;
1841
1840
  const showContentWhileLoading = hasConfirmStep ? true : !appLoaderState.isOpen;
1841
+ const navigate = useNavigate();
1842
1842
  useEffectOnce(() => {
1843
1843
  if (!vehicleFormIsValid) {
1844
1844
  vehicleFormValidate();
@@ -1856,6 +1856,10 @@ const PageCarQuote = () => {
1856
1856
  top: 0,
1857
1857
  behavior: 'smooth',
1858
1858
  });
1859
+ if (hasConfirmStep) {
1860
+ const uniqueUrl = 'offer';
1861
+ navigate(`/${localIndex || defaultLocalIndex}/${insuranceType}/quotes/${uniqueUrl}`);
1862
+ }
1859
1863
  });
1860
1864
  return (jsx("div", { className: `quote-page-content ${hasConfirmStep ? 'confirm-step' : ''}`, children: showContentWhileLoading && (jsxs(Fragment, { children: [hasConfirmStep && jsx(BlockConfirmHeading, {}), jsxs("div", { className: "form-section-container", children: [appDeviceType === DeviceTypes.Mobile && !hasConfirmStep && (jsx(Fragment, { children: !!items?.length && (jsx(Fragment, { children: !quoteState.showCallMessage
1861
1865
  ? (jsx("div", { className: "offer-container", children: jsx(OfferSection, { isBestOffer: true, offerCompany: items[0]?.company, brokerCompany: items[0]?.brokerProfile, offerPrice: {
@@ -3997,7 +4001,7 @@ const NestedRoutes = () => {
3997
4001
  });
3998
4002
  });
3999
4003
  return (jsx(Fragment, { children: appConfigState.drawWrapper && (jsx(Fragment, { children: jsxs(Routes, { children: [jsx(Route, { path: "*", element: jsx(Navigate, { to: { pathname: `/${appConfigState.localIndex || defaultLocalIndex}/${insuranceType}` } }) }), insuranceType === InsuranceTypes.Car
4000
- && (jsxs(Route, { path: "car", children: [jsx(Route, { index: true, element: (jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsx(RouteWrapperPublic, { children: jsx(PageVehicle, {}) }) })) }), jsx(Route, { path: "driver", element: (jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsx(RouteWrapperPublic, { children: jsx(PageDriver, {}) }) })) }), jsx(Route, { path: "discount", element: (jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsx(RouteWrapperPublic, { children: jsx(PageCarDiscount, {}) }) })) }), jsx(Route, { path: "quotes", element: (jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsx(RouteWrapperPublic, { children: jsx(PageCarQuote, {}) }) })) })] })), jsxs(Route, { path: "home", children: [jsx(Route, { index: true, element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Home, children: jsx(RouteWrapperPublic, { children: jsx(PageAddress, {}) }) })) }), jsx(Route, { path: "applicant", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Home, children: jsx(RouteWrapperPublic, { children: jsx(PageApplicant, {}) }) })) }), jsx(Route, { path: "property", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Home, children: jsx(RouteWrapperPublic, { children: jsx(PageProperty, {}) }) })) }), jsx(Route, { path: "discount", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Home, children: jsx(RouteWrapperPublic, { children: jsx(PageHomeDiscount, {}) }) })) }), jsx(Route, { path: "quotes", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Home, children: jsx(RouteWrapperPublic, { children: jsx(PageHomeQuote, {}) }) })) })] }), jsxs(Route, { path: "condo", children: [jsx(Route, { index: true, element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Condo, children: jsx(RouteWrapperPublic, { children: jsx(PageAddress, {}) }) })) }), jsx(Route, { path: "applicant", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Condo, children: jsx(RouteWrapperPublic, { children: jsx(PageApplicant, {}) }) })) }), jsx(Route, { path: "property", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Condo, children: jsx(RouteWrapperPublic, { children: jsx(PageProperty, {}) }) })) }), jsx(Route, { path: "discount", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Condo, children: jsx(RouteWrapperPublic, { children: jsx(PageHomeDiscount, {}) }) })) }), jsx(Route, { path: "quotes", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Condo, children: jsx(RouteWrapperPublic, { children: jsx(PageHomeQuote, {}) }) })) })] }), jsxs(Route, { path: "tenant", children: [jsx(Route, { index: true, element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Tenant, children: jsx(RouteWrapperPublic, { children: jsx(PageAddress, {}) }) })) }), jsx(Route, { path: "applicant", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Tenant, children: jsx(RouteWrapperPublic, { children: jsx(PageApplicant, {}) }) })) }), jsx(Route, { path: "property", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Tenant, children: jsx(RouteWrapperPublic, { children: jsx(PageProperty, {}) }) })) }), jsx(Route, { path: "discount", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Tenant, children: jsx(RouteWrapperPublic, { children: jsx(PageHomeDiscount, {}) }) })) }), jsx(Route, { path: "quotes", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Tenant, children: jsx(RouteWrapperPublic, { children: jsx(PageHomeQuote, {}) }) })) })] }), jsxs(Route, { path: "life", children: [jsx(Route, { index: true, element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Life, children: jsx(RouteWrapperPublic, { children: jsx(PageCoverage, {}) }) })) }), jsx(Route, { path: "applicant", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Life, children: jsx(RouteWrapperPublic, { children: jsx(PageLifeApplicant, {}) }) })) }), jsx(Route, { path: "quotes", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Life, children: jsx(RouteWrapperPublic, { children: jsx(PageLifeQuote, {}) }) })) })] })] }) })) }));
4004
+ && (jsxs(Route, { path: "car", children: [jsx(Route, { index: true, element: (jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsx(RouteWrapperPublic, { children: jsx(PageVehicle, {}) }) })) }), jsx(Route, { path: "driver", element: (jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsx(RouteWrapperPublic, { children: jsx(PageDriver, {}) }) })) }), jsx(Route, { path: "discount", element: (jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsx(RouteWrapperPublic, { children: jsx(PageCarDiscount, {}) }) })) }), jsx(Route, { path: "quotes/:uniqueUrl", element: (jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsx(RouteWrapperPublic, { children: jsx(PageCarQuote, {}) }) })) }), jsx(Route, { path: "quotes", element: (jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsx(RouteWrapperPublic, { children: jsx(PageCarQuote, {}) }) })) })] })), jsxs(Route, { path: "home", children: [jsx(Route, { index: true, element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Home, children: jsx(RouteWrapperPublic, { children: jsx(PageAddress, {}) }) })) }), jsx(Route, { path: "applicant", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Home, children: jsx(RouteWrapperPublic, { children: jsx(PageApplicant, {}) }) })) }), jsx(Route, { path: "property", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Home, children: jsx(RouteWrapperPublic, { children: jsx(PageProperty, {}) }) })) }), jsx(Route, { path: "discount", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Home, children: jsx(RouteWrapperPublic, { children: jsx(PageHomeDiscount, {}) }) })) }), jsx(Route, { path: "quotes", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Home, children: jsx(RouteWrapperPublic, { children: jsx(PageHomeQuote, {}) }) })) })] }), jsxs(Route, { path: "condo", children: [jsx(Route, { index: true, element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Condo, children: jsx(RouteWrapperPublic, { children: jsx(PageAddress, {}) }) })) }), jsx(Route, { path: "applicant", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Condo, children: jsx(RouteWrapperPublic, { children: jsx(PageApplicant, {}) }) })) }), jsx(Route, { path: "property", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Condo, children: jsx(RouteWrapperPublic, { children: jsx(PageProperty, {}) }) })) }), jsx(Route, { path: "discount", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Condo, children: jsx(RouteWrapperPublic, { children: jsx(PageHomeDiscount, {}) }) })) }), jsx(Route, { path: "quotes", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Condo, children: jsx(RouteWrapperPublic, { children: jsx(PageHomeQuote, {}) }) })) })] }), jsxs(Route, { path: "tenant", children: [jsx(Route, { index: true, element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Tenant, children: jsx(RouteWrapperPublic, { children: jsx(PageAddress, {}) }) })) }), jsx(Route, { path: "applicant", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Tenant, children: jsx(RouteWrapperPublic, { children: jsx(PageApplicant, {}) }) })) }), jsx(Route, { path: "property", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Tenant, children: jsx(RouteWrapperPublic, { children: jsx(PageProperty, {}) }) })) }), jsx(Route, { path: "discount", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Tenant, children: jsx(RouteWrapperPublic, { children: jsx(PageHomeDiscount, {}) }) })) }), jsx(Route, { path: "quotes", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Tenant, children: jsx(RouteWrapperPublic, { children: jsx(PageHomeQuote, {}) }) })) })] }), jsxs(Route, { path: "life", children: [jsx(Route, { index: true, element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Life, children: jsx(RouteWrapperPublic, { children: jsx(PageCoverage, {}) }) })) }), jsx(Route, { path: "applicant", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Life, children: jsx(RouteWrapperPublic, { children: jsx(PageLifeApplicant, {}) }) })) }), jsx(Route, { path: "quotes", element: (jsx(AppRouteWrapper, { insuranceType: InsuranceTypes.Life, children: jsx(RouteWrapperPublic, { children: jsx(PageLifeQuote, {}) }) })) })] })] }) })) }));
4001
4005
  };
4002
4006
  const RedirectWithSearchParams = ({ to, path }) => {
4003
4007
  const insuranceType = getInsuranceType();
@@ -4007,6 +4011,7 @@ const RedirectWithSearchParams = ({ to, path }) => {
4007
4011
  const { dispatchDiscountState: dispatchHomeDiscountState } = useStoreFormHomeDiscount();
4008
4012
  const { dispatchApplicantState: dispatchLifeApplicantState } = useStoreFormLifeApplicant();
4009
4013
  const queryRoot = useLocation().search.split('?');
4014
+ const toBasePath = to?.split('/')?.slice(-1)?.[0];
4010
4015
  useEffectOnce(() => {
4011
4016
  if (queryRoot.length > 1) {
4012
4017
  const query = JSON.parse(`{"${decodeURI(queryRoot[1]).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"')}"}`);
@@ -4033,7 +4038,7 @@ const RedirectWithSearchParams = ({ to, path }) => {
4033
4038
  payload: { utmCampaign: query.utm_campaign },
4034
4039
  });
4035
4040
  }
4036
- if (path === 'broker') {
4041
+ if (path === 'broker' || toBasePath === 'car') {
4037
4042
  dispatchCarDiscountState({
4038
4043
  type: StoreFormCarDiscountActionTypes.FormCarDiscountQuoterBrokerInfoSet,
4039
4044
  payload: query,
@@ -4053,7 +4058,7 @@ const RedirectWithSearchParams = ({ to, path }) => {
4053
4058
  payload: { utmCampaign: query.utm_campaign },
4054
4059
  });
4055
4060
  }
4056
- if (path === 'broker') {
4061
+ if (path === 'broker' || ['home', 'condo', 'tenant'].includes(toBasePath)) {
4057
4062
  dispatchHomeDiscountState({
4058
4063
  type: StoreFormHomeDiscountActionTypes.FormHomeQuoterBrokerInfoSet,
4059
4064
  payload: query,