@dhiraj0720/report1chart 2.7.7 → 2.7.9

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.7.7",
3
+ "version": "2.7.9",
4
4
  "main": "src/index.jsx",
5
5
  "scripts": {
6
6
  "test": "echo 'No tests'"
@@ -8,7 +8,7 @@ const SvgBarLineChartCompact3A = ({ data }) => {
8
8
  if (!data?.series || !data.labels?.length) return null;
9
9
 
10
10
  const height = 280;
11
- const paddingLeft = 80;
11
+ const paddingLeft = 20;
12
12
  const paddingRight = 30;
13
13
  const paddingTop = 30;
14
14
  const paddingBottom = 70;
@@ -72,7 +72,7 @@ const SvgBarLineChartCompact3A = ({ data }) => {
72
72
  y={textY}
73
73
  fontSize="10"
74
74
  textAnchor="middle"
75
- fill="black"
75
+ fill="white"
76
76
  transform={`rotate(-90 ${textX} ${textY})`}
77
77
  fontWeight="700"
78
78
  >
@@ -88,8 +88,8 @@ const SvgBarLineChartCompact3A = ({ data }) => {
88
88
  y={y(val2025) + h2025 / 2 + 5}
89
89
  fontSize="10"
90
90
  textAnchor="middle"
91
- fill="red"
92
- transform="rotate(-90 40 160)"
91
+ fill="white"
92
+ transform={`rotate(-90 ${centerX + barGap / 2 + barWidth / 2} ${y(val2025) + h2025 / 2 + 5})`}
93
93
  fontWeight="700"
94
94
  >
95
95
  {formatNumber(val2025)}
@@ -1,5 +1,12 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { ScrollView, Text, ActivityIndicator } from 'react-native';
2
+ import {
3
+ ScrollView,
4
+ Text,
5
+ TouchableOpacity,
6
+ View,
7
+ ActivityIndicator,
8
+ StyleSheet,
9
+ } from 'react-native';
3
10
  import fetchReport1 from '../api/report1Fetcher';
4
11
  import Report1Card from '../components/Report1Card';
5
12
 
@@ -8,23 +15,71 @@ const Report1Screen = ({ endpoint, token, onBack }) => {
8
15
 
9
16
  useEffect(() => {
10
17
  fetchReport1(endpoint, token).then(setRows);
11
- }, []);
18
+ }, [endpoint, token]);
12
19
 
13
- if (!rows) return <ActivityIndicator />;
20
+ if (!rows) {
21
+ return (
22
+ <View style={styles.loadingContainer}>
23
+ <ActivityIndicator size="large" color="#000" />
24
+ </View>
25
+ );
26
+ }
14
27
 
15
28
  return (
29
+ <View style={styles.container}>
30
+ {/* HEADER WITH BACK ICON */}
31
+ <View style={styles.header}>
32
+ <TouchableOpacity onPress={onBack}>
33
+ <Text style={styles.backIcon}>←</Text>
34
+ </TouchableOpacity>
35
+ <Text style={styles.headerTitle}>PERFORMANS RAPORU (USD)</Text>
36
+ </View>
16
37
 
17
- <ScrollView style={{ padding: 16 }}>
18
- <Text onPress={onBack} style={{ marginBottom: 12 }}>‹ Back</Text>
19
- <Text style={{ fontSize: 18, fontWeight: '700', marginBottom: 12 }}>
20
- PERFORMANS RAPORU (USD)
21
- </Text>
22
-
23
- {rows.map((r, i) => (
24
- <Report1Card key={i} item={r} />
25
- ))}
26
- </ScrollView>
38
+ <ScrollView style={styles.content}>
39
+ {rows.map((r, i) => (
40
+ <Report1Card key={i} item={r} />
41
+ ))}
42
+ </ScrollView>
43
+ </View>
27
44
  );
28
45
  };
29
46
 
30
- export default Report1Screen;
47
+ const styles = StyleSheet.create({
48
+ container: {
49
+ flex: 1,
50
+ backgroundColor: '#f8f9fa',
51
+ },
52
+ loadingContainer: {
53
+ flex: 1,
54
+ justifyContent: 'center',
55
+ alignItems: 'center',
56
+ backgroundColor: '#f8f9fa',
57
+ },
58
+ header: {
59
+ flexDirection: 'row',
60
+ alignItems: 'center',
61
+ paddingHorizontal: 16,
62
+ paddingVertical: 18,
63
+ backgroundColor: '#fff',
64
+ borderBottomWidth: 1,
65
+ borderColor: '#eee',
66
+ },
67
+ backIcon: {
68
+ fontSize: 28,
69
+ color: '#000',
70
+ fontWeight: '300',
71
+ },
72
+ headerTitle: {
73
+ fontSize: 19,
74
+ fontWeight: '700',
75
+ color: '#000',
76
+ flex: 1,
77
+ textAlign: 'center',
78
+ },
79
+ content: {
80
+ flex: 1,
81
+ padding: 16,
82
+ },
83
+ });
84
+
85
+ export default Report1Screen;
@@ -8,35 +8,38 @@ import {
8
8
  } from 'react-native';
9
9
 
10
10
  const REPORTS = [
11
- {
12
- id: 1,
13
- title: 'Report 1',
14
- desc: 'Performans Raporu (USD)',
15
- },
11
+
16
12
  {
17
13
  id: '1A',
18
- title: 'Report 1 A',
19
- desc: 'Tablo Bazlı Performans (Detaylı)',
14
+ title: 'Performans Raporu (USD)',
15
+ desc: 'Option 1',
20
16
  },
21
17
  {
22
- id: 2,
23
- title: 'Report 2',
24
- desc: 'Gross Profit by Company & Division',
18
+ id: 1,
19
+ title: 'Performans Raporu (USD)',
20
+ desc: 'Option 2',
25
21
  },
22
+
26
23
  {
27
24
  id: '2A',
28
- title: 'Report 2 A',
29
- desc: 'Compact / Alternate View',
25
+ title: 'Gross Profit by Company & Division',
26
+ desc: 'Option 1',
30
27
  },
31
28
  {
32
- id: 3,
33
- title: 'Report 3',
34
- desc: 'Transportation Business Analysis',
29
+ id: 2,
30
+ title: 'Gross Profit by Company & Division',
31
+ desc: 'Option 2',
35
32
  },
33
+
36
34
  {
37
35
  id: '3A',
38
- title: 'Report 3 A',
39
- desc: 'Monthly & Budget Comparison',
36
+ title: 'Transportation Business Analysis',
37
+ desc: 'Option 1',
38
+ },
39
+ {
40
+ id: 3,
41
+ title: 'Transportation Business Analysis',
42
+ desc: 'Option 2',
40
43
  },
41
44
  ];
42
45