Browse Source

Added bug report button on home screen

Arnaud Vergnet 4 years ago
parent
commit
8c9e068faa

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

@@ -2,7 +2,7 @@
2 2
 
3 3
 import * as React from 'react';
4 4
 import {Avatar, Card, List, withTheme} from 'react-native-paper';
5
-import {StyleSheet} from "react-native";
5
+import {StyleSheet, View} from "react-native";
6 6
 import {DrawerNavigationProp} from "@react-navigation/drawer";
7 7
 import type {CustomTheme} from "../../managers/ThemeManager";
8 8
 import i18n from 'i18n-js';
@@ -25,31 +25,42 @@ class ActionsDashBoardItem extends React.Component<Props> {
25 25
     render() {
26 26
         const isLoggedIn = this.props.isLoggedIn;
27 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 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,9 +68,7 @@ class ActionsDashBoardItem extends React.Component<Props> {
57 68
 const styles = StyleSheet.create({
58 69
     card: {
59 70
         width: 'auto',
60
-        marginLeft: 10,
61
-        marginRight: 10,
62
-        marginTop: 10,
71
+        margin: 10,
63 72
         borderWidth: 1,
64 73
     },
65 74
     avatar: {

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

@@ -69,7 +69,7 @@ class AboutScreen extends React.Component<Props, State> {
69 69
         {
70 70
             onPressCallback: () => this.props.navigation.navigate("feedback"),
71 71
             icon: 'bug',
72
-            text: i18n.t('screens.feedback'),
72
+            text: i18n.t("feedbackScreen.homeButtonTitle"),
73 73
             showChevron: true
74 74
         },
75 75
         {

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

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

+ 3
- 1
translations/en.json View File

@@ -394,6 +394,8 @@
394 394
     "feedback": "Feedback",
395 395
     "feedbackSubtitle": "Let us know what you think!",
396 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,7 +394,8 @@
394 394
     "feedback": "Feedback",
395 395
     "feedbackSubtitle": "Did nous ce que vous pensez!",
396 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