Skip to content

Commit f021db1

Browse files
GBOYEEroot
andauthored
feat(mobile): add wallet creation success screen (#77) (#479)
Co-authored-by: root <root@vmi3321457.contaboserver.net>
1 parent c340f85 commit f021db1

3 files changed

Lines changed: 64 additions & 5 deletions

File tree

app/(auth)/_layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default function AuthLayout() {
1818
<Stack.Screen name="index" options={{ headerShown: false }} />
1919
<Stack.Screen name="create" options={{ title: 'Create Wallet' }} />
2020
<Stack.Screen name="import" options={{ title: 'Import Wallet' }} />
21+
<Stack.Screen name="wallet-creation-success" options={{ title: 'Wallet Created', headerBackVisible: false }} />
2122
</Stack>
2223
);
2324
}

app/(auth)/create.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export default function CreateWalletScreen() {
2323
const { setWallet, markBackupPending } = useWalletStore();
2424
const [keypair, setKeypair] = useState<{ publicKey: string; secretKey: string } | null>(null);
2525
const [isLoading, setIsLoading] = useState(false);
26-
const [isSuccess, setIsSuccess] = useState(false);
2726

2827
// Recovery states
2928
const [onboardingError, setOnboardingError] = useState<OnboardingError | null>(null);
@@ -67,16 +66,13 @@ export default function CreateWalletScreen() {
6766
return;
6867
}
6968
await markBackupPending();
70-
setIsSuccess(true);
69+
router.replace('/(auth)/wallet-creation-success');
7170
}
7271
}
7372
]
7473
);
7574
};
7675

77-
const handleGoToWallet = () => {
78-
router.replace('/(tabs)');
79-
};
8076

8177
const handleRetry = () => {
8278
resetErrors();
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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

Comments
 (0)