feat: add loading component
This commit is contained in:
parent
720d1aacd4
commit
9780db36f1
2 changed files with 14 additions and 2 deletions
7
App.tsx
7
App.tsx
|
|
@ -1,6 +1,9 @@
|
||||||
import { StatusBar, View } from 'react-native';
|
import { StatusBar } from 'react-native';
|
||||||
import { useFonts, Roboto_400Regular, Roboto_700Bold } from '@expo-google-fonts/roboto';
|
import { useFonts, Roboto_400Regular, Roboto_700Bold } from '@expo-google-fonts/roboto';
|
||||||
import { Center, GluestackUIProvider, Text } from '@gluestack-ui/themed';
|
import { Center, GluestackUIProvider, Text } from '@gluestack-ui/themed';
|
||||||
|
|
||||||
|
import { Loading } from '@components/Loading';
|
||||||
|
|
||||||
import { config } from './config/gluestack-ui.config';
|
import { config } from './config/gluestack-ui.config';
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
|
|
@ -16,7 +19,7 @@ export default function App() {
|
||||||
<Text color="white" fontSize={34}>Ignite Gym</Text>
|
<Text color="white" fontSize={34}>Ignite Gym</Text>
|
||||||
</Center>
|
</Center>
|
||||||
) : (
|
) : (
|
||||||
<Text>Loading...</Text>
|
<Loading />
|
||||||
)}
|
)}
|
||||||
<StatusBar
|
<StatusBar
|
||||||
barStyle="light-content"
|
barStyle="light-content"
|
||||||
|
|
|
||||||
9
src/components/Loading.tsx
Normal file
9
src/components/Loading.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { Center, Spinner } from "@gluestack-ui/themed";
|
||||||
|
|
||||||
|
export function Loading() {
|
||||||
|
return (
|
||||||
|
<Center flex={1} bg="$gray700">
|
||||||
|
<Spinner color="$green500" />
|
||||||
|
</Center>
|
||||||
|
)
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue