diff --git a/app/(auth)/login.tsx b/app/(auth)/login.tsx index 2eb9684..6c97ae2 100644 --- a/app/(auth)/login.tsx +++ b/app/(auth)/login.tsx @@ -12,13 +12,16 @@ import { ScrollView, StyleSheet, Text, + TouchableOpacity, View, } from 'react-native'; +import { Ionicons } from '@expo/vector-icons'; export default function LoginScreen() { const { checkEmail, requestOtp, isLoading, error, clearError } = useAuth(); const [email, setEmail] = useState(''); const [partnerCode, setPartnerCode] = useState(''); + const [showPartnerCode, setShowPartnerCode] = useState(false); const [validationError, setValidationError] = useState(null); // Clear errors on mount @@ -140,22 +143,33 @@ export default function LoginScreen() { returnKeyType="next" /> - { - // Only allow digits, max 6 - const digits = text.replace(/\D/g, '').slice(0, 6); - setPartnerCode(digits); - }} - keyboardType="number-pad" - maxLength={6} - editable={!isLoading} - onSubmitEditing={handleContinue} - returnKeyType="done" - /> + {/* Partner Code Toggle */} + {!showPartnerCode ? ( + setShowPartnerCode(true)} + > + + I have a partner code + + ) : ( + { + // Only allow digits, max 5 + const code = text.replace(/\D/g, '').slice(0, 5); + setPartnerCode(code); + }} + keyboardType="number-pad" + maxLength={5} + editable={!isLoading} + onSubmitEditing={handleContinue} + returnKeyType="done" + /> + )}