|
@@ -1,204 +1,10 @@
|
|
|
-// import React, { useState } from 'react';
|
|
|
|
|
-
|
|
|
|
|
-// import {
|
|
|
|
|
-// Text,
|
|
|
|
|
-// Alert,
|
|
|
|
|
-// SafeAreaView,
|
|
|
|
|
-// TouchableOpacity,
|
|
|
|
|
-// View,
|
|
|
|
|
-// TextInput
|
|
|
|
|
-// } from 'react-native';
|
|
|
|
|
-// import { useAuth } from '../../context/AuthProvider';
|
|
|
|
|
-
|
|
|
|
|
-// export default function login() {
|
|
|
|
|
-// const [username, setUsername] = useState('');
|
|
|
|
|
-// const [password, setPassword] = useState('');
|
|
|
|
|
-
|
|
|
|
|
-// const { login } = useAuth();
|
|
|
|
|
-
|
|
|
|
|
-// const _login = (username: string, password: string) => {
|
|
|
|
|
-// if (username === '' || password === '')
|
|
|
|
|
-// Alert.alert('Error', 'Please enter a username and password');
|
|
|
|
|
-// else login(username, password);
|
|
|
|
|
-// };
|
|
|
|
|
-
|
|
|
|
|
-// return (
|
|
|
|
|
-// <SafeAreaView style={{ flex: 1, flexDirection: 'column' }}>
|
|
|
|
|
-// <View
|
|
|
|
|
-// style={{
|
|
|
|
|
-// flex: 1,
|
|
|
|
|
-// flexDirection: 'column',
|
|
|
|
|
-// justifyContent: 'center',
|
|
|
|
|
-// paddingHorizontal: 4
|
|
|
|
|
-// }}
|
|
|
|
|
-// >
|
|
|
|
|
-// <Text style={{ fontSize: 20, marginBottom: 2 }}>Log in</Text>
|
|
|
|
|
-// <Text style={{ marginBottom: 2, opacity: 70 }}>
|
|
|
|
|
-// Any username and password is a valid login.
|
|
|
|
|
-// </Text>
|
|
|
|
|
-// <View>
|
|
|
|
|
-// <Text style={{ fontSize: 20, marginBottom: 2 }}>
|
|
|
|
|
-// Username
|
|
|
|
|
-// </Text>
|
|
|
|
|
-// <TextInput
|
|
|
|
|
-// placeholder="username"
|
|
|
|
|
-// style={{
|
|
|
|
|
-// borderWidth: 1,
|
|
|
|
|
-// borderColor: 'gray',
|
|
|
|
|
-// padding: 3
|
|
|
|
|
-// }}
|
|
|
|
|
-// value={username}
|
|
|
|
|
-// onChangeText={setUsername}
|
|
|
|
|
-// />
|
|
|
|
|
-// </View>
|
|
|
|
|
-// <View>
|
|
|
|
|
-// <Text style={{ fontSize: 20, marginBottom: 2 }}>
|
|
|
|
|
-// Password
|
|
|
|
|
-// </Text>
|
|
|
|
|
-// <TextInput
|
|
|
|
|
-// placeholder="password"
|
|
|
|
|
-// style={{
|
|
|
|
|
-// borderWidth: 1,
|
|
|
|
|
-// borderColor: 'gray',
|
|
|
|
|
-// padding: 3
|
|
|
|
|
-// }}
|
|
|
|
|
-// value={password}
|
|
|
|
|
-// onChangeText={setPassword}
|
|
|
|
|
-// />
|
|
|
|
|
-// </View>
|
|
|
|
|
-// <Button
|
|
|
|
|
-// style={{ marginTop: 20 }}
|
|
|
|
|
-// title="Log in"
|
|
|
|
|
-// onPress={() => _login(username, password)}
|
|
|
|
|
-// />
|
|
|
|
|
-// </View>
|
|
|
|
|
-// </SafeAreaView>
|
|
|
|
|
-// );
|
|
|
|
|
-// }
|
|
|
|
|
-
|
|
|
|
|
-// const Button = ({
|
|
|
|
|
-// title,
|
|
|
|
|
-// onPress,
|
|
|
|
|
-// style
|
|
|
|
|
-// }: {
|
|
|
|
|
-// title: string;
|
|
|
|
|
-// onPress: () => void;
|
|
|
|
|
-// style?: any;
|
|
|
|
|
-// }) => {
|
|
|
|
|
-// return (
|
|
|
|
|
-// <TouchableOpacity onPress={onPress} style={[style]}>
|
|
|
|
|
-// <Text>{title}</Text>
|
|
|
|
|
-// </TouchableOpacity>
|
|
|
|
|
-// );
|
|
|
|
|
-// };
|
|
|
|
|
-
|
|
|
|
|
-// --------------------------------
|
|
|
|
|
-
|
|
|
|
|
-import React, { useState } from 'react';
|
|
|
|
|
-import {
|
|
|
|
|
- Text,
|
|
|
|
|
- Alert,
|
|
|
|
|
- SafeAreaView,
|
|
|
|
|
- TouchableOpacity,
|
|
|
|
|
- View,
|
|
|
|
|
- TextInput
|
|
|
|
|
-} from 'react-native';
|
|
|
|
|
-import { useAuth } from '../../context/AuthProvider';
|
|
|
|
|
-
|
|
|
|
|
-import LoginForm from '../../component/registrationMultiStepForm/formComponent/formPages/loginPage';
|
|
|
|
|
|
|
+import { View } from 'react-native';
|
|
|
import MultiStepForm from '../../component/registrationMultiStepForm/multi_step_form';
|
|
import MultiStepForm from '../../component/registrationMultiStepForm/multi_step_form';
|
|
|
|
|
+
|
|
|
export default function LoginPage() {
|
|
export default function LoginPage() {
|
|
|
- const { login } = useAuth();
|
|
|
|
|
return (
|
|
return (
|
|
|
<View className="flex-1">
|
|
<View className="flex-1">
|
|
|
<MultiStepForm />
|
|
<MultiStepForm />
|
|
|
</View>
|
|
</View>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-// export default function LoginPage() {
|
|
|
|
|
-// const [username, setUsername] = useState('');
|
|
|
|
|
-// const [password, setPassword] = useState('');
|
|
|
|
|
- // const { login } = useAuth();
|
|
|
|
|
-
|
|
|
|
|
- // const _login = async (username: string, password: string) => {
|
|
|
|
|
- // if (username === '' || password === '') {
|
|
|
|
|
- // Alert.alert('Error', 'Please enter a username and password');
|
|
|
|
|
- // } else {
|
|
|
|
|
- // const success = await login(username, password);
|
|
|
|
|
- // if (!success) {
|
|
|
|
|
- // Alert.alert('Error', 'Invalid username or password');
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- // };
|
|
|
|
|
-
|
|
|
|
|
-// return (
|
|
|
|
|
-// <SafeAreaView style={{ flex: 1, flexDirection: 'column' }}>
|
|
|
|
|
-// <View
|
|
|
|
|
-// style={{
|
|
|
|
|
-// flex: 1,
|
|
|
|
|
-// flexDirection: 'column',
|
|
|
|
|
-// justifyContent: 'center',
|
|
|
|
|
-// paddingHorizontal: 4
|
|
|
|
|
-// }}
|
|
|
|
|
-// >
|
|
|
|
|
-// <Text style={{ fontSize: 20, marginBottom: 2 }}>Log in</Text>
|
|
|
|
|
-// <Text style={{ marginBottom: 2, opacity: 70 }}>
|
|
|
|
|
-// Any username and password is a valid login.
|
|
|
|
|
-// </Text>
|
|
|
|
|
-// <View>
|
|
|
|
|
-// <Text style={{ fontSize: 20, marginBottom: 2 }}>
|
|
|
|
|
-// Username
|
|
|
|
|
-// </Text>
|
|
|
|
|
-// <TextInput
|
|
|
|
|
-// placeholder="username"
|
|
|
|
|
-// style={{
|
|
|
|
|
-// borderWidth: 1,
|
|
|
|
|
-// borderColor: 'gray',
|
|
|
|
|
-// padding: 3
|
|
|
|
|
-// }}
|
|
|
|
|
-// value={username}
|
|
|
|
|
-// onChangeText={setUsername}
|
|
|
|
|
-// />
|
|
|
|
|
-// </View>
|
|
|
|
|
-// <View>
|
|
|
|
|
-// <Text style={{ fontSize: 20, marginBottom: 2 }}>
|
|
|
|
|
-// Password
|
|
|
|
|
-// </Text>
|
|
|
|
|
-// <TextInput
|
|
|
|
|
-// placeholder="password"
|
|
|
|
|
-// secureTextEntry
|
|
|
|
|
-// style={{
|
|
|
|
|
-// borderWidth: 1,
|
|
|
|
|
-// borderColor: 'gray',
|
|
|
|
|
-// padding: 3
|
|
|
|
|
-// }}
|
|
|
|
|
-// value={password}
|
|
|
|
|
-// onChangeText={setPassword}
|
|
|
|
|
-// />
|
|
|
|
|
-// </View>
|
|
|
|
|
-// <Button
|
|
|
|
|
-// style={{ marginTop: 20 }}
|
|
|
|
|
-// title="Log in"
|
|
|
|
|
-// onPress={() => _login(username, password)}
|
|
|
|
|
-// />
|
|
|
|
|
-// </View>
|
|
|
|
|
-// </SafeAreaView>
|
|
|
|
|
-// );
|
|
|
|
|
-// }
|
|
|
|
|
-
|
|
|
|
|
-// const Button = ({
|
|
|
|
|
-// title,
|
|
|
|
|
-// onPress,
|
|
|
|
|
-// style
|
|
|
|
|
-// }: {
|
|
|
|
|
-// title: string;
|
|
|
|
|
-// onPress: () => void;
|
|
|
|
|
-// style?: any;
|
|
|
|
|
-// }) => {
|
|
|
|
|
-// return (
|
|
|
|
|
-// <TouchableOpacity onPress={onPress} style={[style]}>
|
|
|
|
|
-// <Text>{title}</Text>
|
|
|
|
|
-// </TouchableOpacity>
|
|
|
|
|
-// );
|
|
|
|
|
-// };
|
|
|