@mychoice/mychoice-sdk-modules 2.1.7 → 2.1.9

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
@@ -308,10 +308,10 @@ const ModalPostal = () => {
308
308
  const getVehicleYearRange = () => {
309
309
  const currentDate = new Date();
310
310
  const vehicleYear = [];
311
- for (let year = (currentDate.getFullYear()); year >= 2001; year -= 1) {
311
+ for (let year = (currentDate.getFullYear()); year >= 1999; year -= 1) {
312
312
  vehicleYear.push({ name: `${year}`, value: `${year}` });
313
313
  }
314
- vehicleYear.push({ name: '2000 or older', value: '2000' });
314
+ vehicleYear.push({ name: '1998 or older', value: '1998' });
315
315
  return vehicleYear;
316
316
  };
317
317
  const getRecommendedRange = (distanceDaily, distanceBusiness) => {
@@ -413,7 +413,8 @@ const BlockCarInfo = () => {
413
413
  const { status: statusModel, getVehicleModel, vehicleModelList = [] } = mychoiceSdkStore.useHandlerCarModel();
414
414
  const { vehicleState, dispatchVehicleState } = mychoiceSdkStore.useStoreFormCarVehicle();
415
415
  const { year: currentYear, make: currentMake, model: currentModel, } = vehicleState.items[vehicleState.activeIndex];
416
- const yearIsValid = !currentYear || Number(currentYear) > 2000;
416
+ const yearIsValid = !currentYear || Number(currentYear) > 1998;
417
+ const yearMessage = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: ["Please contact a licenced representative at Hargerty for classic car insurance:", ' ', jsxRuntime.jsx("a", { href: "tel:18335431540", children: "1-833-543-1540" })] }));
417
418
  const handleVehicleYearChange = ({ value }) => {
418
419
  if (value) {
419
420
  dispatchVehicleState({
@@ -448,7 +449,7 @@ const BlockCarInfo = () => {
448
449
  getVehicleModel(currentYear, currentMake);
449
450
  }
450
451
  });
451
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SelectFormBox, { options: getVehicleYearRange(), name: "carYear", title: "Car Year", placeholder: "Select Year", description: "Every car is different, so for insurers to accurately cover, repair, or replace your vehicle, they need to know the make, model, age, body type, and vehicle history. Each factor will raise or lower your premium\u2014an older vehicle is typically more affordable to repair, for example, since cars lose value each year.", error: !currentYear && vehicleState.inValidation, errorMessage: !yearIsValid ? mychoiceSdkComponents.yearMessage : getErrorMessage(currentYear, vehicleState.inValidation), defaultValue: currentYear, autoSelectIfValueIsOutOfOptions: false, onChange: handleVehicleYearChange }), !!vehicleMakeList.length
452
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SelectFormBox, { options: getVehicleYearRange(), name: "carYear", title: "Car Year", placeholder: "Select Year", description: "Every car is different, so for insurers to accurately cover, repair, or replace your vehicle, they need to know the make, model, age, body type, and vehicle history. Each factor will raise or lower your premium\u2014an older vehicle is typically more affordable to repair, for example, since cars lose value each year.", error: !currentYear && vehicleState.inValidation, errorMessage: !yearIsValid ? yearMessage : getErrorMessage(currentYear, vehicleState.inValidation), defaultValue: currentYear, autoSelectIfValueIsOutOfOptions: false, onChange: handleVehicleYearChange }), !!vehicleMakeList.length
452
453
  && yearIsValid
453
454
  && statusMake === mychoiceSdkComponents.RequestStatusTypes.Success
454
455
  && (jsxRuntime.jsx(SelectFormBox, { options: vehicleMakeList, name: "carMakes", title: "Car Manufacturer", placeholder: "Select a Make", description: "The manufacturer of your vehicle is a huge influence on your insurance premium, but it isn\u2019t the only consideration. Some car manufacturers include security features that may qualify for discounts, like anti-theft protection or anti-lock brakes. Insurers also consider repair, risk, injury, and retail prices. If you do not see your vehicle on our list, call us for a telephonic quote.", error: !currentMake && vehicleState.inValidation, errorMessage: getErrorMessage(currentMake, vehicleState.inValidation), defaultValue: currentMake, autoSelectIfValueIsOutOfOptions: false, onChange: handleVehicleMakeChange })), vehicleModelList.length > 0