Updated intro slide and added settings and about buttons

This commit is contained in:
keplyx 2019-08-07 11:10:17 +02:00
parent f5c3f27f14
commit 1cb68a0d15
8 changed files with 72 additions and 33 deletions

37
App.js
View file

@ -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<Props, State> {
this.setState({
isLoading: false,
currentTheme: ThemeManager.getCurrentTheme(),
showIntro: AsyncStorageManager.getInstance().preferences.showIntro.current === '1'
// showIntro: AsyncStorageManager.getInstance().preferences.showIntro.current === '1'
showIntro: true
});
}

View file

@ -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<Props, State> {
icon="menu"/>
</Touchable>
}
rightMenu={this.props.headerRightMenu}/>
rightButton={this.props.headerRightButton}/>
{this.props.children}
</Container>
</CustomSideMenu>

View file

@ -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<Props> {
static defaultProps = {
hasBackButton: false,
leftButton: <View/>,
rightMenu: <Right/>,
rightButton: <View/>,
hasTabs: false,
};
@ -57,7 +57,17 @@ export default class CustomHeader extends React.Component<Props> {
<Body>
<Title>{this.props.title}</Title>
</Body>
{this.props.rightMenu}
<Right>
{this.props.rightButton}
{this.props.hasBackButton ? <View/> :
<Touchable
style={{padding: 6}}
onPress={() => this.props.navigation.navigate('SettingsScreen')}>
<CustomMaterialIcon
color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
icon="settings"/>
</Touchable>}
</Right>
</Header>);
}
};

View file

@ -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},
},
{

View file

@ -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',

View file

@ -163,7 +163,7 @@ export default class AboutScreen extends React.Component<Props> {
const nav = this.props.navigation;
return (
<Container>
<CustomHeader navigation={nav} title={i18n.t('screens.about')}/>
<CustomHeader navigation={nav} title={i18n.t('screens.about')} hasBackButton={true}/>
<Content padder>
<Card>
<CardItem>

View file

@ -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<Props, State> {
getRefreshButton() {
return (
<Right>
<Touchable
style={{padding: 6}}
onPress={() => this.refreshWebview()}>
<CustomMaterialIcon
color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
icon="refresh"/>
</Touchable>
</Right>
<Touchable
style={{padding: 6}}
onPress={() => this.refreshWebview()}>
<CustomMaterialIcon
color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
icon="refresh"/>
</Touchable>
);
};
@ -56,7 +53,7 @@ export default class PlanningScreen extends React.Component<Props, State> {
render() {
const nav = this.props.navigation;
return (
<BaseContainer navigation={nav} headerTitle={'Planex'} headerRightMenu={this.getRefreshButton()}>
<BaseContainer navigation={nav} headerTitle={'Planex'} headerRightButton={this.getRefreshButton()}>
<WebView
ref={ref => (this.webview = ref)}
source={{uri: PLANEX_URL}}

View file

@ -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<Props, State> {
);
}
getRightButton() {
return (
<Touchable
style={{padding: 6}}
onPress={() => this.props.navigation.navigate('AboutScreen')}>
<CustomMaterialIcon
color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
icon="information"/>
</Touchable>
);
}
render() {
const nav = this.props.navigation;
return (
<Container>
<CustomHeader navigation={nav} title={i18n.t('screens.settings')}/>
<CustomHeader navigation={nav} title={i18n.t('screens.settings')} hasBackButton={true}
rightButton={this.getRightButton()}/>
<Content padder>
<Card>
<CardItem header>