Commit 4aca1f82 authored by d.arizona's avatar d.arizona

update screen ecart

parent 50697d6c
......@@ -10,19 +10,23 @@ export default class BaseButton extends Component {
onPress: PropTypes.func,
text: PropTypes.string,
color: PropTypes.any,
style: PropTypes.object
style: PropTypes.object,
textColor: PropTypes.any,
fontSizeText: PropTypes.number
}
// Defaults for props
static defaultProps = {
text: '',
color: '#4cc9f0'
color: '#4cc9f0',
textColor: 'white',
fontSizeText: 16
}
render () {
return (
<TouchableOpacity onPress={this.props.onPress} style={[{width:'100%', alignItems: 'center', borderRadius: 32, backgroundColor: this.props.color, paddingVertical: 15}, this.props.style]}>
<BaseText text={this.props.text} type={"bold"} style={{fontSize: 16, color: 'white'}}/>
<BaseText text={this.props.text} type={"bold"} style={{fontSize: this.props.fontSizeText, color: this.props.textColor}}/>
</TouchableOpacity>
)
}
......
import React, { Component } from 'react'
import { ScrollView, Text, KeyboardAvoidingView } from 'react-native'
import { ScrollView, Text, KeyboardAvoidingView, View, BackHandler, Image } from 'react-native'
import { connect } from 'react-redux'
// Add Actions - replace 'Your' with whatever your reducer is called :)
// import YourActions from '../Redux/YourRedux'
// Styles
import styles from './Styles/DetailOrderScreenStyle'
import BaseHeader from '../Components/BaseHeader'
import BaseText from '../Components/BaseText'
import { Images } from '../Themes'
import BaseButton from '../Components/BaseButton'
class DetailOrderScreen extends Component {
backAction = () => {
this.props.navigation.goBack()
return true;
};
componentDidMount() {
// alert('sadap')
// alert(JSON.stringify(this.props.navigation))
BackHandler.addEventListener("hardwareBackPress", this.backAction);
}
componentWillUnmount() {
BackHandler.removeEventListener("hardwareBackPress", this.backAction);
}
render () {
return (
<ScrollView style={styles.container}>
<KeyboardAvoidingView behavior='position'>
<Text>DetailOrderScreen</Text>
</KeyboardAvoidingView>
</ScrollView>
<View style={{flex: 1, backgroundColor: '#4cc9f0'}}>
<BaseHeader leftText={'No. Order 123456'} onBackPress={this.backAction}/>
<ScrollView style={[styles.scrollContent]}>
{/* Tanggal */}
<View style={{padding: 15, borderRadius: 10, elevation: 5, backgroundColor: 'white', marginVertical: 20, marginHorizontal: 5}}>
<BaseText text={"Tanggal"} type={"regular"} style={{fontSize: 10, color: '#4b4b4b', opacity: .7}}/>
<BaseText text={"18 Juli 2020, 10:38 AM"} type={"regular"} style={{fontSize: 12, opacity: .9}}/>
<View style={{marginVertical: 10, height: 1, width: '100%', backgroundColor: '#d8d8d8'}}/>
<BaseText text={"Status Pesanan"} type={"regular"} style={{fontSize: 10, color: '#4b4b4b', opacity: .7}}/>
<BaseText text={"MENUNGGU KONFIRMASI"} type={"regular"} style={{fontSize: 12, opacity: .9}}/>
</View>
{/* Produk */}
<View>
<BaseText text={"Produk"} type={"bold"} style={{fontSize: 16, color: '#4b4b4b', paddingHorizontal: 5}}/>
<View style={{padding: 15, borderRadius: 10, elevation: 5, backgroundColor: 'white', marginTop: 20, marginHorizontal: 5}}>
<View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
<View style={{width: 90}}>
<Image source={Images.jaket} style={{resizeMode: 'stretch', height: 90, width: '100%', borderRadius: 40}}/>
</View>
<View style={{flexGrow: 1, justifyContent: 'space-between', paddingLeft: 10}}>
<BaseText text={"88Rising x Guess Hooded Sweatshirt"} type={"bold"} style={{fontSize: 12, color: '#4b4b4b'}}/>
<BaseText text={"Rp. 2.400.000"} type={"bold"} style={{fontSize: 12, color: '#4cc9f0'}}/>
<BaseText text={`Ukuran: L\nJumlah: 1 (1kg)`} type={"bold"} style={{fontSize: 10, color: '#4b4b4b', opacity: .5,}}/>
</View>
</View>
<View style={{marginVertical: 20, height: 1, width: '100%', backgroundColor: '#d8d8d8'}}/>
<BaseText text={"Total Harga"} type={"bold"} style={{fontSize: 10, color: '#4b4b4b', opacity: .5}}/>
<BaseText text={"Rp. 2.400.000"} type={"bold"} style={{fontSize: 12, color: '#4cc9f0'}}/>
</View>
<View style={{padding: 15, borderRadius: 10, elevation: 5, backgroundColor: 'white', marginVertical: 10, marginHorizontal: 5}}>
<View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
<View style={{width: 90}}>
<Image source={Images.sepatu} style={{resizeMode: 'stretch', height: 90, width: '100%', borderRadius: 40}}/>
</View>
<View style={{flexGrow: 1, justifyContent: 'space-between', paddingLeft: 10}}>
<BaseText text={"Compass x Pot Meets Pop"} type={"bold"} style={{fontSize: 12, color: '#4b4b4b'}}/>
<BaseText text={"Rp. 3.700.000"} type={"bold"} style={{fontSize: 12, color: '#4cc9f0'}}/>
<BaseText text={`Ukuran: 43\nJumlah: 1 (1kg)`} type={"bold"} style={{fontSize: 10, color: '#4b4b4b', opacity: .5,}}/>
</View>
</View>
<View style={{marginVertical: 20, height: 1, width: '100%', backgroundColor: '#d8d8d8'}}/>
<BaseText text={"Total Harga"} type={"bold"} style={{fontSize: 10, color: '#4b4b4b', opacity: .5}}/>
<BaseText text={"Rp. 3.700.000"} type={"bold"} style={{fontSize: 12, color: '#4cc9f0'}}/>
</View>
</View>
{/* Detail Pengiriman */}
<View>
<BaseText text={"Detail Pengiriman"} type={"bold"} style={{fontSize: 16, color: '#4b4b4b', paddingHorizontal: 5, marginTop: 10}}/>
<View style={{padding: 15, borderRadius: 10, elevation: 5, backgroundColor: 'white', marginTop: 20, marginHorizontal: 5}}>
<BaseText text={"Kurir Pengiriman"} type={"regular"} style={{fontSize: 10, color: '#4b4b4b', opacity: .7}}/>
<Image source={Images.logoAnterAja} style={{resizeMode: 'stretch', height: 30, width: 70, resizeMode: 'stretch', marginTop: 10}}/>
<View style={{marginVertical: 25}}>
<BaseText text={"No. Resi"} type={"regular"} style={{fontSize: 10, color: '#4b4b4b', opacity: .7}}/>
<View style={{flexDirection: 'row'}}>
<BaseText text={"00987089860"} type={"bold"} style={{fontSize: 12}}/>
<BaseText text={"Salin No. Resi"} type={"bold"} style={{fontSize: 12, color: '#4cc9f0', marginLeft: 20, textDecorationLine: 'underline', textDecorationColor: '#4cc9f0'}}/>
</View>
</View>
<BaseText text={"Alamat Pengiriman"} type={"regular"} style={{fontSize: 10, color: '#4b4b4b', opacity: .7}}/>
<BaseText text={"Rizal Firnando (Rumah)\n08129986899"} type={"bold"} style={{fontSize: 12, color: '#4b4b4b', opacity: .9, marginVertical: 5}}/>
<BaseText text={"Jl. Pejompongan IV No.136, RT.2/RW.5, Bend. Hilir,\nKecamatan Tanah Abang, Kota Jakarta Pusat,\nDKI Jakarta, 10210"} type={"regular"} style={{fontSize: 11, color: '#4b4b4b', opacity: 1}}/>
</View>
</View>
{/* Informasi Pembayaran */}
<View>
<BaseText text={"Informasi Pembayaran"} type={"bold"} style={{fontSize: 16, color: '#4b4b4b', paddingHorizontal: 5, marginTop: 20}}/>
<View style={{padding: 15, borderRadius: 10, elevation: 5, backgroundColor: 'white', marginVertical: 20, marginHorizontal: 5}}>
<View style={{flexDirection:'row', justifyContent:'space-between'}}>
<BaseText text={"Metode Pembayaran"} type={"regular"} style={{fontSize: 12, color: '#4b4b4b', opacity: .7}}/>
<BaseText text={"COD"} type={"bold"} style={{fontSize: 12, opacity: .9}}/>
</View>
<View style={{marginVertical: 10, height: 1, width: '100%', backgroundColor: '#d8d8d8'}}/>
<View style={{paddingVertical: 10}}>
<View style={{flexDirection:'row', justifyContent:'space-between'}}>
<BaseText text={"Total Harga (2 Produk)"} type={"regular"} style={{fontSize: 12, color: '#4b4b4b', opacity: .7}}/>
<BaseText text={"Rp. 6.100.000"} type={"bold"} style={{fontSize: 12, opacity: .9}}/>
</View>
<View style={{flexDirection:'row', justifyContent:'space-between', marginTop: 5}}>
<BaseText text={"Total Ongkos Kirim (1kg)"} type={"regular"} style={{fontSize: 12, color: '#4b4b4b', opacity: .7}}/>
<BaseText text={"Rp. 10.000"} type={"bold"} style={{fontSize: 12, opacity: .9}}/>
</View>
</View>
<View style={{marginVertical: 10, height: 1, width: '100%', backgroundColor: '#d8d8d8'}}/>
<View style={{flexDirection:'row', justifyContent:'space-between', marginTop: 5, paddingVertical: 5}}>
<BaseText text={"Total Bayar"} type={"bold"} style={{color: '#4b4b4b', opacity: .9}}/>
<BaseText text={"Rp. 6.110.000"} type={"bold"} style={{opacity: .9, color: '#4cc9f0'}}/>
</View>
</View>
</View>
{/* Button DUO */}
<View style={{flexDirection: 'row', justifyContent: 'space-between', marginTop: 10, marginBottom: 30}}>
<View style={{width: '50%', alignItems:'center', paddingHorizontal: 5}}>
<BaseButton text={'Tanya Pesanan'} onPress={() => null} fontSizeText={12} color={'white'} textColor={'#4cc9f0'} style={{borderWidth: 1, borderColor: '#4cc9f0'}}/>
</View>
<View style={{width: '50%', alignItems:'center', paddingHorizontal: 5}}>
<BaseButton text={'Pesanan Diterima'} onPress={() => null} fontSizeText={12} />
</View>
</View>
</ScrollView>
<View style={{padding: 20, alignSelf:'flex-end', justifyContent: 'flex-end', backgroundColor: 'white', elevation: 5, width: '100%', borderTopWidth: .5, borderTopColor: '#d8d8d8'}}>
<BaseButton text={'Lacak Pesanan'} onPress={() => this.props.navigation.navigate('TrackOrderScreen')}/>
</View>
</View>
)
}
}
......
......@@ -71,10 +71,14 @@ class HomePageScreen extends Component {
</View>
</View>
<View style={{marginTop: 20, borderTopWidth: .5, borderTopColor: '#4b4b4b', alignItems: 'center', borderBottomWidth: .5, borderBottomColor: '#4b4b4b', paddingVertical: 10, paddingLeft: 30, flexDirection: 'row'}}>
<View style={{alignItems:'center', flexDirection: 'column'}}>
<TouchableOpacity style={{alignItems:'center', flexDirection: 'column'}}
onPress={() => {
this.toggleOpen()
this.props.navigation.navigate('MyOrderScreen')
}}>
<Image source={Images.icon_pesanansaya} style={{width: 25, height: 30}}/>
<BaseText type={"regular"} text={'Pesanan Saya'} style={{fontSize: 9, marginTop: 5}}/>
</View>
</TouchableOpacity>
<TouchableOpacity style={{ alignItems: 'center', flexDirection: 'column', paddingTop: 5, marginLeft: 25 }}
onPress={() => {
this.toggleOpen()
......
import React, { Component } from 'react'
import { ScrollView, Text, View, BackHandler, Image, TouchableOpacity } from 'react-native'
import { ScrollView, Text, View, BackHandler, Image, TouchableOpacity, Alert } from 'react-native'
import { connect } from 'react-redux'
import { NavigationActions, StackActions } from 'react-navigation'
import AuthAction from '../Redux/AuthRedux'
......@@ -25,7 +25,14 @@ class MyAccountScreen extends Component {
}
backAction = () => {
this.props.navigation.goBack()
Alert.alert("Hold on!", "Are you sure you want to exit app?", [
{
text: "Cancel",
onPress: () => null,
style: "cancel"
},
{ text: "YES", onPress: () => BackHandler.exitApp() }
]);
return true;
};
......@@ -38,29 +45,36 @@ class MyAccountScreen extends Component {
BackHandler.removeEventListener("hardwareBackPress", this.backAction);
}
handleNav(to) {
this.props.authClearData()
const resetAction = StackActions.reset({
index: 0,
actions: [
NavigationActions.navigate({
routeName: 'HomeNavigation',
})
],
key: null
});
this.props.navigation.dispatch(resetAction);
handleNav(type) {
if (type == 'Data Diri') {
this.props.navigation.navigate('ProfileScreen');
} else if (type == 'Keluar') {
this.props.authClearData()
const resetAction = StackActions.reset({
index: 0,
actions: [
NavigationActions.navigate({
routeName: 'HomeNavigation',
})
],
key: null
});
this.props.navigation.dispatch(resetAction);
} else {
}
}
render() {
return (
<View style={{ flex: 1, backgroundColor: '#4cc9f0' }}>
<BaseHeader leftText={'Akun Saya'} onBackPress={() => this.props.navigation.goBack()} />
<BaseHeader withBack={false} leftText={'Akun Saya'} onBackPress={() => this.props.navigation.goBack()} />
<View style={{ flex: 1, backgroundColor: '#fff', borderTopLeftRadius: 30, borderTopRightRadius: 30, width: '100%' }}>
<View style={{ paddingVertical: 40, paddingHorizontal: 30 }}>
<View style={{ paddingTop: 25, paddingBottom: 40, paddingHorizontal: 30 }}>
{this.state.array.map((item, index) => {
return (
<TouchableOpacity onPress={() => this.handleNav(item)} style={{ marginTop: index== 0 ? 0 : 20, marginBottom: index == this.state.array.length-1? 30 : 0 }} key={index}>
<TouchableOpacity onPress={() => this.handleNav(item.nama)} style={{ marginTop: index== 0 ? 0 : 20, marginBottom: index == this.state.array.length-1? 30 : 0 }} key={index}>
<View style={{ flexDirection: 'row', paddingVertical: 10}}>
<Image source={item.image} style={{ width: 24, height: 24, resizeMode: 'stretch' }} />
<View style={{ justifyContent: 'center', marginLeft: 20 }}>
......
import React, { Component } from 'react'
import { ScrollView, Text, KeyboardAvoidingView } from 'react-native'
import { ScrollView, Text, KeyboardAvoidingView, View, BackHandler, Image } from 'react-native'
import { connect } from 'react-redux'
import { Container, Header, Tab, Tabs, ScrollableTab, TabHeading } from 'native-base';
import FontAwesome from 'react-native-vector-icons/FontAwesome'
// Add Actions - replace 'Your' with whatever your reducer is called :)
// import YourActions from '../Redux/YourRedux'
// Styles
import styles from './Styles/MyOrderScreenStyle'
import BaseHeader from '../Components/BaseHeader';
import BaseText from '../Components/BaseText';
import { NavigationEvents } from 'react-navigation';
import { Images } from '../Themes';
class MyOrderScreen extends Component {
constructor(props) {
super(props)
this.state = {
activeTab: 0
}
}
backAction = () => {
this.props.navigation.goBack()
return true;
};
componentDidMount() {
BackHandler.addEventListener("hardwareBackPress", this.backAction);
}
componentWillUnmount() {
BackHandler.removeEventListener("hardwareBackPress", this.backAction);
}
render () {
return (
<ScrollView style={styles.container}>
<KeyboardAvoidingView behavior='position'>
<Text>MyOrderScreen</Text>
</KeyboardAvoidingView>
</ScrollView>
<Container style={{backgroundColor: '#4cc9f0'}}>
{/* <NavigationEvents onDidFocus={() => alert('asdasd')}/> */}
<View style={{zIndex: 99}}>
<BaseHeader leftText={'Pesanan Saya'} onBackPress={this.backAction}/>
</View>
<View style={{
flex: 1,
backgroundColor: 'white',
borderTopLeftRadius: 32,
borderTopRightRadius: 32,
zIndex: 0,
paddingHorizontal: 10
// paddingTop: 20
}}>
<Tabs onChangeTab={({i}) => this.setState({activeTab: i})} initialPage={this.state.activeTab} tabBarUnderlineStyle={{backgroundColor: '#4cc9f0'}} tabContainerStyle={{borderTopLeftRadius: 32, borderTopRightRadius: 32, zIndex: 0}} renderTabBar={()=> <ScrollableTab backgroundColor={'transparent'} tabsContainerStyle={{borderTopLeftRadius: 32, borderTopRightRadius: 32, backgroundColor:'transparent', zIndex: 0}}/>}>
<Tab heading={
<TabHeading style={{backgroundColor: 'transparent'}}>
<BaseText text={"Semua"} type={"bold"} style={{fontSize: 12, color: this.state.activeTab == 0? 'black' : '#4b4b4b', opacity: this.state.activeTab == 0? 1 : .6,}}/>
</TabHeading>}>
<View style={{paddingHorizontal: 20, flex: 1, alignItems: 'center', backgroundColor: 'white'}}>
<View style={{borderRadius: 10, width: '100%', elevation: 5, backgroundColor:'white', marginTop: 20}}>
<View style={{paddingHorizontal: 20, paddingVertical: 15, backgroundColor: 'rgba(76, 201, 240, .2)', borderTopLeftRadius: 10, borderTopRightRadius: 10, width: '100%', flexDirection: 'row', justifyContent: 'space-between',}}>
<View style={{justifyContent: 'center', width: '50%'}}>
<BaseText text={"18 Juli 2020"} type={"regular"} style={{fontSize: 10, color: '#4b4b4b', opacity: .7}}/>
<BaseText text={"123456"} type={"regular"} style={{fontSize: 12, opacity: .9}}/>
</View>
<View style={{alignItems:'flex-end', justifyContent: 'center', width: '50%'}}>
<BaseText text={"Menunggu Konfirmasi"} type={"bold"} style={{fontSize: 12, color: 'black'}}/>
</View>
</View>
<View style={{padding: 20}}>
<View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
<View style={{width: '20%'}}>
<Image source={Images.jaket} style={{resizeMode: 'stretch', height: 50, width: 50, borderRadius: 40}}/>
</View>
<View style={{flexGrow: 1, justifyContent: 'space-between'}}>
<BaseText text={"88Rising x Guess Hooded Sweatshirt"} type={"bold"} style={{fontSize: 12, color: '#4b4b4b'}}/>
<BaseText text={"1 produk lainnya"} type={"bold"} style={{fontSize: 12, color: '#4b4b4b', opacity: .5,}}/>
</View>
</View>
</View>
<View style={{alignItems:'center', justifyContent: 'center', paddingTop: 0, paddingBottom: 20}}>
<BaseText onPress={() => this.props.navigation.navigate('DetailOrderScreen')} text={"Detail Pesanan"} type={"bold"} style={{color: '#4cc9f0', textDecorationLine: 'underline', textDecorationColor: '#4cc9f0'}}/>
</View>
<View style={{alignItems:'flex-start', justifyContent: 'center', padding: 20, borderTopWidth: 1, borderTopColor: '#d8d8d8'}}>
<BaseText text={"Total Pembayaran"} type={"bold"} style={{fontSize: 11, color: '#4b4b4b', opacity: .5,}}/>
<BaseText text={"Rp. 6.110.000"} type={"bold"} style={{fontSize: 13, color: '#4cc9f0'}}/>
</View>
</View>
</View>
</Tab>
<Tab heading={
<TabHeading style={{backgroundColor: 'transparent'}}>
<BaseText text={"Menunggu Konfirmasi"} type={"bold"} style={{fontSize: 12, color: this.state.activeTab == 1? 'black' : '#4b4b4b', opacity: this.state.activeTab == 1? 1 : .6,}}/>
</TabHeading>}>
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center', backgroundColor: 'white'}}>
<BaseText text={"List Menunggu Konfirmasi"} type={"bold"} style={{fontSize: 12, color: '#4b4b4b', opacity: .6,}}/>
</View>
</Tab>
<Tab heading={
<TabHeading style={{backgroundColor: 'transparent'}}>
<BaseText text={"Pesanan Diproses"} type={"bold"} style={{fontSize: 12, color: this.state.activeTab == 2? 'black' : '#4b4b4b', opacity: this.state.activeTab == 2? 1 : .6,}}/>
</TabHeading>}>
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center', backgroundColor: 'white'}}>
<BaseText text={"List Diproses"} type={"bold"} style={{fontSize: 12, color: '#4b4b4b', opacity: .6,}}/>
</View>
</Tab>
<Tab heading={
<TabHeading style={{backgroundColor: 'transparent'}}>
<BaseText text={"Pesanan Dikirim"} type={"bold"} style={{fontSize: 12, color: this.state.activeTab == 3? 'black' : '#4b4b4b', opacity: this.state.activeTab == 3? 1 : .6,}}/>
</TabHeading>}>
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center', backgroundColor: 'white'}}>
<BaseText text={"List Dikirim"} type={"bold"} style={{fontSize: 12, color: '#4b4b4b', opacity: .6,}}/>
</View>
</Tab>
<Tab heading={
<TabHeading style={{backgroundColor: 'transparent'}}>
<BaseText text={"Pesanan Tiba"} type={"bold"} style={{fontSize: 12, color: this.state.activeTab == 4? 'black' : '#4b4b4b', opacity: this.state.activeTab == 4? 1 : .6,}}/>
</TabHeading>}>
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center', backgroundColor: 'white'}}>
<BaseText text={"List Tiba"} type={"bold"} style={{fontSize: 12, color: '#4b4b4b', opacity: .6,}}/>
</View>
</Tab>
<Tab heading={
<TabHeading style={{backgroundColor: 'transparent'}}>
<BaseText text={"Pesanan Dikomplain"} type={"bold"} style={{fontSize: 12, color: this.state.activeTab == 5? 'black' : '#4b4b4b', opacity: this.state.activeTab == 5? 1 : .6,}}/>
</TabHeading>}>
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center', backgroundColor: 'white'}}>
<BaseText text={"List Dikomplain"} type={"bold"} style={{fontSize: 12, color: '#4b4b4b', opacity: .6,}}/>
</View>
</Tab>
<Tab heading={
<TabHeading style={{backgroundColor: 'transparent'}}>
<BaseText text={"Pesanan Selesai"} type={"bold"} style={{fontSize: 12, color: this.state.activeTab == 6? 'black' : '#4b4b4b', opacity: this.state.activeTab == 6? 1 : .6,}}/>
</TabHeading>}
tabStyle={{backgroundColor: 'transparent'}} activeTabStyle={{backgroundColor:'transparent'}}>
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center', backgroundColor: 'white'}}>
<BaseText text={"List Selesai"} type={"bold"} style={{fontSize: 12, color: '#4b4b4b', opacity: .6,}}/>
</View>
</Tab>
</Tabs>
</View>
</Container>
)
}
}
......
......@@ -48,15 +48,6 @@ class OtpVerificationScreen extends Component {
}
backAction = () => {
// Alert.alert("Hold on!", "Are you sure you want to exit app?", [
// {
// text: "Cancel",
// onPress: () => null,
// style: "cancel"
// },
// { text: "YES", onPress: () => BackHandler.exitApp() }
// ]);
// this.props.navigation.goBack()
return true;
};
......
......@@ -20,31 +20,15 @@ class ProfileScreen extends Component {
}
}
backAction = () => {
Alert.alert("Hold on!", "Are you sure you want to exit app?", [
{
text: "Cancel",
onPress: () => null,
style: "cancel"
},
{ text: "YES", onPress: () => this.props.navigation.navigate('LoginScreen') }
]);
this.props.navigation.goBack()
return true;
};
componentDidMount() {
// alert('sadap')
// alert(JSON.stringify(this.props.navigation))
const { navigation } = this.props;
this.focusListener = navigation.addListener("didFocus", () => {
// The screen is focused
// Call any action
// alert('addsdas')
});
BackHandler.addEventListener("hardwareBackPress", this.backAction);
}
componentWillUnmount() {
this.focusListener.remove();
BackHandler.removeEventListener("hardwareBackPress", this.backAction);
}
......@@ -59,7 +43,7 @@ class ProfileScreen extends Component {
return (
<View style={{ flex: 1, backgroundColor: '#fff' }}>
<StatusBar backgroundColor={'transparent'} translucent={true} barStyle={'light-content'}/>
<BaseHeader leftText={'Data Diri'} />
<BaseHeader leftText={'Data Diri'} onBackPress={this.backAction}/>
<View style={{ backgroundColor: '#4cc9f0', borderBottomLeftRadius: 80, borderBottomRightRadius: 80, width: '100%', alignSelf: 'center' }}>
{/* <BaseText text={this.state.activeIndex} type={"bold"} style={{color: 'red', fontSize: 16, backgroundColor: 'yellow', width: '100%'}}/> */}
<View style={{ justifyContent: 'center', flexDirection: 'row', marginBottom: 20 }}>
......
......@@ -30,14 +30,6 @@ class RewardScreen extends Component {
}
}
backAction = () => {
// Alert.alert("Hold on!", "Are you sure you want to exit app?", [
// {
// text: "Cancel",
// onPress: () => null,
// style: "cancel"
// },
// { text: "YES", onPress: () => BackHandler.exitApp() }
// ]);
this.props.navigation.goBack()
return true;
};
......
......@@ -2,5 +2,13 @@ import { StyleSheet } from 'react-native'
import { ApplicationStyles } from '../../Themes/'
export default StyleSheet.create({
...ApplicationStyles.screen
...ApplicationStyles.screen,
scrollContent: {
flex: 1,
backgroundColor: 'white',
borderTopLeftRadius: 32,
borderTopRightRadius: 32,
paddingHorizontal: 20,
// paddingTop: 50,
},
})
......@@ -2,5 +2,15 @@ import { StyleSheet } from 'react-native'
import { ApplicationStyles } from '../../Themes/'
export default StyleSheet.create({
...ApplicationStyles.screen
...ApplicationStyles.screen,
text: {
fontFamily: "Nunito-Regular",
color: "#4b4b4b",
fontSize: 10
},
activetext: {
fontFamily: "Nunito-Regular",
color: "black",
fontSize: 10
}
})
......@@ -2,5 +2,13 @@ import { StyleSheet } from 'react-native'
import { ApplicationStyles } from '../../Themes/'
export default StyleSheet.create({
...ApplicationStyles.screen
...ApplicationStyles.screen,
scrollContent: {
flex: 1,
backgroundColor: 'white',
borderTopLeftRadius: 32,
borderTopRightRadius: 32,
paddingHorizontal: 20,
// paddingTop: 50,
},
})
import React, { Component } from 'react'
import { ScrollView, Text, KeyboardAvoidingView } from 'react-native'
import { ScrollView, Text, KeyboardAvoidingView, View, BackHandler } from 'react-native'
import { connect } from 'react-redux'
// Add Actions - replace 'Your' with whatever your reducer is called :)
// import YourActions from '../Redux/YourRedux'
// Styles
import styles from './Styles/TrackOrderScreenStyle'
import BaseHeader from '../Components/BaseHeader';
import BaseText from '../Components/BaseText';
class TrackOrderScreen extends Component {
constructor(props) {
super(props)
this.state = {
dummyData: [
{
tanggal: '18 Mei 2020\n09:00 AM',
info: 'Pesanan Diterima',
notes: 'Dealer telah menerima pesanan dari Anda'
},{
tanggal: '18 Mei 2020\n09:45 AM',
info: 'Pesanan Berhasil',
notes: 'Pembayaran sudah diterima'
},{
tanggal: '18 Mei 2020\n10:45 AM',
info: 'Pengemasan Barang',
notes: 'Penjual sedang dalam proses pengemasan barang'
},{
tanggal: '18 Mei 2020\n06:30 PM',
info: 'Proses Pengiriman',
notes: 'Dealer telah menerima pesanan dari Anda'
},{
tanggal: '18 Mei 2020\n07:00 PM',
info: 'Pesanan Sampai Tujuan',
notes: 'Diterima oleh pembeli'
},
]
}
}
backAction = () => {
this.props.navigation.goBack()
return true;
};
componentDidMount() {
// alert('sadap')
// alert(JSON.stringify(this.props.navigation))
BackHandler.addEventListener("hardwareBackPress", this.backAction);
}
componentWillUnmount() {
BackHandler.removeEventListener("hardwareBackPress", this.backAction);
}
render () {
return (
<ScrollView style={styles.container}>
<KeyboardAvoidingView behavior='position'>
<Text>TrackOrderScreen</Text>
</KeyboardAvoidingView>
</ScrollView>
<View style={{flex: 1, backgroundColor: '#4cc9f0'}}>
<BaseHeader leftText={'No. Order 123456'} onBackPress={this.backAction}/>
<ScrollView style={[styles.scrollContent]}>
{this.state.dummyData.map((item, index) => {
return (
<View style={{marginTop: index == 0? 40 : 0}} key={index}>
<View style={{flexDirection:'row', justifyContent: 'space-between'}}>
<BaseText text={item.tanggal} type={"regular"} style={{fontSize: 12, opacity: .6, textAlign: 'right', width: '25%'}}/>
<View style={{width: '10%', alignItems: 'center', marginHorizontal: 5}}>
<View style={{height: 20, width: 20, backgroundColor: '#4cc9f0', borderRadius: 30}}/>
{index != this.state.dummyData.length -1 && <View style={{width: 3, backgroundColor: '#4cc9f0', height: 50, marginVertical: 5,}}/>}
</View>
<View style={{flexGrow: 1}}>
<BaseText text={item.info} type={"bold"} style={{fontSize: 12, opacity: .9, marginTop: 0,}}/>
<BaseText text={item.notes} type={"bold"} style={{fontSize: 10, opacity: .3}}/>
</View>
</View>
</View>
)
})}
</ScrollView>
</View>
)
}
}
......
......@@ -6,7 +6,7 @@ import { BottomFabBar } from 'rn-wave-bottom-bar'
import HomePageScreen from '../Containers/HomePageScreen';
import NotificationScreen from '../Containers/NotificationScreen';
import WishlistScreen from '../Containers/WishlistScreen';
import ProfileScreen from '../Containers/ProfileScreen';
import MyAccountScreen from '../Containers/MyAccountScreen';
import { NavigationEvents } from 'react-navigation';
const Tab = createBottomTabNavigator();
......@@ -64,17 +64,17 @@ class MyTabs extends React.Component {
{() => <WishlistScreen navigation={this.props.navigation}/>}
</Tab.Screen>
<Tab.Screen
name="Profile"
name="MyAccount"
// component={Profile}
options={{
tabBarLabel: 'Profile',
tabBarLabel: 'MyAccount',
tabBarIcon: ({ color, size }) => (
<MaterialCommunityIcons name="account" color={color} size={size} />
),
}}
>
{() => <ProfileScreen navigation={this.props.navigation}/>}
{() => <MyAccountScreen navigation={this.props.navigation}/>}
</Tab.Screen>
</Tab.Navigator>
);
......@@ -100,6 +100,7 @@ export default class App extends React.Component {
<NavigationEvents
onDidFocus={() => this.refresh()}
/>
{/* <MyTabs navigation={this.props.navigation} activeIndex={this.state.activeIndex}/> */}
{!this.state.refresh && <MyTabs navigation={this.props.navigation} activeIndex={this.state.activeIndex}/>}
</NavigationContainer>
);
......
......@@ -46,6 +46,7 @@ const images = {
beautyProduct: require('../Images/imageDummy/beautyProduct.jpg'),
bodyShop: require('../Images/imageDummy/bodyShop.jpeg'),
comingSoon: require('../Images/imageDummy/comingSoon.png'),
logoAnterAja: require('../Images/imageDummy/logoAnterAja.png'),
}
export default images
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
No preview for this file type
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -75,6 +75,10 @@
<string>Nunito-Italic.ttf</string>
<string>Nunito-Light.ttf</string>
<string>Nunito-Regular.ttf</string>
<string>Fontisto.ttf</string>
<string>Roboto_medium.ttf</string>
<string>Roboto.ttf</string>
<string>rubicon-icon-font.ttf</string>
</array>
</dict>
</plist>
......@@ -37,6 +37,7 @@
"format-json": "^1.0.3",
"identity-obj-proxy": "^3.0.0",
"lodash": "^4.17.15",
"native-base": "^2.13.12",
"prop-types": "^15.7.2",
"querystringify": "^2.1.1",
"ramda": "^0.27.0",
......@@ -58,7 +59,7 @@
"react-native-snap-carousel": "^3.9.1",
"react-native-svg": "^12.1.0",
"react-native-toast-message": "^1.3.1",
"react-native-vector-icons": "6.1.0",
"react-native-vector-icons": "6.6.0",
"react-navigation": "^4.2.2",
"react-navigation-redux-helpers": "^4.0.1",
"react-navigation-stack": "^1.10.3",
......
This diff is collapsed.
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