|
| 1 | +import React, { useMemo } from 'react'; |
| 2 | +import { View, Text, StyleSheet } from 'react-native'; |
| 3 | +import { useRouter } from 'expo-router'; |
| 4 | +import { AsyncActionButton } from '../../src/components/AsyncActionButton'; |
| 5 | +import { SIZES, ThemeColors } from '../../src/constants/theme'; |
| 6 | +import { useTheme } from '../../src/hooks/useTheme'; |
| 7 | +import { CheckCircle } from 'lucide-react-native'; |
| 8 | + |
| 9 | +export default function WalletCreationSuccessScreen() { |
| 10 | + const router = useRouter(); |
| 11 | + const { colors } = useTheme(); |
| 12 | + const styles = useMemo(() => createStyles(colors), [colors]); |
| 13 | + |
| 14 | + const handleGoToWallet = () => { |
| 15 | + router.replace('/(tabs)'); |
| 16 | + }; |
| 17 | + |
| 18 | + return ( |
| 19 | + <View style={styles.container}> |
| 20 | + <View style={styles.content}> |
| 21 | + <View style={styles.successIcon}> |
| 22 | + <CheckCircle color={colors.success} size={64} /> |
| 23 | + </View> |
| 24 | + <Text style={styles.title}>Wallet Created!</Text> |
| 25 | + <Text style={styles.subtitle}> |
| 26 | + Your Testnet wallet is ready. Fund it with the Friendbot on the home screen to start sending test XLM. |
| 27 | + </Text> |
| 28 | + </View> |
| 29 | + <AsyncActionButton title="Go to Wallet" onPress={handleGoToWallet} /> |
| 30 | + </View> |
| 31 | + ); |
| 32 | +} |
| 33 | + |
| 34 | +const createStyles = (colors: ThemeColors) => |
| 35 | + StyleSheet.create({ |
| 36 | + container: { |
| 37 | + flex: 1, |
| 38 | + backgroundColor: colors.background, |
| 39 | + padding: SIZES.xl, |
| 40 | + justifyContent: 'space-between', |
| 41 | + paddingBottom: SIZES.xxl, |
| 42 | + }, |
| 43 | + content: { |
| 44 | + flex: 1, |
| 45 | + justifyContent: 'center', |
| 46 | + }, |
| 47 | + successIcon: { |
| 48 | + alignItems: 'center', |
| 49 | + marginBottom: SIZES.lg, |
| 50 | + }, |
| 51 | + title: { |
| 52 | + fontSize: 28, |
| 53 | + fontWeight: 'bold', |
| 54 | + color: colors.textPrimary, |
| 55 | + marginBottom: SIZES.sm, |
| 56 | + }, |
| 57 | + subtitle: { |
| 58 | + fontSize: 16, |
| 59 | + color: colors.textSecondary, |
| 60 | + lineHeight: 24, |
| 61 | + }, |
| 62 | + }); |
0 commit comments