renamed ButtonSection to Xaxis

This commit is contained in:
Ashish Deo
2023-09-29 13:14:21 +05:30
parent 8b44912587
commit cfedfa2701
8 changed files with 58 additions and 38 deletions

View File

@@ -1,33 +1,34 @@
{
"project_info": {
"project_number": "136591056725",
"project_id": "field-verification-app",
"storage_bucket": "field-verification-app.appspot.com"
"project_number": "60755663443",
"project_id": "address-verification-app",
"storage_bucket": "address-verification-app.appspot.com",
"firebase_url": "https://address-verification-app-default-rtdb.firebaseio.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:136591056725:android:c454085ec6505cc01519dc",
"mobilesdk_app_id": "1:60755663443:android:4a948ee9d0b4e3098584a6",
"android_client_info": {
"package_name": "com.avapp"
}
},
"oauth_client": [
{
"client_id": "136591056725-ev8db4hrlud2m23n0o03or3cmmp3a3cq.apps.googleusercontent.com",
"client_id": "60755663443-40k0fbrbbqv4ci4hrjlbrphab5fj387b.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBL32d7WRJTcJawKjT1XCEcFbGGQ8wA6j8"
"current_key": "AIzaSyA70_d2M2ke-Mu0OHGZ6iZilBbD6A-_z0c"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "136591056725-ev8db4hrlud2m23n0o03or3cmmp3a3cq.apps.googleusercontent.com",
"client_id": "60755663443-40k0fbrbbqv4ci4hrjlbrphab5fj387b.apps.googleusercontent.com",
"client_type": 3
}
]
@@ -36,4 +37,4 @@
}
],
"configuration_version": "1"
}
}

View File

@@ -58,8 +58,8 @@ export const getPerformanceMetrics =
atleastOneEmiCollected: atLeastOneEmiCollectedCases,
},
performanceLevel: {
totalLevel: Number(totalLevel),
currentLevel: Number(currentLevel),
totalLevel: totalLevel ?? 0,
currentLevel: currentLevel ?? 0,
},
totalCashCollected: tillDate?.self ?? 0,
cashCollectedGraphData: graphData,

View File

@@ -266,17 +266,21 @@ export const handleImpersonatedUserLogin =
export const getAgentDetail = (callbackFn?: () => void) => (dispatch: AppDispatch) => {
const url = getApiUrl(ApiKeys.GET_AGENT_DETAIL);
return axiosInstance.get(url).then((response) => {
if (response.status === API_STATUS_CODE.OK) {
const roles: string[] = response?.data?.roles || [];
const isFieldAgent = roles?.includes(IUserRole.ROLE_FIELD_AGENT);
dispatch(
setShowAgentDashboard(
!response?.data?.isExternalAgent && isFieldAgent && roles?.length === 1
)
);
dispatch(setAgentRole(roles));
return axiosInstance
.get(url)
.then((response) => {
if (response.status === API_STATUS_CODE.OK) {
const roles: string[] = response?.data?.roles || [];
const isFieldAgent = roles?.includes(IUserRole.ROLE_FIELD_AGENT);
dispatch(
setShowAgentDashboard(
!response?.data?.isExternalAgent && isFieldAgent && roles?.length === 1
)
);
dispatch(setAgentRole(roles));
}
})
.finally(() => {
callbackFn?.();
}
});
});
};

View File

@@ -3,7 +3,7 @@ import { StyleSheet, View } from 'react-native';
import { Circle, G, Line, Path, Rect, Svg } from 'react-native-svg';
import { GenericStyles } from '../../../RN-UI-LIB/src/styles';
import { COLORS } from '../../../RN-UI-LIB/src/styles/colors';
import ButtonSection from './ButtonSection';
import Xaxis from './Xaxis';
import { GraphItem, LineChartProps } from './types';
import YAxisLabels from './YAxisLabels';
@@ -101,7 +101,7 @@ const Chart: FC<LineChartProps> = (props) => {
</Svg>
</View>
</View>
<ButtonSection />
<Xaxis />
</View>
);
};

View File

