diff --git a/frontend/src/screens/AuthScreen.tsx b/frontend/src/screens/AuthScreen.tsx new file mode 100644 index 00000000..6cc23ae3 --- /dev/null +++ b/frontend/src/screens/AuthScreen.tsx @@ -0,0 +1,209 @@ +import React, { useState } from 'react'; +import { + View, + Text, + StyleSheet, + TouchableOpacity, + SafeAreaView, + TextInput, + ScrollView, + KeyboardAvoidingView, + Platform, +} from 'react-native'; +import { Ionicons } from '@expo/vector-icons'; + +export default function AuthScreen({ navigation }: any) { + const [isSignIn, setIsSignIn] = useState(true); + const [email, setEmail] = useState(''); + const [password, setPassword] = useState(''); + const [firstName, setFirstName] = useState(''); + const [lastName, setLastName] = useState(''); + const [phone, setPhone] = useState(''); + const [referralCode, setReferralCode] = useState(''); + + const handleAuth = () => { + // TODO: Backend integration + navigation.navigate('Home'); + }; + + return ( + + + + + {isSignIn ? 'Welcome Back' : 'Create Account'} + + {isSignIn ? 'Sign in to continue' : 'Join PezkuwiChain today'} + + + + + {!isSignIn && ( + <> + + + First Name * + + + + Last Name * + + + + + + Phone Number * + + + + )} + + + Email * + + + + + Password * + + + + {!isSignIn && ( + + Referral Code (Optional) + + + )} + + + + {isSignIn ? 'Sign In' : 'Create Account'} + + + + setIsSignIn(!isSignIn)} + > + + {isSignIn ? "Don't have an account? " : 'Already have an account? '} + {isSignIn ? 'Sign Up' : 'Sign In'} + + + + + + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + backgroundColor: '#F8F9FA', + }, + keyboardView: { + flex: 1, + }, + header: { + padding: 20, + paddingTop: 40, + backgroundColor: '#FFF', + borderBottomWidth: 1, + borderBottomColor: '#E5E7EB', + }, + title: { + fontSize: 28, + fontWeight: '700', + color: '#1F2937', + marginBottom: 4, + }, + subtitle: { + fontSize: 14, + color: '#6B7280', + }, + form: { + padding: 20, + }, + row: { + flexDirection: 'row', + }, + inputGroup: { + marginBottom: 16, + }, + label: { + fontSize: 14, + fontWeight: '600', + color: '#374151', + marginBottom: 8, + }, + input: { + backgroundColor: '#FFF', + padding: 12, + borderRadius: 8, + fontSize: 16, + borderWidth: 1, + borderColor: '#E5E7EB', + }, + authButton: { + backgroundColor: '#EE2A35', + padding: 16, + borderRadius: 12, + alignItems: 'center', + marginTop: 8, + }, + authButtonText: { + color: '#FFF', + fontSize: 16, + fontWeight: '600', + }, + switchButton: { + marginTop: 20, + alignItems: 'center', + }, + switchText: { + fontSize: 14, + color: '#6B7280', + }, + switchTextBold: { + color: '#EE2A35', + fontWeight: '600', + }, +}); diff --git a/frontend/src/screens/HumanVerificationScreen.tsx b/frontend/src/screens/HumanVerificationScreen.tsx new file mode 100644 index 00000000..20133f8e --- /dev/null +++ b/frontend/src/screens/HumanVerificationScreen.tsx @@ -0,0 +1,133 @@ +import React, { useState } from 'react'; +import { + View, + Text, + StyleSheet, + TouchableOpacity, + SafeAreaView, + TextInput, +} from 'react-native'; +import { Ionicons } from '@expo/vector-icons'; + +const CAPTCHA_QUESTION = { + question: 'What is 5 + 3?', + answer: '8', +}; + +export default function HumanVerificationScreen({ navigation }: any) { + const [answer, setAnswer] = useState(''); + const [error, setError] = useState(''); + + const handleVerify = () => { + if (answer.trim() === CAPTCHA_QUESTION.answer) { + navigation.navigate('Auth'); + } else { + setError('Incorrect answer. Please try again.'); + setAnswer(''); + } + }; + + return ( + + + + + + + Human Verification + Please answer this simple question to continue + + + {CAPTCHA_QUESTION.question} + + + + + {error ? {error} : null} + + + Verify + + + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + backgroundColor: '#F8F9FA', + }, + content: { + flex: 1, + padding: 20, + justifyContent: 'center', + }, + iconContainer: { + alignItems: 'center', + marginBottom: 30, + }, + title: { + fontSize: 24, + fontWeight: '700', + color: '#1F2937', + textAlign: 'center', + marginBottom: 8, + }, + subtitle: { + fontSize: 14, + color: '#6B7280', + textAlign: 'center', + marginBottom: 40, + }, + questionBox: { + backgroundColor: '#FFF', + padding: 24, + borderRadius: 12, + marginBottom: 20, + alignItems: 'center', + borderWidth: 2, + borderColor: '#00A651', + }, + question: { + fontSize: 20, + fontWeight: '600', + color: '#1F2937', + }, + input: { + backgroundColor: '#FFF', + padding: 16, + borderRadius: 12, + fontSize: 16, + borderWidth: 1, + borderColor: '#E5E7EB', + marginBottom: 12, + }, + error: { + color: '#EE2A35', + fontSize: 14, + marginBottom: 12, + textAlign: 'center', + }, + verifyButton: { + backgroundColor: '#00A651', + padding: 16, + borderRadius: 12, + alignItems: 'center', + }, + verifyText: { + color: '#FFF', + fontSize: 16, + fontWeight: '600', + }, +});