39 lines
833 B
TypeScript
39 lines
833 B
TypeScript
import { StyleSheet, Text } from "react-native";
|
|
import { View } from "react-native-reanimated/lib/typescript/Animated";
|
|
|
|
export type PriceDisplayProps = {
|
|
price: number,
|
|
currency?: {
|
|
symbol: string,
|
|
}
|
|
}
|
|
|
|
export default function PriceDisplay({ price }: PriceDisplayProps) {
|
|
|
|
|
|
|
|
return (
|
|
<View style={styles.bigPriceWrapper}>
|
|
<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: 100,
|
|
marginBottom: 100,
|
|
}
|
|
}); |