@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/cjs/index.js +11 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +11 -4
- package/dist/esm/index.js.map +1 -1
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -168,7 +168,7 @@ const OfferSection = ({ offerCompany, brokerCompany, offerPrice, phoneNumber, is
|
|
|
168
168
|
postRequestQuoteOnliaUrl(true, redirectUrl);
|
|
169
169
|
};
|
|
170
170
|
return (jsxRuntime.jsxs("div", { className: `offer-section ${mychoiceCls}`, children: [jsxRuntime.jsx(mychoiceSdkComponents.OfferHeader, { className: isTheBig ? 'thebig-bold' : '', companyName: offerCompany?.name, isBestOffer: isBestOffer }), jsxRuntime.jsx(mychoiceSdkComponents.OfferPrice, { className: isTheBig ? 'thebig' : '', companyLogo: offerCompany?.logo, price: offerPrice }), !isTheBig && offsiteUrl
|
|
171
|
-
? (jsxRuntime.jsxs("div", { className: "offer-phone", children: [jsxRuntime.jsx("h3", { children: "Click below to get this rate" }), jsxRuntime.jsx(mychoiceSdkComponents.ButtonBase, { className: `offer-phone-number ${mychoiceCls}`, label: "
|
|
171
|
+
? (jsxRuntime.jsxs("div", { className: "offer-phone", children: [jsxRuntime.jsx("h3", { children: "Click below to get this rate" }), jsxRuntime.jsx(mychoiceSdkComponents.ButtonBase, { className: `offer-phone-number ${mychoiceCls}`, label: "Buy online", type: mychoiceSdkComponents.ButtonTypes.Button, category: mychoiceSdkComponents.CategoryTypes.Filled, color: mychoiceSdkComponents.ColorTypes.Primary, variant: mychoiceSdkComponents.ButtonVariantTypes.Rectangle, size: mychoiceSdkComponents.SizeTypes.Medium, onClick: handleCTAClick })] })) : (jsxRuntime.jsxs("div", { className: "offer-phone", children: [jsxRuntime.jsx("h3", { className: isTheBig ? 'thebig-bold' : '', children: "Call now to get this rate" }), jsxRuntime.jsx("a", { target: "_blank", rel: "noreferrer noopener", href: `tel:${phoneNumber?.number}`, children: jsxRuntime.jsx(mychoiceSdkComponents.ButtonBase, { className: `${isTheBig ? 'thebig-bold' : 'mychoice'} offer-phone-number`, label: phoneNumber?.title, type: mychoiceSdkComponents.ButtonTypes.Button, category: mychoiceSdkComponents.CategoryTypes.Filled, color: mychoiceSdkComponents.ColorTypes.Primary, variant: mychoiceSdkComponents.ButtonVariantTypes.Rectangle, size: mychoiceSdkComponents.SizeTypes.Medium }) })] })), jsxRuntime.jsxs("button", { className: "dropdown", onClick: handleDropdownClick, children: [jsxRuntime.jsx("span", { children: detailsIsOpen ? 'Less Info' : 'More Info' }), jsxRuntime.jsx(mychoiceSdkComponents.IconDropdownArrow, { color: "grey", className: detailsIsOpen ? 'rotated' : '' })] }), detailsIsOpen && (jsxRuntime.jsxs("div", { className: "offer-details", children: [jsxRuntime.jsx(mychoiceSdkComponents.OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: offerCompany?.name, companyType: mychoiceSdkComponents.CompanyRoleTypes.Offering, description: offerCompany?.description }), jsxRuntime.jsx("hr", {}), (isTheBig || !offsiteUrl)
|
|
172
172
|
&& (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(mychoiceSdkComponents.OfferDetail, { className: isTheBig ? 'thebig-bold' : '', logo: brokerCompany?.logo, name: brokerCompany?.title, companyType: mychoiceSdkComponents.CompanyRoleTypes.Broker, description: brokerCompany?.description }), jsxRuntime.jsx("hr", {})] })), jsxRuntime.jsx(mychoiceSdkComponents.OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: "Hours of Operation", children: jsxRuntime.jsx(mychoiceSdkComponents.OperationHoursInfo, { weekdayHours: weekdayHours, saturdayHours: saturdayHours, sundayHours: sundayHours }) })] }))] }));
|
|
173
173
|
};
|
|
174
174
|
OfferSection.defaultProps = {
|
|
@@ -320,9 +320,10 @@ const ModalPostal = () => {
|
|
|
320
320
|
|
|
321
321
|
const getVehicleYearRange = () => {
|
|
322
322
|
const vehicleYear = [];
|
|
323
|
-
const
|
|
323
|
+
const currentDate = new Date();
|
|
324
|
+
const currentYear = currentDate.getFullYear();
|
|
324
325
|
const minYear = currentYear - 25;
|
|
325
|
-
for (let year = (
|
|
326
|
+
for (let year = (currentDate.getFullYear()); year > minYear; year -= 1) {
|
|
326
327
|
vehicleYear.push({ name: `${year}`, value: `${year}` });
|
|
327
328
|
}
|
|
328
329
|
vehicleYear.push({ name: `${minYear} or older`, value: `${minYear}` });
|
|
@@ -427,14 +428,20 @@ const BlockCarInfo = () => {
|
|
|
427
428
|
const { status: statusModel, getVehicleModel, vehicleModelList = [] } = mychoiceSdkStore.useHandlerCarModel();
|
|
428
429
|
const { vehicleState, dispatchVehicleState } = mychoiceSdkStore.useStoreFormCarVehicle();
|
|
429
430
|
const { year: currentYear, make: currentMake, model: currentModel, } = vehicleState.items[vehicleState.activeIndex];
|
|
430
|
-
const yearIsValid = !currentYear || Number(currentYear) >
|
|
431
|
+
const yearIsValid = !currentYear || Number(currentYear) > 1999;
|
|
431
432
|
const yearMessage = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: ["Please contact a licenced representative at Hagerty for classic car insurance:", ' ', jsxRuntime.jsx("a", { href: "tel:18335431540", children: "1-833-543-1540" })] }));
|
|
432
433
|
const handleVehicleYearChange = ({ value }) => {
|
|
434
|
+
console.log(value);
|
|
433
435
|
if (value) {
|
|
436
|
+
console.log(dispatchVehicleState({
|
|
437
|
+
type: mychoiceSdkStore.StoreFormCarVehicleActionTypes.FormCarVehicleYearSet,
|
|
438
|
+
payload: { year: value },
|
|
439
|
+
}), 'hm');
|
|
434
440
|
dispatchVehicleState({
|
|
435
441
|
type: mychoiceSdkStore.StoreFormCarVehicleActionTypes.FormCarVehicleYearSet,
|
|
436
442
|
payload: { year: value },
|
|
437
443
|
});
|
|
444
|
+
console.log(value, 'hmHm');
|
|
438
445
|
getVehicleMake(value);
|
|
439
446
|
}
|
|
440
447
|
};
|