|
@@ -3,118 +3,151 @@
|
3
|
3
|
import * as React from 'react';
|
4
|
4
|
import {Avatar, Button, Card, Paragraph, withTheme} from 'react-native-paper';
|
5
|
5
|
import i18n from 'i18n-js';
|
6
|
|
-import {Linking} from 'react-native';
|
7
|
|
-import type {CustomThemeType} from '../../managers/ThemeManager';
|
|
6
|
+import {Linking, View} from 'react-native';
|
8
|
7
|
import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
|
9
|
8
|
import type {CardTitleIconPropsType} from '../../constants/PaperStyles';
|
10
|
9
|
|
11
|
|
-type PropsType = {
|
12
|
|
- theme: CustomThemeType,
|
13
|
|
-};
|
14
|
|
-
|
15
|
10
|
const links = {
|
16
|
|
- bugsMail: `mailto:app@amicale-insat.fr?subject=[BUG] Application CAMPUS
|
17
|
|
-&body=Coucou Arnaud ça bug c'est nul,\n\n
|
18
|
|
-Informations sur ton système si tu sais (iOS ou Android, modèle du tel, version):\n\n\n
|
19
|
|
-Nature du problème :\n\n\n
|
20
|
|
-Étapes pour reproduire ce pb :\n\n\n\n
|
21
|
|
-Stp corrige le pb, bien cordialement.`,
|
22
|
|
- bugsGit:
|
23
|
|
- 'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/issues/new',
|
|
11
|
+ bugsGit: 'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/',
|
|
12
|
+ trello: 'https://trello.com/b/RMej49Uq/application-campus-insa',
|
24
|
13
|
facebook: 'https://www.facebook.com/campus.insat',
|
25
|
14
|
feedbackMail: `mailto:app@amicale-insat.fr?subject=[FEEDBACK] Application CAMPUS
|
26
|
15
|
&body=Coucou Arnaud j'ai du feedback\n\n\n\nBien cordialement.`,
|
27
|
16
|
feedbackDiscord: 'https://discord.gg/W8MeTec',
|
28
|
17
|
};
|
29
|
18
|
|
30
|
|
-class FeedbackScreen extends React.Component<PropsType> {
|
|
19
|
+class FeedbackScreen extends React.Component<null> {
|
31
|
20
|
/**
|
32
|
21
|
* Gets link buttons
|
33
|
22
|
*
|
34
|
|
- * @param isBug True if buttons should redirect to bug report methods
|
35
|
23
|
* @returns {*}
|
36
|
24
|
*/
|
37
|
|
- static getButtons(isBug: boolean): React.Node {
|
|
25
|
+ static getButtons(isFeedback: boolean): React.Node {
|
38
|
26
|
return (
|
39
|
27
|
<Card.Actions
|
40
|
28
|
style={{
|
41
|
29
|
flex: 1,
|
42
|
30
|
flexWrap: 'wrap',
|
43
|
31
|
}}>
|
44
|
|
- <Button
|
45
|
|
- icon="email"
|
46
|
|
- mode="contained"
|
47
|
|
- style={{
|
48
|
|
- marginLeft: 'auto',
|
49
|
|
- marginTop: 5,
|
50
|
|
- }}
|
51
|
|
- onPress={() => {
|
52
|
|
- Linking.openURL(isBug ? links.bugsMail : links.feedbackMail);
|
53
|
|
- }}>
|
54
|
|
- MAIL
|
55
|
|
- </Button>
|
56
|
|
- <Button
|
57
|
|
- icon={isBug ? 'git' : 'discord'}
|
58
|
|
- mode="contained"
|
59
|
|
- color={isBug ? '#609927' : '#7289da'}
|
60
|
|
- style={{
|
61
|
|
- marginLeft: 'auto',
|
62
|
|
- marginTop: 5,
|
63
|
|
- }}
|
64
|
|
- onPress={() => {
|
65
|
|
- Linking.openURL(isBug ? links.bugsGit : links.feedbackDiscord);
|
66
|
|
- }}>
|
67
|
|
- {isBug ? 'GITEA' : 'Discord'}
|
68
|
|
- </Button>
|
69
|
|
- <Button
|
70
|
|
- icon="facebook"
|
71
|
|
- mode="contained"
|
72
|
|
- color="#2e88fe"
|
73
|
|
- style={{
|
74
|
|
- marginLeft: 'auto',
|
75
|
|
- marginTop: 5,
|
76
|
|
- }}
|
77
|
|
- onPress={() => {
|
78
|
|
- Linking.openURL(links.facebook);
|
79
|
|
- }}>
|
80
|
|
- Facebook
|
81
|
|
- </Button>
|
|
32
|
+ {isFeedback ? (
|
|
33
|
+ <View
|
|
34
|
+ style={{
|
|
35
|
+ flex: 1,
|
|
36
|
+ flexWrap: 'wrap',
|
|
37
|
+ flexDirection: 'row',
|
|
38
|
+ width: '100%',
|
|
39
|
+ }}>
|
|
40
|
+ <Button
|
|
41
|
+ icon="email"
|
|
42
|
+ mode="contained"
|
|
43
|
+ style={{
|
|
44
|
+ marginLeft: 'auto',
|
|
45
|
+ marginRight: 'auto',
|
|
46
|
+ marginTop: 5,
|
|
47
|
+ }}
|
|
48
|
+ onPress={() => {
|
|
49
|
+ Linking.openURL(links.feedbackMail);
|
|
50
|
+ }}>
|
|
51
|
+ MAIL
|
|
52
|
+ </Button>
|
|
53
|
+ <Button
|
|
54
|
+ icon="facebook"
|
|
55
|
+ mode="contained"
|
|
56
|
+ color="#2e88fe"
|
|
57
|
+ style={{
|
|
58
|
+ marginLeft: 'auto',
|
|
59
|
+ marginRight: 'auto',
|
|
60
|
+ marginTop: 5,
|
|
61
|
+ }}
|
|
62
|
+ onPress={() => {
|
|
63
|
+ Linking.openURL(links.facebook);
|
|
64
|
+ }}>
|
|
65
|
+ Facebook
|
|
66
|
+ </Button>
|
|
67
|
+ <Button
|
|
68
|
+ icon="discord"
|
|
69
|
+ mode="contained"
|
|
70
|
+ color="#7289da"
|
|
71
|
+ style={{
|
|
72
|
+ marginLeft: 'auto',
|
|
73
|
+ marginRight: 'auto',
|
|
74
|
+ marginTop: 5,
|
|
75
|
+ }}
|
|
76
|
+ onPress={() => {
|
|
77
|
+ Linking.openURL(links.feedbackDiscord);
|
|
78
|
+ }}>
|
|
79
|
+ Discord
|
|
80
|
+ </Button>
|
|
81
|
+ </View>
|
|
82
|
+ ) : (
|
|
83
|
+ <View
|
|
84
|
+ style={{
|
|
85
|
+ flex: 1,
|
|
86
|
+ flexWrap: 'wrap',
|
|
87
|
+ flexDirection: 'row',
|
|
88
|
+ width: '100%',
|
|
89
|
+ }}>
|
|
90
|
+ <Button
|
|
91
|
+ icon="git"
|
|
92
|
+ mode="contained"
|
|
93
|
+ color="#609927"
|
|
94
|
+ style={{
|
|
95
|
+ marginLeft: 'auto',
|
|
96
|
+ marginRight: 'auto',
|
|
97
|
+ marginTop: 5,
|
|
98
|
+ }}
|
|
99
|
+ onPress={() => {
|
|
100
|
+ Linking.openURL(links.bugsGit);
|
|
101
|
+ }}>
|
|
102
|
+ GITETUD
|
|
103
|
+ </Button>
|
|
104
|
+ <Button
|
|
105
|
+ icon="calendar"
|
|
106
|
+ mode="contained"
|
|
107
|
+ color="#026AA7"
|
|
108
|
+ style={{
|
|
109
|
+ marginLeft: 'auto',
|
|
110
|
+ marginRight: 'auto',
|
|
111
|
+ marginTop: 5,
|
|
112
|
+ }}
|
|
113
|
+ onPress={() => {
|
|
114
|
+ Linking.openURL(links.trello);
|
|
115
|
+ }}>
|
|
116
|
+ TRELLO
|
|
117
|
+ </Button>
|
|
118
|
+ </View>
|
|
119
|
+ )}
|
82
|
120
|
</Card.Actions>
|
83
|
121
|
);
|
84
|
122
|
}
|
85
|
123
|
|
86
|
124
|
render(): React.Node {
|
87
|
|
- const {theme} = this.props;
|
88
|
125
|
return (
|
89
|
126
|
<CollapsibleScrollView style={{padding: 5}}>
|
90
|
127
|
<Card>
|
91
|
128
|
<Card.Title
|
92
|
|
- title={i18n.t('screens.feedback.bugs')}
|
93
|
|
- subtitle={i18n.t('screens.feedback.bugsSubtitle')}
|
|
129
|
+ title={i18n.t('screens.feedback.feedback')}
|
|
130
|
+ subtitle={i18n.t('screens.feedback.feedbackSubtitle')}
|
94
|
131
|
left={(iconProps: CardTitleIconPropsType): React.Node => (
|
95
|
|
- <Avatar.Icon size={iconProps.size} icon="bug" />
|
|
132
|
+ <Avatar.Icon size={iconProps.size} icon="comment" />
|
96
|
133
|
)}
|
97
|
134
|
/>
|
98
|
135
|
<Card.Content>
|
99
|
|
- <Paragraph>{i18n.t('screens.feedback.bugsDescription')}</Paragraph>
|
100
|
|
- <Paragraph style={{color: theme.colors.primary}}>
|
101
|
|
- {i18n.t('screens.feedback.contactMeans')}
|
|
136
|
+ <Paragraph>
|
|
137
|
+ {i18n.t('screens.feedback.feedbackDescription')}
|
102
|
138
|
</Paragraph>
|
103
|
139
|
</Card.Content>
|
104
|
140
|
{FeedbackScreen.getButtons(true)}
|
105
|
|
- </Card>
|
106
|
|
-
|
107
|
|
- <Card style={{marginTop: 20, marginBottom: 10}}>
|
108
|
141
|
<Card.Title
|
109
|
|
- title={i18n.t('screens.feedback.title')}
|
110
|
|
- subtitle={i18n.t('screens.feedback.feedbackSubtitle')}
|
|
142
|
+ title={i18n.t('screens.feedback.contribute')}
|
|
143
|
+ subtitle={i18n.t('screens.feedback.contributeSubtitle')}
|
111
|
144
|
left={(iconProps: CardTitleIconPropsType): React.Node => (
|
112
|
|
- <Avatar.Icon size={iconProps.size} icon="comment" />
|
|
145
|
+ <Avatar.Icon size={iconProps.size} icon="handshake" />
|
113
|
146
|
)}
|
114
|
147
|
/>
|
115
|
148
|
<Card.Content>
|
116
|
149
|
<Paragraph>
|
117
|
|
- {i18n.t('screens.feedback.feedbackDescription')}
|
|
150
|
+ {i18n.t('screens.feedback.contributeDescription')}
|
118
|
151
|
</Paragraph>
|
119
|
152
|
</Card.Content>
|
120
|
153
|
{FeedbackScreen.getButtons(false)}
|