-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathExpensesOutput.js
More file actions
38 lines (32 loc) · 914 Bytes
/
ExpensesOutput.js
File metadata and controls
38 lines (32 loc) · 914 Bytes
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
import { StyleSheet, Text, View } from 'react-native';
import { GlobalStyles } from '../../constants/styles';
import ExpensesList from './ExpensesList';
import ExpensesSummary from './ExpensesSummary';
function ExpensesOutput({ expenses, expensesPeriod, fallbackText }) {
let content = <Text style={styles.infoText}>{fallbackText}</Text>;
if (expenses.length > 0) {
content = <ExpensesList expenses={expenses} />;
}
return (
<View style={styles.container}>
<ExpensesSummary expenses={expenses} periodName={expensesPeriod} />
{content}
</View>
);
}
export default ExpensesOutput;
const styles = StyleSheet.create({
container: {
flex: 1,
paddingHorizontal: 24,
paddingTop: 24,
paddingBottom: 0,
backgroundColor: GlobalStyles.colors.primary700,
},
infoText: {
color: 'white',
fontSize: 16,
textAlign: 'center',
marginTop: 32,
},
});