fixed darkmode issues on login and home
This commit is contained in:
parent
f62b49b5cf
commit
8437f474aa
3 changed files with 33 additions and 10 deletions
|
|
@ -4,11 +4,17 @@ import { useAuth } from './contexts/AuthContext'
|
|||
import { Redirect } from 'expo-router';
|
||||
import { FontAwesome } from "@expo/vector-icons";
|
||||
import { Input } from '../components';
|
||||
import { useThemeColor } from '../hooks/hooks';
|
||||
|
||||
export default function login() {
|
||||
const [email, setEmail] = useState("");
|
||||
const [password, setPassword] = useState("")
|
||||
const {authState, onLogin} = useAuth();
|
||||
const {authState, onLogin} = useAuth()
|
||||
const backgroundColor = useThemeColor("backgroundColor")
|
||||
const textColor = useThemeColor("primaryText");
|
||||
const elementDefaultColor = useThemeColor("elementDefaultColor")
|
||||
|
||||
|
||||
// const {authState, onLogin} = useAuth();
|
||||
// useEffect(() => {
|
||||
// login()
|
||||
|
|
@ -22,20 +28,24 @@ export default function login() {
|
|||
|
||||
return (
|
||||
|
||||
<SafeAreaView style={{flex: 1, justifyContent: "center"}}>
|
||||
<SafeAreaView style={{flex: 1, justifyContent: "center", backgroundColor: backgroundColor}}>
|
||||
{authState?.authenticated &&
|
||||
<Redirect href={"/"}></Redirect>}
|
||||
<Input
|
||||
placeholder={'Email'}
|
||||
placeholder={'Enter Email'}
|
||||
label='Email or Username'
|
||||
leftIcon={<FontAwesome name="user" size={20} />}
|
||||
labelColor={textColor}
|
||||
leftIcon={<FontAwesome name="user" size={20} color={textColor} />}
|
||||
onChangeHandler={setEmail}
|
||||
bgColor ={elementDefaultColor}
|
||||
/>
|
||||
<Input
|
||||
placeholder={'Enter Password'}
|
||||
label='Password'
|
||||
leftIcon={<FontAwesome name="key" size={20} />}
|
||||
labelColor={textColor}
|
||||
leftIcon={<FontAwesome name="key" size={20} color={textColor}/>}
|
||||
onChangeHandler={setPassword}
|
||||
bgColor ={elementDefaultColor}
|
||||
secure = {true}
|
||||
/>
|
||||
<Button title='login' onPress={login}></Button>
|
||||
|
|
|
|||
Reference in a new issue