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.tsx 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /*
  2. * Copyright (c) 2019 - 2020 Arnaud Vergnet.
  3. *
  4. * This file is part of Campus INSAT.
  5. *
  6. * Campus INSAT is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Campus INSAT is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Campus INSAT. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. import * as React from 'react';
  20. import {Avatar, Button, Card, Paragraph, withTheme} from 'react-native-paper';
  21. import i18n from 'i18n-js';
  22. import {Linking, View} from 'react-native';
  23. import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
  24. const links = {
  25. bugsGit: 'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/',
  26. trello: 'https://trello.com/b/RMej49Uq/application-campus-insa',
  27. facebook: 'https://www.facebook.com/campus.insat',
  28. feedbackMail: `mailto:app@amicale-insat.fr?subject=[FEEDBACK] Application CAMPUS
  29. &body=Coucou Arnaud j'ai du feedback\n\n\n\nBien cordialement.`,
  30. feedbackDiscord: 'https://discord.gg/W8MeTec',
  31. };
  32. function getButtons(isFeedback: boolean) {
  33. return (
  34. <Card.Actions
  35. style={{
  36. flex: 1,
  37. flexWrap: 'wrap',
  38. }}>
  39. {isFeedback ? (
  40. <View
  41. style={{
  42. flex: 1,
  43. flexWrap: 'wrap',
  44. flexDirection: 'row',
  45. width: '100%',
  46. }}>
  47. <Button
  48. icon="email"
  49. mode="contained"
  50. style={{
  51. marginLeft: 'auto',
  52. marginRight: 'auto',
  53. marginTop: 5,
  54. }}
  55. onPress={() => {
  56. Linking.openURL(links.feedbackMail);
  57. }}>
  58. MAIL
  59. </Button>
  60. <Button
  61. icon="facebook"
  62. mode="contained"
  63. color="#2e88fe"
  64. style={{
  65. marginLeft: 'auto',
  66. marginRight: 'auto',
  67. marginTop: 5,
  68. }}
  69. onPress={() => {
  70. Linking.openURL(links.facebook);
  71. }}>
  72. Facebook
  73. </Button>
  74. <Button
  75. icon="discord"
  76. mode="contained"
  77. color="#7289da"
  78. style={{
  79. marginLeft: 'auto',
  80. marginRight: 'auto',
  81. marginTop: 5,
  82. }}
  83. onPress={() => {
  84. Linking.openURL(links.feedbackDiscord);
  85. }}>
  86. Discord
  87. </Button>
  88. </View>
  89. ) : (
  90. <View
  91. style={{
  92. flex: 1,
  93. flexWrap: 'wrap',
  94. flexDirection: 'row',
  95. width: '100%',
  96. }}>
  97. <Button
  98. icon="git"
  99. mode="contained"
  100. color="#609927"
  101. style={{
  102. marginLeft: 'auto',
  103. marginRight: 'auto',
  104. marginTop: 5,
  105. }}
  106. onPress={() => {
  107. Linking.openURL(links.bugsGit);
  108. }}>
  109. GITETUD
  110. </Button>
  111. <Button
  112. icon="calendar"
  113. mode="contained"
  114. color="#026AA7"
  115. style={{
  116. marginLeft: 'auto',
  117. marginRight: 'auto',
  118. marginTop: 5,
  119. }}
  120. onPress={() => {
  121. Linking.openURL(links.trello);
  122. }}>
  123. TRELLO
  124. </Button>
  125. </View>
  126. )}
  127. </Card.Actions>
  128. );
  129. }
  130. function FeedbackScreen() {
  131. return (
  132. <CollapsibleScrollView style={{padding: 5}}>
  133. <Card>
  134. <Card.Title
  135. title={i18n.t('screens.feedback.feedback')}
  136. subtitle={i18n.t('screens.feedback.feedbackSubtitle')}
  137. left={(iconProps) => (
  138. <Avatar.Icon size={iconProps.size} icon="comment" />
  139. )}
  140. />
  141. <Card.Content>
  142. <Paragraph>
  143. {i18n.t('screens.feedback.feedbackDescription')}
  144. </Paragraph>
  145. </Card.Content>
  146. {getButtons(true)}
  147. <Card.Title
  148. title={i18n.t('screens.feedback.contribute')}
  149. subtitle={i18n.t('screens.feedback.contributeSubtitle')}
  150. left={(iconProps) => (
  151. <Avatar.Icon size={iconProps.size} icon="handshake" />
  152. )}
  153. />
  154. <Card.Content>
  155. <Paragraph>
  156. {i18n.t('screens.feedback.contributeDescription')}
  157. </Paragraph>
  158. </Card.Content>
  159. {getButtons(false)}
  160. </Card>
  161. </CollapsibleScrollView>
  162. );
  163. }
  164. export default withTheme(FeedbackScreen);