@suflon/rnmd-reporting 0.0.3 → 0.0.5
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/App.tsx +2 -2
- package/index.js +3 -0
- package/metro.config.js +31 -0
- package/package.json +4 -3
- package/patches/@suflon+native-ui+0.0.18.patch +1715 -4257
- package/src/index.ts +1 -0
- package/src/modules/ManagementReport/components/AnalyticsChartView.tsx +530 -0
- package/src/modules/ManagementReport/components/CategoryTabs.tsx +85 -0
- package/src/modules/ManagementReport/components/DetailsListingView.tsx +781 -0
- package/src/modules/ManagementReport/components/DoctorFilterDropdown.tsx +157 -0
- package/src/modules/ManagementReport/components/KpiMetricsGrid.tsx +183 -0
- package/src/modules/ManagementReport/components/ManagementFilterModal.tsx +142 -0
- package/src/modules/ManagementReport/components/ManagementReportHeader.tsx +115 -0
- package/src/modules/ManagementReport/components/SubModuleTabs.tsx +58 -0
- package/src/modules/ManagementReport/components/TimeframeDropdown.tsx +162 -0
- package/src/modules/ManagementReport/components/ViewModeSwitcher.tsx +71 -0
- package/src/modules/ManagementReport/index.tsx +202 -0
- package/src/modules/Reporting/component/ReportChart.tsx +1 -1
- package/src/modules/Reporting/component/ReportFilterModal.tsx +1 -1
- package/src/modules/Reporting/component/ReportingDetail.tsx +86 -98
- package/src/modules/Reporting/index.tsx +72 -79
- package/src/navigation/index.tsx +17 -6
- package/src/screens/DevToolsCorner.tsx +43 -8
- package/tailwind.config.js +11 -0
|
@@ -10,8 +10,10 @@ import {
|
|
|
10
10
|
TextInput,
|
|
11
11
|
} from 'react-native';
|
|
12
12
|
import { useColorScheme } from 'nativewind';
|
|
13
|
-
import {
|
|
13
|
+
import { createNavigationContainerRef, NavigationContext } from '@react-navigation/native';
|
|
14
14
|
import { useAuthStore, getData, saveData, removeData } from '@suflon/native-ui';
|
|
15
|
+
|
|
16
|
+
export const navigationRef = createNavigationContainerRef<any>();
|
|
15
17
|
import { useConnectionI18n } from '@/context/ConnectionI18nContext';
|
|
16
18
|
import { useLanguageStore } from '@/stores/language.store';
|
|
17
19
|
|
|
@@ -85,11 +87,11 @@ const DEV_STRINGS: Record<LanguageCode, Record<string, string>> = {
|
|
|
85
87
|
|
|
86
88
|
// Default dev values
|
|
87
89
|
const DEFAULT_VALUES = {
|
|
88
|
-
authToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
90
|
+
authToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIzMCIsImV4cCI6MTk0MjU4Mzg1MywidGlkIjoibDFlZGw5ZzUiLCJjbHQiOiJXRUIiLCJzY29wZSI6IkNPTVBBTlkiLCJjb21wYW55X2lkIjoyLCJyZWdpb25faWQiOjEsInN0YWZmX2lkIjo2fQ.mJl5x59-EHA5PjrbOF-5XTZ9U5NipWKU5_fCFrs0Kc0',
|
|
89
91
|
companyId: '2',
|
|
90
92
|
regionId: '1',
|
|
91
|
-
staffId: '
|
|
92
|
-
userId: '
|
|
93
|
+
staffId: '6',
|
|
94
|
+
userId: '30',
|
|
93
95
|
apiBaseUrl: 'https://api-local.woctor.com',
|
|
94
96
|
permissionKey: 'clinic_owner'
|
|
95
97
|
};
|
|
@@ -339,14 +341,31 @@ export function DevToolsCorner() {
|
|
|
339
341
|
const { language, controlledByHost } = useConnectionI18n();
|
|
340
342
|
const setLanguageFromStore = useLanguageStore((s) => s.setLanguage);
|
|
341
343
|
|
|
342
|
-
const navigation =
|
|
344
|
+
const navigation = React.useContext(NavigationContext) as any;
|
|
343
345
|
|
|
344
346
|
const handleNavigateReporting = useCallback(() => {
|
|
345
347
|
setVisible(false);
|
|
346
348
|
try {
|
|
347
|
-
|
|
349
|
+
if (navigationRef.isReady()) {
|
|
350
|
+
navigationRef.navigate('ReportingList');
|
|
351
|
+
} else {
|
|
352
|
+
navigation?.navigate?.('ReportingList');
|
|
353
|
+
}
|
|
348
354
|
} catch (e) {
|
|
349
|
-
console.
|
|
355
|
+
console.log('Navigation error:', e);
|
|
356
|
+
}
|
|
357
|
+
}, [navigation]);
|
|
358
|
+
|
|
359
|
+
const handleNavigateManagementReport = useCallback(() => {
|
|
360
|
+
setVisible(false);
|
|
361
|
+
try {
|
|
362
|
+
if (navigationRef.isReady()) {
|
|
363
|
+
navigationRef.navigate('ManagementReport');
|
|
364
|
+
} else {
|
|
365
|
+
navigation?.navigate?.('ManagementReport');
|
|
366
|
+
}
|
|
367
|
+
} catch (e) {
|
|
368
|
+
console.log('Navigation error:', e);
|
|
350
369
|
}
|
|
351
370
|
}, [navigation]);
|
|
352
371
|
|
|
@@ -570,7 +589,7 @@ export function DevToolsCorner() {
|
|
|
570
589
|
paddingHorizontal: 16,
|
|
571
590
|
borderRadius: 10,
|
|
572
591
|
alignItems: 'center',
|
|
573
|
-
marginBottom:
|
|
592
|
+
marginBottom: 8,
|
|
574
593
|
}}
|
|
575
594
|
>
|
|
576
595
|
<Text style={{ color: '#ffffff', fontWeight: 'bold', fontSize: 14 }}>
|
|
@@ -578,6 +597,22 @@ export function DevToolsCorner() {
|
|
|
578
597
|
</Text>
|
|
579
598
|
</TouchableOpacity>
|
|
580
599
|
|
|
600
|
+
<TouchableOpacity
|
|
601
|
+
onPress={handleNavigateManagementReport}
|
|
602
|
+
style={{
|
|
603
|
+
backgroundColor: '#2563eb',
|
|
604
|
+
paddingVertical: 12,
|
|
605
|
+
paddingHorizontal: 16,
|
|
606
|
+
borderRadius: 10,
|
|
607
|
+
alignItems: 'center',
|
|
608
|
+
marginBottom: 12,
|
|
609
|
+
}}
|
|
610
|
+
>
|
|
611
|
+
<Text style={{ color: '#ffffff', fontWeight: 'bold', fontSize: 14 }}>
|
|
612
|
+
📑 Open Management Report Screen
|
|
613
|
+
</Text>
|
|
614
|
+
</TouchableOpacity>
|
|
615
|
+
|
|
581
616
|
<View style={styles.row}>
|
|
582
617
|
<Text style={{ color: isDark ? '#FFFFFF' : '#111827', fontWeight: '700' }}>Theme ({colorScheme})</Text>
|
|
583
618
|
<View className="flex-row gap-2">
|
package/tailwind.config.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @type {import('tailwindcss').Config} */
|
|
2
2
|
module.exports = {
|
|
3
|
+
darkMode: 'class',
|
|
3
4
|
content: [
|
|
4
5
|
'./src/**/*.{js,jsx,ts,tsx}',
|
|
5
6
|
'./App.{js,jsx,ts,tsx}',
|
|
@@ -9,6 +10,16 @@ module.exports = {
|
|
|
9
10
|
theme: {
|
|
10
11
|
extend: {
|
|
11
12
|
colors: {
|
|
13
|
+
borders: {
|
|
14
|
+
light: {
|
|
15
|
+
light: '#e2e8f0',
|
|
16
|
+
dark: '#38373a',
|
|
17
|
+
},
|
|
18
|
+
dark: {
|
|
19
|
+
light: '#334155',
|
|
20
|
+
dark: '#1e293b',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
12
23
|
brand: {
|
|
13
24
|
50: '#f5f3ff',
|
|
14
25
|
100: '#ede9fe',
|