everything refactored

This commit is contained in:
Walcher 2024-01-02 14:38:47 +01:00
parent 0240eb2562
commit 62e71d1b49
10 changed files with 407 additions and 50 deletions

View file

@ -0,0 +1,38 @@
import React from 'react';
import { Text, StyleSheet } from 'react-native';
import { useTheme } from '../../app/contexts/ThemeContext';
interface BudgetRemainingProps {
budget: number;
spent: number;
}
const BudgetRemaining: React.FC<BudgetRemainingProps> = ({ budget, spent }) => {
const { colors, theme } = useTheme();
const remaining = budget - spent;
const styles = StyleSheet.create({
container: {
margin: 10,
borderRadius: 5,
alignItems: 'center',
justifyContent: 'center',
},
text: {
fontSize: 26,
color: colors.primaryText,
},
boldText: {
fontWeight: 'bold',
},
});
return (
<Text style={styles.text}>
You have <Text style={styles.boldText}>{remaining.toFixed(2)}</Text> left.
</Text>
);
};
export default BudgetRemaining;