mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2024-11-17 06:19:25 +08:00
Move conditional statements in homepage
This commit is contained in:
parent
a11ff2ee6f
commit
22820e139e
1 changed files with 17 additions and 16 deletions
|
@ -363,22 +363,7 @@ export default function Home() {
|
||||||
});
|
});
|
||||||
|
|
||||||
function CustomMap() {
|
function CustomMap() {
|
||||||
if (
|
if (!locationPermitted) {
|
||||||
(StudentStatusQuery.isFetching && studying) ||
|
|
||||||
StudentStatusListQuery.isFetching ||
|
|
||||||
StudyGroupQuery.isFetching ||
|
|
||||||
(StudentStatusQuery.isFetching && !studying) ||
|
|
||||||
StudentStatusListGlobalQuery.isFetching ||
|
|
||||||
StudyGroupGlobalQuery.isFetching
|
|
||||||
) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<View style={{ paddingVertical: 8 }} />
|
|
||||||
<ActivityIndicator size={96} color={colors.secondary_1} />
|
|
||||||
<Text style={styles.text_white_medium}>Loading...</Text>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
} else if (!locationPermitted) {
|
|
||||||
console.log(locationPermitted);
|
console.log(locationPermitted);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -390,6 +375,22 @@ export default function Home() {
|
||||||
);
|
);
|
||||||
} else if (dist && location && locationFetched) {
|
} else if (dist && location && locationFetched) {
|
||||||
if (dist <= 1 || map_distance_override) {
|
if (dist <= 1 || map_distance_override) {
|
||||||
|
if (
|
||||||
|
(StudentStatusQuery.isFetching && studying) ||
|
||||||
|
StudentStatusListQuery.isFetching ||
|
||||||
|
StudyGroupQuery.isFetching ||
|
||||||
|
(StudentStatusQuery.isFetching && !studying) ||
|
||||||
|
StudentStatusListGlobalQuery.isFetching ||
|
||||||
|
StudyGroupGlobalQuery.isFetching
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<View style={{ paddingVertical: 8 }} />
|
||||||
|
<ActivityIndicator size={96} color={colors.secondary_1} />
|
||||||
|
<Text style={styles.text_white_medium}>Loading...</Text>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View style={{ alignSelf: "flex-end" }}>
|
<View style={{ alignSelf: "flex-end" }}>
|
||||||
|
|
Loading…
Reference in a new issue