@mychoice/mychoice-sdk-modules 2.1.31 → 2.1.32
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 +12 -19
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +12 -19
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -157,8 +157,9 @@ const OfferSection = ({ offerCompany, brokerCompany, offerPrice, phoneNumber, is
|
|
|
157
157
|
}
|
|
158
158
|
postRequestQuoteOnliaUrl(true, redirectUrl);
|
|
159
159
|
};
|
|
160
|
+
console.log(offerCompany, "offer c");
|
|
160
161
|
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: "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
|
+
? (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, logo: offerCompany?.logo, companyType: CompanyRoleTypes.Offering, description: offerCompany?.description }), jsx("hr", {}), (isTheBig || !offsiteUrl)
|
|
162
163
|
&& (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
164
|
};
|
|
164
165
|
OfferSection.defaultProps = {
|
|
@@ -3123,29 +3124,21 @@ const PageLifeQuote = () => {
|
|
|
3123
3124
|
behavior: 'smooth',
|
|
3124
3125
|
});
|
|
3125
3126
|
});
|
|
3126
|
-
|
|
3127
|
-
// Check if the company is already added and if so, whether the current item has a lower priceMonthly.
|
|
3128
|
-
if (!acc[currentItem.company] || currentItem.priceMonthly < acc[currentItem.company].priceMonthly) {
|
|
3129
|
-
acc[currentItem.company] = currentItem; // Add or update the item for the company
|
|
3130
|
-
}
|
|
3131
|
-
return acc;
|
|
3132
|
-
}, {});
|
|
3133
|
-
const result = Object.values(uniqueItems);
|
|
3134
|
-
console.log(result, "ach");
|
|
3127
|
+
console.log(items, "items");
|
|
3135
3128
|
return (jsx("div", { className: "quote-page-content", children: !appLoaderState.isOpen
|
|
3136
|
-
&& (jsxs(Fragment, { children: [jsxs("div", { className: "form-section-container", children: [appDeviceType === DeviceTypes.Mobile && (jsx(Fragment, { children: !!
|
|
3137
|
-
? (jsx("div", { className: "offer-container", children: jsx(OfferSection, { isBestOffer: true, offerCompany:
|
|
3138
|
-
monthly:
|
|
3139
|
-
yearly:
|
|
3129
|
+
&& (jsxs(Fragment, { children: [jsxs("div", { className: "form-section-container", children: [appDeviceType === DeviceTypes.Mobile && (jsx(Fragment, { children: !!items?.length && (jsx(Fragment, { children: !quoteState.showCallMessage
|
|
3130
|
+
? (jsx("div", { className: "offer-container", children: jsx(OfferSection, { isBestOffer: true, offerCompany: items[0]?.company, brokerCompany: items[0]?.brokerProfile, offerPrice: {
|
|
3131
|
+
monthly: items[0]?.priceMonthly,
|
|
3132
|
+
yearly: items[0]?.priceYearly,
|
|
3140
3133
|
}, operationHours: {
|
|
3141
|
-
saturdayHours:
|
|
3142
|
-
sundayHours:
|
|
3143
|
-
weekdayHours:
|
|
3134
|
+
saturdayHours: items[0]?.brokerProfile.hoursSaturday,
|
|
3135
|
+
sundayHours: items[0]?.brokerProfile.hoursSunday,
|
|
3136
|
+
weekdayHours: items[0]?.brokerProfile.hoursWorkdays,
|
|
3144
3137
|
}, phoneNumber: formatPhoneObject(items[0]?.brokerProfile.phone), redirectUrl: items[0]?.brokerProfile.redirectUrl || '' }) }))
|
|
3145
3138
|
: jsx(SplashScreen, {}) })) })), jsx(SectionQuoteEdit, {})] }), appDeviceType !== DeviceTypes.Mobile && quoteState.showCallMessage
|
|
3146
3139
|
&& jsx(SplashScreen, {}), !quoteState.showCallMessage
|
|
3147
|
-
&& (jsx("div", { className: "offer-container", children: !!
|
|
3148
|
-
&&
|
|
3140
|
+
&& (jsx("div", { className: "offer-container", children: !!items?.length
|
|
3141
|
+
&& items.map(({ company, brokerProfile, priceMonthly, priceYearly, }, index) => (jsx("div", { children: (appDeviceType !== DeviceTypes.Mobile || (appDeviceType === DeviceTypes.Mobile && index !== 0)) && (jsx(OfferSection, { isBestOffer: index === 0, offerCompany: company, brokerCompany: brokerProfile, offerPrice: {
|
|
3149
3142
|
monthly: priceMonthly,
|
|
3150
3143
|
yearly: priceYearly,
|
|
3151
3144
|
}, operationHours: {
|