@mychoice/mychoice-sdk-modules 2.1.24 → 2.1.26

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
@@ -158,7 +158,7 @@ const OfferSection = ({ offerCompany, brokerCompany, offerPrice, phoneNumber, is
158
158
  postRequestQuoteOnliaUrl(true, redirectUrl);
159
159
  };
160
160
  return (jsxs("div", { className: `offer-section ${mychoiceCls}`, children: [jsx(OfferHeader, { className: isTheBig ? 'thebig-bold' : '', companyName: offerCompany?.name, isBestOffer: isBestOffer }), jsx(OfferPrice, { className: isTheBig ? 'thebig' : '', companyLogo: offerCompany?.logo, price: offerPrice }), !isTheBig && offsiteUrl
161
- ? (jsxs("div", { className: "offer-phone", children: [jsx("h3", { children: "Click below to get this rate" }), jsx(ButtonBase, { className: `offer-phone-number ${mychoiceCls}`, label: "Get details", type: ButtonTypes.Button, category: CategoryTypes.Filled, color: ColorTypes.Primary, variant: ButtonVariantTypes.Rectangle, size: SizeTypes.Medium, onClick: handleCTAClick })] })) : (jsxs("div", { className: "offer-phone", children: [jsx("h3", { className: isTheBig ? 'thebig-bold' : '', children: "Call now to get this rate" }), jsx("a", { target: "_blank", rel: "noreferrer noopener", href: `tel:${phoneNumber?.number}`, children: jsx(ButtonBase, { className: `${isTheBig ? 'thebig-bold' : 'mychoice'} offer-phone-number`, label: phoneNumber?.title, type: ButtonTypes.Button, category: CategoryTypes.Filled, color: ColorTypes.Primary, variant: ButtonVariantTypes.Rectangle, size: SizeTypes.Medium }) })] })), jsxs("button", { className: "dropdown", onClick: handleDropdownClick, children: [jsx("span", { children: detailsIsOpen ? 'Less Info' : 'More Info' }), jsx(IconDropdownArrow, { color: "grey", className: detailsIsOpen ? 'rotated' : '' })] }), detailsIsOpen && (jsxs("div", { className: "offer-details", children: [jsx(OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: offerCompany?.name, companyType: CompanyRoleTypes.Offering, description: offerCompany?.description }), jsx("hr", {}), (isTheBig || !offsiteUrl)
161
+ ? (jsxs("div", { className: "offer-phone", children: [jsx("h3", { children: "Click below to get this rate" }), jsx(ButtonBase, { className: `offer-phone-number ${mychoiceCls}`, label: "Buy online", type: ButtonTypes.Button, category: CategoryTypes.Filled, color: ColorTypes.Primary, variant: ButtonVariantTypes.Rectangle, size: SizeTypes.Medium, onClick: handleCTAClick })] })) : (jsxs("div", { className: "offer-phone", children: [jsx("h3", { className: isTheBig ? 'thebig-bold' : '', children: "Call now to get this rate" }), jsx("a", { target: "_blank", rel: "noreferrer noopener", href: `tel:${phoneNumber?.number}`, children: jsx(ButtonBase, { className: `${isTheBig ? 'thebig-bold' : 'mychoice'} offer-phone-number`, label: phoneNumber?.title, type: ButtonTypes.Button, category: CategoryTypes.Filled, color: ColorTypes.Primary, variant: ButtonVariantTypes.Rectangle, size: SizeTypes.Medium }) })] })), jsxs("button", { className: "dropdown", onClick: handleDropdownClick, children: [jsx("span", { children: detailsIsOpen ? 'Less Info' : 'More Info' }), jsx(IconDropdownArrow, { color: "grey", className: detailsIsOpen ? 'rotated' : '' })] }), detailsIsOpen && (jsxs("div", { className: "offer-details", children: [jsx(OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: offerCompany?.name, companyType: CompanyRoleTypes.Offering, description: offerCompany?.description }), jsx("hr", {}), (isTheBig || !offsiteUrl)
162
162
  && (jsxs(Fragment, { children: [jsx(OfferDetail, { className: isTheBig ? 'thebig-bold' : '', logo: brokerCompany?.logo, name: brokerCompany?.title, companyType: CompanyRoleTypes.Broker, description: brokerCompany?.description }), jsx("hr", {})] })), jsx(OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: "Hours of Operation", children: jsx(OperationHoursInfo, { weekdayHours: weekdayHours, saturdayHours: saturdayHours, sundayHours: sundayHours }) })] }))] }));
163
163
  };
164
164
  OfferSection.defaultProps = {
@@ -310,9 +310,10 @@ const ModalPostal = () => {
310
310
 
311
311
  const getVehicleYearRange = () => {
312
312
  const vehicleYear = [];
313
- const currentYear = 2024;
313
+ const currentDate = new Date();
314
+ const currentYear = currentDate.getFullYear();
314
315
  const minYear = currentYear - 25;
315
- for (let year = (currentYear); year > minYear; year -= 1) {
316
+ for (let year = (currentDate.getFullYear()); year > minYear; year -= 1) {
316
317
  vehicleYear.push({ name: `${year}`, value: `${year}` });
317
318
  }
318
319
  vehicleYear.push({ name: `${minYear} or older`, value: `${minYear}` });
@@ -417,14 +418,20 @@ const BlockCarInfo = () => {
417
418
  const { status: statusModel, getVehicleModel, vehicleModelList = [] } = useHandlerCarModel();
418
419
  const { vehicleState, dispatchVehicleState } = useStoreFormCarVehicle();
419
420
  const { year: currentYear, make: currentMake, model: currentModel, } = vehicleState.items[vehicleState.activeIndex];
420
- const yearIsValid = !currentYear || Number(currentYear) > 1998;
421
+ const yearIsValid = !currentYear || Number(currentYear) > 1999;
421
422
  const yearMessage = (jsxs(Fragment, { children: ["Please contact a licenced representative at Hagerty for classic car insurance:", ' ', jsx("a", { href: "tel:18335431540", children: "1-833-543-1540" })] }));
422
423
  const handleVehicleYearChange = ({ value }) => {
424
+ console.log(value);
423
425
  if (value) {
426
+ console.log(dispatchVehicleState({
427
+ type: StoreFormCarVehicleActionTypes.FormCarVehicleYearSet,
428
+ payload: { year: value },
429
+ }), 'hm');
424
430
  dispatchVehicleState({
425
431
  type: StoreFormCarVehicleActionTypes.FormCarVehicleYearSet,
426
432
  payload: { year: value },
427
433
  });
434
+ console.log(value, 'hmHm');
428
435
  getVehicleMake(value);
429
436
  }
430
437
  };