PliWould/components/Price.tsx

38 lines
795 B
TypeScript
Raw Normal View History

2024-07-01 17:05:24 +02:00
import { StyleSheet, Text, View } from "react-native";
2024-07-01 04:49:41 +02:00
export type PriceDisplayProps = {
price: number,
currency?: {
symbol: string,
}
}
export default function PriceDisplay({ price }: PriceDisplayProps) {
return (
2024-07-01 17:05:24 +02:00
<View style={styles.bigPriceWrapper} aria-label="calculated price">
2024-07-01 04:49:41 +02:00
<Text style={styles.bigPrice}>$ {price.toLocaleString(
undefined, {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}
)}</Text>
</View>
);
}
export const styles = StyleSheet.create({
bigPriceWrapper: {
alignContent: "center",
},
bigPrice: {
alignSelf: "center",
fontSize: 40,
marginTop: 50,
marginBottom: 50,
2024-07-01 04:49:41 +02:00
}
});