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 3.7KB

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