@mychoice/mychoice-sdk-modules 2.1.17 → 2.1.19

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 +7 -9
  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/{three-point-five/BestOfferFirst.d.ts → quote/PageAllQuotes.d.ts} +1 -1
  6. package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +1 -0
  7. package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +2 -0
  8. package/dist/cjs/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +3 -0
  9. package/dist/cjs/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +3 -0
  10. package/dist/esm/index.js +7 -9
  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/{three-point-five/BestOfferFirst.d.ts → quote/PageAllQuotes.d.ts} +1 -1
  15. package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +1 -0
  16. package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +2 -0
  17. package/dist/esm/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +3 -0
  18. package/dist/esm/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +3 -0
  19. package/package.json +3 -3
  20. package/dist/cjs/insurances/car/pages/three-point-five/index.d.ts +0 -1
  21. package/dist/cjs/insurances/car/pages/three-point-five/sections/OfferSectionCopy.d.ts +0 -3
  22. package/dist/cjs/insurances/car/pages/three-point-five/sections/OfferSectionDupe.d.ts +0 -3
  23. package/dist/cjs/insurances/car/pages/three-point-five/sections/index.d.ts +0 -1
  24. package/dist/esm/insurances/car/pages/three-point-five/index.d.ts +0 -1
  25. package/dist/esm/insurances/car/pages/three-point-five/sections/OfferSectionCopy.d.ts +0 -3
  26. package/dist/esm/insurances/car/pages/three-point-five/sections/OfferSectionDupe.d.ts +0 -3
  27. package/dist/esm/insurances/car/pages/three-point-five/sections/index.d.ts +0 -1
@@ -1,3 +1,3 @@
1
- import { SdkFC } from '@groksmith/mychoice-sdk-components';
1
+ import { SdkFC } from '@mychoice/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 '@groksmith/mychoice-sdk-components';
1
+ import { AppTypes } from '@mychoice/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 BestOfferFirst: SdkFC;
2
+ export declare const PageAllQuotes: SdkFC;
@@ -0,0 +1 @@
1
+ export declare const BlockConfirmImages: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SdkFC } from '@groksmith/mychoice-sdk-components';
2
+ export declare const BlockQuoteStatistics: SdkFC;
@@ -0,0 +1,3 @@
1
+ import { SdkFC } from '@groksmith/mychoice-sdk-components';
2
+ import { OfferSectionProps } from '../interfaces';
3
+ export declare const BestOfferSection: SdkFC<OfferSectionProps>;
@@ -0,0 +1,3 @@
1
+ import { SdkFC } from '@groksmith/mychoice-sdk-components';
2
+ import { OfferSectionProps } from '../interfaces';
3
+ export declare const DummyOfferSection: SdkFC<OfferSectionProps>;
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
248
  const isLastPage = window.location.pathname.includes('discount') || window.location.pathname.includes('applicant');
250
- console.log(isLastPage);
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
 
@@ -304,11 +302,10 @@ const ModalPostal = () => {
304
302
  };
305
303
 
306
304
  const getVehicleYearRange = () => {
307
- const currentDate = new Date();
308
305
  const vehicleYear = [];
309
- const currentYear = currentDate.getFullYear();
306
+ const currentYear = 2024;
310
307
  const minYear = currentYear - 25;
311
- for (let year = (currentDate.getFullYear()); year > minYear; year -= 1) {
308
+ for (let year = (currentYear); year > minYear; year -= 1) {
312
309
  vehicleYear.push({ name: `${year}`, value: `${year}` });
313
310
  }
314
311
  vehicleYear.push({ name: `${minYear} or older`, value: `${minYear}` });
@@ -1837,7 +1834,7 @@ const PageCarQuote = () => {
1837
1834
  const { appDeviceType } = useStoreDeviceType();
1838
1835
  const { items, quoteConfirm } = quoteState;
1839
1836
  const isTheBig = appType === AppTypes.TheBig;
1840
- const hasConfirmStep = items?.length && !isTheBig && items[0]?.confirmQuote && quoteConfirm;
1837
+ const hasConfirmStep = !!(items?.length && !isTheBig && items[0]?.confirmQuote && quoteConfirm);
1841
1838
  const quoteItems = hasConfirmStep ? items?.slice(0, 2) : items;
1842
1839
  const showContentWhileLoading = hasConfirmStep ? true : !appLoaderState.isOpen;
1843
1840
  useEffectOnce(() => {
@@ -4008,6 +4005,7 @@ const RedirectWithSearchParams = ({ to, path }) => {
4008
4005
  const { dispatchDiscountState: dispatchHomeDiscountState } = useStoreFormHomeDiscount();
4009
4006
  const { dispatchApplicantState: dispatchLifeApplicantState } = useStoreFormLifeApplicant();
4010
4007
  const queryRoot = useLocation().search.split('?');
4008
+ const toBasePath = to?.split('/')?.slice(-1)?.[0];
4011
4009
  useEffectOnce(() => {
4012
4010
  if (queryRoot.length > 1) {
4013
4011
  const query = JSON.parse(`{"${decodeURI(queryRoot[1]).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"')}"}`);
@@ -4034,7 +4032,7 @@ const RedirectWithSearchParams = ({ to, path }) => {
4034
4032
  payload: { utmCampaign: query.utm_campaign },
4035
4033
  });
4036
4034
  }
4037
- if (path === 'broker') {
4035
+ if (path === 'broker' || toBasePath === 'car') {
4038
4036
  dispatchCarDiscountState({
4039
4037
  type: StoreFormCarDiscountActionTypes.FormCarDiscountQuoterBrokerInfoSet,
4040
4038
  payload: query,
@@ -4054,7 +4052,7 @@ const RedirectWithSearchParams = ({ to, path }) => {
4054
4052
  payload: { utmCampaign: query.utm_campaign },
4055
4053
  });
4056
4054
  }
4057
- if (path === 'broker') {
4055
+ if (path === 'broker' || ['home', 'condo', 'tenant'].includes(toBasePath)) {
4058
4056
  dispatchHomeDiscountState({
4059
4057
  type: StoreFormHomeDiscountActionTypes.FormHomeQuoterBrokerInfoSet,
4060
4058
  payload: query,