Skip to content

Commit

Permalink
Add initial Loading component
Browse files Browse the repository at this point in the history
  • Loading branch information
JDMathew committed Oct 22, 2024
1 parent 6bc7100 commit ecc0127
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions packages/extras/src/components/Loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as React from 'react';
import { ActivityIndicator, StyleSheet, Text, View } from 'react-native';

type Props = {
title?: string;
activityIndicatorProps?: React.ComponentProps<typeof ActivityIndicator>;
};

export const Loading = ({ title, activityIndicatorProps }: Props) => {
return (
<View style={styles.container}>
<ActivityIndicator size="large" {...activityIndicatorProps} />
<Text style={styles.text}>{title ?? 'Loading...'}</Text>
</View>
);
};

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
text: {
marginTop: 10,
marginBottom: 40,
},
});

0 comments on commit ecc0127

Please sign in to comment.