From 96c64a98e00fdcecb3b9e1c7fd5749b7951c5ca2 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Thu, 16 Jul 2020 23:12:03 +0200 Subject: [PATCH] Improved UI and layout --- locales/fr.json | 2 +- src/components/Home/ActionsDashboardItem.js | 2 +- src/components/Home/SmallDashboardItem.js | 4 +- .../Other/Settings/DashboardEditScreen.js | 23 ++++--- src/screens/Other/Settings/SettingsScreen.js | 62 ++++++++++++------- 5 files changed, 56 insertions(+), 37 deletions(-) diff --git a/locales/fr.json b/locales/fr.json index aee5e37..8811518 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -358,7 +358,7 @@ "feedbackDescription": "Tu veux voir une fonctionnalité ajoutée/modifiée/supprimée ? Tu veux donner ton opinion sur l'appli ou simplement discuter avec le développeur (c'est moi coucou) ? Utilise un des liens ci-dessous !", "contactMeans": "L'utilisation de Gitea est recommandée, pour l'utiliser, connecte toi avec tes identifiants INSA.", "homeButtonTitle": "Feedback/Bugs", - "homeButtonSubtitle": "Contacter le développeur" + "homeButtonSubtitle": "Contacte le développeur de l'appli" }, "game": { "title": "Le jeu trop ouf", diff --git a/src/components/Home/ActionsDashboardItem.js b/src/components/Home/ActionsDashboardItem.js index 9db7d28..5b02df3 100644 --- a/src/components/Home/ActionsDashboardItem.js +++ b/src/components/Home/ActionsDashboardItem.js @@ -24,7 +24,7 @@ class ActionsDashBoardItem extends React.Component { } + left={props => } right={props => } onPress={() => this.props.navigation.navigate("feedback")} style={{paddingTop: 0, paddingBottom: 0, marginLeft: 10, marginRight: 10}} diff --git a/src/components/Home/SmallDashboardItem.js b/src/components/Home/SmallDashboardItem.js index e8113b5..53ee6fc 100644 --- a/src/components/Home/SmallDashboardItem.js +++ b/src/components/Home/SmallDashboardItem.js @@ -39,8 +39,8 @@ class SmallDashboardItem extends React.Component { onPress={this.props.onPress} borderless={true} style={{ - marginLeft: 5, - marginRight: 5, + marginLeft: this.itemSize / 4, + marginRight: this.itemSize / 4, }} > { ); } - undoDashboard= () => { + undoDashboard = () => { this.setState({ currentDashboard: [...this.initialDashboard], currentDashboardIdList: [...this.initialDashboardIdList] @@ -132,13 +132,18 @@ class DashboardEditScreen extends React.Component { - {i18n.t("screens.settings.dashboardEdit.message")}} - style={{ - }} - /> + + + {i18n.t("screens.settings.dashboardEdit.message")} + + + } + style={{}} + /> ); } diff --git a/src/screens/Other/Settings/SettingsScreen.js b/src/screens/Other/Settings/SettingsScreen.js index 66d7bb4..5738f03 100644 --- a/src/screens/Other/Settings/SettingsScreen.js +++ b/src/screens/Other/Settings/SettingsScreen.js @@ -172,6 +172,19 @@ class SettingsScreen extends React.Component { ); } + getNavigateItem(route: string, icon: string, title: string, subtitle: string, onLongPress?: () => void) { + return ( + this.props.navigation.navigate(route)} + left={props => } + right={props => } + onLongPress={onLongPress} + /> + ); + } + render() { return ( @@ -203,12 +216,12 @@ class SettingsScreen extends React.Component { left={props => } /> {this.getStartScreenPicker()} - this.props.navigation.navigate("dashboard-edit")} - left={props => } - /> + {this.getNavigateItem( + "dashboard-edit", + "view-dashboard", + i18n.t('screens.settings.dashboard'), + i18n.t('screens.settings.dashboardSub') + )} @@ -229,25 +242,26 @@ class SettingsScreen extends React.Component { {this.state.isDebugUnlocked - ? } - onPress={() => this.props.navigation.navigate("debug")} - /> + ? this.getNavigateItem( + "debug", + "bug-check", + i18n.t('screens.debug.title'), + "" + ) : null} - } - onPress={() => this.props.navigation.navigate("about")} - onLongPress={this.unlockDebugMode} - /> - } - onPress={() => this.props.navigation.navigate("feedback")} - /> + {this.getNavigateItem( + "about", + "information", + i18n.t('screens.about.title'), + i18n.t('screens.about.buttonDesc'), + this.unlockDebugMode, + )} + {this.getNavigateItem( + "feedback", + "comment-quote", + i18n.t('screens.feedback.homeButtonTitle'), + i18n.t('screens.feedback.homeButtonSubtitle'), + )}