react-native-salespanda 0.2.0 → 0.3.0
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/lib/module/SalespandaApp.js +56 -0
- package/lib/module/SalespandaApp.js.map +1 -0
- package/lib/module/config/SalespandaConfig.js +68 -0
- package/lib/module/config/SalespandaConfig.js.map +1 -0
- package/lib/module/index.js +27 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigation/AppNavigator.js +9 -2
- package/lib/module/navigation/AppNavigator.js.map +1 -1
- package/lib/module/navigation/BottomTabNavigator.js +82 -73
- package/lib/module/navigation/BottomTabNavigator.js.map +1 -1
- package/lib/module/navigation/DrawerNavigator.js +7 -1
- package/lib/module/navigation/DrawerNavigator.js.map +1 -1
- package/lib/module/screens/HomeScreen.js +70 -111
- package/lib/module/screens/HomeScreen.js.map +1 -1
- package/lib/typescript/src/SalespandaApp.d.ts +39 -0
- package/lib/typescript/src/SalespandaApp.d.ts.map +1 -0
- package/lib/typescript/src/config/SalespandaConfig.d.ts +52 -0
- package/lib/typescript/src/config/SalespandaConfig.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +17 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/navigation/AppNavigator.d.ts.map +1 -1
- package/lib/typescript/src/navigation/BottomTabNavigator.d.ts.map +1 -1
- package/lib/typescript/src/navigation/DrawerNavigator.d.ts.map +1 -1
- package/lib/typescript/src/screens/HomeScreen.d.ts.map +1 -1
- package/package.json +18 -11
- package/src/SalespandaApp.tsx +92 -0
- package/src/config/SalespandaConfig.ts +105 -0
- package/src/index.tsx +34 -6
- package/src/navigation/AppNavigator.tsx +5 -2
- package/src/navigation/BottomTabNavigator.tsx +54 -50
- package/src/navigation/DrawerNavigator.tsx +5 -1
- package/src/screens/HomeScreen.tsx +41 -87
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
* Feature flags
|
|
28
|
+
*/
|
|
29
|
+
features?: {
|
|
30
|
+
enablePremium?: boolean;
|
|
31
|
+
enableNotifications?: boolean;
|
|
32
|
+
enableReports?: boolean;
|
|
33
|
+
enableDrawer?: boolean;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Analytics configuration
|
|
38
|
+
*/
|
|
39
|
+
analytics?: {
|
|
40
|
+
enabled?: boolean;
|
|
41
|
+
trackingId?: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let globalConfig: SalespandaConfig = {
|
|
46
|
+
theme: {
|
|
47
|
+
primaryColor: '#4a148c',
|
|
48
|
+
secondaryColor: '#25D366',
|
|
49
|
+
backgroundColor: '#fff',
|
|
50
|
+
textColor: '#333',
|
|
51
|
+
accentColor: '#999',
|
|
52
|
+
},
|
|
53
|
+
features: {
|
|
54
|
+
enablePremium: true,
|
|
55
|
+
enableNotifications: true,
|
|
56
|
+
enableReports: true,
|
|
57
|
+
enableDrawer: true,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Initialize Salespanda SDK with custom configuration
|
|
63
|
+
*/
|
|
64
|
+
export function initializeSalespanda(config: SalespandaConfig): void {
|
|
65
|
+
globalConfig = {
|
|
66
|
+
...globalConfig,
|
|
67
|
+
...config,
|
|
68
|
+
theme: {
|
|
69
|
+
...globalConfig.theme,
|
|
70
|
+
...config.theme,
|
|
71
|
+
},
|
|
72
|
+
features: {
|
|
73
|
+
...globalConfig.features,
|
|
74
|
+
...config.features,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Get current Salespanda configuration
|
|
81
|
+
*/
|
|
82
|
+
export function getSalespandaConfig(): SalespandaConfig {
|
|
83
|
+
return globalConfig;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Reset configuration to defaults
|
|
88
|
+
*/
|
|
89
|
+
export function resetSalespandaConfig(): void {
|
|
90
|
+
globalConfig = {
|
|
91
|
+
theme: {
|
|
92
|
+
primaryColor: '#4a148c',
|
|
93
|
+
secondaryColor: '#25D366',
|
|
94
|
+
backgroundColor: '#fff',
|
|
95
|
+
textColor: '#333',
|
|
96
|
+
accentColor: '#999',
|
|
97
|
+
},
|
|
98
|
+
features: {
|
|
99
|
+
enablePremium: true,
|
|
100
|
+
enableNotifications: true,
|
|
101
|
+
enableReports: true,
|
|
102
|
+
enableDrawer: true,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -1,15 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Salespanda SDK
|
|
3
|
+
*
|
|
4
|
+
* This SDK can be used in two ways:
|
|
5
|
+
*
|
|
6
|
+
* 1. As a complete standalone app:
|
|
7
|
+
* import SalespandaApp from 'react-native-salespanda';
|
|
8
|
+
* <SalespandaApp />
|
|
9
|
+
*
|
|
10
|
+
* 2. As individual components/screens in your app:
|
|
11
|
+
* import { HomeScreen, ProfileScreen } from 'react-native-salespanda';
|
|
12
|
+
*/
|
|
2
13
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
14
|
+
// ============================================
|
|
15
|
+
// MAIN APP EXPORT (Default)
|
|
16
|
+
// ============================================
|
|
17
|
+
export { default } from './SalespandaApp';
|
|
18
|
+
export { default as SalespandaApp } from './SalespandaApp';
|
|
19
|
+
export type { SalespandaAppProps } from './SalespandaApp';
|
|
6
20
|
|
|
7
|
-
//
|
|
21
|
+
// ============================================
|
|
22
|
+
// CONFIGURATION
|
|
23
|
+
// ============================================
|
|
24
|
+
export {
|
|
25
|
+
initializeSalespanda,
|
|
26
|
+
getSalespandaConfig,
|
|
27
|
+
resetSalespandaConfig,
|
|
28
|
+
} from './config/SalespandaConfig';
|
|
29
|
+
export type { SalespandaConfig } from './config/SalespandaConfig';
|
|
30
|
+
|
|
31
|
+
// ============================================
|
|
32
|
+
// NAVIGATION COMPONENTS
|
|
33
|
+
// ============================================
|
|
8
34
|
export { default as AppNavigator } from './navigation/AppNavigator';
|
|
9
35
|
export { default as DrawerNavigator } from './navigation/DrawerNavigator';
|
|
10
36
|
export { default as BottomTabNavigator } from './navigation/BottomTabNavigator';
|
|
11
37
|
|
|
12
|
-
//
|
|
38
|
+
// ============================================
|
|
39
|
+
// SCREEN COMPONENTS (Library Mode)
|
|
40
|
+
// ============================================
|
|
13
41
|
export { default as HomeScreen } from './screens/HomeScreen';
|
|
14
42
|
export { default as ProfileScreen } from './screens/ProfileScreen';
|
|
15
43
|
export { default as NotificationsScreen } from './screens/NotificationsScreen';
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { NavigationContainer } from '@react-navigation/native';
|
|
2
|
-
import
|
|
2
|
+
import BottomTabNavigator from './BottomTabNavigator';
|
|
3
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
3
4
|
|
|
4
5
|
export default function AppNavigator() {
|
|
5
6
|
return (
|
|
6
7
|
<NavigationContainer>
|
|
7
|
-
<
|
|
8
|
+
<SafeAreaView style={{ flex: 1 }} edges={['bottom', 'top']}>
|
|
9
|
+
<BottomTabNavigator />
|
|
10
|
+
</SafeAreaView>
|
|
8
11
|
</NavigationContainer>
|
|
9
12
|
);
|
|
10
13
|
}
|
|
@@ -4,61 +4,65 @@ import HomeScreen from '../screens/HomeScreen';
|
|
|
4
4
|
import PremiumScreen from '../screens/PremiumScreen';
|
|
5
5
|
import NotificationsScreen from '../screens/NotificationsScreen';
|
|
6
6
|
import ReportsScreen from '../screens/ReportsScreen';
|
|
7
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
7
8
|
|
|
8
9
|
const Tab = createBottomTabNavigator();
|
|
9
10
|
|
|
10
11
|
export default function BottomTabNavigator() {
|
|
11
12
|
return (
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
>
|
|
26
|
-
<Tab.Screen
|
|
27
|
-
name="Home"
|
|
28
|
-
component={HomeScreen}
|
|
29
|
-
options={{
|
|
30
|
-
tabBarIcon: ({ color, size }) => (
|
|
31
|
-
<Text style={{ fontSize: size, color }}>🏠</Text>
|
|
32
|
-
),
|
|
13
|
+
<SafeAreaView style={{ flex: 1 }} edges={['bottom']}>
|
|
14
|
+
<Tab.Navigator
|
|
15
|
+
screenOptions={{
|
|
16
|
+
headerShown: false, // Hide headers as drawer provides them
|
|
17
|
+
tabBarActiveTintColor: '#4a148c',
|
|
18
|
+
tabBarInactiveTintColor: '#999',
|
|
19
|
+
tabBarStyle: {
|
|
20
|
+
borderTopWidth: 1,
|
|
21
|
+
borderTopColor: '#e0e0e0',
|
|
22
|
+
paddingBottom: 8,
|
|
23
|
+
paddingTop: 8,
|
|
24
|
+
height: 60,
|
|
25
|
+
},
|
|
33
26
|
}}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
27
|
+
>
|
|
28
|
+
<Tab.Screen
|
|
29
|
+
name="Home"
|
|
30
|
+
component={HomeScreen}
|
|
31
|
+
options={{
|
|
32
|
+
tabBarIcon: ({ color, size }) => (
|
|
33
|
+
<Text style={{ fontSize: size, color }}>🏠</Text>
|
|
34
|
+
),
|
|
35
|
+
headerShown: false,
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
<Tab.Screen
|
|
39
|
+
name="Premium"
|
|
40
|
+
component={PremiumScreen}
|
|
41
|
+
options={{
|
|
42
|
+
tabBarIcon: ({ color, size }) => (
|
|
43
|
+
<Text style={{ fontSize: size, color }}>💎</Text>
|
|
44
|
+
),
|
|
45
|
+
}}
|
|
46
|
+
/>
|
|
47
|
+
<Tab.Screen
|
|
48
|
+
name="Notifications"
|
|
49
|
+
component={NotificationsScreen}
|
|
50
|
+
options={{
|
|
51
|
+
tabBarIcon: ({ color, size }) => (
|
|
52
|
+
<Text style={{ fontSize: size, color }}>🔔</Text>
|
|
53
|
+
),
|
|
54
|
+
}}
|
|
55
|
+
/>
|
|
56
|
+
<Tab.Screen
|
|
57
|
+
name="Reports"
|
|
58
|
+
component={ReportsScreen}
|
|
59
|
+
options={{
|
|
60
|
+
tabBarIcon: ({ color, size }) => (
|
|
61
|
+
<Text style={{ fontSize: size, color }}>📊</Text>
|
|
62
|
+
),
|
|
63
|
+
}}
|
|
64
|
+
/>
|
|
65
|
+
</Tab.Navigator>
|
|
66
|
+
</SafeAreaView>
|
|
63
67
|
);
|
|
64
68
|
}
|
|
@@ -144,7 +144,11 @@ export default function DrawerNavigator() {
|
|
|
144
144
|
drawerContent={(props) => <CustomDrawerContent {...props} />}
|
|
145
145
|
screenOptions={{
|
|
146
146
|
headerShown: true,
|
|
147
|
-
drawerType: 'front'
|
|
147
|
+
drawerType: 'slide', // Changed from 'front' for better UX
|
|
148
|
+
swipeEdgeWidth: 100, // Width from edge to start swipe
|
|
149
|
+
drawerStyle: {
|
|
150
|
+
width: 280,
|
|
151
|
+
},
|
|
148
152
|
headerStyle: {
|
|
149
153
|
backgroundColor: '#4a148c',
|
|
150
154
|
},
|
|
@@ -5,8 +5,6 @@ import {
|
|
|
5
5
|
StyleSheet,
|
|
6
6
|
TouchableOpacity,
|
|
7
7
|
ScrollView,
|
|
8
|
-
Image,
|
|
9
|
-
SafeAreaView,
|
|
10
8
|
} from 'react-native';
|
|
11
9
|
|
|
12
10
|
interface MenuItemProps {
|
|
@@ -28,101 +26,57 @@ const MenuItem: React.FC<MenuItemProps> = ({ title, icon, onPress }) => {
|
|
|
28
26
|
|
|
29
27
|
export default function HomeScreen() {
|
|
30
28
|
return (
|
|
31
|
-
<
|
|
32
|
-
{/*
|
|
33
|
-
<View style={styles.
|
|
34
|
-
<
|
|
35
|
-
<Text style={styles.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
<Text style={styles.bannerText}>
|
|
49
|
-
Build strong relationships,{'\n'}
|
|
50
|
-
improve relations & productivity{'\n'}
|
|
51
|
-
by having conversations on{'\n'}
|
|
52
|
-
WhatsAppppppppp.
|
|
53
|
-
</Text>
|
|
54
|
-
<TouchableOpacity style={styles.startButton}>
|
|
55
|
-
<Text style={styles.startButtonText}>Start Sharing →</Text>
|
|
56
|
-
</TouchableOpacity>
|
|
57
|
-
</View>
|
|
58
|
-
<View style={styles.whatsappIconContainer}>
|
|
59
|
-
<View style={styles.whatsappIcon}>
|
|
60
|
-
<Text style={styles.whatsappText}>📱</Text>
|
|
61
|
-
</View>
|
|
29
|
+
<ScrollView style={styles.scrollView}>
|
|
30
|
+
{/* WhatsApp Banner */}
|
|
31
|
+
<View style={styles.banner}>
|
|
32
|
+
<View style={styles.bannerContent}>
|
|
33
|
+
<Text style={styles.bannerText}>
|
|
34
|
+
Build strong relationships,{'\n'}
|
|
35
|
+
improve relations & productivity{'\n'}
|
|
36
|
+
by having conversations on{'\n'}
|
|
37
|
+
WhatsAppppppppp.
|
|
38
|
+
</Text>
|
|
39
|
+
<TouchableOpacity style={styles.startButton}>
|
|
40
|
+
<Text style={styles.startButtonText}>Start Sharing →</Text>
|
|
41
|
+
</TouchableOpacity>
|
|
42
|
+
</View>
|
|
43
|
+
<View style={styles.whatsappIconContainer}>
|
|
44
|
+
<View style={styles.whatsappIcon}>
|
|
45
|
+
<Text style={styles.whatsappText}>📱</Text>
|
|
62
46
|
</View>
|
|
63
47
|
</View>
|
|
48
|
+
</View>
|
|
64
49
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
50
|
+
{/* Carousel Indicators */}
|
|
51
|
+
<View style={styles.carouselIndicators}>
|
|
52
|
+
<View style={[styles.indicator, styles.activeIndicator]} />
|
|
53
|
+
<View style={styles.indicator} />
|
|
54
|
+
<View style={styles.indicator} />
|
|
55
|
+
</View>
|
|
71
56
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
*/}
|
|
78
|
-
<MenuItem title="Social Setup" icon="📢" />
|
|
79
|
-
<MenuItem title="Microsite Setup" icon="⚙️" />
|
|
80
|
-
<MenuItem title="Proposal" icon="📋" />
|
|
57
|
+
{/* Menu Grid */}
|
|
58
|
+
<View style={styles.menuGrid}>
|
|
59
|
+
<MenuItem title="Content Library" icon="📚" />
|
|
60
|
+
<MenuItem title="Buy Now" icon="🛒" />
|
|
61
|
+
<MenuItem title="Quiz & Calculator" icon="🧮" />
|
|
81
62
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
63
|
+
<MenuItem title="Social Setup" icon="📢" />
|
|
64
|
+
<MenuItem title="Microsite Setup" icon="⚙️" />
|
|
65
|
+
<MenuItem title="Proposal" icon="📋" />
|
|
85
66
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
67
|
+
<MenuItem title="Email Campaign" icon="📧" />
|
|
68
|
+
<MenuItem title="View Microsite" icon="🎵" />
|
|
69
|
+
<MenuItem title="Import Contact" icon="📄" />
|
|
70
|
+
|
|
71
|
+
<MenuItem title="Poster Of The Week" icon="🖼️" />
|
|
72
|
+
<MenuItem title="DigiCard" icon="👤" />
|
|
73
|
+
<MenuItem title="Help Videos" icon="❓" />
|
|
74
|
+
</View>
|
|
75
|
+
</ScrollView>
|
|
92
76
|
);
|
|
93
77
|
}
|
|
94
78
|
|
|
95
79
|
const styles = StyleSheet.create({
|
|
96
|
-
container: {
|
|
97
|
-
flex: 1,
|
|
98
|
-
backgroundColor: '#fff',
|
|
99
|
-
},
|
|
100
|
-
header: {
|
|
101
|
-
flexDirection: 'row',
|
|
102
|
-
alignItems: 'center',
|
|
103
|
-
justifyContent: 'space-between',
|
|
104
|
-
padding: 16,
|
|
105
|
-
backgroundColor: '#fff',
|
|
106
|
-
borderBottomWidth: 1,
|
|
107
|
-
borderBottomColor: '#e0e0e0',
|
|
108
|
-
},
|
|
109
|
-
menuButton: {
|
|
110
|
-
padding: 4,
|
|
111
|
-
},
|
|
112
|
-
menuIcon: {
|
|
113
|
-
fontSize: 24,
|
|
114
|
-
color: '#333',
|
|
115
|
-
},
|
|
116
|
-
headerTitle: {
|
|
117
|
-
fontSize: 18,
|
|
118
|
-
fontWeight: '600',
|
|
119
|
-
color: '#333',
|
|
120
|
-
},
|
|
121
|
-
logo: {
|
|
122
|
-
width: 40,
|
|
123
|
-
height: 40,
|
|
124
|
-
borderRadius: 20,
|
|
125
|
-
},
|
|
126
80
|
scrollView: {
|
|
127
81
|
flex: 1,
|
|
128
82
|
},
|