remove loading for now

This commit is contained in:
Loewy
2024-02-07 17:49:08 -08:00
parent 2ac780bdaa
commit ea130df02b
3 changed files with 0 additions and 59 deletions

View File

@@ -1,39 +0,0 @@
import React, { createContext, useEffect, useState } from "react";
import { ActivityIndicator, StyleSheet, View } from "react-native";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { colors } from "../../styles";
const LoadingContext = createContext<boolean>(false);
export default function Loading({ children }) {
const [loading, setLoading] = useState(true);
useEffect(() => {
const checkHasToken = async () => {
const hasToken = await AsyncStorage.getItem("token");
// needs to connect to app state
return hasToken;
};
checkHasToken().then(() => setLoading(false));
}, []);
if (!loading) {
return (
<LoadingContext.Provider value={loading}>
{children}
</LoadingContext.Provider>
);
}
return (
<View style={s.container}>
<ActivityIndicator size="large" color={colors.tournamentBlue} />
</View>
);
}
const s = StyleSheet.create({
container: { flex: 1, justifyContent: "center", alignItems: "center" },
});