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.

SmallDashboardItem.js 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import * as React from 'react';
  2. import {Badge, IconButton, withTheme} from 'react-native-paper';
  3. import {View} from "react-native";
  4. /**
  5. * Component used to render a small dashboard item
  6. *
  7. * @param props Props to pass to the component
  8. * @return {*}
  9. */
  10. function SmallDashboardItem(props) {
  11. const {colors} = props.theme;
  12. return (
  13. <View>
  14. <IconButton
  15. icon={props.icon}
  16. color={
  17. props.isAvailable
  18. ? props.color
  19. : colors.textDisabled
  20. }
  21. size={35}
  22. onPress={props.clickAction}
  23. />
  24. {
  25. props.badgeNumber > 0 ?
  26. <Badge
  27. style={{
  28. position: 'absolute',
  29. top: 5,
  30. right: 5
  31. }}>
  32. {props.badgeNumber}
  33. </Badge> : null
  34. }
  35. </View>
  36. );
  37. }
  38. export default withTheme(SmallDashboardItem);