Spinner.tsx 878 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import React, { JSX } from 'react';
  2. import { Platform, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
  3. import Spin from 'react-native-spinkit';
  4. import { THEME_COLOR } from '@app/constants';
  5. function Spinner(props: {
  6. containerStyle?: StyleProp<ViewStyle>;
  7. }): JSX.Element {
  8. return (
  9. <View
  10. style={[
  11. styles.container,
  12. props.containerStyle ? props.containerStyle : {},
  13. ]}
  14. >
  15. <Spin
  16. isVisible={true}
  17. size={24}
  18. type={Platform.select({ android: 'FadingCircleAlt', ios: 'Arc' })}
  19. color={THEME_COLOR}
  20. />
  21. </View>
  22. );
  23. }
  24. export default Spinner;
  25. const styles = StyleSheet.create({
  26. container: {
  27. position: 'absolute',
  28. backgroundColor: 'rgba(43, 43, 43, 0.1)',
  29. top: 0,
  30. left: 0,
  31. bottom: 0,
  32. right: 0,
  33. alignItems: 'center',
  34. justifyContent: 'center',
  35. },
  36. });