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.

EventDashboardItem.js 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // @flow
  2. import * as React from 'react';
  3. import {Avatar, Card, withTheme} from 'react-native-paper';
  4. import {StyleSheet} from "react-native";
  5. /**
  6. * Component used to display a dashboard item containing a preview event
  7. *
  8. * @param props Props to pass to the component
  9. * @return {*}
  10. */
  11. function EventDashBoardItem(props) {
  12. const {colors} = props.theme;
  13. const iconColor = props.isAvailable ?
  14. colors.planningColor :
  15. colors.textDisabled;
  16. const textColor = props.isAvailable ?
  17. colors.text :
  18. colors.textDisabled;
  19. return (
  20. <Card
  21. style={styles.card}
  22. onPress={props.clickAction}>
  23. <Card.Title
  24. title={props.title}
  25. titleStyle={{color: textColor}}
  26. subtitle={props.subtitle}
  27. subtitleStyle={{color: textColor}}
  28. left={() =>
  29. <Avatar.Icon
  30. icon={props.icon}
  31. color={iconColor}
  32. size={60}
  33. style={styles.avatar}/>}
  34. />
  35. <Card.Content>
  36. {props.children}
  37. </Card.Content>
  38. </Card>
  39. );
  40. }
  41. const styles = StyleSheet.create({
  42. card: {
  43. width: 'auto',
  44. marginLeft: 10,
  45. marginRight: 10,
  46. marginTop: 10,
  47. overflow: 'hidden',
  48. },
  49. avatar: {
  50. backgroundColor: 'transparent'
  51. }
  52. });
  53. export default withTheme(EventDashBoardItem);