react-native-salespanda 0.5.3 → 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/android/build.gradle +15 -198
- package/package.json +3 -4
- 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,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
|
-
});
|
|
@@ -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
|
-
});
|