@mychoice/mychoice-sdk-modules 2.1.59 → 2.1.61

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.
@@ -1,3 +1,3 @@
1
1
  export declare const NoQuotesMessage: ({ type }: {
2
- type: 'car' | 'home';
3
- }) => import("react/jsx-runtime").JSX.Element;
2
+ type: 'car' | 'home' | 'life';
3
+ }) => import("react/jsx-runtime").JSX.Element | null;
package/dist/esm/index.js CHANGED
@@ -172,12 +172,17 @@ var logo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA80AAAEGCAYAAABfBnerAA
172
172
  const TITLE = {
173
173
  car: 'Hello Canadian Drivers, Welcome to MyChoice!',
174
174
  home: 'Hello Canadian Residents, Welcome to MyChoice!',
175
+ life: 'Hello Canadian Residents, Welcome to MyChoice!',
175
176
  };
176
177
  const TEXT = {
177
178
  car: 'Our apologies but unfortunately, we are unable to provide you with an auto insurance rate in your home province at this current time however we are actively working on adding partners to our platform who will be able to provide you with a rate in the near future! Please check back with us at a later date, in the meantime, drive safely!',
178
179
  home: 'Our apologies but unfortunately, we are unable to provide you with an property insurance rate in your home province at this current time however we are actively working on adding partners to our platform who will be able to provide you with a rate in the near future! Please check back with us at a later date, in the meantime, stay safe!',
180
+ life: 'Our apologies but unfortunately, we are unable to provide you with an life insurance rate in your home province at this current time however we are actively working on adding more partners to our platform who will be able to provide you with a rate in the near future! Please check back with us at a later date, in the meantime, stay safe!',
179
181
  };
180
182
  const NoQuotesMessage = ({ type }) => {
183
+ const { appConfigState: { appType }, } = useStoreAppConfig();
184
+ if (appType === AppTypes.TheBig)
185
+ return null;
181
186
  return (jsxs("div", { className: "offer-section mychoice", children: [jsx("div", { style: { width: '100%' }, children: jsx("img", { src: logo, alt: "My Choice", style: { width: '120px' } }) }), jsx("p", { children: jsx("h3", { style: { whiteSpace: 'normal' }, children: TITLE[type] }) }), jsx("p", { style: { lineHeight: '1.25rem' }, children: TEXT[type] })] }));
182
187
  };
183
188
 
