Commit e9972f14 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'deni15' into 'master'

Deni15

See merge request !27
parents b64e457c dae60ccd
......@@ -11,21 +11,74 @@ import BaseInput from '../Components/BaseInput'
import BaseText from '../Components/BaseText'
import { Images } from '../Themes'
import Modal from 'react-native-modal';
import ImagePicker from 'react-native-image-crop-picker';
import images from '../Themes/Images'
class ComplainScreen extends Component {
constructor(props) {
super(props)
this.state = {
modalComplain: false
modalComplain: false,
check: false,
imageBukti: [],
modalPhoto: false
}
}
handleImagePicker(type) {
if (type == 'Galeri') {
ImagePicker.openPicker({
width: 480,
height: 296,
cropping: true,
compressImageQuality: 0.7,
mediaType: 'photo',
includeBase64: true,
multiple: true
}).then(image => {
let imageBukti = []
image.map((item) => {
imageBukti.push({
uri: item.data,
type: item.mime
})
})
console.log('multiple', image)
this.setState({ imageBukti });
});
} else {
ImagePicker.openCamera({
width: 480,
height: 296,
cropping: true,
compressImageQuality: 0.7,
mediaType: 'photo'
}).then(image => {
// console.log(image)
});
}
}
render() {
return (
<View style={{ flex: 1, backgroundColor: '#4cc9f0' }}>
<Modal animationOut='slideOutRight' animationOutTiming={ 1000 } isVisible={this.state.modalComplain} onBackButtonPress={() => this.setState({ modalComplain: false })} style={{ paddingHorizontal: 10 }}>
<Modal animationOut='slideOutRight' animationOutTiming={1000} isVisible={this.state.modalPhoto} onBackButtonPress={() => this.setState({ modalPhoto: false })} style={{ paddingHorizontal: 10 }}>
<View style={{ backgroundColor: 'white', width: '90%', alignSelf: 'center' }}>
<View style={{ height: 50, borderBottomColor: '#4cc9f0', borderBottomWidth: 1, justifyContent: 'center', paddingHorizontal: 20 }}>
<BaseText type={"bold"} text={'Pilih Aksi!'} style={{ fontSize: 16, color: '#4cc9f0' }} />
</View>
<TouchableOpacity style={{ paddingHorizontal: 20, paddingVertical: 10, borderBottomColor: 'black', borderBottomWidth: .4, }} onPress={() => this.setState({ modalPhoto: false }, () => this.handleImagePicker('Galeri'))}>
<BaseText type={"regular"} text={'Galeri'} style={{ fontSize: 16, color: 'black' }} />
</TouchableOpacity>
<TouchableOpacity style={{ paddingHorizontal: 20, paddingVertical: 10 }}>
<BaseText type={"regular"} text={'Kamera'} style={{ fontSize: 16, color: 'black' }} />
</TouchableOpacity>
</View>
</Modal>
<Modal animationOut='slideOutRight' animationOutTiming={1000} isVisible={this.state.modalComplain} onBackButtonPress={() => this.setState({ modalComplain: false })} style={{ paddingHorizontal: 10 }}>
<View style={{ backgroundColor: 'white', width: '100%' }}>
<View style={{ justifyContent: 'center', paddingTop: 40}}>
<Image source={Images.berhasil} style={{ height: 90, width: 90, alignSelf: 'center'}} />
<View style={{ justifyContent: 'center', paddingTop: 40 }}>
<Image source={Images.berhasil} style={{ height: 90, width: 90, alignSelf: 'center' }} />
<BaseText type={"bold"} text={'Komplain Anda Anda telah dikirim, mohon menunggu konfirmasi selanjutnya.'} style={{ fontSize: 14, color: 'black', textAlign: 'center', marginTop: 20 }} />
</View>
<View style={{ padding: 15, paddingBottom: 25 }}>
......@@ -47,7 +100,9 @@ class ComplainScreen extends Component {
<BaseText type={"regular"} text={'Produk Yang Dikomplain'} style={{ fontSize: 10, color: '#4b4b4b', fontWeight: '600', opacity: .5 }} />
<View style={{ flexDirection: 'row', marginTop: 10, justifyContent: 'space-between' }}>
<View style={{ justifyContent: 'center' }}>
<Image source={Images.radioOn} style={{ height: 24, width: 24 }} />
<TouchableOpacity onPress={() => this.setState({ check: !this.state.check })}>
<Image source={this.state.check ? Images.radioOn : Images.radioOff} style={{ height: 24, width: 24 }} />
</TouchableOpacity>
</View>
<View style={{ width: '85%', backgroundColor: 'white', elevation: 2, borderRadius: 15, flexDirection: 'row', padding: 10 }}>
<Image source={Images.jaket} style={{ width: 60, height: 60, borderRadius: 15 }} />
......@@ -66,14 +121,24 @@ class ComplainScreen extends Component {
/>
</View>
<BaseText type={"regular"} text={'Bukti Komplain'} style={{ fontSize: 10, color: '#4b4b4b', fontWeight: '600', marginTop: 20, opacity: .5 }} />
<View style={{ width: 56, height: 56, justifyContent: 'center', backgroundColor: '#4b4b4b', borderRadius: 10, marginTop: 20, opacity: .7 }}>
<BaseText type={"bold"} text={'+'} style={{ fontSize: 10, color: '#fff', textAlign: 'center' }} />
<BaseText type={"bold"} text={'Unggah Bukti'} style={{ fontSize: 10, color: '#fff', textAlign: 'center' }} />
</View>
<ScrollView style={{ marginTop: 20, }} horizontal={true} showsHorizontalScrollIndicator={false} >
<TouchableOpacity style={{ width: 56, height: 56, justifyContent: 'center', backgroundColor: '#4b4b4b', borderRadius: 10, opacity: .7 }} onPress={() => this.setState({ modalPhoto: true })}>
<BaseText type={"bold"} text={'+'} style={{ fontSize: 10, color: '#fff', textAlign: 'center' }} />
<BaseText type={"bold"} text={'Unggah Bukti'} style={{ fontSize: 10, color: '#fff', textAlign: 'center' }} />
</TouchableOpacity>
{this.state.imageBukti.map((item, index) => {
return (
<TouchableOpacity style={{ width: 56, height: 56, justifyContent: 'center', borderRadius: 10, marginLeft: 20}}>
<Image source={{ uri: `data:image/gif;base64,${item.uri}` }} style={{ width: 56, height: 56, borderRadius: 10 }} resizeMode={"cover"} />
</TouchableOpacity>
)
})}
</ScrollView>
</View>
</ScrollView>
<View style={{ position: 'absolute', bottom: 0, width: '100%', justifyContent: 'center', paddingVertical: 20, borderTopWidth: .5, borderTopColor: 'rgba(0, 0, 0, 0.1)', elevation: 10, backgroundColor: 'white' }}>
<TouchableOpacity style={{ width: '80%', alignSelf: 'center', backgroundColor: '#4cc9f0', borderRadius: 20, height: 40, justifyContent: 'center' }} onPress={()=> this.setState({ modalComplain: true})}>
<TouchableOpacity style={{ width: '80%', alignSelf: 'center', backgroundColor: '#4cc9f0', borderRadius: 20, height: 40, justifyContent: 'center' }} onPress={() => this.setState({ modalComplain: true })}>
<BaseText type={"bold"} text={'Kirim Komplain'} style={{ fontSize: 12, color: '#fff', textAlign: 'center' }} />
</TouchableOpacity>
</View>
......
import React, { Component } from 'react'
import { ScrollView, Text, Image, View, TextInput, TouchableOpacity } from 'react-native'
import { connect } from 'react-redux'
import MapView from 'react-native-maps';
// Add Actions - replace 'Your' with whatever your reducer is called :)
// import YourActions from '../Redux/YourRedux'
// Styles
import styles from './Styles/CreateAddressScreenStyle'
import BaseHeader from '../Components/BaseHeader'
import BaseInput from '../Components/BaseInput'
import BaseText from '../Components/BaseText'
import { Images } from '../Themes'
class CreateAddressScreen extends Component {
render() {
return (
<View style={{ flex: 1, backgroundColor: '#4cc9f0' }}>
<BaseHeader leftText={'Tambah Alamat'} onBackPress={() => this.props.navigation.goBack()} />
<ScrollView style={[styles.scrollContent]}>
<View style={{ marginTop: 20 }}>
<BaseInput
title={"Nama Alamat"}
placeholder={"Masukkan Nama Alamat Anda"}
blurOnSubmit={false}
/>
<BaseText type={"regular"} text={'Contoh: Rumah, Kantor, Apartemen'} style={{ fontSize: 10, marginTop: 10, color: '#4b4b4b', opacity: .5 }} />
</View>
<View style={{ marginTop: 20 }}>
<BaseInput
title={"Nama Penerima"}
placeholder={"Masukkan Nama Penerima"}
blurOnSubmit={false}
/>
</View>
<View style={{ marginTop: 20 }}>
<BaseText text={"No. Handphone"} type={"bold"} style={{ fontSize: 12, color: '#4b4b4b', opacity: .6 }} />
<View style={{ flexDirection: 'row', flexGrow: 1, borderBottomColor: '#d8d8d8', borderBottomWidth: 1, alignItems: 'center', }}>
<View style={{ width: '15%', flexDirection: 'row' }}>
<BaseText text={"+62"} type={"bold"} style={{ fontSize: 14, color: '#4b4b4b', opacity: .8 }} />
<BaseText text={"|"} type={"light"} style={{ fontSize: 18, color: '#4b4b4b', opacity: .5, marginHorizontal: 10, marginTop: -3 }} />
</View>
<View style={{ width: '85%' }}>
<TextInput
placeholder={"8xxxxxxxxx"}
style={{ padding: 0 }}
// value={this.state.phone}
keyboardType={'phone-pad'}
// ref={(ref) => { this.phone = ref; }}
maxLength={13}
onChangeText={(phone) => {
// this.setState({ phone: handlePhone(phone) })
}}
blurOnSubmit={false}
/>
</View>
</View>
</View>
<View style={{ marginTop: 20 }}>
<BaseInput
title={"Provinsi"}
placeholder={"Pilih Provinsi"}
blurOnSubmit={false}
/>
</View>
<View style={{ marginTop: 20 }}>
<BaseInput
title={"Kota"}
placeholder={"Pilih Kota"}
blurOnSubmit={false}
/>
</View>
<View style={{ marginTop: 20 }}>
<BaseInput
title={"Kecamatan"}
placeholder={"Pilih Kecamatan"}
blurOnSubmit={false}
/>
</View>
<View style={{ marginTop: 20 }}>
<BaseInput
title={"Kelurahan"}
placeholder={"Pilih Kelurahan"}
blurOnSubmit={false}
/>
</View>
<View style={{ marginTop: 20 }}>
<BaseInput
title={"Alamat Pengirim"}
placeholder={"Masukkan Alamat Pengirim"}
blurOnSubmit={false}
/>
</View>
<View style={{ marginTop: 20 }}>
<BaseText text={"Pin Lokasi"} type={"regular"} style={{ fontSize: 12, color: 'black', opacity: .7 }} />
<TouchableOpacity style={{ borderWidth: .9, borderColor: '#d8d8d8', marginTop: 10, flexDirection: 'row', padding: 10, borderRadius: 4, backgroundColor: 'white', marginBottom: 10 }} onPress={()=> this.props.navigation.navigate('MapViewScreen')}>
<View style={{ width: '20%' }}>
<View style={{ width: 40, height: 40, backgroundColor: '#d8d8d8', justifyContent: 'center', opacity: .5, }}>
<Image source={Images.map} style={{ height: 24, width: 18, alignSelf: 'center'}} />
</View>
</View>
<View style={{ width: '80%', }}>
<BaseText text={"Sesuaikan lokasi"} type={"regular"} style={{ fontSize: 12, color: '#4b4b4b', opacity: .7 }} />
<View style={{ borderWidth: .7, borderColor: '#d8d8d8', marginTop: 5 }} />
<BaseText text={"Lokasi harus sesuai dengan alamat diatas"} type={"regular"} style={{ fontSize: 10, color: '#4b4b4b', opacity: .7 }} />
</View>
</TouchableOpacity>
</View>
</ScrollView>
<View style={{ flexDirection: 'row', position: 'absolute', bottom: 0, width: '100%', justifyContent: 'space-around', paddingVertical: 20, paddingHorizontal: 20, borderTopWidth: .5, borderTopColor: 'rgba(0, 0, 0, 0.5)', elevation: 10, backgroundColor: 'white' }}>
<TouchableOpacity style={{ width: '45%', alignSelf: 'center', backgroundColor: 'white', borderRadius: 20, height: 40, justifyContent: 'center', borderColor: '#4cc9f0', borderWidth: .6 }}>
<BaseText type={"bold"} text={'Batal'} style={{ fontSize: 12, color: '#4cc9f0', textAlign: 'center' }} />
</TouchableOpacity>
<TouchableOpacity style={{ width: '45%', alignSelf: 'center', backgroundColor: '#4cc9f0', borderRadius: 20, height: 40, justifyContent: 'center' }}>
<BaseText type={"bold"} text={'Simpan'} style={{ fontSize: 12, color: '#fff', textAlign: 'center' }} />
</TouchableOpacity>
</View>
</View>
)
}
}
const mapStateToProps = (state) => {
return {
}
}
const mapDispatchToProps = (dispatch) => {
return {
}
}
export default connect(mapStateToProps, mapDispatchToProps)(CreateAddressScreen)
import React, { Component } from 'react'
import { View, Image, ScrollView, BackHandler } from 'react-native'
import { View, Image, ScrollView, BackHandler, TouchableOpacity } from 'react-native'
import { connect } from 'react-redux'
// Add Actions - replace 'Your' with whatever your reducer is called :)
// import YourActions from '../Redux/YourRedux'
......@@ -53,7 +53,9 @@ class ListAddressScreen extends Component {
<BaseHeader leftText={'Pilih Alamat'} onBackPress={() => this.props.navigation.goBack()} />
<ScrollView style={[styles.scrollContent]}>
<View style={{ flexDirection: 'row', marginTop: 20 }}>
<Image source={Images.add} style={{ height: 24, width: 24 }} />
<TouchableOpacity onPress={()=> this.props.navigation.navigate('CreateAddressScreen')}>
<Image source={Images.add} style={{ height: 24, width: 24 }} />
</TouchableOpacity>
<BaseText type={"regular"} text={'Tambah Alamat'} style={{ fontSize: 12, color: 'black', marginLeft: 10, alignSelf: 'center' }} />
</View>
{this.state.data.map((item, index) => {
......
......@@ -63,29 +63,45 @@ class LoginScreen extends Component {
this.setState({auth: prevState.auth})
let auth = this.state.auth
if (auth !== null && !auth.fetching) {
Toast.show({
type: auth.error? 'failed' : 'success',
position: 'bottom',
text1: auth.error? 'Failed' : 'Success',
text2: auth.error? `${auth.errorData.message}` : `Login success ${auth.user.data.user_email}👋`,
visibilityTime: 2500,
autoHide: true,
// topOffset: 100,
// bottomOffset: 40,
})
if (auth.error && String(auth.errorData.message).includes('aktivasi')) {
this.props.navigation.navigate('OtpVerificationScreen')
if (auth.error) {
}
if (auth.error) {
let typeError = String(auth.errorData.message)
if (typeError.includes('aktivasi')) {
Toast.show({
type: 'failed',
position: 'bottom',
text1: 'Failed',
text2: typeError,
visibilityTime: 2500,
autoHide: true,
// topOffset: 100,
// bottomOffset: 40,
})
this.props.navigation.navigate('OtpVerificationScreen')
} else if (typeError.includes('email')) {
this.setState({errorEmail: typeError})
} else if (typeError.includes('password')) {
this.setState({errorPassword: typeError})
}
}
if (!auth.error) {
Toast.show({
type: 'success',
position: 'bottom',
text1: 'Success',
text2: `Login success 👋`,
visibilityTime: 2500,
autoHide: true,
// topOffset: 100,
// bottomOffset: 40,
})
AsyncStorage.setItem(Constants.TOKEN, auth.user.data.token)
this.props.navigation.navigate('HomeNavigation')
}
// auth.error? null : (
// auth.errorData !== null && String(auth.errorData.message).include('aktivasi') ?
// this.props.navigation.navigate('OtpVerificationScreen')
// :
// this.props.navigation.navigate('HomeNavigation')
// )
}
}
}
......@@ -137,6 +153,7 @@ class LoginScreen extends Component {
render () {
return (
<View style={{flex: 1, backgroundColor:'#4cc9f0'}}>
<NavigationEvents onDidFocus={() => {this.refreshValidasi()}}/>
<BaseHeader onBackPress={() => this.props.navigation.goBack()} leftText={'Masuk'} rightText={'Daftar'} onNextPress={() => this.props.navigation.navigate('RegisterScreen')}/>
<ScrollView showsVerticalScrollIndicator={false} style={styles.scrollContent}>
<View style={{width: '100%'}}>
......
import React, { Component } from 'react'
import { ScrollView, Text, KeyboardAvoidingView, View } from 'react-native'
import { connect } from 'react-redux'
import MapView, { Marker } from 'react-native-maps';
// Add Actions - replace 'Your' with whatever your reducer is called :)
// import YourActions from '../Redux/YourRedux'
// Styles
import styles from './Styles/MapViewScreenStyle'
import BaseHeader from '../Components/BaseHeader';
class MapViewScreen extends Component {
constructor(props) {
super(props)
this.state = {
region: {
latitude: 24.92009056750823,
longitude: 67.1012272143364,
latitudeDelta: 0.1,
longitudeDelta: 0.1
},
long: 24.92009056750823,
lat: 67.1012272143364
}
}
render() {
return (
<View style={{ flex: 1 }}>
<BaseHeader leftText={'Pilih Lokasi'} onBackPress={() => this.props.navigation.goBack()} />
<MapView style={{ flex: 1, }} region={this.state.region}
onPress={(e) => this.setState({ long: e.nativeEvent.coordinate.longitude, lat: e.nativeEvent.coordinate.latitude })}>
<Marker
coordinate={{ latitude: this.state.lat, longitude: this.state.long}}
/>
</MapView>
</View>
)
}
}
const mapStateToProps = (state) => {
return {
}
}
const mapDispatchToProps = (dispatch) => {
return {
}
}
export default connect(mapStateToProps, mapDispatchToProps)(MapViewScreen)
......@@ -16,6 +16,7 @@ import BaseInput from '../Components/BaseInput';
import BaseButton from '../Components/BaseButton'
import BaseText from '../Components/BaseText'
import { handlePhone } from '../Lib/Utils'
import { NavigationEvents } from 'react-navigation'
class RegisterScreen extends Component {
constructor(props) {
......@@ -64,17 +65,43 @@ class RegisterScreen extends Component {
console.log('data real', auth)
console.log('tes disini', auth.error)
if (auth !== null && !auth.fetching) {
Toast.show({
type: auth.error? 'failed' : 'success',
position: 'bottom',
text1: auth.error? 'Failed' : 'Success',
text2: auth.error? `${auth.errorData.message}` : `Cek inbox/spam pada email ${auth.user.data.user_email}👋`,
visibilityTime: 2500,
autoHide: true,
// topOffset: 100,
// bottomOffset: 40,
})
auth.error? null : this.props.navigation.navigate('OtpVerificationScreen')
if (auth.error) {
let typeError = String(auth.errorData.message)
if (typeError.includes('aktivasi')) {
Toast.show({
type: 'failed',
position: 'bottom',
text1: 'Failed',
text2: typeError,
visibilityTime: 2500,
autoHide: true,
// topOffset: 100,
// bottomOffset: 40,
})
this.props.navigation.navigate('OtpVerificationScreen')
} else if (typeError.includes('phone')) {
this.setState({errorPhone: typeError})
} else if (typeError.includes('email')) {
this.setState({errorEmail: typeError})
} else if (typeError.includes('password')) {
this.setState({errorPassword: typeError})
}
}
if (!auth.error) {
Toast.show({
type: 'success',
position: 'bottom',
text1: 'Success',
text2: `Cek inbox/spam pada email ${auth.user.data.user_email} 👋`,
visibilityTime: 2500,
autoHide: true,
// topOffset: 100,
// bottomOffset: 40,
})
this.props.navigation.navigate('OtpVerificationScreen')
}
}
}
}
......@@ -116,10 +143,16 @@ class RegisterScreen extends Component {
this.setState({errorPhone: 'No. Handphone tidak boleh kosong'})
} else if (this.state.phone.substr(0,1) == 0) {
this.setState({errorPhone: 'Angka pertama tidak boleh 0'})
} else if (this.state.phone.length < 10) {
this.setState({errorPhone: 'No. Handphone minimal 10 digit'})
} else if (R.isEmpty(this.state.password)) {
this.setState({errorPassword: 'Password tidak boleh kosong'})
} else if (this.state.password.length < 5) {
this.setState({errorPassword: 'Password minimal 5 karakter'})
} else if (R.isEmpty(this.state.passwordConfirm)) {
this.setState({errorPasswordConfirm: 'Konfirmasi kata sandi tidak boleh kosong'})
} else if (this.state.passwordConfirm.length < 5) {
this.setState({errorPassword: 'Password minimal 5 karakter'})
} else if (!R.equals(this.state.passwordConfirm, this.state.password)) {
this.setState({errorPasswordConfirm: 'Konfirmasi kata sandi tidak sama dengan kata sandi'})
} else {
......@@ -154,6 +187,7 @@ class RegisterScreen extends Component {
render () {
return (
<View style={{flex: 1, backgroundColor: '#4cc9f0'}}>
<NavigationEvents onDidFocus={() => {this.refreshValidasi()}}/>
<BaseHeader onBackPress={() => this.props.navigation.goBack()} leftText={'Daftar'} rightText={'Masuk'} onNextPress={() => this.props.navigation.goBack()}/>
<ScrollView showsVerticalScrollIndicator={false} style={styles.scrollContent}>
<View style={{width: '100%'}}>
......@@ -208,7 +242,7 @@ class RegisterScreen extends Component {
value={this.state.phone}
keyboardType={'phone-pad'}
ref={(ref) => { this.phone = ref;}}
maxLength={13}
maxLength={14}
onChangeText={(phone) => {
this.setState({phone: handlePhone(phone)}, () => this.refreshValidasi())
} }
......@@ -232,6 +266,7 @@ class RegisterScreen extends Component {
onPressIcon={() => this.setState({visiblePassword: !this.state.visiblePassword})}
notes={'Minimal 8 Karakter'}
value={this.state.password}
maxLength={30}
onChangeText={(password) => this.setState({password}, () => this.refreshValidasi())}
onRef={(ref) => {
this.inputs['password'] = ref;
......@@ -240,7 +275,7 @@ class RegisterScreen extends Component {
this.focusNextField('passwordConfirm');
}}
lineColor={this.state.errorPassword? 'red' : '#d8d8d8' }
notes={this.state.errorPassword? this.state.errorPassword : 'Minimal 8 Karakter'}
notes={this.state.errorPassword? this.state.errorPassword : 'Minimal 5 Karakter'}
notesColor={this.state.errorPassword? 'red' : '#4b4b4b'}
blurOnSubmit={false}
/>
......@@ -255,6 +290,7 @@ class RegisterScreen extends Component {
placeholder={"Ulangi Kata Sandi Anda"}
onPressIcon={() => this.setState({visiblePasswordConfirm: !this.state.visiblePasswordConfirm})}
value={this.state.passwordConfirm}
maxLength={30}
onChangeText={(passwordConfirm) => this.setState({passwordConfirm}, () => this.refreshValidasi())}
onRef={(ref) => {
this.inputs['passwordConfirm'] = ref;
......
......@@ -156,7 +156,7 @@ class RincianProfilScreen extends Component {
<BaseText type={"bold"} text={'Harap diisi sesuai dengan nomor handphone Anda yang aktif untuk mempermudah proses verifikasi'} style={{ fontSize: 12, color: '#4b4b4b', alignSelf: 'center', textAlign: 'center' }} />
<View style={{ marginTop: 30 }}>
<BaseText text={"No. Handphone"} type={"bold"} style={{ fontSize: 12, color: '#4b4b4b', opacity: .6 }} />
<View style={{ flexDirection: 'row', flexGrow: 1, borderBottomColor: this.state.errorPhone ? 'red' : '#d8d8d8', borderBottomWidth: 1, alignItems: 'center', }}>
<View style={{ flexDirection: 'row', flexGrow: 1, borderBottomColor: '#d8d8d8', borderBottomWidth: 1, alignItems: 'center', }}>
<View style={{ width: '15%', flexDirection: 'row' }}>
<BaseText text={"+62"} type={"bold"} style={{ fontSize: 14, color: '#4b4b4b', opacity: .8 }} />
<BaseText text={"|"} type={"light"} style={{ fontSize: 18, color: '#4b4b4b', opacity: .5, marginHorizontal: 10, marginTop: -3 }} />
......
import { StyleSheet } from 'react-native'
import { ApplicationStyles } from '../../Themes/'
export default StyleSheet.create({
...ApplicationStyles.screen,
scrollContent: {
flex: 1,
backgroundColor: 'white',
borderTopLeftRadius: 32,
borderTopRightRadius: 32,
paddingHorizontal: 25,
},
})
import { StyleSheet } from 'react-native'
import { ApplicationStyles } from '../../Themes/'
export default StyleSheet.create({
...ApplicationStyles.screen
})
......@@ -70,14 +70,6 @@ class WishlistScreen extends Component {
Api.create().searchWhislist(body).then((response) => {
if (response.data.status == "success") {
let data = response.data.data
let numOfRowsToBeAdded = 2 - (data.length % 2);
// here im ommitting if we get 0 as remainder as its not required
if (numOfRowsToBeAdded) {
for (let i = 0; i < numOfRowsToBeAdded; i++) {
data.push(null);
}
}
console.log('search', JSON.stringify(data))
this.setState({
data
})
......@@ -100,14 +92,14 @@ class WishlistScreen extends Component {
</View>
<FontAwesome name={'times-circle'} size={20} color={"rgba(75, 75, 75, 0.4)"} style={{ alignSelf: 'center' }} />
</View>
<View style={{ flex: 1, backgroundColor: '#fff', borderTopLeftRadius: 30, borderTopRightRadius: 30, width: '100%', marginTop: 20, paddingHorizontal: 15 }}>
<View style={{ flex: 1, backgroundColor: '#fff', borderTopLeftRadius: 30, borderTopRightRadius: 30, width: '100%', marginTop: 20, paddingHorizontal: 20, }}>
<FlatList
showsVerticalScrollIndicator={false}
data={this.state.dummyList}
renderItem={({ item, index }) => {
return (
<View style={{ flex: 1 / 2, flexDirection: 'column', margin: 10, backgroundColor: '#fff', borderRadius: 15, elevation: 3, marginTop: index == 0 ? 20 : index == 1 ? 20 : 0, marginRight: index == this.state.dummyList.length - 1 && this.state.isSecondColumn == false ? 10 : 0 }}>
<View style={{ flex: 1/2, flexDirection: 'column', margin: 10, backgroundColor: '#fff', borderRadius: 15, elevation: 3, marginTop: index == 0 ? 20 : index == 1 ? 20 : 0, marginRight: index == this.state.dummyList.length - 1 && this.state.isSecondColumn == false ? 30 : 10 }}>
<TouchableOpacity style={{ flex: 1 }} onPress={()=> alert(index)}>
<View style={{ backgroundColor: item.color, width: '100%', height: 148, borderRadius: 10 }}>
{/* <Image source={{ uri: item.product_image }} style={{ width: '100%', height: '100%' }} /> */}
......
import { createAppContainer } from 'react-navigation'
import MapViewScreen from '../Containers/MapViewScreen'
import CreateAddressScreen from '../Containers/CreateAddressScreen'
import TermsConditionScreen from '../Containers/TermsConditionScreen'
import ContactUsScreen from '../Containers/ContactUsScreen'
import AboutUsScreen from '../Containers/AboutUsScreen'
......@@ -33,6 +35,8 @@ import HomeNavigation from './HomeNavigation'
// Manifest of possible screens
const PrimaryNav = createStackNavigator({
MapViewScreen: { screen: MapViewScreen },
CreateAddressScreen: { screen: CreateAddressScreen },
TermsConditionScreen: { screen: TermsConditionScreen },
ContactUsScreen: { screen: ContactUsScreen },
AboutUsScreen: { screen: AboutUsScreen },
......
......@@ -188,6 +188,10 @@ dependencies {
implementation project(':react-native-i18n')
implementation project(':react-native-vector-icons')
implementation project(':react-native-gesture-handler')
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation 'com.android.support:support-annotations:28.0.0'
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-maps')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'com.android.support:multidex:1.0.3'
......
......@@ -25,6 +25,12 @@
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCTl0yP2k67rKKtAmPPTEFn3rcl-zSoKPY"/>
<!-- You will also only need to add this uses-libray tag -->
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
</application>
</manifest>
......@@ -6,6 +6,9 @@ buildscript {
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
playServicesVersion = "17.0.0"
androidMapsUtilsVersion = "1.3.1"
}
repositories {
google()
......
......@@ -9,3 +9,5 @@ include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
......@@ -51,6 +51,7 @@
"react-native-gesture-handler": "1.3.0",
"react-native-i18n": "2.0.14",
"react-native-image-crop-picker": "0.32.0",
"react-native-maps": "0.27.1",
"react-native-modal": "^11.5.6",
"react-native-progress": "^4.1.2",
"react-native-reanimated": "^1.9.0",
......
......@@ -11190,6 +11190,11 @@ react-native-keyboard-aware-scroll-view@0.9.1:
prop-types "^15.6.2"
react-native-iphone-x-helper "^1.0.3"
react-native-maps@0.27.1:
version "0.27.1"
resolved "https://registry.yarnpkg.com/react-native-maps/-/react-native-maps-0.27.1.tgz#2f10cd417bb2fd938c9e015b1c9b6d9b1a44b97f"
integrity sha512-HygBkZBecTnIVRYrSiLRAvu4OmXOYso/A7c6Cy73HkOh9CgGV8Ap5eBea24tvmFGptjj5Hg8AJ94/YbmWK1Okw==
react-native-modal@^11.5.6:
version "11.5.6"
resolved "https://registry.yarnpkg.com/react-native-modal/-/react-native-modal-11.5.6.tgz#bb25a78c35a5e24f45de060e5f64284397d38a87"
......
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