Skip to content

Instantly share code, notes, and snippets.

@Pinwheeler
Last active August 8, 2021 17:41
Show Gist options
  • Save Pinwheeler/3a4a56c82e54860d96117854defb5855 to your computer and use it in GitHub Desktop.
Save Pinwheeler/3a4a56c82e54860d96117854defb5855 to your computer and use it in GitHub Desktop.
import React from "react"
import { View, Text } from "react-native"
import { ActivityIndicator } from "react-native-paper"
import Theme from "src/lib/Theme"
interface Props {
loading: boolean
}
export const LoadingScreen: React.FC<Props> = (props) => {
return (
<>
{props.children}
{props.loading && (
<View
style={{
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
height: "100%",
backgroundColor: Theme.colors.background,
}}
>
<Text>Loading...</Text>
<View style={{ height: 20 }} />
<ActivityIndicator />
</View>
)}
</>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment