@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.
- package/dist/cjs/index.js +14 -18
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/shared/sections/quotes/NoQuotesMessage/NoQuotesMessage.d.ts +1 -1
- package/dist/esm/index.js +14 -18
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/shared/sections/quotes/NoQuotesMessage/NoQuotesMessage.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -190,25 +190,24 @@ const TEXT = {
|
|
|
190
190
|
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!',
|
|
191
191
|
};
|
|
192
192
|
const NoQuotesMessage = ({ type }) => {
|
|
193
|
+
const { appConfigState: { appType }, } = mychoiceSdkStore.useStoreAppConfig();
|
|
194
|
+
if (appType === mychoiceSdkComponents.AppTypes.TheBig)
|
|
195
|
+
return null;
|
|
193
196
|
return (jsxRuntime.jsxs("div", { className: "offer-section mychoice", children: [jsxRuntime.jsx("div", { style: { width: '100%' }, children: jsxRuntime.jsx("img", { src: logo, alt: "My Choice", style: { width: '120px' } }) }), jsxRuntime.jsx("p", { children: jsxRuntime.jsx("h3", { style: { whiteSpace: 'normal' }, children: TITLE[type] }) }), jsxRuntime.jsx("p", { style: { lineHeight: '1.25rem' }, children: TEXT[type] })] }));
|
|
194
197
|
};
|
|
195
198
|
|
|
196
199
|
const usePathGroups = (insuranceType) => {
|
|
197
200
|
const { appConfigState } = mychoiceSdkStore.useStoreAppConfig();
|
|
198
201
|
const insurancePathGroup = {
|
|
199
|
-
[`${mychoiceSdkComponents.InsuranceTypes.Car}`]: [
|
|
200
|
-
|
|
201
|
-
],
|
|
202
|
-
[`${mychoiceSdkComponents.InsuranceTypes.Home}`]: [
|
|
203
|
-
{ name: 'Home', link: `/${appConfigState.localIndex}/home` },
|
|
204
|
-
],
|
|
202
|
+
[`${mychoiceSdkComponents.InsuranceTypes.Car}`]: [{ name: 'Car', link: `/${appConfigState.localIndex}/car` }],
|
|
203
|
+
[`${mychoiceSdkComponents.InsuranceTypes.Home}`]: [{ name: 'Home', link: `/${appConfigState.localIndex}/home` }],
|
|
205
204
|
// @todo: will be used in future
|
|
206
205
|
// [`${InsuranceTypes.Life}`]: [{ name: 'Life', link: `/${appConfigState.localIndex}/life` }],
|
|
207
206
|
};
|
|
208
207
|
const externalPathGroup = [
|
|
209
|
-
{ name: 'Car', link: '
|
|
210
|
-
{ name: 'Home', link: '
|
|
211
|
-
{ name: 'Life', link: '
|
|
208
|
+
{ name: 'Car', link: '/insurance/car' },
|
|
209
|
+
{ name: 'Home', link: '/insurance/home' },
|
|
210
|
+
{ name: 'Life', link: '/insurance/life' },
|
|
212
211
|
{ name: 'Learn', link: 'https://www.mychoice.ca/blog/' },
|
|
213
212
|
];
|
|
214
213
|
// @todo: use in future.
|
|
@@ -1529,7 +1528,7 @@ const PageDriver = () => {
|
|
|
1529
1528
|
React.useEffect(() => {
|
|
1530
1529
|
setIsRender(true);
|
|
1531
1530
|
}, [isRender]);
|
|
1532
|
-
return (jsxRuntime.jsxs("div", { className: "form-container", children: [jsxRuntime.jsx(TabDriver, { createItem: createDriver }), jsxRuntime.jsxs("div", { className: "form-section-container", children: [isRender && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SectionDriverInfo, {}), jsxRuntime.jsx(SectionDriverLicence, {}), jsxRuntime.jsx(SectionDriverInsurancePolicy, {}), jsxRuntime.jsx(SectionDriverCancellation, {}), jsxRuntime.jsx(SectionDriverHistory, {}), jsxRuntime.jsx(HonestyMessage, {})] })), appType === mychoiceSdkComponents.AppTypes.TheBig ? (jsxRuntime.jsx(NavigationBottomTheBig, { createItem: createDriver, formSteps: formSteps[mychoiceSdkComponents.InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: driverFormIsValid })) : (jsxRuntime.jsx(NavigationBottom, { className: "mychoice", createItem: createDriver, formSteps: formSteps[mychoiceSdkComponents.InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: driverFormIsValid }))] }), localIndex !== mychoiceSdkComponents.defaultLocalIndex && (jsxRuntime.jsx("img", { className: "logo-for-partner", src: myChoicePartnerLogo, alt: "partner logo" }))] }));
|
|
1531
|
+
return (jsxRuntime.jsxs("div", { className: "form-container", children: [jsxRuntime.jsx(TabDriver, { createItem: createDriver }), jsxRuntime.jsxs("div", { className: "form-section-container", children: [isRender && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SectionDriverInfo, {}), jsxRuntime.jsx(SectionDriverLicence, {}), jsxRuntime.jsx(SectionDriverInsurancePolicy, {}), jsxRuntime.jsx(SectionDriverCancellation, {}), jsxRuntime.jsx(SectionDriverHistory, {}), appType === mychoiceSdkComponents.AppTypes.MyChoice && jsxRuntime.jsx(HonestyMessage, {})] })), appType === mychoiceSdkComponents.AppTypes.TheBig ? (jsxRuntime.jsx(NavigationBottomTheBig, { createItem: createDriver, formSteps: formSteps[mychoiceSdkComponents.InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: driverFormIsValid })) : (jsxRuntime.jsx(NavigationBottom, { className: "mychoice", createItem: createDriver, formSteps: formSteps[mychoiceSdkComponents.InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: driverFormIsValid }))] }), localIndex !== mychoiceSdkComponents.defaultLocalIndex && (jsxRuntime.jsx("img", { className: "logo-for-partner", src: myChoicePartnerLogo, alt: "partner logo" }))] }));
|
|
1533
1532
|
};
|
|
1534
1533
|
|
|
1535
1534
|
const BlockVehLinks = () => {
|
|
@@ -1955,7 +1954,7 @@ const SectionAddress = () => {
|
|
|
1955
1954
|
const { getPostal } = mychoiceSdkStore.useHandlerPostal(insuranceType);
|
|
1956
1955
|
const { postalState: { item, inValidation }, dispatchPostalState, } = mychoiceSdkStore.useStoreFormHomePostal();
|
|
1957
1956
|
const { dispatchApplicantBaseState } = mychoiceSdkStore.useStoreFormHomeApplicantBase();
|
|
1958
|
-
const { streetAddress = '', postalCode = '', addressObject, errorMessage
|
|
1957
|
+
const { streetAddress = '', postalCode = '', addressObject, errorMessage } = item;
|
|
1959
1958
|
const navigate = reactRouterDom.useNavigate();
|
|
1960
1959
|
const asyncSelectRef = React.useRef(null);
|
|
1961
1960
|
const isMychoice = appType === mychoiceSdkComponents.AppTypes.MyChoice;
|
|
@@ -2056,7 +2055,7 @@ const SectionAddress = () => {
|
|
|
2056
2055
|
console.error(error);
|
|
2057
2056
|
});
|
|
2058
2057
|
};
|
|
2059
|
-
const handleOwnerTypeChange = ({ value: typeValue
|
|
2058
|
+
const handleOwnerTypeChange = ({ value: typeValue }) => {
|
|
2060
2059
|
dispatchDwellingState({
|
|
2061
2060
|
type: mychoiceSdkStore.StoreFormHomeDwellingActionTypes.FormHomeDwellingClear,
|
|
2062
2061
|
payload: { type: typeValue },
|
|
@@ -2137,7 +2136,7 @@ const SectionAddress = () => {
|
|
|
2137
2136
|
const placeholderText = 'Type in Your Street Address';
|
|
2138
2137
|
return (jsxRuntime.jsxs("div", { className: `form-section ${mychoiceCls}`, children: [jsxRuntime.jsx("h2", { className: "section-title", children: " Where do you reside and thrive? " }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.homeOwnerTypeOptions, name: "ownerType", onChange: handleOwnerTypeChange, defaultValue: insuranceType, title: "Type of Insurance", placeholder: "Select Type of Insurance", error: !insuranceType && inValidation, errorMessage: getErrorMessage(insuranceType, inValidation) }), jsxRuntime.jsxs("div", { className: "input-form-box-container", children: [jsxRuntime.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." }), jsxRuntime.jsx(GooglePlacesAutocomplete__default["default"], { autocompletionRequest: {
|
|
2139
2138
|
componentRestrictions: { country: 'ca' },
|
|
2140
|
-
}, apiKey:
|
|
2139
|
+
}, apiKey: process.env.REACT_APP_HOME_SEARCH_GOOGLE_API_KEY, selectProps: {
|
|
2141
2140
|
value: addressObject,
|
|
2142
2141
|
onChange: handleAddressChange,
|
|
2143
2142
|
placeholder: placeholderText,
|
|
@@ -2145,17 +2144,14 @@ const SectionAddress = () => {
|
|
|
2145
2144
|
styles: {
|
|
2146
2145
|
control: (baseStyles, state) => ({
|
|
2147
2146
|
...baseStyles,
|
|
2148
|
-
borderColor: getErrorMessage(streetAddress && postalCode, inValidation) ||
|
|
2149
|
-
errorMessage
|
|
2147
|
+
borderColor: getErrorMessage(streetAddress && postalCode, inValidation) || errorMessage
|
|
2150
2148
|
? 'red'
|
|
2151
2149
|
: getBorderColor(state.isFocused),
|
|
2152
2150
|
borderRadius: isMychoice ? '0.625rem' : '0.25rem',
|
|
2153
2151
|
boxShadow: 'none',
|
|
2154
2152
|
height: '3.75rem',
|
|
2155
2153
|
':hover': {
|
|
2156
|
-
borderColor: getErrorMessage(streetAddress && postalCode, inValidation) || errorMessage
|
|
2157
|
-
? 'red'
|
|
2158
|
-
: '#8ED6DC',
|
|
2154
|
+
borderColor: getErrorMessage(streetAddress && postalCode, inValidation) || errorMessage ? 'red' : '#8ED6DC',
|
|
2159
2155
|
borderWidth: '0.125rem',
|
|
2160
2156
|
cursor: 'pointer',
|
|
2161
2157
|
},
|