Commit 53e898dc authored by d.arizona's avatar d.arizona

finishing ngantuk

parent 34e5dab7
......@@ -262,7 +262,7 @@ class CartScreen extends Component {
<BarIndicator count={5} color='#4cc9f0' size={25}/>
</View> :
<View style={[styles.scrollContent]}>
<View style={{padding: 20, flexDirection:'row', justifyContent: 'space-between', borderBottomColor: '#ececec', borderBottomWidth: 1}}>
{this.state.listCart.length != 0 && <View style={{padding: 20, flexDirection:'row', justifyContent: 'space-between', borderBottomColor: '#ececec', borderBottomWidth: 1}}>
<View style={{flexDirection:'row'}}>
<TouchableOpacity onPress={() => {
this.state.arrayCheck.length > 0 && this.state.arrayCheck.length == this.state.listCart.length?
......@@ -276,13 +276,13 @@ class CartScreen extends Component {
<BaseText onPress={() => {
this.state.arrayCheck.length > 0 && this.state.arrayCheck.length == this.state.listCart.length?
this.setState({arrayCheck: [], dataCheckout: []}) : this.handleCheckAll()
}} text={"Pilih Semua Orang"} type={"bold"} style={{opacity: .7, fontSize: 12, marginLeft: 15, alignSelf: 'flex-end',}}/>
}} text={"Pilih Semua Barang"} type={"bold"} style={{opacity: .7, fontSize: 12, marginLeft: 15, alignSelf: 'flex-end',}}/>
</View>
<View>
<BaseText text={'Hapus'} type={"bold"} style={{opacity: .8, color: '#4cc9f0'}}/>
</View>
</View>
<ScrollView showsVerticalScrollIndicator={false} style={{backgroundColor:'white'}}>
</View>}
<ScrollView showsVerticalScrollIndicator={false} style={this.state.listCart.length == 0? styles.scrollContent : {backgroundColor:'white'}}>
{this.state.listCart.map((item,index) => {
return (
<View key={index}>
......@@ -384,7 +384,7 @@ class CartScreen extends Component {
</View>
<View style={{width: '100%', height: 15, backgroundColor: '#ececec'}}/>
{index == this.state.listCart.length -1 && item.default_size.length > 0 && <View style={{height: 200, backgroundColor:'#ececec', width: '100%'}}/>}
{index == this.state.listCart.length -1 && item.default_size.length > 0 && <View style={{height: 200, backgroundColor:'white', width: '100%'}}/>}
</View>
)
})}
......@@ -398,7 +398,7 @@ class CartScreen extends Component {
<BaseText text={this.getTotalCart()} type={"bold"} style={{opacity: .8, color: '#4cc9f0'}}/>
</View>
<View style={{width: '40%'}}>
<BaseButton text={'Checkout'} onPress={() => this.handleNavigateCheckout()} fontSizeText={14}/>
<BaseButton text={'Checkout'} color={this.state.listCart.length == 0? '#dedede' : '#4cc9f0'} onPress={() => this.state.listCart.length == 0? null : this.handleNavigateCheckout()} fontSizeText={14}/>
</View>
</View>
</View>
......
This diff is collapsed.
......@@ -16,6 +16,7 @@ import Api from '../Services/Api';
import moment from 'moment';
import Constant from '../Lib/Constant';
import { formatRp } from '../Lib/Utils';
import { BarIndicator } from 'react-native-indicators';
class MyOrderScreen extends Component {
constructor(props) {
......@@ -23,7 +24,8 @@ class MyOrderScreen extends Component {
this.state = {
activeTab: 0,
listOrder: [],
currency: ''
currency: '',
loading: false
}
}
backAction = () => {
......@@ -38,10 +40,12 @@ class MyOrderScreen extends Component {
}
getListOrder() {
this.setState({loading: true})
Api.create().getOrder().then((response) => {
if (response.data.status == 'success') {
this.setState({listOrder: response.data.data})
}
this.setState({loading: false})
})
}
......@@ -98,6 +102,9 @@ class MyOrderScreen extends Component {
<View style={{zIndex: 99}}>
<BaseHeader leftText={'Pesanan Saya'} onBackPress={this.backAction}/>
</View>
{this.state.loading? <View style={{flex: 1, backgroundColor: 'white', borderTopLeftRadius: 32, borderTopRightRadius: 32}}>
<BarIndicator count={5} color='#4cc9f0' size={25}/>
</View> :
<View style={{
flex: 1,
backgroundColor: 'white',
......@@ -194,7 +201,7 @@ class MyOrderScreen extends Component {
</View>
</Tab>
</Tabs>
</View>
</View>}
</Container>
)
}
......
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