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.2KB

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