@@ -1517,7 +1522,7 @@ const PageDriver = () => {
1517
1522
  useEffect(() => {
1518
1523
  setIsRender(true);
1519
1524
  }, [isRender]);
1520
- return (jsxs("div", { className: "form-container", children: [jsx(TabDriver, { createItem: createDriver }), jsxs("div", { className: "form-section-container", children: [isRender && (jsxs(Fragment, { children: [jsx(SectionDriverInfo, {}), jsx(SectionDriverLicence, {}), jsx(SectionDriverInsurancePolicy, {}), jsx(SectionDriverCancellation, {}), jsx(SectionDriverHistory, {}), jsx(HonestyMessage, {})] })), appType === AppTypes.TheBig ? (jsx(NavigationBottomTheBig, { createItem: createDriver, formSteps: formSteps[InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: driverFormIsValid })) : (jsx(NavigationBottom, { className: "mychoice", createItem: createDriver, formSteps: formSteps[InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: driverFormIsValid }))] }), localIndex !== defaultLocalIndex && (jsx("img", { className: "logo-for-partner", src: myChoicePartnerLogo, alt: "partner logo" }))] }));
1525
+ return (jsxs("div", { className: "form-container", children: [jsx(TabDriver, { createItem: createDriver }), jsxs("div", { className: "form-section-container", children: [isRender && (jsxs(Fragment, { children: [jsx(SectionDriverInfo, {}), jsx(SectionDriverLicence, {}), jsx(SectionDriverInsurancePolicy, {}), jsx(SectionDriverCancellation, {}), jsx(SectionDriverHistory, {}), appType === AppTypes.MyChoice && jsx(HonestyMessage, {})] })), appType === AppTypes.TheBig ? (jsx(NavigationBottomTheBig, { createItem: createDriver, formSteps: formSteps[InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: driverFormIsValid })) : (jsx(NavigationBottom, { className: "mychoice", createItem: createDriver, formSteps: formSteps[InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: driverFormIsValid }))] }), localIndex !== defaultLocalIndex && (jsx("img", { className: "logo-for-partner", src: myChoicePartnerLogo, alt: "partner logo" }))] }));
1521
1526
  };
1522
1527
 
1523
1528
  const BlockVehLinks = () => {
@@ -1943,7 +1948,7 @@ const SectionAddress = () => {
1943
1948
  const { getPostal } = useHandlerPostal(insuranceType);
1944
1949
  const { postalState: { item, inValidation }, dispatchPostalState, } = useStoreFormHomePostal();
1945
1950
  const { dispatchApplicantBaseState } = useStoreFormHomeApplicantBase();
1946
- const { streetAddress = '', postalCode = '', addressObject, errorMessage, } = item;
1951
+ const { streetAddress = '', postalCode = '', addressObject, errorMessage } = item;
1947
1952
  const navigate = useNavigate();
1948
1953
  const asyncSelectRef = useRef(null);
1949
1954
  const isMychoice = appType === AppTypes.MyChoice;
@@ -2044,7 +2049,7 @@ const SectionAddress = () => {
2044
2049
  console.error(error);
2045
2050
  });
2046
2051
  };
2047
- const handleOwnerTypeChange = ({ value: typeValue, }) => {
2052
+ const handleOwnerTypeChange = ({ value: typeValue }) => {
2048
2053
  dispatchDwellingState({
2049
2054
  type: StoreFormHomeDwellingActionTypes.FormHomeDwellingClear,
2050
2055
  payload: { type: typeValue },
@@ -2125,7 +2130,7 @@ const SectionAddress = () => {
2125
2130
  const placeholderText = 'Type in Your Street Address';
2126
2131
  return (jsxs("div", { className: `form-section ${mychoiceCls}`, children: [jsx("h2", { className: "section-title", children: " Where do you reside and thrive? " }), jsx(SelectFormBox, { options: homeOwnerTypeOptions, name: "ownerType", onChange: handleOwnerTypeChange, defaultValue: insuranceType, title: "Type of Insurance", placeholder: "Select Type of Insurance", error: !insuranceType && inValidation, errorMessage: getErrorMessage(insuranceType, inValidation) }), jsxs("div", { className: "input-form-box-container", children: [jsx(LabelFormBox, { name: "homeAddress", title: "Home Address", subTitle: "The address should contain Street Address (example: '123 Main St'), City, Province Code, Postal Code, Country", description: "For your convenience, suggestions for your address will be displayed as you start typing. Please select an option from the list to continue. If you can\u2019t find your address in the list, please click \u201CI can\u2019t find my address. Let me type it in.\u201D and you will be directed to a page which will let you enter your address manually." }), jsx(GooglePlacesAutocomplete, { autocompletionRequest: {
2127
2132
  componentRestrictions: { country: 'ca' },
2128
- }, apiKey: "AIzaSyCzQKD3HwxCezMrPsS4q_xFQ3g3TS4u1nY", selectProps: {
2133
+ }, apiKey: process.env.REACT_APP_HOME_SEARCH_GOOGLE_API_KEY, selectProps: {
2129
2134
  value: addressObject,
2130
2135
  onChange: handleAddressChange,
2131
2136
  placeholder: placeholderText,
@@ -2133,17 +2138,14 @@ const SectionAddress = () => {
2133
2138
  styles: {
2134
2139
  control: (baseStyles, state) => ({
2135
2140
  ...baseStyles,
2136
- borderColor: getErrorMessage(streetAddress && postalCode, inValidation) ||
2137
- errorMessage
2141
+ borderColor: getErrorMessage(streetAddress && postalCode, inValidation) || errorMessage
2138
2142
  ? 'red'
2139
2143
  : getBorderColor(state.isFocused),
2140
2144
  borderRadius: isMychoice ? '0.625rem' : '0.25rem',
2141
2145
  boxShadow: 'none',
2142
2146
  height: '3.75rem',
2143
2147
  ':hover': {
2144
- borderColor: getErrorMessage(streetAddress && postalCode, inValidation) || errorMessage
2145
- ? 'red'
2146
- : '#8ED6DC',
2148
+ borderColor: getErrorMessage(streetAddress && postalCode, inValidation) || errorMessage ? 'red' : '#8ED6DC',
2147
2149
  borderWidth: '0.125rem',
2148
2150
  cursor: 'pointer',
2149
2151
  },
@@ -3238,25 +3240,22 @@ const PageLifeQuote = () => {
3238
3240
  behavior: 'smooth',
3239
3241
  });
3240
3242
  });
3241
- return (jsx("div", { className: "quote-page-content", children: !appLoaderState.isOpen && (jsxs(Fragment, { children: [jsxs("div", { className: "form-section-container", children: [appDeviceType === DeviceTypes.Mobile && (jsx(Fragment, { children: !!items?.length && (jsx(Fragment, { children: !quoteState.showCallMessage ? (jsx("div", { className: "offer-container", children: jsx(OfferSection, { isBestOffer: true, offerCompany: items[0]?.company, brokerCompany: items[0]?.brokerProfile, offerPrice: {
3243
+ return (jsx("div", { className: "quote-page-content", children: !appLoaderState.isOpen && (jsxs(Fragment, { children: [jsxs("div", { className: "form-section-container", children: [appDeviceType === DeviceTypes.Mobile && (jsx(Fragment, { children: !!items?.length ? (jsx(Fragment, { children: !quoteState.showCallMessage ? (jsx("div", { className: "offer-container", children: jsx(OfferSection, { isBestOffer: true, offerCompany: items[0]?.company, brokerCompany: items[0]?.brokerProfile, offerPrice: {
3242
3244
  monthly: items[0]?.priceMonthly,
3243
3245
  yearly: items[0]?.priceYearly,
3244
3246
  }, operationHours: {
3245
3247
  saturdayHours: items[0]?.brokerProfile.hoursSaturday,
3246
3248
  sundayHours: items[0]?.brokerProfile.hoursSunday,
3247
3249
  weekdayHours: items[0]?.brokerProfile.hoursWorkdays,
3248
- }, phoneNumber: formatPhoneObject(items[0]?.brokerProfile.phone), redirectUrl: items[0]?.brokerProfile.redirectUrl || '' }) })) : (jsx(SplashScreen, {})) })) })), jsx(SectionQuoteEdit, {})] }), appDeviceType !== DeviceTypes.Mobile &&
3249
- quoteState.showCallMessage && jsx(SplashScreen, {}), !quoteState.showCallMessage && (jsx("div", { className: "offer-container", children: !!items?.length &&
3250
- items.map(({ company, brokerProfile, priceMonthly, priceYearly, }, index) => (jsx("div", { children: (appDeviceType !== DeviceTypes.Mobile ||
3251
- (appDeviceType === DeviceTypes.Mobile &&
3252
- index !== 0)) && (jsx(OfferSection, { isBestOffer: index === 0, offerCompany: company, brokerCompany: brokerProfile, offerPrice: {
3253
- monthly: priceMonthly,
3254
- yearly: priceYearly,
3255
- }, operationHours: {
3256
- saturdayHours: brokerProfile.hoursSaturday,
3257
- sundayHours: brokerProfile.hoursSunday,
3258
- weekdayHours: brokerProfile.hoursWorkdays,
3259
- }, phoneNumber: formatPhoneObject(brokerProfile.phone), redirectUrl: brokerProfile.redirectUrl || '' })) }, index))) }))] })) }));
3250
+ }, phoneNumber: formatPhoneObject(items[0]?.brokerProfile.phone), redirectUrl: items[0]?.brokerProfile.redirectUrl || '' }) })) : (jsx(SplashScreen, {})) })) : (jsx(NoQuotesMessage, { type: "life" })) })), jsx(SectionQuoteEdit, {})] }), appDeviceType !== DeviceTypes.Mobile && quoteState.showCallMessage && jsx(SplashScreen, {}), !quoteState.showCallMessage && (jsx("div", { className: "offer-container", children: !!items?.length ? (items.map(({ company, brokerProfile, priceMonthly, priceYearly }, index) => (jsx("div", { children: (appDeviceType !== DeviceTypes.Mobile ||
3251
+ (appDeviceType === DeviceTypes.Mobile && index !== 0)) && (jsx(OfferSection, { isBestOffer: index === 0, offerCompany: company, brokerCompany: brokerProfile, offerPrice: {
3252
+ monthly: priceMonthly,
3253
+ yearly: priceYearly,
3254
+ }, operationHours: {
3255
+ saturdayHours: brokerProfile.hoursSaturday,
3256
+ sundayHours: brokerProfile.hoursSunday,
3257
+ weekdayHours: brokerProfile.hoursWorkdays,
3258
+ }, phoneNumber: formatPhoneObject(brokerProfile.phone), redirectUrl: brokerProfile.redirectUrl || '' })) }, index)))) : (jsx(NoQuotesMessage, { type: "life" })) }))] })) }));
3260
3259
  };
3261
3260
 
3262
3261
  const getFormattedAddress = (unitNumber, streetAddress, city, provinceCode, postalCode, country) => {