@@ -2,7 +2,7 @@ import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { COLORS } from '../../../RN-UI-LIB/src/styles/colors';
const ButtonSection = () => (
const Xaxis = () => (
<View style={styles.container}>
<Text style={styles.buttonText}>6th</Text>
<Text style={styles.buttonText}>13th</Text>
@@ -24,4 +24,4 @@ const styles = StyleSheet.create({
},
});
export default ButtonSection;
export default Xaxis;

View File

@@ -1,14 +1,14 @@
import { MILLISECONDS_IN_A_MINUTE, MINUTES_IN_AN_HOUR } from '../../RN-UI-LIB/src/utlis/common';
export const BASE_AV_APP_URL = 'https://longhorn.navi.com/field-app';
export const BASE_AV_APP_URL = 'https://qa-longhorn-portal.np.navi-tech.in/field-app';
export const SENTRY_DSN =
'https://5daa4832fade44b389b265de9b26c2fd@longhorn.navi.com/glitchtip-events/172';
export const JANUS_SERVICE_URL = 'https://longhorn.navi.com/api/events/json';
export const ENV = 'prod';
'https://acef93c884c1424cacc4ec899562e203@qa-longhorn-portal.np.navi-tech.in/glitchtip-events/173';
export const JANUS_SERVICE_URL = 'https://qa-longhorn-portal.np.navi-tech.in/api/events/json';
export const ENV = 'qa';
export const IS_SSO_ENABLED = true;
export const APM_APP_NAME = 'cosmos-app';
export const APM_BASE_URL = 'https://longhorn.navi.com/apm-events';
export const APM_BASE_URL = 'https://qa-longhorn-portal.np.navi-tech.in/apm-events';
export const IS_DATA_SYNC_REQUIRED = true;
export const DATA_SYNC_TIME_INTERVAL = 2 * MINUTES_IN_AN_HOUR * MILLISECONDS_IN_A_MINUTE; // 2hr
export const GOOGLE_SSO_CLIENT_ID =
'136591056725-ev8db4hrlud2m23n0o03or3cmmp3a3cq.apps.googleusercontent.com';
'60755663443-40k0fbrbbqv4ci4hrjlbrphab5fj387b.apps.googleusercontent.com';

View File

@@ -5,7 +5,15 @@ import Text from '../../../RN-UI-LIB/src/components/Text';
import { GenericStyles, SCREEN_WIDTH } from '../../../RN-UI-LIB/src/styles';
import { COLORS } from '../../../RN-UI-LIB/src/styles/colors';
import { useAppSelector } from '../../hooks';
import { boxGradientColors } from './constants';
import {
boxGradientColors,
FIRST_BOX,
LAST_BOX,
BOX_TO_SCREEN_RATIO,
POINTER_POSITION_MULTIPLIER,
BIGGER_BOX_SIZE_MULTIPLIER,
} from './constants';
import DashedLine from './DashedLine';
import { formatNumberWithSuffix } from './utils';
import { useSelector } from 'react-redux';
@@ -23,15 +31,16 @@ const PerformanceLevelGraph = () => {
const aboveLevelAmount = formatNumberWithSuffix(cashCollectedTillDate?.aboveLevel);
const belowLevelAmount = formatNumberWithSuffix(cashCollectedTillDate?.belowLevel);
const isFirstBox = (box: Box) => box.id === 1;
const isLastBox = (box: Box) => box.id === 9;
const isFirstBox = (box: Box) => box.id === FIRST_BOX;
const isLastBox = (box: Box) => box.id === LAST_BOX;
const boxWidth = (SCREEN_WIDTH * 0.75) / boxGradientColors.length;
const biggerBoxWidth = boxWidth * 1.25;
const boxWidth = (SCREEN_WIDTH * BOX_TO_SCREEN_RATIO) / boxGradientColors.length;
const biggerBoxWidth = boxWidth * BIGGER_BOX_SIZE_MULTIPLIER;
const isBiggerBox = (box: Box) => box.id === performanceLevel?.currentLevel;
const selfLevelPosition =
((cashCollectedTillDate.self - cashCollectedTillDate.belowLevel) * 80) /
((cashCollectedTillDate.self - cashCollectedTillDate.belowLevel) *
POINTER_POSITION_MULTIPLIER) /
(cashCollectedTillDate.aboveLevel - cashCollectedTillDate.belowLevel + 1); // if cash collected till date is 0 we are adding it to 1, to avoid calculation error, this should never happen i
const getBoxStyles = (box: Box) => {

View File

@@ -61,3 +61,9 @@ export const boxGradientColors = [
color: COLORS.GRADIENT.COLOR9,
},
];
export const FIRST_BOX = 1;
export const LAST_BOX = 9;
export const BOX_TO_SCREEN_RATIO = 0.75;
export const POINTER_POSITION_MULTIPLIER = 80;
export const BIGGER_BOX_SIZE_MULTIPLIER = 1.25;