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.

FeedbackScreen.js 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. // @flow
  2. import * as React from 'react';
  3. import {Avatar, Button, Card, Paragraph, withTheme} from 'react-native-paper';
  4. import i18n from 'i18n-js';
  5. import {Linking, View} from 'react-native';
  6. import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
  7. import type {CardTitleIconPropsType} from '../../constants/PaperStyles';
  8. const links = {
  9. bugsGit: 'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/',
  10. trello: 'https://trello.com/b/RMej49Uq/application-campus-insa',
  11. facebook: 'https://www.facebook.com/campus.insat',
  12. feedbackMail: `mailto:app@amicale-insat.fr?subject=[FEEDBACK] Application CAMPUS
  13. &body=Coucou Arnaud j'ai du feedback\n\n\n\nBien cordialement.`,
  14. feedbackDiscord: 'https://discord.gg/W8MeTec',
  15. };
  16. class FeedbackScreen extends React.Component<null> {
  17. /**
  18. * Gets link buttons
  19. *
  20. * @returns {*}
  21. */
  22. static getButtons(isFeedback: boolean): React.Node {
  23. return (
  24. <Card.Actions
  25. style={{
  26. flex: 1,
  27. flexWrap: 'wrap',
  28. }}>
  29. {isFeedback ? (
  30. <View
  31. style={{
  32. flex: 1,
  33. flexWrap: 'wrap',
  34. flexDirection: 'row',
  35. width: '100%',
  36. }}>
  37. <Button
  38. icon="email"
  39. mode="contained"
  40. style={{
  41. marginLeft: 'auto',
  42. marginRight: 'auto',
  43. marginTop: 5,
  44. }}
  45. onPress={() => {
  46. Linking.openURL(links.feedbackMail);
  47. }}>
  48. MAIL
  49. </Button>
  50. <Button
  51. icon="facebook"
  52. mode="contained"
  53. color="#2e88fe"
  54. style={{
  55. marginLeft: 'auto',
  56. marginRight: 'auto',
  57. marginTop: 5,
  58. }}
  59. onPress={() => {
  60. Linking.openURL(links.facebook);
  61. }}>
  62. Facebook
  63. </Button>
  64. <Button
  65. icon="discord"
  66. mode="contained"
  67. color="#7289da"
  68. style={{
  69. marginLeft: 'auto',
  70. marginRight: 'auto',
  71. marginTop: 5,
  72. }}
  73. onPress={() => {
  74. Linking.openURL(links.feedbackDiscord);
  75. }}>
  76. Discord
  77. </Button>
  78. </View>
  79. ) : (
  80. <View
  81. style={{
  82. flex: 1,
  83. flexWrap: 'wrap',
  84. flexDirection: 'row',
  85. width: '100%',
  86. }}>
  87. <Button
  88. icon="git"
  89. mode="contained"
  90. color="#609927"
  91. style={{
  92. marginLeft: 'auto',
  93. marginRight: 'auto',
  94. marginTop: 5,
  95. }}
  96. onPress={() => {
  97. Linking.openURL(links.bugsGit);
  98. }}>
  99. GITETUD
  100. </Button>
  101. <Button
  102. icon="calendar"
  103. mode="contained"
  104. color="#026AA7"
  105. style={{
  106. marginLeft: 'auto',
  107. marginRight: 'auto',
  108. marginTop: 5,
  109. }}
  110. onPress={() => {
  111. Linking.openURL(links.trello);
  112. }}>
  113. TRELLO
  114. </Button>
  115. </View>
  116. )}
  117. </Card.Actions>
  118. );
  119. }
  120. render(): React.Node {
  121. return (
  122. <CollapsibleScrollView style={{padding: 5}}>
  123. <Card>
  124. <Card.Title
  125. title={i18n.t('screens.feedback.feedback')}
  126. subtitle={i18n.t('screens.feedback.feedbackSubtitle')}
  127. left={(iconProps: CardTitleIconPropsType): React.Node => (
  128. <Avatar.Icon size={iconProps.size} icon="comment" />
  129. )}
  130. />
  131. <Card.Content>
  132. <Paragraph>
  133. {i18n.t('screens.feedback.feedbackDescription')}
  134. </Paragraph>
  135. </Card.Content>
  136. {FeedbackScreen.getButtons(true)}
  137. <Card.Title
  138. title={i18n.t('screens.feedback.contribute')}
  139. subtitle={i18n.t('screens.feedback.contributeSubtitle')}
  140. left={(iconProps: CardTitleIconPropsType): React.Node => (
  141. <Avatar.Icon size={iconProps.size} icon="handshake" />
  142. )}
  143. />
  144. <Card.Content>
  145. <Paragraph>
  146. {i18n.t('screens.feedback.contributeDescription')}
  147. </Paragraph>
  148. </Card.Content>
  149. {FeedbackScreen.getButtons(false)}
  150. </Card>
  151. </CollapsibleScrollView>
  152. );
  153. }
  154. }
  155. export default withTheme(FeedbackScreen);