Browse Source

Added bug report button on home screen

Arnaud Vergnet 3 years ago
parent
commit
8c9e068faa

+ 36
- 27
src/components/Home/ActionsDashboardItem.js View File

2
 
2
 
3
 import * as React from 'react';
3
 import * as React from 'react';
4
 import {Avatar, Card, List, withTheme} from 'react-native-paper';
4
 import {Avatar, Card, List, withTheme} from 'react-native-paper';
5
-import {StyleSheet} from "react-native";
5
+import {StyleSheet, View} from "react-native";
6
 import {DrawerNavigationProp} from "@react-navigation/drawer";
6
 import {DrawerNavigationProp} from "@react-navigation/drawer";
7
 import type {CustomTheme} from "../../managers/ThemeManager";
7
 import type {CustomTheme} from "../../managers/ThemeManager";
8
 import i18n from 'i18n-js';
8
 import i18n from 'i18n-js';
25
     render() {
25
     render() {
26
         const isLoggedIn = this.props.isLoggedIn;
26
         const isLoggedIn = this.props.isLoggedIn;
27
         return (
27
         return (
28
-            <Card style={{
29
-                ...styles.card,
30
-                borderColor: this.props.theme.colors.primary,
31
-            }}>
28
+            <View>
29
+                <Card style={{
30
+                    ...styles.card,
31
+                    borderColor: this.props.theme.colors.primary,
32
+                }}>
33
+                    <List.Item
34
+                        title={i18n.t("homeScreen.dashboard.amicaleTitle")}
35
+                        description={isLoggedIn
36
+                            ? i18n.t("homeScreen.dashboard.amicaleConnected")
37
+                            : i18n.t("homeScreen.dashboard.amicaleConnect")}
38
+                        left={props => <Avatar.Image
39
+                            {...props}
40
+                            size={40}
41
+                            source={ICON_AMICALE}
42
+                            style={styles.avatar}/>}
43
+                        right={props => <List.Icon {...props} icon={isLoggedIn
44
+                            ? "chevron-right"
45
+                            : "login"}/>}
46
+                        onPress={isLoggedIn
47
+                            ? () => this.props.navigation.navigate("services", {
48
+                                screen: 'index'
49
+                            })
50
+                            : () => this.props.navigation.navigate("login")}
51
+                        style={styles.list}
52
+                    />
53
+                </Card>
32
                 <List.Item
54
                 <List.Item
33
-                    title={i18n.t("homeScreen.dashboard.amicaleTitle")}
34
-                    description={isLoggedIn
35
-                        ? i18n.t("homeScreen.dashboard.amicaleConnected")
36
-                        : i18n.t("homeScreen.dashboard.amicaleConnect")}
37
-                    left={props => <Avatar.Image
38
-                        {...props}
39
-                        size={40}
40
-                        source={ICON_AMICALE}
41
-                        style={styles.avatar}/>}
42
-                    right={props => <List.Icon {...props} icon={isLoggedIn
43
-                        ? "chevron-right"
44
-                        : "login"}/>}
45
-                    onPress={isLoggedIn
46
-                        ? () => this.props.navigation.navigate("services", {
47
-                            screen: 'index'
48
-                        })
49
-                        : () => this.props.navigation.navigate("login")}
50
-                    style={styles.list}
55
+                    title={i18n.t("feedbackScreen.homeButtonTitle")}
56
+                    description={i18n.t("feedbackScreen.homeButtonSubtitle")}
57
+                    left={props => <List.Icon {...props} icon={"bug"}/>}
58
+                    right={props => <List.Icon {...props} icon={"chevron-right"}/>}
59
+                    onPress={() => this.props.navigation.navigate("feedback")}
60
+                    style={{...styles.list, marginLeft: 10, marginRight: 10}}
51
                 />
61
                 />
52
-            </Card>
62
+            </View>
63
+
53
         );
64
         );
54
     }
65
     }
55
 }
66
 }
57
 const styles = StyleSheet.create({
68
 const styles = StyleSheet.create({
58
     card: {
69
     card: {
59
         width: 'auto',
70
         width: 'auto',
60
-        marginLeft: 10,
61
-        marginRight: 10,
62
-        marginTop: 10,
71
+        margin: 10,
63
         borderWidth: 1,
72
         borderWidth: 1,
64
     },
73
     },
65
     avatar: {
74
     avatar: {

+ 1
- 1
src/screens/About/AboutScreen.js View File

69
         {
69
         {
70
             onPressCallback: () => this.props.navigation.navigate("feedback"),
70
             onPressCallback: () => this.props.navigation.navigate("feedback"),
71
             icon: 'bug',
71
             icon: 'bug',
72
-            text: i18n.t('screens.feedback'),
72
+            text: i18n.t("feedbackScreen.homeButtonTitle"),
73
             showChevron: true
73
             showChevron: true
74
         },
74
         },
75
         {
75
         {

+ 10
- 4
src/screens/Other/FeedbackScreen.js View File

31
 
31
 
32
     getButtons(isBug: boolean) {
32
     getButtons(isBug: boolean) {
33
         return (
33
         return (
34
-            <Card.Actions>
34
+            <Card.Actions style={{
35
+                flex: 1,
36
+                flexWrap: 'wrap',
37
+            }}>
35
                 <Button
38
                 <Button
36
                     icon="email"
39
                     icon="email"
37
                     mode="contained"
40
                     mode="contained"
38
                     style={{
41
                     style={{
39
                         marginLeft: 'auto',
42
                         marginLeft: 'auto',
43
+                        marginTop: 5,
40
                     }}
44
                     }}
41
                     onPress={() => Linking.openURL(isBug ? links.bugsMail : links.feedbackMail)}>
45
                     onPress={() => Linking.openURL(isBug ? links.bugsMail : links.feedbackMail)}>
42
                     MAIL
46
                     MAIL
45
                     icon="git"
49
                     icon="git"
46
                     mode="contained"
50
                     mode="contained"
47
                     style={{
51
                     style={{
48
-                        marginLeft: 10,
52
+                        marginLeft: 'auto',
53
+                        marginTop: 5,
49
                     }}
54
                     }}
50
                     onPress={() => Linking.openURL(isBug ? links.bugsGit : links.feedbackGit)}>
55
                     onPress={() => Linking.openURL(isBug ? links.bugsGit : links.feedbackGit)}>
51
-                    GIT
56
+                    GITEA
52
                 </Button>
57
                 </Button>
53
                 <Button
58
                 <Button
54
                     icon="facebook"
59
                     icon="facebook"
55
                     mode="contained"
60
                     mode="contained"
56
                     style={{
61
                     style={{
57
-                        marginLeft: 10,
62
+                        marginLeft: 'auto',
63
+                        marginTop: 5,
58
                     }}
64
                     }}
59
                     onPress={() => Linking.openURL(links.facebook)}>
65
                     onPress={() => Linking.openURL(links.facebook)}>
60
                     Facebook
66
                     Facebook

+ 3
- 1
translations/en.json View File

394
     "feedback": "Feedback",
394
     "feedback": "Feedback",
395
     "feedbackSubtitle": "Let us know what you think!",
395
     "feedbackSubtitle": "Let us know what you think!",
396
     "feedbackDescription": "Do you have a feature you want to be added/changed/removed, want to give your opinion on the app or simply chat with the dev? Use one of the links below!",
396
     "feedbackDescription": "Do you have a feature you want to be added/changed/removed, want to give your opinion on the app or simply chat with the dev? Use one of the links below!",
397
-    "contactMeans": "Using Git is recommended, to use it simply login with your INSA account."
397
+    "contactMeans": "Using Gitea is recommended, to use it simply login with your INSA account.",
398
+    "homeButtonTitle": "Feedback/Bug report",
399
+    "homeButtonSubtitle": "Contact the devs"
398
   }
400
   }
399
 }
401
 }

+ 3
- 2
translations/fr.json View File

394
     "feedback": "Feedback",
394
     "feedback": "Feedback",
395
     "feedbackSubtitle": "Did nous ce que vous pensez!",
395
     "feedbackSubtitle": "Did nous ce que vous pensez!",
396
     "feedbackDescription": "Vous voulez voir une fonctionnalité ajoutée/modifiée/supprimée ?, vous voulez donner votre opinion sur l'appli ou simplement discuter avec les devs ? Utilisez un des liens ci-dessous !",
396
     "feedbackDescription": "Vous voulez voir une fonctionnalité ajoutée/modifiée/supprimée ?, vous voulez donner votre opinion sur l'appli ou simplement discuter avec les devs ? Utilisez un des liens ci-dessous !",
397
-    "contactMeans": "L'utilisation de Git est recommandée, pour l'utiliser, connectez vous avec vos identifiants INSA."
398
-
397
+    "contactMeans": "L'utilisation de Gitea est recommandée, pour l'utiliser, connectez vous avec vos identifiants INSA.",
398
+    "homeButtonTitle": "Feedback/Bugs",
399
+    "homeButtonSubtitle": "Contacter les devs"
399
   }
400
   }
400
 }
401
 }

Loading…
Cancel
Save