2026-07-02 14:34:19 +05:30

33 lines
1.2 KiB
TypeScript

import React, { useState } from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { CustomInput, PrimaryButton } from '@components';
import { useAppTheme } from '@theme';
import { useNavigation } from '@react-navigation/native';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { AuthStackParamList } from '@navigation/navigationTypes';
import { RouteNames } from '@utils/constants';
export const OtpScreen: React.FC<{ route: any }> = ({ route: _route }) => {
const { colors } = useAppTheme();
const navigation = useNavigation<NativeStackNavigationProp<AuthStackParamList>>();
const [otp, setOtp] = useState('');
const handleVerify = () => {
navigation.navigate(RouteNames.SetLocation);
};
return (
<View style={[styles.container, { backgroundColor: colors.background }]}
>
<Text style={styles.title}>Enter OTP</Text>
<CustomInput label="OTP" value={otp} onChangeText={setOtp} keyboardType="numeric" />
<PrimaryButton title="Verify" onPress={handleVerify} />
</View>
);
};
const styles = StyleSheet.create({
container: { flex: 1, justifyContent: 'center', padding: 20 },
title: { fontSize: 24, marginBottom: 20, textAlign: 'center' },
});
export default OtpScreen;