Move conditional statements in homepage

This commit is contained in:
Keannu Bernasol 2023-10-14 10:51:28 +08:00
parent a11ff2ee6f
commit 22820e139e

View file

@ -363,6 +363,18 @@ export default function Home() {
});
function CustomMap() {
if (!locationPermitted) {
console.log(locationPermitted);
return (
<>
<Text style={styles.text_white_medium}>{feedback}</Text>
<Button onPress={async () => await requestLocation()}>
<Text style={styles.text_white_medium}>Allow Access</Text>
</Button>
</>
);
} else if (dist && location && locationFetched) {
if (dist <= 1 || map_distance_override) {
if (
(StudentStatusQuery.isFetching && studying) ||
StudentStatusListQuery.isFetching ||
@ -378,18 +390,7 @@ export default function Home() {
<Text style={styles.text_white_medium}>Loading...</Text>
</>
);
} else if (!locationPermitted) {
console.log(locationPermitted);
return (
<>
<Text style={styles.text_white_medium}>{feedback}</Text>
<Button onPress={async () => await requestLocation()}>
<Text style={styles.text_white_medium}>Allow Access</Text>
</Button>
</>
);
} else if (dist && location && locationFetched) {
if (dist <= 1 || map_distance_override) {
}
return (
<>
<View style={{ alignSelf: "flex-end" }}>