|
| 1 | +import React, { ReactElement, memo } from 'react'; |
| 2 | +import { useTranslation } from 'react-i18next'; |
| 3 | +import { Image, StyleSheet, View } from 'react-native'; |
| 4 | + |
| 5 | +import BottomSheetNavigationHeader from '../../components/BottomSheetNavigationHeader'; |
| 6 | +import GradientView from '../../components/GradientView'; |
| 7 | +import SafeAreaInset from '../../components/SafeAreaInset'; |
| 8 | +import Button from '../../components/buttons/Button'; |
| 9 | +import { useSheetRef } from '../../sheets/SheetRefsProvider'; |
| 10 | +import { BodyM } from '../../styles/text'; |
| 11 | + |
| 12 | +const imageSrc = require('../../assets/illustrations/exclamation-mark.png'); |
| 13 | + |
| 14 | +const UsedUp = (): ReactElement => { |
| 15 | + const { t } = useTranslation('other'); |
| 16 | + const sheetRef = useSheetRef('gift'); |
| 17 | + |
| 18 | + const onContinue = (): void => { |
| 19 | + sheetRef.current?.close(); |
| 20 | + }; |
| 21 | + |
| 22 | + return ( |
| 23 | + <GradientView style={styles.root}> |
| 24 | + <BottomSheetNavigationHeader |
| 25 | + title={t('gift.used_up.title')} |
| 26 | + showBackButton={false} |
| 27 | + /> |
| 28 | + |
| 29 | + <View style={styles.content}> |
| 30 | + <BodyM color="secondary">{t('gift.used_up.text')}</BodyM> |
| 31 | + |
| 32 | + <View style={styles.imageContainer}> |
| 33 | + <Image style={styles.image} source={imageSrc} /> |
| 34 | + </View> |
| 35 | + |
| 36 | + <View style={styles.buttonContainer}> |
| 37 | + <Button |
| 38 | + style={styles.button} |
| 39 | + size="large" |
| 40 | + text={t('ok')} |
| 41 | + onPress={onContinue} |
| 42 | + /> |
| 43 | + </View> |
| 44 | + </View> |
| 45 | + <SafeAreaInset type="bottom" minPadding={16} /> |
| 46 | + </GradientView> |
| 47 | + ); |
| 48 | +}; |
| 49 | + |
| 50 | +const styles = StyleSheet.create({ |
| 51 | + root: { |
| 52 | + flex: 1, |
| 53 | + }, |
| 54 | + content: { |
| 55 | + flex: 1, |
| 56 | + paddingHorizontal: 16, |
| 57 | + }, |
| 58 | + imageContainer: { |
| 59 | + flexShrink: 1, |
| 60 | + justifyContent: 'center', |
| 61 | + alignItems: 'center', |
| 62 | + alignSelf: 'center', |
| 63 | + width: 256, |
| 64 | + aspectRatio: 1, |
| 65 | + marginTop: 'auto', |
| 66 | + }, |
| 67 | + image: { |
| 68 | + flex: 1, |
| 69 | + resizeMode: 'contain', |
| 70 | + }, |
| 71 | + buttonContainer: { |
| 72 | + flexDirection: 'row', |
| 73 | + justifyContent: 'center', |
| 74 | + marginTop: 'auto', |
| 75 | + gap: 16, |
| 76 | + }, |
| 77 | + button: { |
| 78 | + flex: 1, |
| 79 | + }, |
| 80 | +}); |
| 81 | + |
| 82 | +export default memo(UsedUp); |
0 commit comments