Application Android et IOS pour l'amicale des élèves
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

EmptyWebSectionListItem.js 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import * as React from 'react';
  2. import {ActivityIndicator, Subheading, withTheme} from 'react-native-paper';
  3. import {StyleSheet, View} from "react-native";
  4. import {MaterialCommunityIcons} from "@expo/vector-icons";
  5. /**
  6. * Component used to display a message when a list is empty
  7. *
  8. * @param props Props to pass to the component
  9. * @return {*}
  10. */
  11. function EmptyWebSectionListItem(props: { text: string, icon: string, refreshing: boolean, theme: {} }) {
  12. const {colors} = props.theme;
  13. return (
  14. <View>
  15. <View style={styles.iconContainer}>
  16. {props.refreshing ?
  17. <ActivityIndicator
  18. animating={true}
  19. size={'large'}
  20. color={colors.primary}/>
  21. :
  22. <MaterialCommunityIcons
  23. name={props.icon}
  24. size={100}
  25. color={colors.textDisabled}/>}
  26. </View>
  27. <Subheading style={{
  28. ...styles.subheading,
  29. color: colors.textDisabled
  30. }}>
  31. {props.text}
  32. </Subheading>
  33. </View>
  34. );
  35. }
  36. const styles = StyleSheet.create({
  37. iconContainer: {
  38. justifyContent: 'center',
  39. alignItems: 'center',
  40. width: '100%',
  41. height: 100,
  42. marginBottom: 20
  43. },
  44. subheading: {
  45. textAlign: 'center',
  46. marginRight: 20,
  47. marginLeft: 20,
  48. }
  49. });
  50. export default withTheme(EmptyWebSectionListItem);