diff --git a/src/components/Button/DrawerButton.tsx b/src/components/Button/DrawerButton.tsx index 8f81da3..785cb64 100644 --- a/src/components/Button/DrawerButton.tsx +++ b/src/components/Button/DrawerButton.tsx @@ -1,21 +1,16 @@ import * as React from "react"; -import { Pressable, GestureResponderEvent } from "react-native"; +import { Pressable } from "react-native"; import styles from "../../styles"; +import { colors } from "../../styles"; -export interface props { - children: React.ReactNode; - onPress: (event: GestureResponderEvent) => void; - color: string; -} - -export default function DrawerButton(props: props) { +export default function DrawerButton({ color = colors.secondary_3, ...props }) { return ( { dispatch(logout()); await AsyncStorage.clear(); @@ -61,7 +60,6 @@ export default function CustomDrawerContent(props: {}) { Stud-E { navigation.navigate("Home"); }} @@ -70,7 +68,6 @@ export default function CustomDrawerContent(props: {}) { Home { navigation.navigate("User Info"); }} @@ -79,7 +76,6 @@ export default function CustomDrawerContent(props: {}) { User Info { navigation.navigate("Subjects"); }} @@ -88,7 +84,6 @@ export default function CustomDrawerContent(props: {}) { Subjects { dispatch(logout()); await AsyncStorage.clear(); @@ -113,7 +108,6 @@ export default function CustomDrawerContent(props: {}) { Stud-E { navigation.navigate("Login"); }} @@ -122,7 +116,6 @@ export default function CustomDrawerContent(props: {}) { Login { navigation.navigate("Register"); }} diff --git a/src/routes/Home/Home.tsx b/src/routes/Home/Home.tsx index 7cc911a..39015a6 100644 --- a/src/routes/Home/Home.tsx +++ b/src/routes/Home/Home.tsx @@ -43,6 +43,9 @@ export default function Home() { useEffect(() => { requestLocation(); }, [location]); + useEffect(() => { + requestLocation(); + }, []); async function getDistance(location: LocationType) { let dist = GetDistance( diff --git a/src/routes/Login/Login.tsx b/src/routes/Login/Login.tsx index f45d503..34a3d6f 100644 --- a/src/routes/Login/Login.tsx +++ b/src/routes/Login/Login.tsx @@ -99,14 +99,10 @@ export default function Login() { } }); }} - color={colors.secondary_3} > Login - diff --git a/src/routes/Register/Register.tsx b/src/routes/Register/Register.tsx index dc3d55d..868d215 100644 --- a/src/routes/Register/Register.tsx +++ b/src/routes/Register/Register.tsx @@ -158,7 +158,6 @@ export default function Register() { { } }} - color={colors.secondary_3} > Register diff --git a/src/routes/SubjectsPage/SubjectsPage.tsx b/src/routes/SubjectsPage/SubjectsPage.tsx index 51d36cb..372b058 100644 --- a/src/routes/SubjectsPage/SubjectsPage.tsx +++ b/src/routes/SubjectsPage/SubjectsPage.tsx @@ -201,7 +201,6 @@ export default function SubjectsPage() {