From c8589e15f553f1f01d0b02a81c473fade4606cfe Mon Sep 17 00:00:00 2001 From: akshayd2020 Date: Mon, 26 Feb 2024 18:59:03 -0500 Subject: [PATCH] Make text input component --- frontend/sac-mobile/app/(auth)/login.tsx | 143 +++++++++++++-------- frontend/sac-mobile/app/(auth)/welcome.tsx | 22 ++-- frontend/sac-mobile/components/button.tsx | 21 ++- frontend/sac-mobile/components/input.tsx | 27 ++++ 4 files changed, 142 insertions(+), 71 deletions(-) create mode 100644 frontend/sac-mobile/components/input.tsx diff --git a/frontend/sac-mobile/app/(auth)/login.tsx b/frontend/sac-mobile/app/(auth)/login.tsx index 47bfd55f9..6121a8a71 100644 --- a/frontend/sac-mobile/app/(auth)/login.tsx +++ b/frontend/sac-mobile/app/(auth)/login.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Controller, useForm } from 'react-hook-form'; -import { Alert, Button, StyleSheet, Text, TextInput, View } from 'react-native'; +import { Alert, StyleSheet, Text, TextInput, View } from 'react-native'; +import { ButtonProps } from 'react-native'; import { SafeAreaView } from 'react-native-safe-area-context'; import { router } from 'expo-router'; @@ -8,6 +9,8 @@ import { router } from 'expo-router'; import { ZodError, z } from 'zod'; import Wordmark from '@/components/Wordmark'; +import Button from '@/components/button'; +import Input from '@/components/input'; import { useAuthStore } from '@/hooks/use-auth'; import { loginByEmail } from '@/services/auth'; @@ -54,63 +57,77 @@ const Login = () => { - Let's Go + Let's go Discover, follow, and join all the clubs & events Northeastern has to offer - - Email - ( - + + + Email + ( + + )} + name="email" + rules={{ required: 'Email is required' }} + /> + {errors.email && {errors.email.message}} + + + ( + + Password + + + )} + name="password" + rules={{ required: 'Password is required' }} + /> + {errors.password && ( + {errors.password.message} )} - name="email" - rules={{ required: 'Email is required' }} - /> - {errors.email && {errors.email.message}} - - - - Password - ( - - )} - name="password" - rules={{ required: 'Password is required' }} - /> - {errors.password && {errors.password.message}} - + - -