Merge branch '32-fix-welcome-component-colors' into 'main'

Resolve "fix welcome component colors"

Closes #32

See merge request thschleicher/interaktive-systeme!11
This commit is contained in:
jastornig 2023-12-08 16:32:30 +00:00
commit 8bd54574cc
6 changed files with 56 additions and 34 deletions

View file

@ -9,6 +9,7 @@ import { useRouter } from "expo-router"
import { useAuth } from '../../contexts/AuthContext';
export default function Page() {
const backgroundColor = useThemeColor("backgroundColor")
const router = useRouter()
const {onLogout} = useAuth();
const [plusShow, setPlusShow] = useState(true);
@ -53,7 +54,7 @@ export default function Page() {
return (
<SafeAreaView style={{flex: 1}}>
<SafeAreaView style={{flex: 1, backgroundColor: backgroundColor}}>
{plusShow && <Plus onPress={()=>{
router.push("/(tabs)/home/addItem")
}}/>}

View file

@ -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,24 +28,27 @@ 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} />}
rightIcon={<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>
<Button title='Login' onPress={login}></Button>
</SafeAreaView>
);