@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.
@@ -10,8 +10,10 @@ import {
10
10
  TextInput,
11
11
  } from 'react-native';
12
12
  import { useColorScheme } from 'nativewind';
13
- import { useNavigation } from '@react-navigation/native';
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.eyJzdWIiOiIxIiwiZXhwIjoxOTQxNzEwNzI5LCJ0aWQiOiJka2t3Ynd1ZyIsImNsdCI6IldFQiIsInNjb3BlIjoiQ09NUEFOWSIsImNvbXBhbnlfaWQiOjIsInJlZ2lvbl9pZCI6MSwic3RhZmZfaWQiOjF9.hPQC0_-uFfHU253gvJi-eJD1HnM8fGWA0lG3IRVs09I',
90
+ authToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIzMCIsImV4cCI6MTk0MjU4Mzg1MywidGlkIjoibDFlZGw5ZzUiLCJjbHQiOiJXRUIiLCJzY29wZSI6IkNPTVBBTlkiLCJjb21wYW55X2lkIjoyLCJyZWdpb25faWQiOjEsInN0YWZmX2lkIjo2fQ.mJl5x59-EHA5PjrbOF-5XTZ9U5NipWKU5_fCFrs0Kc0',
89
91
  companyId: '2',
90
92
  regionId: '1',
91
- staffId: '1',
92
- userId: '1',
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 = useNavigation<any>();
344
+ const navigation = React.useContext(NavigationContext) as any;
343
345
 
344
346
  const handleNavigateReporting = useCallback(() => {
345
347
  setVisible(false);
346
348
  try {
347
- navigation.navigate('ReportingList');
349
+ if (navigationRef.isReady()) {
350
+ navigationRef.navigate('ReportingList');
351
+ } else {
352
+ navigation?.navigate?.('ReportingList');
353
+ }
348
354
  } catch (e) {
349
- console.error('Navigation error:', e);
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: 12,
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">
@@ -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',