Commit 69e73606 by G

updated to use the recent made wrapper and some twix

parent 5a0715d7
import { useUserAuthenticationContext } from "@/contexts/UserAuthenticationContext"; import { useUserAuthenticationContext } from "@/contexts/UserAuthenticationContext";
import type { MainStackScreenComponentProps } from "@/navigations/Types"; import type { MainStackScreenComponentProps } from "@/navigations/Types";
import Button from "@components/Button"; import Button from "@components/Button";
import ContainerBorderTopCurved from "@components/ContainerBorderTopCurved";
import InputWithTopLabel from "@components/InputWithTopLabel"; import InputWithTopLabel from "@components/InputWithTopLabel";
import BeasyDefaultBackgroundWrapper from "@components/backgrounds/BeasyDefaultBackground";
import Box from "@components/bases/Box"; import Box from "@components/bases/Box";
import Text from "@components/bases/Text"; import WrapperWithDefaultBeasyBackgroundAndSafeAreaFull from "@components/wrappers/WrapperWithDefaultBeasyBackgroundAndSafeAreaFull";
import { Fontisto } from "@expo/vector-icons"; import { Fontisto } from "@expo/vector-icons";
import { LOG } from "@logger"; import { LOG } from "@logger";
import { containers } from "@styles/Commons"; import Card from "@re-card";
import Text from "@re-text";
import { useCallback, useState } from "react"; import { useCallback, useState } from "react";
import { TouchableOpacity, View } from "react-native"; import { TouchableOpacity } from "react-native";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import { useSafeAreaInsets } from "react-native-safe-area-context";
const log = LOG.extend("UserLoginScreen"); const log = LOG.extend("UserLoginScreen");
const UserLoginScreen: MainStackScreenComponentProps<"userLoginScreen"> = ({ navigation }) => { const UserLoginScreen: MainStackScreenComponentProps<"userLoginScreen"> = ({ navigation }) => {
...@@ -21,14 +21,15 @@ const UserLoginScreen: MainStackScreenComponentProps<"userLoginScreen"> = ({ nav ...@@ -21,14 +21,15 @@ const UserLoginScreen: MainStackScreenComponentProps<"userLoginScreen"> = ({ nav
// TODO : Remove default value for email and password // TODO : Remove default value for email and password
const [email, setEmail] = useState("admin"); const [email, setEmail] = useState("admin");
const [password, setPassword] = useState("admin"); const [password, setPassword] = useState("admin");
const insets = useSafeAreaInsets();
const submit = useCallback(() => { const submit = useCallback(() => {
login(email, password); login(email, password);
}, [email, password, login]); }, [email, password, login]);
return ( return (
<BeasyDefaultBackgroundWrapper> <WrapperWithDefaultBeasyBackgroundAndSafeAreaFull>
<View style={[containers.containerFull]}> <Box height={"100%"}>
<Box style={{ height: "20%" }} px={"l"}> <Box style={{ height: "20%" }} px={"l"}>
<Box <Box
px={"m"} px={"m"}
...@@ -45,7 +46,7 @@ const UserLoginScreen: MainStackScreenComponentProps<"userLoginScreen"> = ({ nav ...@@ -45,7 +46,7 @@ const UserLoginScreen: MainStackScreenComponentProps<"userLoginScreen"> = ({ nav
</TouchableOpacity> </TouchableOpacity>
</Box> </Box>
</Box> </Box>
<ContainerBorderTopCurved> <Card variant={"curvedTopContainer"} style={{ marginTop: "auto" }}>
<KeyboardAwareScrollView <KeyboardAwareScrollView
// extraScrollHeight={-125} // extraScrollHeight={-125}
extraHeight={10} extraHeight={10}
...@@ -96,9 +97,16 @@ const UserLoginScreen: MainStackScreenComponentProps<"userLoginScreen"> = ({ nav ...@@ -96,9 +97,16 @@ const UserLoginScreen: MainStackScreenComponentProps<"userLoginScreen"> = ({ nav
/> />
</Box> </Box>
</KeyboardAwareScrollView> </KeyboardAwareScrollView>
</ContainerBorderTopCurved> </Card>
</View> </Box>
</BeasyDefaultBackgroundWrapper> <Box
position={"absolute"}
bottom={0}
height={insets.bottom}
backgroundColor={"white"}
width={"100%"}
/>
</WrapperWithDefaultBeasyBackgroundAndSafeAreaFull>
); );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment