TP-60588 | pr clean up

This commit is contained in:
github-cicd
2024-09-20 16:25:11 +05:30
parent a9d01c3d51
commit 30354f7c21
5 changed files with 46 additions and 18 deletions

View File

@@ -120,11 +120,13 @@ function App() {
modalRef.current?.show();
break;
case codePush.SyncStatus.INSTALLING_UPDATE:
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_INSTALLING_CODEPUSH, {})
break;
case codePush.SyncStatus.UP_TO_DATE:
modalRef.current?.hide();
break;
default:
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_CODEPUSH_DEFAULT_STATUS, {})
modalRef.current?.hide();
break;
}

View File

@@ -7,6 +7,8 @@ import ModalWrapperForAlfredV2 from '@common/ModalWrapperForAlfredV2';
import LottieView from 'lottie-react-native';
import Text from '@rn-ui-lib/components/Text';
import NaviLogoWithTextIcon from '@rn-ui-lib/icons/NaviLogoWithTextIcon';
import {GenericStyles} from "@rn-ui-lib/styles";
import lottieJson from './loader.json';
export interface CodePushLoadingModalRef {
show: () => void;
@@ -14,6 +16,7 @@ export interface CodePushLoadingModalRef {
updateProgress: (progress: DownloadProgress) => void;
}
const CodePushLoadingModal = forwardRef<CodePushLoadingModalRef>((_, ref) => {
const [visible, setVisible] = useState(false);
const [progress, setProgress] = useState<DownloadProgress>();
@@ -33,10 +36,10 @@ const CodePushLoadingModal = forwardRef<CodePushLoadingModalRef>((_, ref) => {
<ModalWrapperForAlfredV2 visible={visible} animationType="fade">
<View style={styles.modalContainer}>
<View style={styles.modalContent}>
<View style={{ alignItems: 'center', marginBottom: 24 }}>
<View style={styles.LottieContainerStyles}>
<LottieView
style={{ width: 140, height: 140 }}
source={require('./loader.json')}
style={styles.LottieStyles}
source={lottieJson}
autoPlay
loop
/>
@@ -52,7 +55,7 @@ const CodePushLoadingModal = forwardRef<CodePushLoadingModalRef>((_, ref) => {
</View>
) : null}
</View>
<View style={{ alignItems: 'center' }}>
<View style={GenericStyles.alignCenter}>
<NaviLogoWithTextIcon />
</View>
</View>
@@ -61,6 +64,20 @@ const CodePushLoadingModal = forwardRef<CodePushLoadingModalRef>((_, ref) => {
});
const styles = StyleSheet.create({
LottieContainerStyles: {
alignItems: 'center',
marginBottom: 24
},
LottieStyles: {
height: 140,
width: 140
},
header: {
color: COLORS.TEXT.BLACK_24,
fontSize: 14,
paddingBottom: 6,
paddingTop: 24,
},
modalContainer: {
flex: 1,
padding: 20,
@@ -69,23 +86,18 @@ const styles = StyleSheet.create({
flex: 1,
justifyContent: 'center',
},
header: {
fontSize: 14,
color: COLORS.TEXT.BLACK_24,
paddingTop: 24,
paddingBottom: 6,
progressBar: {
height: 2,
marginTop: 10,
width: '100%',
},
progressText: {
color: COLORS.TEXT.BLACK_24,
fontSize: 14,
fontWeight: '700',
marginTop: 6,
},
progressBar: {
width: '100%',
height: 2,
marginTop: 10,
},
}
});
CodePushLoadingModal.displayName = 'codepush-loading-modal';
export default CodePushLoadingModal;

View File

@@ -2,14 +2,20 @@ import { COLORS } from '@rn-ui-lib/colors';
import React, { useState, useEffect } from 'react';
import { View, Text, Animated, StyleSheet } from 'react-native';
const ProgressBar = ({ progress, height = 10, color = '#18bf5f' }) => {
type ProgressBarProps = {
progress: number;
height?: number;
color?: string;
}
const ProgressBar = ({ progress, height = 10, color = '#18bf5f' }: ProgressBarProps ) => {
const [animatedWidth] = useState(new Animated.Value(0));
console.log({ progress });
useEffect(() => {
Animated.timing(animatedWidth, {
toValue: progress * 100,
duration: 500,
useNativeDriver: false,
}).start();
}, [progress]);

View File

@@ -2,7 +2,7 @@
<string name="app_name">Cosmos</string>
<string name="appCenterCrashes_whenToSendCrashes" moduleConfig="true" translatable="false">DO_NOT_ASK_JAVASCRIPT</string>
<string name="appCenterAnalytics_whenToEnableAnalytics" moduleConfig="true" translatable="false">ALWAYS_SEND</string>
<string moduleConfig="true" name="CodePushDeploymentKey">pastekeyhere</string>
<string moduleConfig="true" name="CodePushDeploymentKey">llmg8BO8mnvrryZvfq175t6xyOdVFPn_EbDOr</string>
<string name="bottom_sheet_overlay">Bottom Sheet Overlay</string>
<string name="something_went_wrong">Something Went Wrong</string>
<string name="crash_occurred">Crash Occurred</string>

View File

@@ -1293,6 +1293,14 @@ export const CLICKSTREAM_EVENT_NAMES = {
name: 'FA_CALLING_FEEDBACK_NUDGE_CLOSED',
description: 'Feedback nudge closed'
},
FA_INSTALLING_CODEPUSH: {
name : 'FA_INSTALLING_CODEPUSH',
description: 'Codepush installation started'
},
FA_CODEPUSH_DEFAULT_STATUS: {
name : 'FA_CODEPUSH_DEFAULT_STATUS',
description: 'Codepush default fallback case'
}
} as const;