couponPageComponent.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { View, Text, Pressable, Dimensions, StyleSheet } from 'react-native';
  2. import { SafeAreaView } from 'react-native-safe-area-context';
  3. import { router } from 'expo-router';
  4. import { CrossLogoSvg } from '../global/SVG';
  5. import CouponTabViewComponent from '../global/couponTabView';
  6. import DisplayedOnlyCouponTabView from '../global/displayedOnlyCouponTabView';
  7. import { useTranslation } from '../../util/hooks/useTranslation';
  8. const CouponPageComponent = () => {
  9. const { t } = useTranslation(); // 使用翻译钩子
  10. const screenHeight = Dimensions.get('window').height;
  11. return (
  12. <SafeAreaView className="flex-1 bg-white" edges={['top', 'right', 'left']}>
  13. <View style={{ minHeight: screenHeight, flex: 1 }}>
  14. <View className="mx-[5%]" style={{ marginTop: 25 }}>
  15. <Pressable
  16. onPress={() => {
  17. if (router.canGoBack()) {
  18. router.back();
  19. } else {
  20. router.replace('/optionPage');
  21. }
  22. }}
  23. >
  24. <CrossLogoSvg />
  25. </Pressable>
  26. <Text style={{ fontSize: 45, marginVertical: 25 }}>{t('wallet.coupons.title')}</Text>
  27. </View>
  28. <View className="flex-1">
  29. <DisplayedOnlyCouponTabView titles={[t('wallet.coupons.available'), t('wallet.coupons.used_expired')]} />
  30. </View>
  31. </View>
  32. </SafeAreaView>
  33. );
  34. };
  35. const styles = StyleSheet.create({
  36. floatingButton: {
  37. elevation: 5,
  38. shadowColor: '#000',
  39. shadowOffset: { width: 0, height: 2 },
  40. shadowOpacity: 0.25,
  41. shadowRadius: 3.84
  42. }
  43. });
  44. export default CouponPageComponent;