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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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:app@amicale-insat.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:app@amicale-insat.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 style={{
  30. flex: 1,
  31. flexWrap: 'wrap',
  32. }}>
  33. <Button
  34. icon="email"
  35. mode="contained"
  36. style={{
  37. marginLeft: 'auto',
  38. marginTop: 5,
  39. }}
  40. onPress={() => Linking.openURL(isBug ? links.bugsMail : links.feedbackMail)}>
  41. MAIL
  42. </Button>
  43. <Button
  44. icon="git"
  45. mode="contained"
  46. style={{
  47. marginLeft: 'auto',
  48. marginTop: 5,
  49. }}
  50. onPress={() => Linking.openURL(isBug ? links.bugsGit : links.feedbackGit)}>
  51. GITEA
  52. </Button>
  53. <Button
  54. icon="facebook"
  55. mode="contained"
  56. style={{
  57. marginLeft: 'auto',
  58. marginTop: 5,
  59. }}
  60. onPress={() => Linking.openURL(links.facebook)}>
  61. Facebook
  62. </Button>
  63. </Card.Actions>
  64. );
  65. }
  66. render() {
  67. return (
  68. <ScrollView style={{padding: 5}}>
  69. <Card>
  70. <Card.Title
  71. title={i18n.t('feedbackScreen.bugs')}
  72. subtitle={i18n.t('feedbackScreen.bugsSubtitle')}
  73. left={(props) => <Avatar.Icon {...props} icon="bug"/>}
  74. />
  75. <Card.Content>
  76. <Paragraph>
  77. {i18n.t('feedbackScreen.bugsDescription')}
  78. </Paragraph>
  79. <Paragraph style={{color: this.props.theme.colors.primary}}>
  80. {i18n.t('feedbackScreen.contactMeans')}
  81. </Paragraph>
  82. </Card.Content>
  83. {this.getButtons(true)}
  84. </Card>
  85. <Card style={{marginTop: 20, marginBottom: 10}}>
  86. <Card.Title
  87. title={i18n.t('feedbackScreen.feedback')}
  88. subtitle={i18n.t('feedbackScreen.feedbackSubtitle')}
  89. left={(props) => <Avatar.Icon {...props} icon="comment"/>}
  90. />
  91. <Card.Content>
  92. <Paragraph>
  93. {i18n.t('feedbackScreen.feedbackDescription')}
  94. </Paragraph>
  95. </Card.Content>
  96. {this.getButtons(false)}
  97. </Card>
  98. </ScrollView>
  99. );
  100. }
  101. }
  102. export default withTheme(FeedbackScreen);