From 1cb68a0d1539aa0ccc69f312812b43c6b21f2803 Mon Sep 17 00:00:00 2001 From: keplyx Date: Wed, 7 Aug 2019 11:10:17 +0200 Subject: [PATCH] Updated intro slide and added settings and about buttons --- App.js | 37 ++++++++++++++++++++++++---------- components/BaseContainer.js | 4 ++-- components/CustomHeader.js | 16 ++++++++++++--- navigation/AppNavigator.js | 6 ++++-- navigation/MainTabNavigator.js | 2 +- screens/About/AboutScreen.js | 2 +- screens/PlanexScreen.js | 21 +++++++++---------- screens/SettingsScreen.js | 17 +++++++++++++++- 8 files changed, 72 insertions(+), 33 deletions(-) diff --git a/App.js b/App.js index e051b93..c8df585 100644 --- a/App.js +++ b/App.js @@ -48,30 +48,44 @@ const styles = StyleSheet.create({ const slides = [ { key: '1', - title: 'L\'application de l\'Amicale', - text: 'Toutes les informations du campus de Toulouse', + title: 'Bienvenue sur COFFEE', + text: ' La nouvelle app à consulter pendant la pause café pour être au courant de la vie du campus !', image: require('./assets/amicale.png'), colors: ['#ff8a6d', '#aa1c0d'], }, { key: '2', - title: 'N\'oubliez plus votre linge', - text: 'Visualisez les disponibilités des machines et rajoutez des alarmes', - icon: 'washing-machine', + title: 'Restez informés', + text: 'COFFEE vous permettra bientôt d\'être au courant de tous les événements qui ont lieu sur le campus, de la vente de crêpes jusqu\'aux concerts enfoiros !', + icon: 'calendar-range', colors: ['#9cd6d3', '#3186be'], }, { key: '3', - title: 'Le proximo', - text: 'Regardez le stock de la supérette de l\'INSA depuis n\'importe où', - icon: 'shopping', + title: 'N\'oubliez plus votre linge !', + text: 'COFFEE vous informe de la disponibilité des machines et vous permet d\'être notifiés lorsque la vôtre se termine bientôt !', + icon: 'washing-machine', colors: ['#f9a967', '#da5204'], }, { key: '4', + title: 'Proximo', + text: 'Il vous manque des pâtes ? Ou un petit creux au gouter, regardez les stocks de votre supérette insaienne en temps réel', + icon: 'shopping', + colors: ['#f9a967', '#da5204'], + }, + { + key: '5', + title: 'Planex', + text: 'Consultez votre emploi du temps sur COFFEE', + icon: 'timetable', + colors: ['#f9a967', '#da5204'], + }, + { + key: '6', title: 'Toujours en développement', - text: 'D\'autres fonctionnalités seront disponibles prochainement', - icon: 'settings-outline', + text: 'D\'autres fonctionnalités arrivent bientôt, n\'hésitez pas à nous donner votre avis pour améliorer l\'appli', + icon: 'cogs', colors: ['#9be238', '#1e6a22'], }, ]; @@ -114,7 +128,8 @@ export default class App extends React.Component { this.setState({ isLoading: false, currentTheme: ThemeManager.getCurrentTheme(), - showIntro: AsyncStorageManager.getInstance().preferences.showIntro.current === '1' + // showIntro: AsyncStorageManager.getInstance().preferences.showIntro.current === '1' + showIntro: true }); } diff --git a/components/BaseContainer.js b/components/BaseContainer.js index f235e61..484e3ff 100644 --- a/components/BaseContainer.js +++ b/components/BaseContainer.js @@ -13,7 +13,7 @@ import Touchable from "react-native-platform-touchable"; type Props = { navigation: Object, headerTitle: string, - headerRightMenu: React.Node, + headerRightButton: React.Node, children: React.Node } @@ -61,7 +61,7 @@ export default class BaseContainer extends React.Component { icon="menu"/> } - rightMenu={this.props.headerRightMenu}/> + rightButton={this.props.headerRightButton}/> {this.props.children} diff --git a/components/CustomHeader.js b/components/CustomHeader.js index 98fd94e..ad9732e 100644 --- a/components/CustomHeader.js +++ b/components/CustomHeader.js @@ -11,7 +11,7 @@ import CustomMaterialIcon from "./CustomMaterialIcon"; type Props = { hasBackButton: boolean, leftButton: React.Node, - rightMenu: React.Node, + rightButton: React.Node, title: string, navigation: Object, hasTabs: boolean, @@ -30,7 +30,7 @@ export default class CustomHeader extends React.Component { static defaultProps = { hasBackButton: false, leftButton: , - rightMenu: , + rightButton: , hasTabs: false, }; @@ -57,7 +57,17 @@ export default class CustomHeader extends React.Component { {this.props.title} - {this.props.rightMenu} + + {this.props.rightButton} + {this.props.hasBackButton ? : + this.props.navigation.navigate('SettingsScreen')}> + + } + ); } }; diff --git a/navigation/AppNavigator.js b/navigation/AppNavigator.js index ca7446b..ee08f10 100644 --- a/navigation/AppNavigator.js +++ b/navigation/AppNavigator.js @@ -1,9 +1,9 @@ // @flow import {createAppContainer, createStackNavigator} from 'react-navigation'; - -import MainDrawerNavigator from './MainDrawerNavigator'; import MainTabNavigator from './MainTabNavigator'; +import SettingsScreen from '../screens/SettingsScreen'; +import AboutScreen from '../screens/About/AboutScreen'; import ProximoListScreen from '../screens/Proximo/ProximoListScreen'; import AboutDependenciesScreen from '../screens/About/AboutDependenciesScreen'; @@ -15,6 +15,8 @@ export default createAppContainer( Tabs: MainTabNavigator, // Drawer: MainDrawerNavigator, ProximoListScreen: {screen: ProximoListScreen}, + SettingsScreen: {screen: SettingsScreen}, + AboutScreen: {screen: AboutScreen}, AboutDependenciesScreen: {screen: AboutDependenciesScreen}, }, { diff --git a/navigation/MainTabNavigator.js b/navigation/MainTabNavigator.js index 59b6451..6567991 100644 --- a/navigation/MainTabNavigator.js +++ b/navigation/MainTabNavigator.js @@ -9,7 +9,7 @@ import PlanexScreen from '../screens/PlanexScreen'; import CustomMaterialIcon from "../components/CustomMaterialIcon"; const TAB_ICONS = { - Home: 'home', + Home: 'coffee', Planning: 'calendar-range', Proxiwash: 'washing-machine', Proximo: 'shopping', diff --git a/screens/About/AboutScreen.js b/screens/About/AboutScreen.js index 7bb45ec..5634ff8 100644 --- a/screens/About/AboutScreen.js +++ b/screens/About/AboutScreen.js @@ -163,7 +163,7 @@ export default class AboutScreen extends React.Component { const nav = this.props.navigation; return ( - + diff --git a/screens/PlanexScreen.js b/screens/PlanexScreen.js index 507749a..c9efe47 100644 --- a/screens/PlanexScreen.js +++ b/screens/PlanexScreen.js @@ -2,8 +2,7 @@ import * as React from 'react'; import {Platform, View} from 'react-native'; -import {Container, Right, Spinner} from 'native-base'; -import CustomHeader from "../components/CustomHeader"; +import {Spinner} from 'native-base'; import WebView from "react-native-webview"; import Touchable from "react-native-platform-touchable"; import CustomMaterialIcon from "../components/CustomMaterialIcon"; @@ -36,15 +35,13 @@ export default class PlanningScreen extends React.Component { getRefreshButton() { return ( - - this.refreshWebview()}> - - - + this.refreshWebview()}> + + ); }; @@ -56,7 +53,7 @@ export default class PlanningScreen extends React.Component { render() { const nav = this.props.navigation; return ( - + (this.webview = ref)} source={{uri: PLANEX_URL}} diff --git a/screens/SettingsScreen.js b/screens/SettingsScreen.js index 61fd43a..2ba45f4 100644 --- a/screens/SettingsScreen.js +++ b/screens/SettingsScreen.js @@ -21,6 +21,8 @@ import i18n from "i18n-js"; import {NavigationActions, StackActions} from "react-navigation"; import CustomMaterialIcon from "../components/CustomMaterialIcon"; import AsyncStorageManager from "../utils/AsyncStorageManager"; +import Touchable from "react-native-platform-touchable"; +import {Platform} from "react-native"; type Props = { navigation: Object, @@ -170,11 +172,24 @@ export default class SettingsScreen extends React.Component { ); } + getRightButton() { + return ( + this.props.navigation.navigate('AboutScreen')}> + + + ); + } + render() { const nav = this.props.navigation; return ( - +