diff --git a/frontend/occupi-mobile4/screens/Login/CreatePassword.tsx b/frontend/occupi-mobile4/screens/Login/CreatePassword.tsx index 2b5d648f..e5f60595 100644 --- a/frontend/occupi-mobile4/screens/Login/CreatePassword.tsx +++ b/frontend/occupi-mobile4/screens/Login/CreatePassword.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useRef, useState, useEffect } from 'react'; import { VStack, Box, @@ -14,12 +14,14 @@ import { Input, useToast, Toast, + Icon, InputField, ToastTitle, FormControlHelper, FormControlError, FormControlErrorIcon, FormControlErrorText, + ChevronLeftIcon, InputIcon, InputSlot, ScrollView, @@ -28,15 +30,16 @@ import { } from '@gluestack-ui/themed'; import { AlertTriangle } from 'lucide-react-native'; import { LinearGradient } from 'expo-linear-gradient'; -import Logo from './assets/images/Occupi/file.png'; +import Logo from '../../screens/Login/assets/images/Occupi/Occupi-gradient.png'; import { useForm, Controller } from 'react-hook-form'; import { z } from 'zod'; -import { Keyboard } from 'react-native'; +import { Keyboard,StyleSheet, TextInput,Animated, Easing } from 'react-native'; import { zodResolver } from '@hookform/resolvers/zod'; import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen'; import GuestLayout from '../../layouts/GuestLayout'; import { router } from 'expo-router'; import { styled } from '@gluestack-style/react'; +import StyledExpoRouterLink from '../../components/StyledExpoRouterLink'; const StyledImage = styled(Image, { props: { @@ -165,14 +168,42 @@ export default function CreatePassword() { }); function ScreenText() { + const spinValue = useRef(new Animated.Value(0)).current; + + useEffect(() => { + Animated.loop( + Animated.timing(spinValue, { + toValue: 2, + duration: 10000, + easing: Easing.linear, + useNativeDriver: true, + }) + ).start(); + }, []); + + const spin = spinValue.interpolate({ + inputRange: [0, 1], + outputRange: ['0deg', '360deg'], + }); + return ( + + + + logo + - - - ); - } + return ( - { + Animated.loop( + Animated.timing(spinValue, { + toValue: 2, + duration: 10000, + easing: Easing.linear, + useNativeDriver: true, + }) + ).start(); + }, []); + + const spin = spinValue.interpolate({ + inputRange: [0, 1], + outputRange: ['0deg', '360deg'], + }); + return ( - + + logo + @@ -211,7 +230,7 @@ export default function ForgotPassword() { diff --git a/frontend/occupi-mobile4/screens/Login/OtpVerification.tsx b/frontend/occupi-mobile4/screens/Login/OtpVerification.tsx index 81181bd0..1c696210 100644 --- a/frontend/occupi-mobile4/screens/Login/OtpVerification.tsx +++ b/frontend/occupi-mobile4/screens/Login/OtpVerification.tsx @@ -1,12 +1,12 @@ import React, { useRef, useState, useEffect } from 'react'; -import { View, StyleSheet, TextInput } from 'react-native'; +import { View, StyleSheet, TextInput,Animated, Easing } from 'react-native'; import { VStack, Box, HStack, Image, Heading, Toast, useToast, ToastTitle, Text, } from '@gluestack-ui/themed'; // import { useForm } from 'react-hook-form'; import { z } from 'zod'; // import { zodResolver } from '@hookform/resolvers/zod'; import * as SecureStore from 'expo-secure-store'; import { useRouter, useLocalSearchParams } from 'expo-router'; -import Logo from './assets/images/Occupi/file.png'; +import Logo from '../../screens/Login/assets/images/Occupi/Occupi-gradient.png'; import StyledExpoRouterLink from '@/components/StyledExpoRouterLink'; import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen'; import { LinearGradient } from 'expo-linear-gradient'; @@ -21,7 +21,7 @@ type OTPSchemaType = z.infer; const OTPVerification = () => { const [email, setEmail] = useState(""); // const email = 'kamo@gmail.com'; - const [remainingTime, setRemainingTime] = useState(60); // 1 minute + const [remainingTime, setRemainingTime] = useState(10); // 1 minute const otpSent = useState(false); const timerRef = useRef(null); const [loading, setLoading] = useState(false); @@ -102,7 +102,10 @@ const OTPVerification = () => { locations={[0.02, 0.31, 0.67, 0.97]} start={[0, 1]} end={[1, 0]} - style={styles.buttonContainer} + style={{ + ...styles.buttonContainer, + marginTop: 16, + }} > {text} @@ -115,7 +118,7 @@ const OTPVerification = () => { bg="$backgroundLight0" sx={{ '@md': { - p: '$8', + p: '$5', }, '_dark': { bg: '$backgroundDark800', @@ -124,12 +127,16 @@ const OTPVerification = () => { py="$8" px="$4" flex={1} + mt="$4" + mb="$4" > - + - Entered OTP: {otp.join('')} - {remainingTime} seconds remaining + + Entered OTP: {otp.join('')} + {/* {remainingTime} minutes remaining */} + {loading ? ( { text="Verify" /> )} - @@ -150,11 +156,30 @@ const OTPVerification = () => { }; const MainText = (email) => { - // console.log("email",email.email); + const spinValue = useRef(new Animated.Value(0)).current; + + useEffect(() => { + Animated.loop( + Animated.timing(spinValue, { + toValue: 2, + duration: 10000, + easing: Easing.linear, + useNativeDriver: true, + }) + ).start(); + }, []); + + const spin = spinValue.interpolate({ + inputRange: [0, 1], + outputRange: ['0deg', '360deg'], + }); + return ( + occupi + { { fontSize={wp('5%')} fontWeight="$light" > - We have sent the OTP code to {email.email} + We have sent the OTP code to {email.email} @@ -196,14 +222,13 @@ function AccountLink() { mt: '$40', }, }} - mt="auto" - space="xs" + mt="$5" alignItems="center" justifyContent="center" > - + Login diff --git a/frontend/occupi-mobile4/screens/Login/SignIn.tsx b/frontend/occupi-mobile4/screens/Login/SignIn.tsx index d938634b..66c1a471 100644 --- a/frontend/occupi-mobile4/screens/Login/SignIn.tsx +++ b/frontend/occupi-mobile4/screens/Login/SignIn.tsx @@ -1,5 +1,5 @@ -import React, { useState, useEffect } from 'react'; -import { Keyboard } from 'react-native'; +import React, { useState, useEffect, useRef } from 'react'; +import { Keyboard,Animated, Easing } from 'react-native'; import { router } from 'expo-router'; import * as LocalAuthentication from 'expo-local-authentication'; // import CookieManager from '@react-native-cookies/cookies'; @@ -37,7 +37,7 @@ import { zodResolver } from '@hookform/resolvers/zod'; import { z } from 'zod'; import { AlertTriangle, EyeIcon, EyeOffIcon } from 'lucide-react-native'; import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen'; -import Logo from '../../screens/Login/assets/images/Occupi/file.png'; +import Logo from '../../screens/Login/assets/images/Occupi/Occupi-gradient.png'; import StyledExpoRouterLink from '../../components/StyledExpoRouterLink'; import GradientButton from '@/components/GradientButton'; import { UserLogin } from '@/utils/auth'; @@ -74,8 +74,11 @@ const SignInForm = () => { const toast = useToast(); + + useEffect(() => { checkBiometricAvailability(); + }, []); const checkBiometricAvailability = async () => { @@ -84,6 +87,7 @@ const SignInForm = () => { // console.log('Biometric hardware available:', isBiometricAvailable); }; + const handleBiometricSignIn = async () => { const biometricType = await LocalAuthentication.supportedAuthenticationTypesAsync(); console.log('Supported biometric types:', biometricType); @@ -205,7 +209,7 @@ const SignInForm = () => { render={({ field: { onChange, onBlur, value } }) => ( { }, }} render={({ field: { onChange, onBlur, value } }) => ( - + { returnKeyType="done" type={showPassword ? 'text' : 'password'} /> - - + + )} @@ -283,7 +287,7 @@ const SignInForm = () => { render={({ field: { onChange, value } }) => ( { /> - + Forgot Password? @@ -320,6 +324,24 @@ const SignInForm = () => { }; const Main = () => { + const spinValue = useRef(new Animated.Value(0)).current; + + useEffect(() => { + Animated.loop( + Animated.timing(spinValue, { + toValue: 2, + duration: 10000, + easing: Easing.linear, + useNativeDriver: true, + }) + ).start(); + }, []); + + const spin = spinValue.interpolate({ + inputRange: [0, 1], + outputRange: ['0deg', '360deg'], + }); + return ( { > + Occupi Logo + { type={showPassword ? 'text' : 'password'} /> - + )} @@ -303,7 +304,7 @@ const SignUpForm = () => { type={showConfirmPassword ? 'text' : 'password'} /> - + )} @@ -323,13 +324,11 @@ const SignUpForm = () => { render={({ field: { onChange, value } }) => ( @@ -394,6 +393,24 @@ const SignUpForm = () => { }; function SignUpFormComponent() { + const spinValue = useRef(new Animated.Value(0)).current; + + useEffect(() => { + Animated.loop( + Animated.timing(spinValue, { + toValue: 2, + duration: 10000, + easing: Easing.linear, + useNativeDriver: true, + }) + ).start(); + }, []); + + const spin = spinValue.interpolate({ + inputRange: [0, 1], + outputRange: ['0deg', '360deg'], + }); + return ( <> + Occupi Logo + Have an account? - Login + Login diff --git a/frontend/occupi-mobile4/screens/Login/SplashScreen.tsx b/frontend/occupi-mobile4/screens/Login/SplashScreen.tsx index 1c5dce6c..d5fef1e4 100644 --- a/frontend/occupi-mobile4/screens/Login/SplashScreen.tsx +++ b/frontend/occupi-mobile4/screens/Login/SplashScreen.tsx @@ -93,6 +93,7 @@ export default function SplashScreen() { useEffect(() => { const timer = setTimeout(() => { setSelectedIndex(1); // Assuming Onboarding1 is at index 1 + router.replace('/login'); // Navigate to Onboarding1 screen }, 5000); // 8 seconds diff --git a/frontend/occupi-mobile4/screens/Login/Welcome.tsx b/frontend/occupi-mobile4/screens/Login/Welcome.tsx index 06662f45..29a9e189 100644 --- a/frontend/occupi-mobile4/screens/Login/Welcome.tsx +++ b/frontend/occupi-mobile4/screens/Login/Welcome.tsx @@ -1,24 +1,44 @@ -import React from 'react'; +import React, { useEffect, useRef } from 'react'; import { Image, Center, Text, Heading, } from '@gluestack-ui/themed'; -import { StyleSheet, View } from 'react-native'; +import { StyleSheet, View, Animated, Easing } from 'react-native'; import { router } from 'expo-router'; import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen'; import GradientButton from '@/components/GradientButton'; const Welcome = () => { + const spinValue = useRef(new Animated.Value(0)).current; + + useEffect(() => { + Animated.loop( + Animated.timing(spinValue, { + toValue: 2, + duration: 10000, + easing: Easing.linear, + useNativeDriver: true, + }) + ).start(); + }, []); + + const spin = spinValue.interpolate({ + inputRange: [0, 1], + outputRange: ['0deg', '360deg'], + }); + return (
- logo + + logo + Log in. Let's Plan. Predict. Plan. Perfect.