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.

FeedbackScreen.js 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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, ScrollView} from "react-native";
  6. import type {CustomTheme} from "../../managers/ThemeManager";
  7. type Props = {
  8. theme: CustomTheme
  9. };
  10. const links = {
  11. bugsMail: `mailto:app@amicale-insat.fr?subject=[BUG] Application CAMPUS
  12. &body=Coucou Arnaud ça bug c'est nul,\n\n
  13. Informations sur ton système si tu sais (iOS ou Android, modèle du tel, version):\n\n\n
  14. Nature du problème :\n\n\n
  15. Étapes pour reproduire ce pb :\n\n\n\n
  16. Stp corrige le pb, bien cordialement.`,
  17. bugsGit: 'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/issues/new',
  18. facebook: "https://www.facebook.com/campus.insat",
  19. feedbackMail: `mailto:app@amicale-insat.fr?subject=[FEEDBACK] Application CAMPUS
  20. &body=Coucou Arnaud j'ai du feedback\n\n\n\nBien cordialement.`,
  21. feedbackGit: "https://git.etud.insa-toulouse.fr/vergnet/application-amicale/issues/new",
  22. }
  23. class FeedbackScreen extends React.Component<Props> {
  24. /**
  25. * Gets link buttons
  26. *
  27. * @param isBug True if buttons should redirect to bug report methods
  28. * @returns {*}
  29. */
  30. getButtons(isBug: boolean) {
  31. return (
  32. <Card.Actions style={{
  33. flex: 1,
  34. flexWrap: 'wrap',
  35. }}>
  36. <Button
  37. icon="email"
  38. mode={"contained"}
  39. style={{
  40. marginLeft: 'auto',
  41. marginTop: 5,
  42. }}
  43. onPress={() => Linking.openURL(isBug ? links.bugsMail : links.feedbackMail)}>
  44. MAIL
  45. </Button>
  46. <Button
  47. icon="git"
  48. mode={"contained"}
  49. color={"#609927"}
  50. style={{
  51. marginLeft: 'auto',
  52. marginTop: 5,
  53. }}
  54. onPress={() => Linking.openURL(isBug ? links.bugsGit : links.feedbackGit)}>
  55. GITEA
  56. </Button>
  57. <Button
  58. icon="facebook"
  59. mode={"contained"}
  60. color={"#2e88fe"}
  61. style={{
  62. marginLeft: 'auto',
  63. marginTop: 5,
  64. }}
  65. onPress={() => Linking.openURL(links.facebook)}>
  66. Facebook
  67. </Button>
  68. </Card.Actions>
  69. );
  70. }
  71. render() {
  72. return (
  73. <ScrollView style={{padding: 5}}>
  74. <Card>
  75. <Card.Title
  76. title={i18n.t('feedbackScreen.bugs')}
  77. subtitle={i18n.t('feedbackScreen.bugsSubtitle')}
  78. left={(props) => <Avatar.Icon {...props} icon="bug"/>}
  79. />
  80. <Card.Content>
  81. <Paragraph>
  82. {i18n.t('feedbackScreen.bugsDescription')}
  83. </Paragraph>
  84. <Paragraph style={{color: this.props.theme.colors.primary}}>
  85. {i18n.t('feedbackScreen.contactMeans')}
  86. </Paragraph>
  87. </Card.Content>
  88. {this.getButtons(true)}
  89. </Card>
  90. <Card style={{marginTop: 20, marginBottom: 10}}>
  91. <Card.Title
  92. title={i18n.t('feedbackScreen.feedback')}
  93. subtitle={i18n.t('feedbackScreen.feedbackSubtitle')}
  94. left={(props) => <Avatar.Icon {...props} icon="comment"/>}
  95. />
  96. <Card.Content>
  97. <Paragraph>
  98. {i18n.t('feedbackScreen.feedbackDescription')}
  99. </Paragraph>
  100. </Card.Content>
  101. {this.getButtons(false)}
  102. </Card>
  103. </ScrollView>
  104. );
  105. }
  106. }
  107. export default withTheme(FeedbackScreen);