Application Android et IOS pour l'amicale des élèves https://play.google.com/store/apps/details?id=fr.amicaleinsat.application
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.

AmicaleContactScreen.js 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. // @flow
  2. import * as React from 'react';
  3. import {Animated, FlatList, Image, Linking, View} from 'react-native';
  4. import {Card, List, Text, withTheme} from 'react-native-paper';
  5. import i18n from 'i18n-js';
  6. import {Collapsible} from "react-navigation-collapsible";
  7. import CustomTabBar from "../../components/Tabbar/CustomTabBar";
  8. import {withCollapsible} from "../../utils/withCollapsible";
  9. type Props = {
  10. collapsibleStack: Collapsible
  11. };
  12. type State = {};
  13. /**
  14. * Class defining a planning event information page.
  15. */
  16. class AmicaleContactScreen extends React.Component<Props, State> {
  17. CONTACT_DATASET = [
  18. {
  19. name: i18n.t("amicaleAbout.roles.interSchools"),
  20. email: "inter.ecoles@amicale-insat.fr",
  21. icon: "share-variant"
  22. },
  23. {
  24. name: i18n.t("amicaleAbout.roles.culture"),
  25. email: "culture@amicale-insat.fr",
  26. icon: "book"
  27. },
  28. {
  29. name: i18n.t("amicaleAbout.roles.animation"),
  30. email: "animation@amicale-insat.fr",
  31. icon: "emoticon"
  32. },
  33. {
  34. name: i18n.t("amicaleAbout.roles.clubs"),
  35. email: "clubs@amicale-insat.fr",
  36. icon: "account-group"
  37. },
  38. {
  39. name: i18n.t("amicaleAbout.roles.event"),
  40. email: "evenements@amicale-insat.fr",
  41. icon: "calendar-range"
  42. },
  43. {
  44. name: i18n.t("amicaleAbout.roles.tech"),
  45. email: "technique@amicale-insat.fr",
  46. icon: "settings"
  47. },
  48. {
  49. name: i18n.t("amicaleAbout.roles.communication"),
  50. email: "amicale@amicale-insat.fr",
  51. icon: "comment-account"
  52. },
  53. {
  54. name: i18n.t("amicaleAbout.roles.intraSchools"),
  55. email: "intra.ecoles@amicale-insat.fr",
  56. icon: "school"
  57. },
  58. {
  59. name: i18n.t("amicaleAbout.roles.publicRelations"),
  60. email: "rp@amicale-insat.fr",
  61. icon: "account-tie"
  62. },
  63. ];
  64. colors: Object;
  65. constructor(props) {
  66. super(props);
  67. this.colors = props.theme.colors;
  68. }
  69. keyExtractor = (item: Object) => item.email;
  70. getChevronIcon = (props: Object) => <List.Icon {...props} icon={'chevron-right'}/>;
  71. renderItem = ({item}: Object) => {
  72. const onPress = () => Linking.openURL('mailto:' + item.email);
  73. return <List.Item
  74. title={item.name}
  75. description={item.email}
  76. left={(props) => <List.Icon {...props} icon={item.icon}/>}
  77. right={this.getChevronIcon}
  78. onPress={onPress}
  79. />
  80. };
  81. getScreen = () => {
  82. return (
  83. <View>
  84. <View style={{
  85. width: '100%',
  86. height: 100,
  87. marginTop: 20,
  88. marginBottom: 20,
  89. justifyContent: 'center',
  90. alignItems: 'center'
  91. }}>
  92. <Image
  93. source={require('../../../assets/amicale.png')}
  94. style={{flex: 1, resizeMode: "contain"}}
  95. resizeMode="contain"/>
  96. </View>
  97. <Card style={{margin: 5}}>
  98. <Card.Title
  99. title={i18n.t("amicaleAbout.title")}
  100. subtitle={i18n.t("amicaleAbout.subtitle")}
  101. left={props => <List.Icon {...props} icon={'information'}/>}
  102. />
  103. <Card.Content>
  104. <Text>{i18n.t("amicaleAbout.message")}</Text>
  105. {/*$FlowFixMe*/}
  106. <FlatList
  107. data={this.CONTACT_DATASET}
  108. keyExtractor={this.keyExtractor}
  109. renderItem={this.renderItem}
  110. />
  111. </Card.Content>
  112. </Card>
  113. </View>
  114. );
  115. };
  116. render() {
  117. const {containerPaddingTop, scrollIndicatorInsetTop, onScroll} = this.props.collapsibleStack;
  118. return (
  119. <Animated.FlatList
  120. data={[{key: "1"}]}
  121. renderItem={this.getScreen}
  122. // Animations
  123. onScroll={onScroll}
  124. contentContainerStyle={{
  125. paddingTop: containerPaddingTop,
  126. paddingBottom: CustomTabBar.TAB_BAR_HEIGHT,
  127. minHeight: '100%'
  128. }}
  129. scrollIndicatorInsets={{top: scrollIndicatorInsetTop}}
  130. />
  131. );
  132. }
  133. }
  134. export default withCollapsible(withTheme(AmicaleContactScreen));