react-native-salespanda 0.7.7 → 0.7.8

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.
Files changed (51) hide show
  1. package/package.json +2 -5
  2. package/src/NativeSalespanda.ts +0 -7
  3. package/src/SalespandaApp.tsx +0 -141
  4. package/src/assets/images/bottomtabs/analytics.png +0 -0
  5. package/src/assets/images/bottomtabs/analyticsactive.png +0 -0
  6. package/src/assets/images/bottomtabs/crm.png +0 -0
  7. package/src/assets/images/bottomtabs/crmactive.png +0 -0
  8. package/src/assets/images/bottomtabs/diary.png +0 -0
  9. package/src/assets/images/bottomtabs/diaryactive.png +0 -0
  10. package/src/assets/images/bottomtabs/home.png +0 -0
  11. package/src/assets/images/bottomtabs/homeactive.png +0 -0
  12. package/src/assets/images/bottomtabs/notification.png +0 -0
  13. package/src/assets/images/bottomtabs/notificationactive.png +0 -0
  14. package/src/assets/images/index.js +0 -11
  15. package/src/assets/images/index.ts +0 -40
  16. package/src/components/BottomSheet.tsx +0 -146
  17. package/src/components/ContactViaModal.tsx +0 -80
  18. package/src/components/Loader.tsx +0 -48
  19. package/src/components/ScreenHeader.tsx +0 -57
  20. package/src/components/SearchBar.tsx +0 -59
  21. package/src/components/TabsHeader.tsx +0 -72
  22. package/src/components/index.ts +0 -5
  23. package/src/config/FlavorConfig.ts +0 -55
  24. package/src/config/SalespandaConfig.ts +0 -142
  25. package/src/constants/Colors.ts +0 -17
  26. package/src/constants/GetPlatorm.ts +0 -29
  27. package/src/index.tsx +0 -31
  28. package/src/navigation/AppNavigator.tsx +0 -24
  29. package/src/navigation/BottomTabNavigator.tsx +0 -181
  30. package/src/navigation/DrawerNavigator.tsx +0 -306
  31. package/src/navigation/StackNavigator.tsx +0 -32
  32. package/src/screens/CRM/AddContactModal.tsx +0 -57
  33. package/src/screens/CRM/CategoryTabs.tsx +0 -109
  34. package/src/screens/CRM/ContactItem.tsx +0 -168
  35. package/src/screens/CRM/FilterDropdown.tsx +0 -34
  36. package/src/screens/CRM/FunnelChart.tsx +0 -103
  37. package/src/screens/CRM/InfoCard.tsx +0 -51
  38. package/src/screens/CRM/LeadCard.tsx +0 -69
  39. package/src/screens/CRM/LogCallScreen.tsx +0 -318
  40. package/src/screens/CRM/TopTabs.tsx +0 -95
  41. package/src/screens/CRM/index.ts +0 -10
  42. package/src/screens/ReportsScreen.tsx +0 -37
  43. package/src/screens/Tabs/ActivityAnalytics.tsx +0 -25
  44. package/src/screens/Tabs/CRMScreen.tsx +0 -381
  45. package/src/screens/Tabs/DigitalDiary.tsx +0 -35
  46. package/src/screens/Tabs/HomeScreen.tsx +0 -379
  47. package/src/screens/Tabs/NotificationsScreen.tsx +0 -25
  48. package/src/screens/contentliberary/contentliberary.tsx +0 -268
  49. package/src/services/api.ts +0 -173
  50. package/src/services/authService.ts +0 -75
  51. package/src/store/index.ts +0 -16
