mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2024-11-17 06:19:25 +08:00
Fixed loading indicator container size
This commit is contained in:
parent
f9c3a5c5d4
commit
ec693a7bb6
3 changed files with 25 additions and 18 deletions
17
src/components/LoadingFeedback/LoadingFeedback.tsx
Normal file
17
src/components/LoadingFeedback/LoadingFeedback.tsx
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import * as React from "react";
|
||||||
|
import styles from "../../styles";
|
||||||
|
import { View, Text, ActivityIndicator } from "react-native";
|
||||||
|
import { colors } from "../../styles";
|
||||||
|
import AnimatedContainer from "../AnimatedContainer/AnimatedContainer";
|
||||||
|
|
||||||
|
export default function LoadingFeedback() {
|
||||||
|
return (
|
||||||
|
<View style={styles.background}>
|
||||||
|
<AnimatedContainer>
|
||||||
|
<View style={{ paddingVertical: 8 }} />
|
||||||
|
<ActivityIndicator size={128} color={colors.secondary_1} />
|
||||||
|
<Text style={styles.text_white_medium}>Loading...</Text>
|
||||||
|
</AnimatedContainer>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
|
@ -26,6 +26,9 @@ import AnimatedContainerNoScroll from "../../components/AnimatedContainer/Animat
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { RootState } from "../../features/redux/Store/Store";
|
import { RootState } from "../../features/redux/Store/Store";
|
||||||
import { useToast } from "react-native-toast-notifications";
|
import { useToast } from "react-native-toast-notifications";
|
||||||
|
import AnimatedContainer from "../../components/AnimatedContainer/AnimatedContainer";
|
||||||
|
import Loading from "../Loading/Loading";
|
||||||
|
import LoadingFeedback from "../../components/LoadingFeedback/LoadingFeedback";
|
||||||
|
|
||||||
export default function SubjectsPage() {
|
export default function SubjectsPage() {
|
||||||
const logged_in_user = useSelector((state: RootState) => state.user.user);
|
const logged_in_user = useSelector((state: RootState) => state.user.user);
|
||||||
|
@ -184,15 +187,7 @@ export default function SubjectsPage() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (StudentInfo.isLoading || Subjects.isLoading) {
|
if (StudentInfo.isLoading || Subjects.isLoading) {
|
||||||
return (
|
return <LoadingFeedback />;
|
||||||
<View style={styles.background}>
|
|
||||||
<AnimatedContainerNoScroll>
|
|
||||||
<View style={{ paddingVertical: 8 }} />
|
|
||||||
<ActivityIndicator size={96} color={colors.secondary_1} />
|
|
||||||
<Text style={styles.text_white_medium}>Loading...</Text>
|
|
||||||
</AnimatedContainerNoScroll>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<View style={styles.background}>
|
<View style={styles.background}>
|
||||||
|
|
|
@ -43,6 +43,9 @@ import { setUser as setUserinState } from "../../features/redux/slices/UserSlice
|
||||||
import * as ImagePicker from "expo-image-picker";
|
import * as ImagePicker from "expo-image-picker";
|
||||||
import * as FileSystem from "expo-file-system";
|
import * as FileSystem from "expo-file-system";
|
||||||
import { useToast } from "react-native-toast-notifications";
|
import { useToast } from "react-native-toast-notifications";
|
||||||
|
import AnimatedContainer from "../../components/AnimatedContainer/AnimatedContainer";
|
||||||
|
import Loading from "../Loading/Loading";
|
||||||
|
import LoadingFeedback from "../../components/LoadingFeedback/LoadingFeedback";
|
||||||
|
|
||||||
export default function UserInfoPage() {
|
export default function UserInfoPage() {
|
||||||
const logged_in_user = useSelector((state: RootState) => state.user.user);
|
const logged_in_user = useSelector((state: RootState) => state.user.user);
|
||||||
|
@ -292,15 +295,7 @@ export default function UserInfoPage() {
|
||||||
yearlevel_query.isLoading ||
|
yearlevel_query.isLoading ||
|
||||||
course_query.isLoading
|
course_query.isLoading
|
||||||
) {
|
) {
|
||||||
return (
|
return <LoadingFeedback />;
|
||||||
<View style={styles.background}>
|
|
||||||
<AnimatedContainerNoScroll>
|
|
||||||
<View style={{ paddingVertical: 8 }} />
|
|
||||||
<ActivityIndicator size={96} color={colors.secondary_1} />
|
|
||||||
<Text style={styles.text_white_medium}>Loading...</Text>
|
|
||||||
</AnimatedContainerNoScroll>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<View style={styles.background}>
|
<View style={styles.background}>
|
||||||
|
|
Loading…
Reference in a new issue