@dhiraj0720/report1chart 2.3.2 → 2.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhiraj0720/report1chart",
3
- "version": "2.3.2",
3
+ "version": "2.5.0",
4
4
  "main": "src/index.jsx",
5
5
  "scripts": {
6
6
  "test": "echo 'No tests'"
@@ -23,7 +23,7 @@ const styles = StyleSheet.create({
23
23
  },
24
24
  container: {
25
25
  flex: 1,
26
- paddingBottom: Platform.OS === 'android' ? 24 : 0,
27
- paddingTop: Platform.OS === 'android' ? 24 : 0,
26
+ paddingBottom: Platform.OS === 'android' ? 50 : 0,
27
+ paddingTop: Platform.OS === 'android' ? 30 : 0,
28
28
  },
29
29
  });
package/src/index.jsx CHANGED
@@ -6,7 +6,7 @@ import Report1Screen from './screens/Report1Screen';
6
6
  import Report2Screen from './screens/Report2Screen';
7
7
  import Report3Screen from './screens/Report3Screen';
8
8
 
9
- const AnalyticsReports = ({ config }) => {
9
+ const AnalyticsReports = ({ config, onExit }) => {
10
10
  const [active, setActive] = useState(null);
11
11
  const [loading, setLoading] = useState(true);
12
12
 
@@ -38,7 +38,7 @@ const AnalyticsReports = ({ config }) => {
38
38
  if (!active) {
39
39
  return (
40
40
  <SafeScreen>
41
- <ReportListScreen onSelect={setActive} />
41
+ <ReportListScreen onSelect={setActive} onExit={onExit}/>
42
42
  </SafeScreen>
43
43
  );
44
44
  }
@@ -1,15 +1,102 @@
1
1
  import React from 'react';
2
- import { View } from 'react-native';
3
- import ReportCard from '../components/ReportCard';
2
+ import {
3
+ View,
4
+ Text,
5
+ TouchableOpacity,
6
+ StyleSheet,
7
+ } from 'react-native';
4
8
 
5
- const ReportListScreen = ({ onSelect }) => {
9
+ const ReportListScreen = ({ onSelect, onExit }) => {
6
10
  return (
7
- <View style={{ padding: 16 }}>
8
- <ReportCard title="Report 1" onPress={() => onSelect(1)} />
9
- <ReportCard title="Report 2" onPress={() => onSelect(2)} />
10
- <ReportCard title="Report 3" onPress={() => onSelect(3)} />
11
+ <View style={styles.container}>
12
+ {/* HEADER */}
13
+ <View style={styles.header}>
14
+ <TouchableOpacity onPress={onExit}>
15
+ <Text style={styles.back}>‹</Text>
16
+ </TouchableOpacity>
17
+ <Text style={styles.title}>Analytics Reports</Text>
18
+ <View style={{ width: 24 }} />
19
+ </View>
20
+
21
+ {/* CARDS */}
22
+ <TouchableOpacity
23
+ style={styles.card}
24
+ onPress={() => onSelect(1)}
25
+ >
26
+ <Text style={styles.cardTitle}>Report 1</Text>
27
+ <Text style={styles.cardDesc}>
28
+ Performans Raporu (USD)
29
+ </Text>
30
+ </TouchableOpacity>
31
+
32
+ <TouchableOpacity
33
+ style={styles.card}
34
+ onPress={() => onSelect(2)}
35
+ >
36
+ <Text style={styles.cardTitle}>Report 2</Text>
37
+ <Text style={styles.cardDesc}>
38
+ Gross Profit by Company & Division
39
+ </Text>
40
+ </TouchableOpacity>
41
+
42
+ <TouchableOpacity
43
+ style={styles.card}
44
+ onPress={() => onSelect(3)}
45
+ >
46
+ <Text style={styles.cardTitle}>Report 3</Text>
47
+ <Text style={styles.cardDesc}>
48
+ Transportation Business Analysis
49
+ </Text>
50
+ </TouchableOpacity>
11
51
  </View>
12
52
  );
13
53
  };
14
54
 
15
55
  export default ReportListScreen;
56
+
57
+ const styles = StyleSheet.create({
58
+ container: {
59
+ padding: 16,
60
+ flex: 1,
61
+ backgroundColor: '#f4f6f8',
62
+ },
63
+
64
+ header: {
65
+ flexDirection: 'row',
66
+ alignItems: 'center',
67
+ marginBottom: 20,
68
+ },
69
+
70
+ back: {
71
+ fontSize: 26,
72
+ fontWeight: '700',
73
+ },
74
+
75
+ title: {
76
+ flex: 1,
77
+ textAlign: 'center',
78
+ fontSize: 18,
79
+ fontWeight: '700',
80
+ },
81
+
82
+ card: {
83
+ backgroundColor: '#fff',
84
+ padding: 18,
85
+ borderRadius: 14,
86
+ marginBottom: 14,
87
+ borderWidth: 1,
88
+ borderColor: '#e0e0e0',
89
+ elevation: 2,
90
+ },
91
+
92
+ cardTitle: {
93
+ fontSize: 16,
94
+ fontWeight: '700',
95
+ marginBottom: 6,
96
+ },
97
+
98
+ cardDesc: {
99
+ fontSize: 13,
100
+ color: '#555',
101
+ },
102
+ });