-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
76 lines (72 loc) · 1.68 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React, {useState} from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
Dimensions
} from 'react-native';
import {
Header,
LearnMoreLinks,
Colors,
DebugInstructions,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
import Graph from './components/graph';
import Cards from './components/Cards';
const App = () => {
const [initialInvestment, setInitialInvestment] = useState(10000);
const [timeHorizon, setTimeHorizon] = useState(5);
const [monthlyContribution, setMonthlyContribution] = useState(250);
const [chartData, setchartData] = useState([]);
const [loading, setLoading] = useState(false);
return (
<>
<View style={styles.appContainer}>
<View style={styles.graph}>
<Graph
forecastData={chartData}
loading={loading}
timeHorizon={timeHorizon}
initialInvestment={initialInvestment}
monthlyContribution={monthlyContribution}
/>
</View>
<View style={styles.panel}>
<Cards
setInitial={setInitialInvestment}
setTime={setTimeHorizon}
setMonthlyContribution={setMonthlyContribution}
setchartData={setchartData}
setLoading={setLoading}
/>
</View>
</View>
</>
);
};
const styles = StyleSheet.create({
appContainer: {
justifyContent: 'center',
flex:1,
// flexWrap: "wrap"
},
graph: {
flex: 1.9,
},
panel: {
flex: 1,
// paddingBottom:10
},
});
export default App;