Blame · Line-by-line history
LoadingSpinner.tsx
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| c53cf00 | 1 | import React from 'react'; |
| 2 | import { ActivityIndicator, View, StyleSheet } from 'react-native'; | |
| 3 | import { colors } from '../theme/colors'; | |
| 4 | ||
| 5 | interface Props { | |
| 6 | size?: 'small' | 'large'; | |
| 7 | fullScreen?: boolean; | |
| 8 | } | |
| 9 | ||
| 10 | export function LoadingSpinner({ size = 'large', fullScreen = false }: Props) { | |
| 11 | if (fullScreen) { | |
| 12 | return ( | |
| 13 | <View style={styles.fullScreen}> | |
| 14 | <ActivityIndicator size={size} color={colors.accent} /> | |
| 15 | </View> | |
| 16 | ); | |
| 17 | } | |
| 18 | return ( | |
| 19 | <View style={styles.inline}> | |
| 20 | <ActivityIndicator size={size} color={colors.accent} /> | |
| 21 | </View> | |
| 22 | ); | |
| 23 | } | |
| 24 | ||
| 25 | const styles = StyleSheet.create({ | |
| 26 | fullScreen: { | |
| 27 | flex: 1, | |
| 28 | alignItems: 'center', | |
| 29 | justifyContent: 'center', | |
| 30 | backgroundColor: colors.bg, | |
| 31 | }, | |
| 32 | inline: { | |
| 33 | padding: 24, | |
| 34 | alignItems: 'center', | |
| 35 | justifyContent: 'center', | |
| 36 | }, | |
| 37 | }); |