import React, {useState} from 'react'; import {View, StyleSheet, ViewStyle, Text} from 'react-native'; import Icon from './icon'; import {$Colors} from './style'; export type PriceTagProps = { discount: number; style?: ViewStyle; }; const PriceTag: React.FC = ({discount, style}) => { return ( {discount > 100 ? 99 : discount}折 ); }; export default PriceTag; const styles = StyleSheet.create({ wrapper: { height: 18, width: 45, position: 'relative', }, discount: { fontSize: 12, paddingLeft: 10, lineHeight: 18, textAlign: 'center', color: $Colors.third, zIndex: 1, }, tag: { fontSize: 18, position: 'absolute', color: '#FFF2EC', left: 0, top: 0, zIndex: 0, }, });