@@ -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
- });
@@ -1,5 +0,0 @@
1
- // Reusable Components
2
- export { SearchBar } from './SearchBar';
3
- export { BottomSheet, BottomSheetOption } from './BottomSheet';
4
- export { ContactViaModal } from './ContactViaModal';
5
- export { ScreenHeader } from './ScreenHeader';
@@ -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
- }
@@ -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
- });
@@ -1,181 +0,0 @@
1
- import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
2
- import { View, Image, StyleSheet } from 'react-native';
3
- import { scale, verticalScale, moderateScale } from 'react-native-size-matters';
4
- import HomeScreen from '../screens/Tabs/HomeScreen';
5
- import ReportsScreen from '../screens/ReportsScreen';
6
- import { SafeAreaView } from 'react-native-safe-area-context';
7
- import { Colors } from '../constants/Colors';
8
- import {
9
- analyticsIcon,
10
- analyticsIconActive,
11
- crmIcon,
12
- crmIconActive,
13
- diaryIcon,
14
- diaryIconActive,
15
- homeIcon,
16
- homeIconActive,
17
- notificationIcon,
18
- notificationIconActive,
19
- } from '../assets/images';
20
- import CRMScreen from '../screens/Tabs/CRMScreen';
21
- import NotificationsScreen from '../screens/Tabs/NotificationsScreen';
22
- import { useNavigation } from '@react-navigation/native';
23
- import ActivityAnalytics from '../screens/Tabs/ActivityAnalytics';
24
-
25
- export type BottomTabParamList = {
26
- 'Home': undefined;
27
- 'CRM': undefined;
28
- 'Reports': undefined;
29
- 'Notifications': undefined;
30
- 'Activity Analytics': undefined;
31
- };
32
-
33
- const Tab = createBottomTabNavigator<BottomTabParamList>();
34
-
35
- interface TabIconProps {
36
- focused: boolean;
37
- size: number;
38
- }
39
-
40
- interface ImageIconProps {
41
- inactive: any;
42
- active: any;
43
- }
44
-
45
- const ImageIcon = ({ inactive, active }: ImageIconProps) => {
46
- return ({ focused, size }: TabIconProps) => {
47
- if (focused) {
48
- return (
49
- <View style={styles.activeIconContainer}>
50
- <Image
51
- source={active}
52
- resizeMode="contain"
53
- style={styles.activeIcon}
54
- />
55
- </View>
56
- );
57
- }
58
- return (
59
- <Image
60
- source={inactive}
61
- resizeMode="contain"
62
- style={[styles.inactiveIcon, { width: size, height: size }]}
63
- />
64
- );
65
- };
66
- };
67
-
68
- const BottomTabNavigator: React.FC = () => {
69
- const navigation = useNavigation();
70
-
71
- return (
72
- <SafeAreaView style={styles.container} edges={['bottom']}>
73
- <Tab.Navigator
74
- screenOptions={{
75
- headerShown: false,
76
- sceneStyle: { backgroundColor: Colors.background },
77
- tabBarShowLabel: false,
78
- tabBarStyle: styles.tabBar,
79
- tabBarItemStyle: { overflow: 'visible' },
80
- }}
81
- screenListeners={{
82
- state: (e) => {
83
- const state = e.data.state;
84
- if (state && state.routes && state.index !== undefined) {
85
- const currentRoute = state.routes[state.index];
86
- if (currentRoute) {
87
- const tabName = currentRoute.name;
88
-
89
- // Update the drawer header title based on current tab
90
- navigation.setOptions({
91
- title: tabName,
92
- });
93
- }
94
- }
95
- },
96
- }}
97
- >
98
- <Tab.Screen
99
- name="Home"
100
- component={HomeScreen}
101
- options={{
102
- tabBarIcon: ImageIcon({
103
- inactive: homeIcon,
104
- active: homeIconActive,
105
- }),
106
- }}
107
- />
108
- <Tab.Screen
109
- name="CRM"
110
- component={CRMScreen}
111
- options={{
112
- tabBarIcon: ImageIcon({ inactive: crmIcon, active: crmIconActive }),
113
- }}
114
- />
115
- <Tab.Screen
116
- name="Reports"
117
- component={ReportsScreen}
118
- options={{
119
- tabBarIcon: ImageIcon({
120
- inactive: diaryIcon,
121
- active: diaryIconActive,
122
- }),
123
- }}
124
- />
125
- <Tab.Screen
126
- name="Notifications"
127
- component={NotificationsScreen}
128
- options={{
129
- tabBarIcon: ImageIcon({
130
- inactive: notificationIcon,
131
- active: notificationIconActive,
132
- }),
133
- }}
134
- />
135
- <Tab.Screen
136
- name="Activity Analytics"
137
- component={ActivityAnalytics}
138
- options={{
139
- tabBarIcon: ImageIcon({
140
- inactive: analyticsIcon,
141
- active: analyticsIconActive,
142
- }),
143
- }}
144
- />
145
- </Tab.Navigator>
146
- </SafeAreaView>
147
- );
148
- };
149
-
150
- export default BottomTabNavigator;
151
-
152
- const styles = StyleSheet.create({
153
- container: {
154
- flex: 1,
155
- backgroundColor: Colors.background,
156
- },
157
- tabBar: {
158
- borderTopWidth: 1,
159
- borderTopColor: Colors.border,
160
- backgroundColor: Colors.white,
161
- height: verticalScale(40),
162
- },
163
- activeIconContainer: {
164
- width: scale(48),
165
- height: scale(48),
166
- borderRadius: moderateScale(24),
167
- alignItems: 'center',
168
- justifyContent: 'center',
169
- borderWidth: 4,
170
- borderColor: Colors.white,
171
- transform: [{ translateY: verticalScale(-6) }],
172
- },
173
- activeIcon: {
174
- width: scale(42),
175
- height: scale(42),
176
- tintColor: Colors.primary,
177
- },
178
- inactiveIcon: {
179
- tintColor: Colors.black30,
180
- },
181
- });