Commit c5af5e89 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

ini udah bisa

parent 9e0f0674
...@@ -34,6 +34,9 @@ class Home extends React.Component { ...@@ -34,6 +34,9 @@ class Home extends React.Component {
this._renderCarousell() this._renderCarousell()
this._account(); this._account();
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator:true,
})
this._getPermissions() this._getPermissions()
this._renderCarousell() this._renderCarousell()
this._account(); this._account();
......
...@@ -26,6 +26,7 @@ class MenuSelection extends React.Component { ...@@ -26,6 +26,7 @@ class MenuSelection extends React.Component {
componentDidMount() { componentDidMount() {
if (this.props.outlet_id != '') { if (this.props.outlet_id != '') {
this.getMenuList() this.getMenuList()
} else { } else {
Alert.alert('Device belum mendapatkan lokasi anda') Alert.alert('Device belum mendapatkan lokasi anda')
...@@ -33,6 +34,9 @@ class MenuSelection extends React.Component { ...@@ -33,6 +34,9 @@ class MenuSelection extends React.Component {
console.log("INI OUTLET : "+ this.props.outlet_id) console.log("INI OUTLET : "+ this.props.outlet_id)
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
if (this.props.outlet_id != '') { if (this.props.outlet_id != '') {
this.setState({
indicator:true
})
this.getMenuList() this.getMenuList()
} else { } else {
Alert.alert('Device belum mendapatkan lokasi anda') Alert.alert('Device belum mendapatkan lokasi anda')
...@@ -221,10 +225,17 @@ class MenuSelection extends React.Component { ...@@ -221,10 +225,17 @@ class MenuSelection extends React.Component {
)} )}
</View> </View>
<View style={styles.shadow}> <View style={styles.shadow}>
<View style={{ flexDirection: 'row', }}>
<Text style={{ fontSize: 12, margin: 10 }}> Price Estimation / Item {this.props.order_quantity} </Text> {
<Text style={{ fontSize: 20, margin: 10, marginBottom: 10 }}> Rp. {this.props.order_total}</Text> this.state.indicator == true ? (<ActivityIndicator style={{ top: 10 }} size="large" color="#c9af6d" />):(
</View>
<View style={{ flexDirection: 'row', }}>
<Text style={{ fontSize: 12, margin: 10 }}> Price Estimation / Item {this.props.order_quantity} </Text>
<Text style={{ fontSize: 20, margin: 10, marginBottom: 10 }}> Rp. {this.props.order_total}</Text>
</View>
)
}
<View> <View>
<Button title="VIEW CART" onPress={() => this.props.navigation.navigate('Shopping Cart')}></Button> <Button title="VIEW CART" onPress={() => this.props.navigation.navigate('Shopping Cart')}></Button>
</View> </View>
......
...@@ -18,9 +18,12 @@ class OrderHistory extends React.Component { ...@@ -18,9 +18,12 @@ class OrderHistory extends React.Component {
componentDidMount() { componentDidMount() {
this.getOrderHistory() this.getOrderHistory()
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
return (
this.setState({
indicator:true,
})
this.getOrderHistory() this.getOrderHistory()
)
}); });
} }
......
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