@dhiraj0720/report1chart 2.3.0 → 2.3.2

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.0",
3
+ "version": "2.3.2",
4
4
  "main": "src/index.jsx",
5
5
  "scripts": {
6
6
  "test": "echo 'No tests'"
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import {
3
+ SafeAreaView,
4
+ View,
5
+ StyleSheet,
6
+ Platform,
7
+ } from 'react-native';
8
+
9
+ const SafeScreen = ({ children }) => {
10
+ return (
11
+ <SafeAreaView style={styles.safe}>
12
+ <View style={styles.container}>{children}</View>
13
+ </SafeAreaView>
14
+ );
15
+ };
16
+
17
+ export default SafeScreen;
18
+
19
+ const styles = StyleSheet.create({
20
+ safe: {
21
+ flex: 1,
22
+ backgroundColor: '#fff',
23
+ },
24
+ container: {
25
+ flex: 1,
26
+ paddingBottom: Platform.OS === 'android' ? 24 : 0,
27
+ paddingTop: Platform.OS === 'android' ? 24 : 0,
28
+ },
29
+ });
@@ -70,7 +70,7 @@ const SvgBarLineChart = ({ data }) => {
70
70
  x={x}
71
71
  y={yPos(data.series[0].data[i])}
72
72
  width={barWidth}
73
- height={scaleY(dat.series[0].data[i])}
73
+ height={scaleY(data.series[0].data[i])}
74
74
  fill="#E07A3F"
75
75
  onPress={() =>
76
76
  setActivePoint({
package/src/index.jsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { View, ActivityIndicator } from 'react-native';
3
-
3
+ import SafeScreen from './components/SafeScreen';
4
4
  import ReportListScreen from './screens/ReportListScreen';
5
5
  import Report1Screen from './screens/Report1Screen';
6
6
  import Report2Screen from './screens/Report2Screen';
@@ -36,39 +36,50 @@ const AnalyticsReports = ({ config }) => {
36
36
 
37
37
  // 👉 AFTER LOADER → SHOW REPORT LIST
38
38
  if (!active) {
39
- return <ReportListScreen onSelect={setActive} />;
40
- }
39
+ return (
40
+ <SafeScreen>
41
+ <ReportListScreen onSelect={setActive} />
42
+ </SafeScreen>
43
+ );
44
+ }
45
+
41
46
 
42
47
  // 👉 REPORT 1
43
48
  if (active === 1) {
44
49
  return (
50
+ <SafeScreen>
45
51
  <Report1Screen
46
52
  endpoint={config.report1.url}
47
53
  token={config.token}
48
54
  onBack={() => setActive(null)}
49
55
  />
56
+ </SafeScreen>
50
57
  );
51
58
  }
52
59
 
53
60
  // 👉 REPORT 2
54
61
  if (active === 2) {
55
62
  return (
63
+ <SafeScreen>
56
64
  <Report2Screen
57
65
  api={config.report2}
58
66
  token={config.token}
59
67
  onBack={() => setActive(null)}
60
68
  />
69
+ </SafeScreen>
61
70
  );
62
71
  }
63
72
 
64
73
  // 👉 REPORT 3
65
74
  if (active === 3) {
66
75
  return (
76
+ <SafeScreen>
67
77
  <Report3Screen
68
78
  api={config.report3}
69
79
  token={config.token}
70
80
  onBack={() => setActive(null)}
71
81
  />
82
+ </SafeScreen>
72
83
  );
73
84
  }
74
85
 
@@ -13,6 +13,7 @@ const Report1Screen = ({ endpoint, token, onBack }) => {
13
13
  if (!rows) return <ActivityIndicator />;
14
14
 
15
15
  return (
16
+
16
17
  <ScrollView style={{ padding: 16 }}>
17
18
  <Text onPress={onBack} style={{ marginBottom: 12 }}>‹ Back</Text>
18
19
  <Text style={{ fontSize: 18, fontWeight: '700', marginBottom: 12 }}>
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { ScrollView, Text, ActivityIndicator } from 'react-native';
3
-
3
+ import SafeScreen from '../components/SafeScreen';
4
4
  import { getDivisions, getTable, getLine, getBar } from '../api/report2Fetcher';
5
5
  import MonthSelector from '../components/MonthSelector';
6
6
  import DivisionSelector from '../components/DivisionSelector';
@@ -91,6 +91,7 @@ const filteredBar = filterChartByMonth(bar, month);
91
91
 
92
92
 
93
93
  </ScrollView>
94
+
94
95
  );
95
96
  };
96
97
 
@@ -53,6 +53,7 @@ const filteredBar = filterChartByMonth(bar, month);
53
53
 
54
54
 
55
55
  return (
56
+
56
57
  <ScrollView style={{ padding: 16 }}>
57
58
  <Text onPress={onBack}>‹ Back</Text>
58
59
 
@@ -71,6 +72,7 @@ const filteredBar = filterChartByMonth(bar, month);
71
72
  <SvgLineChart data={filteredLine} />
72
73
  <SvgBarLineChart data={filteredBar} />
73
74
  </ScrollView>
75
+
74
76
  );
75
77
  };
76
78