TP-67100 | added error screen in codePush (#10961)
This commit is contained in:
7
App.tsx
7
App.tsx
@@ -9,7 +9,10 @@ import {
|
||||
getBuildConfigDetails,
|
||||
setBuildConfigDetails,
|
||||
} from "./App/common/utilities/CacheUtils";
|
||||
import { GenericShimmerScreen } from "./App/Container/Navi-Insurance";
|
||||
import {
|
||||
GenericErrorScreen,
|
||||
GenericShimmerScreen,
|
||||
} from "./App/Container/Navi-Insurance";
|
||||
import {
|
||||
getStringPreference,
|
||||
setStringPreference,
|
||||
@@ -126,7 +129,7 @@ export default class App extends Component<{}, AppState> {
|
||||
) : this.state.bundleState === BundleState.LOADING ? (
|
||||
<GenericShimmerScreen />
|
||||
) : (
|
||||
<></>
|
||||
<GenericErrorScreen />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export { default as QuoteOfferScreen } from "./screen/quote-offer-screen/QuoteOfferScreen";
|
||||
export { default as QuoteApologyScreen } from "./screen/quote-apology-screen/QuoteApologyScreen";
|
||||
export { default as ComparePlanScreen } from "./screen/compare-plan-screen/ComparePlanScreen";
|
||||
export { default as GenericShimmerScreen } from "./screen/generic-shimmer-screen/GenericShimmerScreen";
|
||||
export { default as GenericShimmerScreen } from "./screen/generic-shimmer-screen/GenericShimmerScreen";
|
||||
export { default as GenericErrorScreen } from "./screen/generic-error-screen/GenericErrorScreen";
|
||||
@@ -0,0 +1,63 @@
|
||||
import { View, Text } from "react-native";
|
||||
|
||||
import { CtaData, CtaType } from "../../../../common/interface";
|
||||
import { StaticHeader } from "../../../../../components/reusable/static-header/StaticHeader";
|
||||
import { styles } from "./GenericErrorScreenStyle";
|
||||
|
||||
import {
|
||||
ERROR_SUBTITLE,
|
||||
ERROR_TITLE,
|
||||
ImageName,
|
||||
} from "../../../../common/constants/StringConstant";
|
||||
import { AppImage } from "../../../../../components/AppImage";
|
||||
import { logToSentry } from "../../../../common/hooks/useSentryLogging";
|
||||
import { NativeDeeplinkNavigatorModule } from "../../../../common/native-module/NativeModules";
|
||||
import { ConstantCta } from "../../../../common/constants";
|
||||
|
||||
const GenericErrorScreen = () => {
|
||||
const handleClick = (cta?: CtaData) => {
|
||||
if (!cta) {
|
||||
logToSentry(
|
||||
`Navigation cta is missing or invalid: ${cta} | MethodName: handleClick}`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
switch (cta.type) {
|
||||
case CtaType.DEEP_LINK:
|
||||
case CtaType.USE_ROOT_DEEPLINK_NAVIGATOR:
|
||||
NativeDeeplinkNavigatorModule.navigateToNaviInsuranceDeeplinkNavigator(
|
||||
JSON.stringify(cta),
|
||||
);
|
||||
break;
|
||||
default:
|
||||
NativeDeeplinkNavigatorModule.navigateToNaviDeeplinkNavigator(
|
||||
JSON.stringify(cta),
|
||||
);
|
||||
break;
|
||||
}
|
||||
} catch (error) {
|
||||
logToSentry(
|
||||
`Error while navigating to deep link with CTA: ${cta} | MethodName: handleClick}`,
|
||||
);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<StaticHeader
|
||||
handleClick={handleClick}
|
||||
leftIconCta={ConstantCta.STATIC_HEADER_LEFT_ICON_CTA}
|
||||
leftIcon={"CROSS"}
|
||||
/>
|
||||
<View style={styles.centerContent}>
|
||||
{AppImage(ImageName.SWW, styles.centerIcon)}
|
||||
<Text style={styles.errorTitle}>{ERROR_TITLE}</Text>
|
||||
<Text style={styles.errorSubtitle}>{ERROR_SUBTITLE}</Text>
|
||||
</View>
|
||||
<View style={styles.retryButton}></View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default GenericErrorScreen;
|
||||
@@ -0,0 +1,47 @@
|
||||
import { StyleSheet } from "react-native";
|
||||
|
||||
export const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
justifyContent: "space-between",
|
||||
backgroundColor: "white",
|
||||
},
|
||||
centerContent: {
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
},
|
||||
centerIcon: {
|
||||
width: 125,
|
||||
height: 125,
|
||||
},
|
||||
errorTitle: {
|
||||
fontSize: 16,
|
||||
lineHeight: 22,
|
||||
fontFamily: "tt_semi_bold",
|
||||
color: "#191919",
|
||||
textAlign: "center",
|
||||
marginTop: 32,
|
||||
},
|
||||
errorSubtitle: {
|
||||
fontSize: 14,
|
||||
lineHeight: 22,
|
||||
fontFamily: "tt_regular",
|
||||
color: "#6B6B6B",
|
||||
textAlign: "center",
|
||||
marginTop: 16,
|
||||
},
|
||||
retryButton: {
|
||||
padding: 16,
|
||||
marginHorizontal: 16,
|
||||
marginVertical: 32,
|
||||
borderRadius: 4,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
},
|
||||
buttonText: {
|
||||
color: "white",
|
||||
fontSize: 14,
|
||||
lineHeight: 22,
|
||||
fontFamily: "tt_semi_bold",
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user