react-native-salespanda 0.6.0 → 0.7.1
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/README.md +50 -102
- package/package.json +2 -3
- package/lib/module/NativeSalespanda.js.map +0 -1
- package/lib/module/SalespandaApp.js.map +0 -1
- package/lib/module/assets/images/index.js.map +0 -1
- package/lib/module/components/BottomSheet.js.map +0 -1
- package/lib/module/components/ContactViaModal.js.map +0 -1
- package/lib/module/components/Loader.js.map +0 -1
- package/lib/module/components/ScreenHeader.js.map +0 -1
- package/lib/module/components/SearchBar.js.map +0 -1
- package/lib/module/components/TabsHeader.js.map +0 -1
- package/lib/module/components/index.js.map +0 -1
- package/lib/module/config/FlavorConfig.js.map +0 -1
- package/lib/module/config/SalespandaConfig.js.map +0 -1
- package/lib/module/constants/Colors.js.map +0 -1
- package/lib/module/constants/GetPlatorm.js.map +0 -1
- package/lib/module/index.js.map +0 -1
- package/lib/module/navigation/AppNavigator.js.map +0 -1
- package/lib/module/navigation/BottomTabNavigator.js.map +0 -1
- package/lib/module/navigation/DrawerNavigator.js.map +0 -1
- package/lib/module/navigation/StackNavigator.js.map +0 -1
- package/lib/module/screens/CRM/AddContactModal.js.map +0 -1
- package/lib/module/screens/CRM/CategoryTabs.js.map +0 -1
- package/lib/module/screens/CRM/ContactItem.js.map +0 -1
- package/lib/module/screens/CRM/FilterDropdown.js.map +0 -1
- package/lib/module/screens/CRM/FunnelChart.js.map +0 -1
- package/lib/module/screens/CRM/InfoCard.js.map +0 -1
- package/lib/module/screens/CRM/LeadCard.js.map +0 -1
- package/lib/module/screens/CRM/LogCallScreen.js.map +0 -1
- package/lib/module/screens/CRM/TopTabs.js.map +0 -1
- package/lib/module/screens/CRM/index.js.map +0 -1
- package/lib/module/screens/ReportsScreen.js.map +0 -1
- package/lib/module/screens/Tabs/ActivityAnalytics.js.map +0 -1
- package/lib/module/screens/Tabs/CRMScreen.js.map +0 -1
- package/lib/module/screens/Tabs/DigitalDiary.js.map +0 -1
- package/lib/module/screens/Tabs/HomeScreen.js.map +0 -1
- package/lib/module/screens/Tabs/NotificationsScreen.js.map +0 -1
- package/lib/module/screens/contentliberary/contentliberary.js.map +0 -1
- package/lib/module/services/api.js.map +0 -1
- package/lib/module/services/authService.js.map +0 -1
- package/lib/module/store/index.js.map +0 -1
- package/lib/typescript/src/NativeSalespanda.d.ts.map +0 -1
- package/lib/typescript/src/SalespandaApp.d.ts.map +0 -1
- package/lib/typescript/src/assets/images/index.d.ts.map +0 -1
- package/lib/typescript/src/components/BottomSheet.d.ts.map +0 -1
- package/lib/typescript/src/components/ContactViaModal.d.ts.map +0 -1
- package/lib/typescript/src/components/Loader.d.ts.map +0 -1
- package/lib/typescript/src/components/ScreenHeader.d.ts.map +0 -1
- package/lib/typescript/src/components/SearchBar.d.ts.map +0 -1
- package/lib/typescript/src/components/TabsHeader.d.ts.map +0 -1
- package/lib/typescript/src/components/index.d.ts.map +0 -1
- package/lib/typescript/src/config/FlavorConfig.d.ts.map +0 -1
- package/lib/typescript/src/config/SalespandaConfig.d.ts.map +0 -1
- package/lib/typescript/src/constants/Colors.d.ts.map +0 -1
- package/lib/typescript/src/constants/GetPlatorm.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/navigation/AppNavigator.d.ts.map +0 -1
- package/lib/typescript/src/navigation/BottomTabNavigator.d.ts.map +0 -1
- package/lib/typescript/src/navigation/DrawerNavigator.d.ts.map +0 -1
- package/lib/typescript/src/navigation/StackNavigator.d.ts.map +0 -1
- package/lib/typescript/src/screens/CRM/AddContactModal.d.ts.map +0 -1
- package/lib/typescript/src/screens/CRM/CategoryTabs.d.ts.map +0 -1
- package/lib/typescript/src/screens/CRM/ContactItem.d.ts.map +0 -1
- package/lib/typescript/src/screens/CRM/FilterDropdown.d.ts.map +0 -1
- package/lib/typescript/src/screens/CRM/FunnelChart.d.ts.map +0 -1
- package/lib/typescript/src/screens/CRM/InfoCard.d.ts.map +0 -1
- package/lib/typescript/src/screens/CRM/LeadCard.d.ts.map +0 -1
- package/lib/typescript/src/screens/CRM/LogCallScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/CRM/TopTabs.d.ts.map +0 -1
- package/lib/typescript/src/screens/CRM/index.d.ts.map +0 -1
- package/lib/typescript/src/screens/ReportsScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/Tabs/ActivityAnalytics.d.ts.map +0 -1
- package/lib/typescript/src/screens/Tabs/CRMScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/Tabs/DigitalDiary.d.ts.map +0 -1
- package/lib/typescript/src/screens/Tabs/HomeScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/Tabs/NotificationsScreen.d.ts.map +0 -1
- package/lib/typescript/src/screens/contentliberary/contentliberary.d.ts.map +0 -1
- package/lib/typescript/src/services/api.d.ts.map +0 -1
- package/lib/typescript/src/services/authService.d.ts.map +0 -1
- package/lib/typescript/src/store/index.d.ts.map +0 -1
- package/src/NativeSalespanda.ts +0 -7
- package/src/SalespandaApp.tsx +0 -141
- package/src/assets/images/bottomtabs/analytics.png +0 -0
- package/src/assets/images/bottomtabs/analyticsactive.png +0 -0
- package/src/assets/images/bottomtabs/crm.png +0 -0
- package/src/assets/images/bottomtabs/crmactive.png +0 -0
- package/src/assets/images/bottomtabs/diary.png +0 -0
- package/src/assets/images/bottomtabs/diaryactive.png +0 -0
- package/src/assets/images/bottomtabs/home.png +0 -0
- package/src/assets/images/bottomtabs/homeactive.png +0 -0
- package/src/assets/images/bottomtabs/notification.png +0 -0
- package/src/assets/images/bottomtabs/notificationactive.png +0 -0
- package/src/assets/images/index.js +0 -11
- package/src/assets/images/index.ts +0 -40
- package/src/components/BottomSheet.tsx +0 -146
- package/src/components/ContactViaModal.tsx +0 -80
- package/src/components/Loader.tsx +0 -48
- package/src/components/ScreenHeader.tsx +0 -57
- package/src/components/SearchBar.tsx +0 -59
- package/src/components/TabsHeader.tsx +0 -72
- package/src/components/index.ts +0 -5
- package/src/config/FlavorConfig.ts +0 -55
- package/src/config/SalespandaConfig.ts +0 -142
- package/src/constants/Colors.ts +0 -17
- package/src/constants/GetPlatorm.ts +0 -29
- package/src/index.tsx +0 -31
- package/src/navigation/AppNavigator.tsx +0 -24
- package/src/navigation/BottomTabNavigator.tsx +0 -181
- package/src/navigation/DrawerNavigator.tsx +0 -306
- package/src/navigation/StackNavigator.tsx +0 -32
- package/src/screens/CRM/AddContactModal.tsx +0 -57
- package/src/screens/CRM/CategoryTabs.tsx +0 -109
- package/src/screens/CRM/ContactItem.tsx +0 -168
- package/src/screens/CRM/FilterDropdown.tsx +0 -34
- package/src/screens/CRM/FunnelChart.tsx +0 -103
- package/src/screens/CRM/InfoCard.tsx +0 -51
- package/src/screens/CRM/LeadCard.tsx +0 -69
- package/src/screens/CRM/LogCallScreen.tsx +0 -318
- package/src/screens/CRM/TopTabs.tsx +0 -95
- package/src/screens/CRM/index.ts +0 -10
- package/src/screens/ReportsScreen.tsx +0 -37
- package/src/screens/Tabs/ActivityAnalytics.tsx +0 -25
- package/src/screens/Tabs/CRMScreen.tsx +0 -381
- package/src/screens/Tabs/DigitalDiary.tsx +0 -35
- package/src/screens/Tabs/HomeScreen.tsx +0 -379
- package/src/screens/Tabs/NotificationsScreen.tsx +0 -25
- package/src/screens/contentliberary/contentliberary.tsx +0 -268
- package/src/services/api.ts +0 -173
- package/src/services/authService.ts +0 -75
- package/src/store/index.ts +0 -16
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { BottomSheet, BottomSheetOption } from './BottomSheet';
|
|
2
|
-
|
|
3
|
-
interface ContactViaModalProps {
|
|
4
|
-
visible: boolean;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
onCall?: () => void;
|
|
7
|
-
onWhatsapp?: () => void;
|
|
8
|
-
onEmail?: () => void;
|
|
9
|
-
onSMS?: () => void;
|
|
10
|
-
onAddTask?: () => void;
|
|
11
|
-
onAddNote?: () => void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const ContactViaModal: React.FC<ContactViaModalProps> = ({
|
|
15
|
-
visible,
|
|
16
|
-
onClose,
|
|
17
|
-
onCall,
|
|
18
|
-
onWhatsapp,
|
|
19
|
-
onEmail,
|
|
20
|
-
onSMS,
|
|
21
|
-
onAddTask,
|
|
22
|
-
onAddNote,
|
|
23
|
-
}) => {
|
|
24
|
-
return (
|
|
25
|
-
<BottomSheet visible={visible} onClose={onClose} title="Contact Via">
|
|
26
|
-
<BottomSheetOption
|
|
27
|
-
icon="📞"
|
|
28
|
-
label="Call"
|
|
29
|
-
iconColor="#FF6B6B"
|
|
30
|
-
onPress={() => {
|
|
31
|
-
onClose();
|
|
32
|
-
onCall?.();
|
|
33
|
-
}}
|
|
34
|
-
/>
|
|
35
|
-
<BottomSheetOption
|
|
36
|
-
icon="💬"
|
|
37
|
-
label="Whatsapp"
|
|
38
|
-
iconColor="#25D366"
|
|
39
|
-
onPress={() => {
|
|
40
|
-
onClose();
|
|
41
|
-
onWhatsapp?.();
|
|
42
|
-
}}
|
|
43
|
-
/>
|
|
44
|
-
<BottomSheetOption
|
|
45
|
-
icon="✉️"
|
|
46
|
-
label="E-mail"
|
|
47
|
-
iconColor="#9B59B6"
|
|
48
|
-
onPress={() => {
|
|
49
|
-
onClose();
|
|
50
|
-
onEmail?.();
|
|
51
|
-
}}
|
|
52
|
-
/>
|
|
53
|
-
<BottomSheetOption
|
|
54
|
-
icon="💬"
|
|
55
|
-
label="SMS"
|
|
56
|
-
iconColor="#3498DB"
|
|
57
|
-
onPress={() => {
|
|
58
|
-
onClose();
|
|
59
|
-
onSMS?.();
|
|
60
|
-
}}
|
|
61
|
-
/>
|
|
62
|
-
<BottomSheetOption
|
|
63
|
-
icon="📋"
|
|
64
|
-
label="Add Task"
|
|
65
|
-
onPress={() => {
|
|
66
|
-
onClose();
|
|
67
|
-
onAddTask?.();
|
|
68
|
-
}}
|
|
69
|
-
/>
|
|
70
|
-
<BottomSheetOption
|
|
71
|
-
icon="📝"
|
|
72
|
-
label="Add Note"
|
|
73
|
-
onPress={() => {
|
|
74
|
-
onClose();
|
|
75
|
-
onAddNote?.();
|
|
76
|
-
}}
|
|
77
|
-
/>
|
|
78
|
-
</BottomSheet>
|
|
79
|
-
);
|
|
80
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, Text, ActivityIndicator, StyleSheet } from 'react-native';
|
|
3
|
-
import type { ViewStyle } from 'react-native';
|
|
4
|
-
import { Colors } from '../constants/Colors';
|
|
5
|
-
import { verticalScale, moderateScale, scale } from 'react-native-size-matters';
|
|
6
|
-
|
|
7
|
-
type LoaderProps = {
|
|
8
|
-
message?: string;
|
|
9
|
-
overlay?: boolean;
|
|
10
|
-
color?: string;
|
|
11
|
-
style?: ViewStyle;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const Loader: React.FC<LoaderProps> = ({
|
|
15
|
-
message = 'Loading...',
|
|
16
|
-
overlay = false,
|
|
17
|
-
color = Colors.primary,
|
|
18
|
-
style,
|
|
19
|
-
}) => {
|
|
20
|
-
return (
|
|
21
|
-
<View style={[styles.container, overlay ? styles.overlay : null, style]}>
|
|
22
|
-
<ActivityIndicator size="large" color={color} />
|
|
23
|
-
{message ? <Text style={styles.text}>{message}</Text> : null}
|
|
24
|
-
</View>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export default Loader;
|
|
29
|
-
|
|
30
|
-
const styles = StyleSheet.create({
|
|
31
|
-
container: {
|
|
32
|
-
paddingVertical: verticalScale(16),
|
|
33
|
-
paddingHorizontal: scale(12),
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
justifyContent: 'center',
|
|
36
|
-
backgroundColor: Colors.white,
|
|
37
|
-
},
|
|
38
|
-
overlay: {
|
|
39
|
-
...StyleSheet.absoluteFillObject,
|
|
40
|
-
zIndex: 10,
|
|
41
|
-
backgroundColor: Colors.white50,
|
|
42
|
-
},
|
|
43
|
-
text: {
|
|
44
|
-
marginTop: verticalScale(8),
|
|
45
|
-
fontSize: moderateScale(12),
|
|
46
|
-
color: Colors.black,
|
|
47
|
-
},
|
|
48
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
|
|
2
|
-
import { scale, verticalScale, moderateScale } from 'react-native-size-matters';
|
|
3
|
-
import { Colors } from '../constants/Colors';
|
|
4
|
-
|
|
5
|
-
interface ScreenHeaderProps {
|
|
6
|
-
title?: string;
|
|
7
|
-
onBackPress: () => void;
|
|
8
|
-
showCrossOnLeft?: boolean; // If true, shows cross icon instead of back arrow on left
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const ScreenHeader: React.FC<ScreenHeaderProps> = ({
|
|
12
|
-
title,
|
|
13
|
-
onBackPress,
|
|
14
|
-
showCrossOnLeft = false,
|
|
15
|
-
}) => {
|
|
16
|
-
return (
|
|
17
|
-
<View style={styles.header}>
|
|
18
|
-
<TouchableOpacity onPress={onBackPress} style={styles.iconButton}>
|
|
19
|
-
<Text style={styles.icon}>{showCrossOnLeft ? '✕' : '←'}</Text>
|
|
20
|
-
</TouchableOpacity>
|
|
21
|
-
{title && <Text style={styles.title}>{title}</Text>}
|
|
22
|
-
<TouchableOpacity onPress={onBackPress} style={styles.iconButton}>
|
|
23
|
-
<Text style={styles.icon}>✕</Text>
|
|
24
|
-
</TouchableOpacity>
|
|
25
|
-
</View>
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const styles = StyleSheet.create({
|
|
30
|
-
header: {
|
|
31
|
-
flexDirection: 'row',
|
|
32
|
-
alignItems: 'center',
|
|
33
|
-
justifyContent: 'space-between',
|
|
34
|
-
paddingHorizontal: scale(16),
|
|
35
|
-
paddingVertical: verticalScale(12),
|
|
36
|
-
backgroundColor: Colors.white,
|
|
37
|
-
borderBottomWidth: 1,
|
|
38
|
-
borderBottomColor: '#e0e0e0',
|
|
39
|
-
},
|
|
40
|
-
iconButton: {
|
|
41
|
-
width: scale(40),
|
|
42
|
-
height: scale(40),
|
|
43
|
-
justifyContent: 'center',
|
|
44
|
-
alignItems: 'center',
|
|
45
|
-
},
|
|
46
|
-
icon: {
|
|
47
|
-
fontSize: moderateScale(24),
|
|
48
|
-
color: Colors.black,
|
|
49
|
-
},
|
|
50
|
-
title: {
|
|
51
|
-
fontSize: moderateScale(18),
|
|
52
|
-
fontWeight: '600',
|
|
53
|
-
color: Colors.black,
|
|
54
|
-
flex: 1,
|
|
55
|
-
textAlign: 'center',
|
|
56
|
-
},
|
|
57
|
-
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { View, Text, StyleSheet, TextInput } from 'react-native';
|
|
2
|
-
import { scale, verticalScale, moderateScale } from 'react-native-size-matters';
|
|
3
|
-
import { Colors } from '../constants/Colors';
|
|
4
|
-
|
|
5
|
-
interface SearchBarProps {
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
onChangeText?: (text: string) => void;
|
|
8
|
-
value?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const SearchBar: React.FC<SearchBarProps> = ({
|
|
12
|
-
placeholder = 'Search by name',
|
|
13
|
-
onChangeText,
|
|
14
|
-
value,
|
|
15
|
-
}) => {
|
|
16
|
-
return (
|
|
17
|
-
<View style={styles.searchContainer}>
|
|
18
|
-
<View style={styles.searchBar}>
|
|
19
|
-
<Text style={styles.searchIcon}>🔍</Text>
|
|
20
|
-
<TextInput
|
|
21
|
-
style={styles.searchInput}
|
|
22
|
-
placeholder={placeholder}
|
|
23
|
-
placeholderTextColor="#ccc"
|
|
24
|
-
onChangeText={onChangeText}
|
|
25
|
-
value={value}
|
|
26
|
-
/>
|
|
27
|
-
</View>
|
|
28
|
-
</View>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const styles = StyleSheet.create({
|
|
33
|
-
searchContainer: {
|
|
34
|
-
backgroundColor: Colors.white,
|
|
35
|
-
paddingHorizontal: scale(16),
|
|
36
|
-
paddingVertical: verticalScale(12),
|
|
37
|
-
},
|
|
38
|
-
searchBar: {
|
|
39
|
-
flexDirection: 'row',
|
|
40
|
-
alignItems: 'center',
|
|
41
|
-
backgroundColor: Colors.white,
|
|
42
|
-
borderWidth: 1,
|
|
43
|
-
borderColor: '#E0E0E0',
|
|
44
|
-
borderRadius: moderateScale(8),
|
|
45
|
-
paddingHorizontal: scale(12),
|
|
46
|
-
paddingVertical: verticalScale(8),
|
|
47
|
-
},
|
|
48
|
-
searchIcon: {
|
|
49
|
-
fontSize: moderateScale(18),
|
|
50
|
-
marginRight: scale(8),
|
|
51
|
-
color: '#999',
|
|
52
|
-
},
|
|
53
|
-
searchInput: {
|
|
54
|
-
flex: 1,
|
|
55
|
-
fontSize: moderateScale(16),
|
|
56
|
-
color: Colors.black,
|
|
57
|
-
padding: 0,
|
|
58
|
-
},
|
|
59
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
|
-
import { useNavigation } from '@react-navigation/native';
|
|
4
|
-
import { scale, moderateScale } from 'react-native-size-matters';
|
|
5
|
-
import { Colors } from '../constants/Colors';
|
|
6
|
-
|
|
7
|
-
interface TabsHeaderProps {
|
|
8
|
-
title: string;
|
|
9
|
-
rightSlot?: React.ReactNode;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const TabsHeader: React.FC<TabsHeaderProps> = ({ title, rightSlot }) => {
|
|
13
|
-
const navigation = useNavigation<any>();
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<View style={styles.container}>
|
|
17
|
-
<TouchableOpacity
|
|
18
|
-
style={styles.toggleButton}
|
|
19
|
-
onPress={() => navigation.toggleDrawer?.()}
|
|
20
|
-
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
21
|
-
accessibilityRole="button"
|
|
22
|
-
accessibilityLabel="Open navigation drawer"
|
|
23
|
-
>
|
|
24
|
-
<Text style={styles.toggleIcon}>☰</Text>
|
|
25
|
-
</TouchableOpacity>
|
|
26
|
-
<Text style={styles.title}>{title}</Text>
|
|
27
|
-
<View style={styles.rightSlot}>{rightSlot}</View>
|
|
28
|
-
</View>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default TabsHeader;
|
|
33
|
-
|
|
34
|
-
const styles = StyleSheet.create({
|
|
35
|
-
container: {
|
|
36
|
-
flexDirection: 'row',
|
|
37
|
-
alignItems: 'center',
|
|
38
|
-
paddingHorizontal: moderateScale(12),
|
|
39
|
-
paddingVertical: moderateScale(4),
|
|
40
|
-
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
41
|
-
borderBottomColor: Colors.divider,
|
|
42
|
-
backgroundColor: Colors.white,
|
|
43
|
-
},
|
|
44
|
-
toggleButton: {
|
|
45
|
-
width: scale(36),
|
|
46
|
-
height: scale(36),
|
|
47
|
-
borderRadius: moderateScale(18),
|
|
48
|
-
borderWidth: 1,
|
|
49
|
-
borderColor: Colors.border,
|
|
50
|
-
justifyContent: 'center',
|
|
51
|
-
alignItems: 'center',
|
|
52
|
-
backgroundColor: Colors.lightblue,
|
|
53
|
-
},
|
|
54
|
-
toggleIcon: {
|
|
55
|
-
fontSize: moderateScale(20),
|
|
56
|
-
color: Colors.black,
|
|
57
|
-
},
|
|
58
|
-
title: {
|
|
59
|
-
flex: 1,
|
|
60
|
-
textAlign: 'left',
|
|
61
|
-
fontSize: moderateScale(16),
|
|
62
|
-
fontWeight: '600',
|
|
63
|
-
color: Colors.black,
|
|
64
|
-
marginLeft: 12,
|
|
65
|
-
},
|
|
66
|
-
rightSlot: {
|
|
67
|
-
minWidth: scale(36),
|
|
68
|
-
minHeight: scale(36),
|
|
69
|
-
alignItems: 'flex-end',
|
|
70
|
-
justifyContent: 'center',
|
|
71
|
-
},
|
|
72
|
-
});
|
package/src/components/index.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { NativeModules, Platform } from 'react-native';
|
|
2
|
-
|
|
3
|
-
interface FlavorConfig {
|
|
4
|
-
appName: string;
|
|
5
|
-
applicationId: string;
|
|
6
|
-
host: string;
|
|
7
|
-
clevertapAccountId: string;
|
|
8
|
-
clevertapToken: string;
|
|
9
|
-
twScheme: string;
|
|
10
|
-
fileProviderAuthority: string;
|
|
11
|
-
freshchatFileProviderAuthority: string;
|
|
12
|
-
defaultNotificationChannelId: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Get the current flavor configuration
|
|
17
|
-
* This reads from native build config on Android
|
|
18
|
-
* On iOS, you'll need to configure schemes and xcconfig files
|
|
19
|
-
*/
|
|
20
|
-
export const getFlavorConfig = (): FlavorConfig => {
|
|
21
|
-
if (Platform.OS === 'android') {
|
|
22
|
-
const { BuildConfig } = NativeModules;
|
|
23
|
-
|
|
24
|
-
if (BuildConfig) {
|
|
25
|
-
return {
|
|
26
|
-
appName: BuildConfig.APP_NAME || 'Salespanda',
|
|
27
|
-
applicationId: BuildConfig.APPLICATION_ID || 'com.salespanda.app',
|
|
28
|
-
host: BuildConfig.HOST || '',
|
|
29
|
-
clevertapAccountId: BuildConfig.CLEVERTAP_ACCOUNT_ID || '',
|
|
30
|
-
clevertapToken: BuildConfig.CLEVERTAP_TOKEN || '',
|
|
31
|
-
twScheme: BuildConfig.TWSCHEME || '',
|
|
32
|
-
fileProviderAuthority: BuildConfig.FILE_PROVIDER_AUTHORITY || '',
|
|
33
|
-
freshchatFileProviderAuthority:
|
|
34
|
-
BuildConfig.FRESHCHAT_FILE_PROVIDER_AUTHORITY || '',
|
|
35
|
-
defaultNotificationChannelId:
|
|
36
|
-
BuildConfig.DEFAULT_NOTIFICATION_CHANNEL_ID || '',
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Default configuration for iOS or if BuildConfig is not available
|
|
42
|
-
return {
|
|
43
|
-
appName: 'Salespanda',
|
|
44
|
-
applicationId: 'com.salespanda.app',
|
|
45
|
-
host: '',
|
|
46
|
-
clevertapAccountId: '',
|
|
47
|
-
clevertapToken: '',
|
|
48
|
-
twScheme: '',
|
|
49
|
-
fileProviderAuthority: '',
|
|
50
|
-
freshchatFileProviderAuthority: '',
|
|
51
|
-
defaultNotificationChannelId: '',
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export default getFlavorConfig();
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Salespanda SDK Configuration
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export interface SalespandaConfig {
|
|
6
|
-
/**
|
|
7
|
-
* Theme configuration
|
|
8
|
-
*/
|
|
9
|
-
theme?: {
|
|
10
|
-
primaryColor?: string;
|
|
11
|
-
secondaryColor?: string;
|
|
12
|
-
backgroundColor?: string;
|
|
13
|
-
textColor?: string;
|
|
14
|
-
accentColor?: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* API configuration
|
|
19
|
-
*/
|
|
20
|
-
api?: {
|
|
21
|
-
baseUrl?: string;
|
|
22
|
-
apiKey?: string;
|
|
23
|
-
timeout?: number;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Authentication info supplied by host app
|
|
28
|
-
* If provided, SDK will use these tokens instead of performing login
|
|
29
|
-
*/
|
|
30
|
-
auth?: {
|
|
31
|
-
/**
|
|
32
|
-
* Token to be sent as `Token` header for protected APIs
|
|
33
|
-
*/
|
|
34
|
-
token?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Access token used for SSO or other flows when required
|
|
37
|
-
*/
|
|
38
|
-
accessToken?: string;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Feature flags
|
|
43
|
-
*/
|
|
44
|
-
features?: {
|
|
45
|
-
enablePremium?: boolean;
|
|
46
|
-
enableNotifications?: boolean;
|
|
47
|
-
enableReports?: boolean;
|
|
48
|
-
enableDrawer?: boolean;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Analytics configuration
|
|
53
|
-
*/
|
|
54
|
-
analytics?: {
|
|
55
|
-
enabled?: boolean;
|
|
56
|
-
trackingId?: string;
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
let globalConfig: SalespandaConfig = {
|
|
61
|
-
theme: {
|
|
62
|
-
primaryColor: '#4a148c',
|
|
63
|
-
secondaryColor: '#25D366',
|
|
64
|
-
backgroundColor: '#fff',
|
|
65
|
-
textColor: '#333',
|
|
66
|
-
accentColor: '#999',
|
|
67
|
-
},
|
|
68
|
-
features: {
|
|
69
|
-
enablePremium: true,
|
|
70
|
-
enableNotifications: true,
|
|
71
|
-
enableReports: true,
|
|
72
|
-
enableDrawer: true,
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Initialize Salespanda SDK with custom configuration
|
|
78
|
-
*/
|
|
79
|
-
export function initializeSalespanda(config: SalespandaConfig): void {
|
|
80
|
-
// Debug log for toolkit usage
|
|
81
|
-
// Helps in verifying that initializeSalespanda is being called correctly from host app
|
|
82
|
-
console.log('[Salespanda][initializeSalespanda] called with config:', config);
|
|
83
|
-
|
|
84
|
-
globalConfig = {
|
|
85
|
-
...globalConfig,
|
|
86
|
-
...config,
|
|
87
|
-
theme: {
|
|
88
|
-
...globalConfig.theme,
|
|
89
|
-
...config.theme,
|
|
90
|
-
},
|
|
91
|
-
features: {
|
|
92
|
-
...globalConfig.features,
|
|
93
|
-
...config.features,
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
// If host app passes tokens, make them available runtime-wide
|
|
98
|
-
if (config.auth?.token || config.auth?.accessToken) {
|
|
99
|
-
// Lazy import to avoid circular dep
|
|
100
|
-
const { setRuntimeTokens } = require('../services/api');
|
|
101
|
-
setRuntimeTokens({
|
|
102
|
-
token: config.auth?.token || null,
|
|
103
|
-
accessToken: config.auth?.accessToken || null,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Get current Salespanda configuration
|
|
110
|
-
*/
|
|
111
|
-
export function getSalespandaConfig(): SalespandaConfig {
|
|
112
|
-
console.log(
|
|
113
|
-
'[Salespanda][getSalespandaConfig] returning config:',
|
|
114
|
-
globalConfig
|
|
115
|
-
);
|
|
116
|
-
return globalConfig;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Reset configuration to defaults
|
|
121
|
-
*/
|
|
122
|
-
export function resetSalespandaConfig(): void {
|
|
123
|
-
console.log(
|
|
124
|
-
'[Salespanda][resetSalespandaConfig] resetting config to defaults'
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
globalConfig = {
|
|
128
|
-
theme: {
|
|
129
|
-
primaryColor: '#4a148c',
|
|
130
|
-
secondaryColor: '#25D366',
|
|
131
|
-
backgroundColor: '#fff',
|
|
132
|
-
textColor: '#333',
|
|
133
|
-
accentColor: '#999',
|
|
134
|
-
},
|
|
135
|
-
features: {
|
|
136
|
-
enablePremium: true,
|
|
137
|
-
enableNotifications: true,
|
|
138
|
-
enableReports: true,
|
|
139
|
-
enableDrawer: true,
|
|
140
|
-
},
|
|
141
|
-
};
|
|
142
|
-
}
|
package/src/constants/Colors.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const Colors = {
|
|
2
|
-
// Minimal palette as requested
|
|
3
|
-
primary: '#46bdd3',
|
|
4
|
-
white: '#ffffff',
|
|
5
|
-
black: '#322F2F',
|
|
6
|
-
background: '#ffffff',
|
|
7
|
-
border: '#ffffff',
|
|
8
|
-
divider: '#e0e0e0',
|
|
9
|
-
white50: 'rgba(255, 255, 255, 0.5)',
|
|
10
|
-
black50: 'rgba(0, 0, 0, 0.2)',
|
|
11
|
-
black30: 'rgba(0, 0, 0, 0.3)',
|
|
12
|
-
black20: 'rgba(0, 0, 0, 0.2)',
|
|
13
|
-
black10: 'rgba(0, 0, 0, 0.1)',
|
|
14
|
-
lightblue: '#E1F5FE',
|
|
15
|
-
} as const;
|
|
16
|
-
|
|
17
|
-
export type ColorKey = keyof typeof Colors;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Platform } from 'react-native';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns different values based on the platform
|
|
5
|
-
* @param value - Single value to use for both platforms, or object with platform specific values
|
|
6
|
-
* @param androidValue - Optional value for Android (if not provided, uses the same value for both platforms)
|
|
7
|
-
* @returns Platform specific value
|
|
8
|
-
*/
|
|
9
|
-
export const GetPlatform = <T>(
|
|
10
|
-
value: T | { ios: T; android: T },
|
|
11
|
-
androidValue?: T
|
|
12
|
-
): T => {
|
|
13
|
-
if (
|
|
14
|
-
value &&
|
|
15
|
-
typeof value === 'object' &&
|
|
16
|
-
'ios' in value &&
|
|
17
|
-
'android' in value
|
|
18
|
-
) {
|
|
19
|
-
return Platform.select({
|
|
20
|
-
ios: value.ios,
|
|
21
|
-
android: value.android,
|
|
22
|
-
}) as T;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return Platform.select({
|
|
26
|
-
ios: value as T,
|
|
27
|
-
android: androidValue ?? (value as T),
|
|
28
|
-
}) as T;
|
|
29
|
-
};
|
package/src/index.tsx
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export { default } from './SalespandaApp';
|
|
2
|
-
export { default as SalespandaApp } from './SalespandaApp';
|
|
3
|
-
export type { SalespandaAppProps } from './SalespandaApp';
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
initializeSalespanda,
|
|
7
|
-
getSalespandaConfig,
|
|
8
|
-
resetSalespandaConfig,
|
|
9
|
-
} from './config/SalespandaConfig';
|
|
10
|
-
export type { SalespandaConfig } from './config/SalespandaConfig';
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
login,
|
|
14
|
-
logout,
|
|
15
|
-
isAuthenticated,
|
|
16
|
-
getCurrentUser,
|
|
17
|
-
getCurrentToken,
|
|
18
|
-
} from './services/authService';
|
|
19
|
-
|
|
20
|
-
export { getFlavorConfig } from './config/FlavorConfig';
|
|
21
|
-
export { default as FlavorConfig } from './config/FlavorConfig';
|
|
22
|
-
|
|
23
|
-
export { default as AppNavigator } from './navigation/AppNavigator';
|
|
24
|
-
export { default as DrawerNavigator } from './navigation/DrawerNavigator';
|
|
25
|
-
export { default as BottomTabNavigator } from './navigation/BottomTabNavigator';
|
|
26
|
-
|
|
27
|
-
export { default as HomeScreen } from './screens/Tabs/HomeScreen';
|
|
28
|
-
export { default as ProfileScreen } from './screens/Tabs/ActivityAnalytics';
|
|
29
|
-
export { default as NotificationsScreen } from './screens/Tabs/NotificationsScreen';
|
|
30
|
-
export { default as ReportsScreen } from './screens/ReportsScreen';
|
|
31
|
-
export { default as PremiumScreen } from './screens/Tabs/CRMScreen';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { NavigationContainer } from '@react-navigation/native';
|
|
2
|
-
import { StyleSheet } from 'react-native';
|
|
3
|
-
import StackNavigator from './StackNavigator';
|
|
4
|
-
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
5
|
-
import { Colors } from '../constants/Colors';
|
|
6
|
-
|
|
7
|
-
const AppNavigator: React.FC = () => {
|
|
8
|
-
return (
|
|
9
|
-
<NavigationContainer>
|
|
10
|
-
<SafeAreaView style={styles.container} edges={['bottom', 'top']}>
|
|
11
|
-
<StackNavigator />
|
|
12
|
-
</SafeAreaView>
|
|
13
|
-
</NavigationContainer>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default AppNavigator;
|
|
18
|
-
|
|
19
|
-
const styles = StyleSheet.create({
|
|
20
|
-
container: {
|
|
21
|
-
flex: 1,
|
|
22
|
-
backgroundColor: Colors.background,
|
|
23
|
-
},
|
|
24
|
-
});
|