Commit cc571bdc authored by Phuengton Chummuel's avatar Phuengton Chummuel

change navigation style

parent 749e9400
import React, { Component } from 'react'; import React, { Component } from 'react';
import { DrawerNavigator, StackNavigator } from 'react-navigation'; import { DrawerNavigator, StackNavigator, TabNavigator } from 'react-navigation';
import HomeScreen from './../screens/HomeScreen'; import HomeScreen from './../screens/HomeScreen';
import CameraScreen from './../screens/CameraScreen'; import CameraScreen from './../screens/CameraScreen';
...@@ -14,7 +14,7 @@ import ReminderDetail from './../screens/ReminderDetail' ...@@ -14,7 +14,7 @@ import ReminderDetail from './../screens/ReminderDetail'
const RootNavigator = StackNavigator( const RootNavigator = StackNavigator(
{ {
Home: { Home: {
screen: DrawerNavigator({ screen: TabNavigator({
Home: { Home: {
screen: StackNavigator({ screen: StackNavigator({
Home: { Home: {
...@@ -54,6 +54,18 @@ const RootNavigator = StackNavigator( ...@@ -54,6 +54,18 @@ const RootNavigator = StackNavigator(
headerMode: 'none' headerMode: 'none'
}) })
} }
}, {
tabBarPosition: 'bottom',
swipeEnabled: false,
tabBarOptions: {
labelStyle: {
color: 'black'
},
style: {
backgroundColor: 'white',
}
}
}) })
}, },
SignIn: { SignIn: {
...@@ -64,5 +76,4 @@ const RootNavigator = StackNavigator( ...@@ -64,5 +76,4 @@ const RootNavigator = StackNavigator(
} }
) )
export default RootNavigator; export default RootNavigator;
\ No newline at end of file
...@@ -67,7 +67,7 @@ class HomeScreen extends Component { ...@@ -67,7 +67,7 @@ class HomeScreen extends Component {
<Grid> <Grid>
<Col> <Col>
<Row> <Row>
<TouchableOpacity style={timePeriodLeftStyle} onPress={() => this._timePeriodPress(this.state.morningReminder)}> <TouchableOpacity style={timePeriodLeftStyle} onPress={() => this._timePeriodPress(this.state.morningReminder, 1)}>
<ReminderList <ReminderList
periodText={"Morning"} periodText={"Morning"}
items={this.state.morningReminder} items={this.state.morningReminder}
...@@ -75,7 +75,7 @@ class HomeScreen extends Component { ...@@ -75,7 +75,7 @@ class HomeScreen extends Component {
</TouchableOpacity> </TouchableOpacity>
</Row> </Row>
<Row> <Row>
<TouchableOpacity style={timePeriodLeftStyle} onPress={() => this._timePeriodPress(this.state.afternoonReminder)}> <TouchableOpacity style={timePeriodLeftStyle} onPress={() => this._timePeriodPress(this.state.afternoonReminder, 2)}>
<ReminderList <ReminderList
periodText={"Afternoon"} periodText={"Afternoon"}
items={this.state.afternoonReminder} items={this.state.afternoonReminder}
...@@ -85,7 +85,7 @@ class HomeScreen extends Component { ...@@ -85,7 +85,7 @@ class HomeScreen extends Component {
</Col> </Col>
<Col> <Col>
<Row> <Row>
<TouchableOpacity style={timePeriodRightStyle} onPress={() => this._timePeriodPress(this.state.eveningReminder)}> <TouchableOpacity style={timePeriodRightStyle} onPress={() => this._timePeriodPress(this.state.eveningReminder, 3)}>
<ReminderList <ReminderList
periodText={"Evening"} periodText={"Evening"}
items={this.state.eveningReminder} items={this.state.eveningReminder}
...@@ -93,7 +93,7 @@ class HomeScreen extends Component { ...@@ -93,7 +93,7 @@ class HomeScreen extends Component {
</TouchableOpacity> </TouchableOpacity>
</Row> </Row>
<Row> <Row>
<TouchableOpacity style={timePeriodRightStyle} onPress={() => this._timePeriodPress(this.state.nightReminder)}> <TouchableOpacity style={timePeriodRightStyle} onPress={() => this._timePeriodPress(this.state.nightReminder, 4)}>
<ReminderList <ReminderList
periodText={"Night"} periodText={"Night"}
items={this.state.nightReminder} items={this.state.nightReminder}
...@@ -124,9 +124,9 @@ class HomeScreen extends Component { ...@@ -124,9 +124,9 @@ class HomeScreen extends Component {
this.props.navigation.navigate('DrawerToggle'); this.props.navigation.navigate('DrawerToggle');
} }
_timePeriodPress(data) { _timePeriodPress(data, period) {
ToastAndroid.show(JSON.stringify(data), ToastAndroid.SHORT) ToastAndroid.show(JSON.stringify(data), ToastAndroid.SHORT)
this.props.navigation.navigate('Detail', { items: data }) this.props.navigation.navigate('Detail', { items: data, period: period })
} }
_queryReminder() { _queryReminder() {
......
...@@ -19,13 +19,14 @@ class ReminderDetail extends React.Component { ...@@ -19,13 +19,14 @@ class ReminderDetail extends React.Component {
const { params } = this.props.navigation.state; const { params } = this.props.navigation.state;
const { goBack } = this.props.navigation; const { goBack } = this.props.navigation;
const items = params ? params.items : null const items = params ? params.items : null
const period = params.period == 1 ? "Mornign" : params.period == 2 ? "Afternoon" : params.period == 3 ? "Evening" : "Night"
const { headerStyle, headerFontStyle } = styles const { headerStyle, headerFontStyle } = styles
return ( return (
<Container style={{ backgroundColor: 'white' }}> <Container style={{ backgroundColor: 'white' }}>
<AppHeader <AppHeader
headerText={"Morning"} headerText={period}
headerLeft={ headerLeft={
<Button onPress={() => goBack()}> <Button onPress={() => goBack()}>
<Icon name='arrow-back' /> <Icon name='arrow-back' />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment