ListEmpty.tsx 844 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import React, { JSX } from 'react';
  2. import { Image, StyleSheet, Text, View } from 'react-native';
  3. type Props = {
  4. text?: string;
  5. };
  6. export default function ListEmpty(props: Props): JSX.Element {
  7. return (
  8. <View style={styles.container}>
  9. <Image
  10. style={styles.image}
  11. resizeMode="contain"
  12. source={require('@common/assets/images/common_list_empty.png')}
  13. />
  14. <Text style={styles.text}>
  15. {props.text && props.text.length > 0 ? props.text : '暂无数据'}
  16. </Text>
  17. </View>
  18. );
  19. }
  20. const styles = StyleSheet.create({
  21. container: {
  22. alignItems: 'center',
  23. justifyContent: 'center',
  24. marginTop: 50,
  25. marginBottom: 20,
  26. },
  27. image: {
  28. width: 150,
  29. height: 102,
  30. },
  31. text: {
  32. textAlign: 'center',
  33. color: '#6B6B75',
  34. fontSize: 14,
  35. marginTop: 15,
  36. },
  37. });