react-native-salespanda 0.2.0 → 0.4.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/Salespanda.podspec +4 -0
- package/android/build.gradle +2 -0
- package/lib/module/SalespandaApp.js +70 -0
- package/lib/module/SalespandaApp.js.map +1 -0
- package/lib/module/assets/images/bottomtabs/analytics.png +0 -0
- package/lib/module/assets/images/bottomtabs/analyticsactive.png +0 -0
- package/lib/module/assets/images/bottomtabs/crm.png +0 -0
- package/lib/module/assets/images/bottomtabs/crmactive.png +0 -0
- package/lib/module/assets/images/bottomtabs/diary.png +0 -0
- package/lib/module/assets/images/bottomtabs/diaryactive.png +0 -0
- package/lib/module/assets/images/bottomtabs/home.png +0 -0
- package/lib/module/assets/images/bottomtabs/homeactive.png +0 -0
- package/lib/module/assets/images/bottomtabs/notification.png +0 -0
- package/lib/module/assets/images/bottomtabs/notificationactive.png +0 -0
- package/lib/module/assets/images/index.js +35 -0
- package/lib/module/assets/images/index.js.map +1 -0
- package/lib/module/config/SalespandaConfig.js +68 -0
- package/lib/module/config/SalespandaConfig.js.map +1 -0
- package/lib/module/constants/Colors.js +17 -0
- package/lib/module/constants/Colors.js.map +1 -0
- package/lib/module/constants/GetPlatorm.js +23 -0
- package/lib/module/constants/GetPlatorm.js.map +1 -0
- package/lib/module/index.js +28 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigation/AppNavigator.js +11 -2
- package/lib/module/navigation/AppNavigator.js.map +1 -1
- package/lib/module/navigation/BottomTabNavigator.js +100 -73
- package/lib/module/navigation/BottomTabNavigator.js.map +1 -1
- package/lib/module/navigation/DrawerNavigator.js +214 -127
- package/lib/module/navigation/DrawerNavigator.js.map +1 -1
- package/lib/module/screens/CRMScreen.js +41 -0
- package/lib/module/screens/CRMScreen.js.map +1 -0
- package/lib/module/screens/HomeScreen.js +123 -170
- package/lib/module/screens/HomeScreen.js.map +1 -1
- package/lib/module/screens/NotificationsScreen.js +11 -97
- package/lib/module/screens/NotificationsScreen.js.map +1 -1
- package/lib/module/screens/ProfileScreen.js +13 -119
- package/lib/module/screens/ProfileScreen.js.map +1 -1
- package/lib/module/screens/ReportsScreen.js +11 -187
- package/lib/module/screens/ReportsScreen.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/assets/images/index.d.ts +17 -0
- package/lib/typescript/src/assets/images/index.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/constants/Colors.d.ts +15 -0
- package/lib/typescript/src/constants/Colors.d.ts.map +1 -0
- package/lib/typescript/src/constants/GetPlatorm.d.ts +11 -0
- package/lib/typescript/src/constants/GetPlatorm.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +18 -2
- 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/CRMScreen.d.ts +2 -0
- package/lib/typescript/src/screens/CRMScreen.d.ts.map +1 -0
- package/lib/typescript/src/screens/HomeScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/NotificationsScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/ReportsScreen.d.ts +1 -1
- package/lib/typescript/src/screens/ReportsScreen.d.ts.map +1 -1
- package/package.json +20 -11
- package/react-native.config.js +9 -0
- package/src/SalespandaApp.tsx +112 -0
- 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 +11 -0
- package/src/assets/images/index.ts +40 -0
- package/src/config/SalespandaConfig.ts +105 -0
- package/src/constants/Colors.ts +16 -0
- package/src/constants/GetPlatorm.ts +29 -0
- package/src/index.tsx +35 -7
- package/src/navigation/AppNavigator.tsx +9 -2
- package/src/navigation/BottomTabNavigator.tsx +110 -51
- package/src/navigation/DrawerNavigator.tsx +179 -126
- package/src/screens/CRMScreen.tsx +34 -0
- package/src/screens/HomeScreen.tsx +110 -143
- package/src/screens/NotificationsScreen.tsx +9 -110
- package/src/screens/ProfileScreen.tsx +10 -97
- package/src/screens/ReportsScreen.tsx +9 -166
- package/lib/module/screens/PremiumScreen.js +0 -222
- package/lib/module/screens/PremiumScreen.js.map +0 -1
- package/lib/typescript/src/screens/PremiumScreen.d.ts +0 -2
- package/lib/typescript/src/screens/PremiumScreen.d.ts.map +0 -1
- package/src/screens/PremiumScreen.tsx +0 -250
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsScreen.d.ts","sourceRoot":"","sources":["../../../../src/screens/NotificationsScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NotificationsScreen.d.ts","sourceRoot":"","sources":["../../../../src/screens/NotificationsScreen.tsx"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,mBAAmB,4CAS1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileScreen.d.ts","sourceRoot":"","sources":["../../../../src/screens/ProfileScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProfileScreen.d.ts","sourceRoot":"","sources":["../../../../src/screens/ProfileScreen.tsx"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,aAAa,4CASpC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default function
|
|
1
|
+
export default function NotificationsScreen(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=ReportsScreen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsScreen.d.ts","sourceRoot":"","sources":["../../../../src/screens/ReportsScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReportsScreen.d.ts","sourceRoot":"","sources":["../../../../src/screens/ReportsScreen.tsx"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,mBAAmB,4CAS1C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-salespanda",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "sdk",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"registry": "https://registry.npmjs.org/"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
+
"@babel/core": "^7.28.5",
|
|
62
63
|
"@commitlint/config-conventional": "^19.8.1",
|
|
63
64
|
"@eslint/compat": "^1.3.2",
|
|
64
65
|
"@eslint/eslintrc": "^3.3.1",
|
|
@@ -67,9 +68,15 @@
|
|
|
67
68
|
"@react-native-community/cli": "20.0.1",
|
|
68
69
|
"@react-native/babel-preset": "0.81.1",
|
|
69
70
|
"@react-native/eslint-config": "^0.81.1",
|
|
71
|
+
"@react-native/metro-babel-transformer": "0.81.1",
|
|
72
|
+
"@react-native/metro-config": "0.81.1",
|
|
73
|
+
"@react-navigation/bottom-tabs": "^7.8.2",
|
|
74
|
+
"@react-navigation/drawer": "^7.7.2",
|
|
75
|
+
"@react-navigation/native": "^7.1.19",
|
|
70
76
|
"@release-it/conventional-changelog": "^10.0.1",
|
|
71
77
|
"@types/jest": "^29.5.14",
|
|
72
78
|
"@types/react": "^19.1.0",
|
|
79
|
+
"babel-plugin-module-resolver": "^5.0.2",
|
|
73
80
|
"commitlint": "^19.8.1",
|
|
74
81
|
"del-cli": "^6.0.0",
|
|
75
82
|
"eslint": "^9.35.0",
|
|
@@ -80,13 +87,24 @@
|
|
|
80
87
|
"react": "19.1.0",
|
|
81
88
|
"react-native": "0.81.1",
|
|
82
89
|
"react-native-builder-bob": "^0.40.13",
|
|
90
|
+
"react-native-gesture-handler": "^2.29.1",
|
|
91
|
+
"react-native-reanimated": "^3.15.4",
|
|
92
|
+
"react-native-safe-area-context": "^5.6.2",
|
|
93
|
+
"react-native-screens": "^4.18.0",
|
|
83
94
|
"release-it": "^19.0.4",
|
|
84
95
|
"turbo": "^2.5.6",
|
|
85
96
|
"typescript": "^5.9.2"
|
|
86
97
|
},
|
|
87
98
|
"peerDependencies": {
|
|
99
|
+
"@react-navigation/bottom-tabs": ">=6.0.0",
|
|
100
|
+
"@react-navigation/drawer": ">=6.0.0",
|
|
101
|
+
"@react-navigation/native": ">=6.0.0",
|
|
88
102
|
"react": "*",
|
|
89
|
-
"react-native": "*"
|
|
103
|
+
"react-native": "*",
|
|
104
|
+
"react-native-gesture-handler": ">=2.0.0",
|
|
105
|
+
"react-native-reanimated": ">=3.0.0",
|
|
106
|
+
"react-native-safe-area-context": ">=4.0.0",
|
|
107
|
+
"react-native-screens": ">=3.0.0"
|
|
90
108
|
},
|
|
91
109
|
"workspaces": [
|
|
92
110
|
"example"
|
|
@@ -160,14 +178,5 @@
|
|
|
160
178
|
"languages": "kotlin-objc",
|
|
161
179
|
"type": "turbo-module",
|
|
162
180
|
"version": "0.54.8"
|
|
163
|
-
},
|
|
164
|
-
"dependencies": {
|
|
165
|
-
"@react-navigation/bottom-tabs": "^7.8.2",
|
|
166
|
-
"@react-navigation/drawer": "^7.7.2",
|
|
167
|
-
"@react-navigation/native": "^7.1.19",
|
|
168
|
-
"react-native-gesture-handler": "^2.29.1",
|
|
169
|
-
"react-native-reanimated": "^4.1.3",
|
|
170
|
-
"react-native-safe-area-context": "^5.6.2",
|
|
171
|
-
"react-native-screens": "^4.18.0"
|
|
172
181
|
}
|
|
173
182
|
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavigationContainer, DefaultTheme } from '@react-navigation/native';
|
|
3
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
4
|
+
import DrawerNavigator from './navigation/DrawerNavigator';
|
|
5
|
+
import BottomTabNavigator from './navigation/BottomTabNavigator';
|
|
6
|
+
import {
|
|
7
|
+
SafeAreaProvider,
|
|
8
|
+
initialWindowMetrics,
|
|
9
|
+
} from 'react-native-safe-area-context';
|
|
10
|
+
import { Colors } from './constants/Colors';
|
|
11
|
+
|
|
12
|
+
export interface SalespandaAppProps {
|
|
13
|
+
/**
|
|
14
|
+
* Custom navigation container ref for external navigation control
|
|
15
|
+
*/
|
|
16
|
+
navigationRef?: React.RefObject<any>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Optional theme configuration
|
|
20
|
+
*/
|
|
21
|
+
theme?: {
|
|
22
|
+
primaryColor?: string;
|
|
23
|
+
backgroundColor?: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* If true, the app will not render NavigationContainer
|
|
28
|
+
* (useful when embedding in an existing navigation structure)
|
|
29
|
+
*/
|
|
30
|
+
standalone?: boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Callback when app is ready
|
|
34
|
+
*/
|
|
35
|
+
onReady?: () => void;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* If true, uses drawer navigation (default), otherwise uses bottom tabs only
|
|
39
|
+
*/
|
|
40
|
+
useDrawer?: boolean;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* If false, will not wrap with GestureHandlerRootView
|
|
44
|
+
* Set to false if your app already has gesture handler imported at the entry point
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
47
|
+
wrapWithGestureHandler?: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Main Salespanda App Component
|
|
52
|
+
* Can be used as a standalone app or embedded in another React Native app
|
|
53
|
+
*/
|
|
54
|
+
export default function SalespandaApp({
|
|
55
|
+
navigationRef,
|
|
56
|
+
theme: customTheme,
|
|
57
|
+
standalone = false,
|
|
58
|
+
onReady,
|
|
59
|
+
useDrawer = true,
|
|
60
|
+
wrapWithGestureHandler = false,
|
|
61
|
+
}: SalespandaAppProps = {}) {
|
|
62
|
+
// TODO: Apply theme to app (future enhancement)
|
|
63
|
+
// Currently theme is managed through SalespandaConfig
|
|
64
|
+
void customTheme;
|
|
65
|
+
|
|
66
|
+
// Use drawer navigation by default, or bottom tabs only if specified
|
|
67
|
+
const AppContent = () =>
|
|
68
|
+
useDrawer ? <DrawerNavigator /> : <BottomTabNavigator />;
|
|
69
|
+
|
|
70
|
+
// If standalone mode, don't wrap with NavigationContainer
|
|
71
|
+
// (parent app will provide it)
|
|
72
|
+
if (standalone) {
|
|
73
|
+
return <AppContent />;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Navigation content with SafeAreaProvider
|
|
77
|
+
const navTheme = {
|
|
78
|
+
...DefaultTheme,
|
|
79
|
+
colors: {
|
|
80
|
+
...DefaultTheme.colors,
|
|
81
|
+
background: Colors.background,
|
|
82
|
+
primary: Colors.primary,
|
|
83
|
+
card: Colors.white,
|
|
84
|
+
text: Colors.black,
|
|
85
|
+
border: Colors.border,
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const NavigationContent = (
|
|
90
|
+
<SafeAreaProvider initialMetrics={initialWindowMetrics}>
|
|
91
|
+
<NavigationContainer
|
|
92
|
+
ref={navigationRef}
|
|
93
|
+
onReady={onReady}
|
|
94
|
+
theme={navTheme}
|
|
95
|
+
>
|
|
96
|
+
<AppContent />
|
|
97
|
+
</NavigationContainer>
|
|
98
|
+
</SafeAreaProvider>
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
// Wrap with GestureHandlerRootView only if requested
|
|
102
|
+
// (default is false since most apps already have gesture handler imported)
|
|
103
|
+
if (wrapWithGestureHandler) {
|
|
104
|
+
return (
|
|
105
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
106
|
+
{NavigationContent}
|
|
107
|
+
</GestureHandlerRootView>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return NavigationContent;
|
|
112
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Bottom Tab Icons
|
|
2
|
+
export const homeIcon = require('./bottomtabs/home.png');
|
|
3
|
+
export const homeIconActive = require('./bottomtabs/homeactive.png');
|
|
4
|
+
export const analyticsIcon = require('./bottomtabs/analytics.png');
|
|
5
|
+
export const analyticsIconActive = require('./bottomtabs/analyticsactive.png');
|
|
6
|
+
export const crmIcon = require('./bottomtabs/crm.png');
|
|
7
|
+
export const crmIconActive = require('./bottomtabs/crmactive.png');
|
|
8
|
+
export const diaryIcon = require('./bottomtabs/diary.png');
|
|
9
|
+
export const diaryIconActive = require('./bottomtabs/diaryactive.png');
|
|
10
|
+
export const notificationIcon = require('./bottomtabs/notification.png');
|
|
11
|
+
export const notificationIconActive = require('./bottomtabs/notificationactive.png');
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ImageSourcePropType } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const homeIcon: ImageSourcePropType = require('./bottomtabs/home.png');
|
|
4
|
+
export const homeIconActive: ImageSourcePropType = require('./bottomtabs/homeactive.png');
|
|
5
|
+
export const analyticsIcon: ImageSourcePropType = require('./bottomtabs/analytics.png');
|
|
6
|
+
export const analyticsIconActive: ImageSourcePropType = require('./bottomtabs/analyticsactive.png');
|
|
7
|
+
export const crmIcon: ImageSourcePropType = require('./bottomtabs/crm.png');
|
|
8
|
+
export const crmIconActive: ImageSourcePropType = require('./bottomtabs/crmactive.png');
|
|
9
|
+
export const diaryIcon: ImageSourcePropType = require('./bottomtabs/diary.png');
|
|
10
|
+
export const diaryIconActive: ImageSourcePropType = require('./bottomtabs/diaryactive.png');
|
|
11
|
+
export const notificationIcon: ImageSourcePropType = require('./bottomtabs/notification.png');
|
|
12
|
+
export const notificationIconActive: ImageSourcePropType = require('./bottomtabs/notificationactive.png');
|
|
13
|
+
|
|
14
|
+
export type IconPair = {
|
|
15
|
+
default: ImageSourcePropType;
|
|
16
|
+
active: ImageSourcePropType;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const bottomTabIcons: Record<string, IconPair> = {
|
|
20
|
+
home: {
|
|
21
|
+
default: homeIcon,
|
|
22
|
+
active: homeIconActive,
|
|
23
|
+
},
|
|
24
|
+
analytics: {
|
|
25
|
+
default: analyticsIcon,
|
|
26
|
+
active: analyticsIconActive,
|
|
27
|
+
},
|
|
28
|
+
crm: {
|
|
29
|
+
default: crmIcon,
|
|
30
|
+
active: crmIconActive,
|
|
31
|
+
},
|
|
32
|
+
diary: {
|
|
33
|
+
default: diaryIcon,
|
|
34
|
+
active: diaryIconActive,
|
|
35
|
+
},
|
|
36
|
+
notification: {
|
|
37
|
+
default: notificationIcon,
|
|
38
|
+
active: notificationIconActive,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const Colors = {
|
|
2
|
+
// Minimal palette as requested
|
|
3
|
+
primary: '#46bdd3',
|
|
4
|
+
white: '#ffffff',
|
|
5
|
+
black: '#322F2F',
|
|
6
|
+
background: '#ffffff',
|
|
7
|
+
border: '#e0e0e0',
|
|
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
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
export type ColorKey = keyof typeof Colors;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
CHANGED
|
@@ -1,17 +1,45 @@
|
|
|
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';
|
|
16
44
|
export { default as ReportsScreen } from './screens/ReportsScreen';
|
|
17
|
-
export { default as PremiumScreen } from './screens/
|
|
45
|
+
export { default as PremiumScreen } from './screens/CRMScreen';
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { NavigationContainer } from '@react-navigation/native';
|
|
2
|
-
import
|
|
2
|
+
import BottomTabNavigator from './BottomTabNavigator';
|
|
3
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
4
|
+
import { Colors } from '../constants/Colors';
|
|
3
5
|
|
|
4
6
|
export default function AppNavigator() {
|
|
5
7
|
return (
|
|
6
8
|
<NavigationContainer>
|
|
7
|
-
<
|
|
9
|
+
<SafeAreaView
|
|
10
|
+
style={{ flex: 1, backgroundColor: Colors.background }}
|
|
11
|
+
edges={['bottom', 'top']}
|
|
12
|
+
>
|
|
13
|
+
<BottomTabNavigator />
|
|
14
|
+
</SafeAreaView>
|
|
8
15
|
</NavigationContainer>
|
|
9
16
|
);
|
|
10
17
|
}
|