@mychoice/mychoice-sdk-modules 2.1.60 → 2.1.62

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
2
  type: 'car' | 'home' | 'life';
3
- }) => import("react/jsx-runtime").JSX.Element;
3
+ }) => import("react/jsx-runtime").JSX.Element | null;
package/dist/esm/index.js CHANGED
@@ -180,25 +180,24 @@ const TEXT = {
180
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!',
181
181
  };
182
182
  const NoQuotesMessage = ({ type }) => {
183
+ const { appConfigState: { appType }, } = useStoreAppConfig();
184
+ if (appType === AppTypes.TheBig)
185
+ return null;
183
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] })] }));
184
187
  };
185
188
 
186
189
  const usePathGroups = (insuranceType) => {
187
190
  const { appConfigState } = useStoreAppConfig();
188
191
  const insurancePathGroup = {
189
- [`${InsuranceTypes.Car}`]: [
190
- { name: 'Car', link: `/${appConfigState.localIndex}/car` },
191
- ],
192
- [`${InsuranceTypes.Home}`]: [
193
- { name: 'Home', link: `/${appConfigState.localIndex}/home` },
194
- ],
192
+ [`${InsuranceTypes.Car}`]: [{ name: 'Car', link: `/${appConfigState.localIndex}/car` }],
193
+ [`${InsuranceTypes.Home}`]: [{ name: 'Home', link: `/${appConfigState.localIndex}/home` }],
195
194
  // @todo: will be used in future
196
195
  // [`${InsuranceTypes.Life}`]: [{ name: 'Life', link: `/${appConfigState.localIndex}/life` }],
197
196
  };
198
197
  const externalPathGroup = [
199
- { name: 'Car', link: 'https://quote.mychoice.ca/insurance/car' },
200
- { name: 'Home', link: 'https://quote.mychoice.ca/insurance/home' },
201
- { name: 'Life', link: 'https://quote.mychoice.ca/insurance/life' },
198
+ { name: 'Car', link: '/insurance/car' },
199
+ { name: 'Home', link: '/insurance/home' },
200
+ { name: 'Life', link: '/insurance/life' },
202
201
  { name: 'Learn', link: 'https://www.mychoice.ca/blog/' },
203
202
  ];
204
203
  // @todo: use in future.
@@ -1519,7 +1518,7 @@ const PageDriver = () => {
1519
1518
  useEffect(() => {
1520
1519
  setIsRender(true);
1521
1520
  }, [isRender]);
1522
- 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" }))] }));
1521
+ 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" }))] }));
1523
1522
  };
1524
1523
 
1525
1524
  const BlockVehLinks = () => {
@@ -1945,7 +1944,7 @@ const SectionAddress = () => {
1945
1944
  const { getPostal } = useHandlerPostal(insuranceType);
1946
1945
  const { postalState: { item, inValidation }, dispatchPostalState, } = useStoreFormHomePostal();
1947
1946
  const { dispatchApplicantBaseState } = useStoreFormHomeApplicantBase();
1948
- const { streetAddress = '', postalCode = '', addressObject, errorMessage, } = item;
1947
+ const { streetAddress = '', postalCode = '', addressObject, errorMessage } = item;
1949
1948
  const navigate = useNavigate();
1950
1949
  const asyncSelectRef = useRef(null);
1951
1950
  const isMychoice = appType === AppTypes.MyChoice;
@@ -2046,7 +2045,7 @@ const SectionAddress = () => {
2046
2045
  console.error(error);
2047
2046
  });
2048
2047
  };
2049
- const handleOwnerTypeChange = ({ value: typeValue, }) => {
2048
+ const handleOwnerTypeChange = ({ value: typeValue }) => {
2050
2049
  dispatchDwellingState({
2051
2050
  type: StoreFormHomeDwellingActionTypes.FormHomeDwellingClear,
2052
2051
  payload: { type: typeValue },
@@ -2127,7 +2126,7 @@ const SectionAddress = () => {
2127
2126
  const placeholderText = 'Type in Your Street Address';
2128
2127
  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: {
2129
2128
  componentRestrictions: { country: 'ca' },
2130
- }, apiKey: "AIzaSyCzQKD3HwxCezMrPsS4q_xFQ3g3TS4u1nY", selectProps: {
2129
+ }, apiKey: process.env.REACT_APP_HOME_SEARCH_GOOGLE_API_KEY, selectProps: {
2131
2130
  value: addressObject,
2132
2131
  onChange: handleAddressChange,
2133
2132
  placeholder: placeholderText,
@@ -2135,17 +2134,14 @@ const SectionAddress = () => {
2135
2134
  styles: {
2136
2135
  control: (baseStyles, state) => ({
2137
2136
  ...baseStyles,
2138
- borderColor: getErrorMessage(streetAddress && postalCode, inValidation) ||
2139
- errorMessage
2137
+ borderColor: getErrorMessage(streetAddress && postalCode, inValidation) || errorMessage
2140
2138
  ? 'red'
2141
2139
  : getBorderColor(state.isFocused),
2142
2140
  borderRadius: isMychoice ? '0.625rem' : '0.25rem',
2143
2141
  boxShadow: 'none',
2144
2142
  height: '3.75rem',
2145
2143
  ':hover': {
2146
- borderColor: getErrorMessage(streetAddress && postalCode, inValidation) || errorMessage
2147
- ? 'red'
2148
- : '#8ED6DC',
2144
+ borderColor: getErrorMessage(streetAddress && postalCode, inValidation) || errorMessage ? 'red' : '#8ED6DC',
2149
2145
  borderWidth: '0.125rem',
2150
2146
  cursor: 'pointer',
2151
2147
  },