@mychoice/mychoice-sdk-modules 2.1.2 → 2.1.4
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AppErrorScreen: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
2
3
|
import { AppTypes, TitleForm, TooltipForm, IconDelete, ColorVariablesTypes, InputTypes, InputForm, InputFormPhone, InputFormEmail, InputFormLicence, SelectForm, getFormattedDate, DateTypes, getDateOptions, ButtonForm, OfferHeader, OfferPrice, ButtonBase, ButtonTypes, CategoryTypes, ColorTypes, ButtonVariantTypes, SizeTypes, IconDropdownArrow, OfferDetail, CompanyRoleTypes, OperationHoursInfo, InsuranceTypes, HeaderNavGroup, ButtonMenu, IconLoaderPrimary, getInsuranceType, RequestStatusTypes, formatPostalCode, IconLoaderSecondary, postalCodeFormat, defaultBrokerPhone, useEffectOnce, yearMessage, carCondition, carStatus, carWinterTiresCheck, carKeepPlace, carUsagePurpose, firstDriveDistanceList, dailyDriveBusinessDistanceList, yearlyDriveDistanceList, numberWithCommas, VehiclePrimaryUseTypes, comprehensiveCoverage, collisionCoverage, DeviceTypes, defaultLocalIndex, maritalStatusOptions, subYearsFromDate, occupationOptions, genderOptions, applicantRelationshipOptions, addYearsToDate, checkDateIsSpecial, DriverLicenceTypes, getDifferenceInYears, getLicenceTypeOptions, getDisabledLicenceTypes, yesNoOptions, addDaysToDate, getMinDate, CheckboxForm, subMonthsFromDate, getMinDateByYears, compareDates, insuranceCancellationReasonOptions, DriverListTypes, licenceSuspensionsReasonOptions, trafficTicketsGroupOptions, DriverPriorityTypes, ValidationStatusTypes, QuoteEdit, coverageOptions, liabilityOptions, homeOwnerTypeOptions, tenantBuildingStructureOptions, condoBuildingStructureOptions, homeBuildingStructureOptions, residentsOptions, insuredYearsOptions, getInsuranceYearsOptions, ApplicantListTypes, claimTypeOptions, exteriorFinishOptions, constructionTypeOptions, garageTypeOptions, getNumericOptions, fireHallDistanceOptions, fireHydrantDistanceOptions, primaryHeatingTypeOptions, auxHeatingTypeOptions, InfoMessage, ppOptions, homeCoverageOptions, homeLiabilityOptions, lifeProvinceOptions, lifeInsuranceTypeOptions, lifeCoverageOptions, smokerOptions, MychoiceStep, Step, IconClock, ButtonArrow, DirectionTypes, ButtonTabArrow, ButtonTab, ButtonTabMobile, NavigationCar, NavigationPerson, NavigationDiscount, NavigationQuotes, NavigationAddress, NavigationProperty, ModalTypes } from '@mychoice/mychoice-sdk-components';
|
|
3
4
|
import { useStoreAppConfig, CarQuoteDataHandler, useStorePartner, useStoreAppLoader, useStoreAppModal, StoreConfigAppModalActionTypes, useHandlerPostal, useHandlerCarMake, useHandlerCarModel, useStoreFormCarVehicle, StoreFormCarVehicleActionTypes, useProvince, useStoreFormCarDiscount, useStoreDeviceType, StoreFormCarDiscountActionTypes, useValidationVehicle, useStoreFormCarDriverBase, StoreFormCarDriverBaseActionTypes, useStoreFormCarConfig, useStoreFormCarDriverInfo, StoreFormCarDriverInfoActionTypes, useStoreFormCarDriverLicence, addDayToDate, StoreFormCarDriverLicenceActionTypes, useStoreFormCarDriverInsurance, useStoreFormCarQuote, StoreFormCarDriverInsuranceActionTypes, useStoreFormCarDriverCancellation, StoreFormCarDriverCancellationActionTypes, useStoreFormCarDriverSuspension, StoreFormCarDriverSuspensionActionTypes, useStoreFormCarDriverAccident, StoreFormCarDriverAccidentActionTypes, useStoreFormCarDriverTicket, StoreFormCarDriverTicketActionTypes, useValidationDriver, useValidationCarDiscount, useHandlerCarQuoterEmail, useStoreFormHomeDwelling, useStoreFormHomePostal, useStoreFormHomeApplicantBase, StoreFormHomePostalActionTypes, StoreFormHomeDwellingActionTypes, StoreConfigAppConfigActionTypes, StoreFormHomeApplicantBaseActionTypes, useValidationAddress, useStoreFormHomeApplicantInfo, useStoreFormHomeDiscount, StoreFormHomeDiscountActionTypes, StoreFormHomeApplicantInfoActionTypes, useStoreFormHomeApplicantInsurance, StoreFormHomeApplicantInsuranceActionTypes, useStoreFormHomeApplicantCancellation, StoreFormHomeApplicantCancellationActionTypes, useStoreFormHomeApplicantClaim, StoreFormHomeApplicantClaimActionTypes, useValidationApplicant, useValidationDwelling, useStoreFormHomeQuote, HomeQuoteDataHandler, useValidationHomeDiscount, useHandlerHomeQuoterEmail, useStoreFormLifeCoverage, StoreFormLifeCoverageActionTypes, useValidationCoverage, useStoreFormLifeQuote, useStoreFormLifeApplicant, LifeQuoteDataHandler, useValidationLifeApplicant, useHandlerLifeQuoterEmail, StoreFormLifeApplicantActionTypes, useStoreFormCarPostal, useStoreFormLifePostal, ClearFormDataHandler, useStoreAppDevice, useStoreClient, useHandlerAuth, useHandlerPartner, StoreConfigAppLoaderActionTypes, StoreFormCarConfigActionTypes, StoreFormCarPostalActionTypes, StoreFormCarQuoteActionTypes, StoreFormHomeQuoteActionTypes, StoreFormLifePostalActionTypes, StoreFormLifeQuoteActionTypes, StoreClientActionTypes, StoreConfigAppDeviceActionTypes, StoreProvider, initHttpResponse } from '@mychoice/mychoice-sdk-store';
|
|
4
5
|
import { useNavigate, useLocation, BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
|
|
@@ -1801,7 +1802,7 @@ const SectionConfirm = () => {
|
|
|
1801
1802
|
};
|
|
1802
1803
|
if (!bestQuote)
|
|
1803
1804
|
return null;
|
|
1804
|
-
return (jsxs("div", { style: { zIndex: '1' }, children: [jsxs("div", { className: "shadow-box", children: [jsx("div", { className: "highlighted-heading", children: "Best Offer" }), jsx("h1", { children: `$${bestQuote.priceMonthly} / month` }), jsx("div", { className: "highlighted-heading", children: jsx("span", { children: `$${bestQuote.priceYearly} / year` }) })] }), jsxs("div", { className: "statistics-wrapper", children: [jsx("div", { className: "counter", id: "output", children: comparedCountMin }), jsx("div", { className: "divider" }), jsx("div", { style: { textAlign: 'center', fontSize: '1.15rem', marginTop: '10px' }, children: `
|
|
1805
|
+
return (jsxs("div", { style: { zIndex: '1' }, children: [jsxs("div", { className: "shadow-box", children: [jsx("div", { className: "highlighted-heading", children: "Best Offer" }), jsx("h1", { children: `$${bestQuote.priceMonthly} / month` }), jsx("div", { className: "highlighted-heading", children: jsx("span", { children: `$${bestQuote.priceYearly} / year` }) })] }), jsxs("div", { className: "statistics-wrapper", children: [jsx("div", { className: "counter", id: "output", children: comparedCountMin.toLocaleString('en-US') }), jsx("div", { className: "divider" }), jsx("div", { style: { textAlign: 'center', fontSize: '1.15rem', marginTop: '10px' }, children: ` and saved ${savedPercentage}% on average` })] }), jsx("div", { style: { marginBottom: '2rem' }, children: jsx("div", { className: "all-quotes-form", children: jsx("h2", { style: { whiteSpace: 'normal', marginTop: '20px', textAlign: 'center' }, children: `${lockEmoji} Complete the form below to see which companies are offering your quotes.` }) }) }), jsx("div", { style: { marginBottom: '1rem' }, children: jsx(InputFormBox, { name: "firstName", title: "First Name", onChange: handleFirstNameChange, defaultValue: firstName, placeholder: "Your First Name", error: !firstName && discountState.inValidation, errorMessage: getErrorMessage(firstName, discountState.inValidation) }) }), jsx("div", { style: { marginBottom: '1rem' }, children: jsx(InputFormBox, { name: "lastname", title: "Last Name", onChange: handleLastNameChange, defaultValue: lastName, placeholder: "Your Last Name", error: !lastName && discountState.inValidation, errorMessage: getErrorMessage(lastName, discountState.inValidation) }) }), jsx("div", { style: { marginBottom: '1rem' }, children: jsx(InputFormPhoneBox, { name: "phone", onChange: handlePhoneNumberChange, defaultValue: phone, title: "Phone Number", placeholder: "(111) 111-1111", error: !phone && discountState.inValidation, errorMessage: getErrorMessage(phone, discountState.inValidation) }) }), jsx("div", { className: "submit-wrapper", children: jsx(ButtonBase, { className: "mychoice", size: SizeTypes.Large, category: CategoryTypes.Filled, onClick: handleSubmit, color: ColorTypes.Primary, label: "Get Your Quote" }) }), jsxs("div", { className: "extra-info", children: [jsx("h5", { children: "On the next page, you will also be able to:" }), jsx("div", { className: "next-page-points", children: jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [jsxs("div", { className: "bullet-container", children: [jsx("div", { className: "bullet-point", children: "1" }), jsx("div", { children: "See what rates insurance carriers are offering" })] }), jsxs("div", { className: "bullet-container", children: [jsx("div", { className: "bullet-point", children: "2" }), jsx("div", { children: "Get in touch with a broker and secure your rate" })] }), jsxs("div", { className: "bullet-container", children: [jsx("div", { className: "bullet-point", children: "3" }), jsx("div", { children: "Potentially save more by speaking with a broker" })] })] }) }), jsx("div", { className: "privacy-policy", children: jsxs("p", { children: ["Once you submit this form, you are agreeing to have your insurance quote sent to you via email and My Choice will provide your contact information to one of our trusted broker partners, who will contact you after your quote is complete to further assist you in securing your best rate. For more details, see our", jsx("a", { href: "https://www.mychoice.ca/privacy-policy/", children: " Privacy Policy" }), "."] }) })] })] }));
|
|
1805
1806
|
};
|
|
1806
1807
|
|
|
1807
1808
|
const SplashScreen$2 = () => {
|
|
@@ -4280,6 +4281,15 @@ const AppConfig = (props) => {
|
|
|
4280
4281
|
return null;
|
|
4281
4282
|
};
|
|
4282
4283
|
|
|
4284
|
+
const AppErrorScreen = () => {
|
|
4285
|
+
const onClear = () => {
|
|
4286
|
+
localStorage.clear();
|
|
4287
|
+
// eslint-disable-next-line
|
|
4288
|
+
location.reload();
|
|
4289
|
+
};
|
|
4290
|
+
return (jsxs("div", { style: { textAlign: 'center', paddingTop: '100px' }, children: [jsx("h1", { children: "Something went wrong." }), jsxs("p", { style: { margin: '10px 0 10px 0' }, children: [jsx("a", { href: "#reset", onClick: onClear, style: { color: 'red', textDecoration: 'underline' }, children: "Click here" }), ' ', "to restart the application"] }), jsxs("p", { children: ["If that doesn't help, please reach out to us at", ' ', jsx("a", { href: "mailto:info@mychoice.ca", children: "info@mychoice.ca" })] })] }));
|
|
4291
|
+
};
|
|
4292
|
+
|
|
4283
4293
|
const AppWrapperConfig = (props) => {
|
|
4284
4294
|
initHttpResponse();
|
|
4285
4295
|
const { appType } = props;
|
|
@@ -4293,7 +4303,7 @@ const AppWrapperConfig = (props) => {
|
|
|
4293
4303
|
return (jsxs(Fragment, { children: [jsx(AppLoader, {}), jsx(AppConfig, { appType: appType }), drawWrapper && isReady
|
|
4294
4304
|
&& jsx(AppRoutes, { appType: appType })] }));
|
|
4295
4305
|
};
|
|
4296
|
-
const AppWrapper = ({ appType }) => (jsx(StoreProvider, { children: jsx(AppWrapperConfig, { appType: appType }) }));
|
|
4306
|
+
const AppWrapper = ({ appType }) => (jsx(StoreProvider, { children: jsx(ErrorBoundary, { fallbackRender: AppErrorScreen, children: jsx(AppWrapperConfig, { appType: appType }) }) }));
|
|
4297
4307
|
AppWrapper.defaultProps = {
|
|
4298
4308
|
appType: AppTypes.MyChoice,
|
|
4299
4309
|
insuranceType: InsuranceTypes.Car,
|