Commit 6951cc5b authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

Merge branch 'master' of ssh://repo.cs.co.id:2222/wahyu/bahanoprek

# Conflicts:
#	view/Home.js
parents 8a088e2b 85da87be
This diff is collapsed.
...@@ -242,7 +242,7 @@ class Auth extends React.Component { ...@@ -242,7 +242,7 @@ class Auth extends React.Component {
headerTitleStyle: { headerTitleStyle: {
alignSelf: 'center', alignSelf: 'center',
fontFamily: 'Gotham-Black', fontFamily: 'Gotham-Black',
fontSize:18, fontSize: 18,
color: 'white', color: 'white',
textAlign: 'center' textAlign: 'center'
}, title: 'LANGUAGE' }, title: 'LANGUAGE'
...@@ -264,7 +264,18 @@ class Auth extends React.Component { ...@@ -264,7 +264,18 @@ class Auth extends React.Component {
<Stack.Screen name="Renewal" component={Renewal} /> <Stack.Screen name="Renewal" component={Renewal} />
<Stack.Screen name="Account" component={Account} /> <Stack.Screen name="Account" component={Account} />
<Stack.Screen name="Login" component={Login} options={{ headerShown: false }} /> <Stack.Screen name="Login" component={Login} options={{ headerShown: false }} />
<Stack.Screen name="Transfer Balance" component={TransferBalance} /> <Stack.Screen name="Transfer Balance" component={TransferBalance} options={{
headerStyle: { backgroundColor: "#CFB368" },
headerBackTitleStyle: { color: 'white' },
headerTintColor: '#fff',
headerTitleAlign: 'center',
headerTitleStyle: {
fontFamily: 'Gotham-Black',
color: 'white',
fontSize: 18,
},
title: 'TRANSFER BALANCE'
}} />
<Stack.Screen name="Register" component={Register} /> <Stack.Screen name="Register" component={Register} />
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> <Stack.Screen name="Email Confirmation" component={EmailConfirmation} />
<Stack.Screen name="Upgrade Premium" component={UpgradePremium} /> <Stack.Screen name="Upgrade Premium" component={UpgradePremium} />
...@@ -392,7 +403,7 @@ class Auth extends React.Component { ...@@ -392,7 +403,7 @@ class Auth extends React.Component {
<Stack.Screen name="Transaction Detail" component={TransactionDetail} /> <Stack.Screen name="Transaction Detail" component={TransactionDetail} />
{/* <Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> */} {/* <Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> */}
<Stack.Screen name="News Detail" component={NewsDetail} options={{ headerShown: false }}/> <Stack.Screen name="News Detail" component={NewsDetail} options={{ headerShown: false }} />
<Stack.Screen name="Confirm Your Order" component={MenuConfirmation} /> <Stack.Screen name="Confirm Your Order" component={MenuConfirmation} />
<Stack.Screen name="Date Time" component={DateTime} /> <Stack.Screen name="Date Time" component={DateTime} />
<Stack.Screen name="New Register" component={NewRegister} <Stack.Screen name="New Register" component={NewRegister}
......
...@@ -222,7 +222,6 @@ class Home extends React.Component { ...@@ -222,7 +222,6 @@ class Home extends React.Component {
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
<View>
<SliderBox <SliderBox
images={this.state.images} images={this.state.images}
onCurrentImagePressed={index => console.log(`image ${index} pressed`)} onCurrentImagePressed={index => console.log(`image ${index} pressed`)}
...@@ -257,8 +256,6 @@ class Home extends React.Component { ...@@ -257,8 +256,6 @@ class Home extends React.Component {
imageLoadingColor='#c7c7c7' imageLoadingColor='#c7c7c7'
onCurrentImagePressed={(index) => this.props.navigation.navigate('News Detail', {slug: this.state.slugs[index]})} onCurrentImagePressed={(index) => this.props.navigation.navigate('News Detail', {slug: this.state.slugs[index]})}
/> />
</View>
</View> </View>
<View style={styles.content}> <View style={styles.content}>
<View style={styles.card}> <View style={styles.card}>
......
...@@ -10,6 +10,7 @@ import session from '../function/session'; ...@@ -10,6 +10,7 @@ import session from '../function/session';
import * as Location from 'expo-location'; import * as Location from 'expo-location';
import * as Permissions from 'expo-permissions'; import * as Permissions from 'expo-permissions';
import * as Device from 'expo-device'; import * as Device from 'expo-device';
import NumberFormat from 'react-number-format';
class MenuSelection extends React.Component { class MenuSelection extends React.Component {
constructor(props) { constructor(props) {
...@@ -307,24 +308,23 @@ class MenuSelection extends React.Component { ...@@ -307,24 +308,23 @@ class MenuSelection extends React.Component {
)} )}
</View> </View>
<View> <View>
</View> </View>
<View style={styles.shadow}> <View style={styles.shadow}>
<View style={{ flex: 1, flexDirection: 'row' }}> <View style={{ flex: 1, flexDirection: 'row' }}>
<View style={{ flex: 0.7}}> <View style={{ flex: 1}}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black',top:10 }}> {this.props.order_quantity} Item | {this.props.type_pickup == true ? (null) : ( <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', textAlign: 'center',top:10,marginLeft:45 }}> {this.props.order_quantity} Item | {this.props.type_pickup == true ? (null) : (
<Text style={{ fontSize: 12 }}> Ongkir {this.props.grabamount} </Text> <Text style={{ fontSize: 12 }}> Ongkir {this.props.grabamount} </Text>
)} </Text> )} </Text>
<Text style={{ fontSize: 20, fontFamily: 'Gotham-Light', top:20 }}> Rp. {this.props.order_total}</Text> <NumberFormat decimalScale={0} value={this.props.order_total} renderText={value => <Text style={{ fontSize: 20, fontFamily: 'Gotham-Light', top: 20, textAlign: 'center' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View> </View>
<View style={{ flex: 1, height: 100 }}> <View style={{ flex: 1, height: 100 }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Shopping Cart')}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Shopping Cart')}>
<View> <View>
<View style={{ height: 50, borderRadius: 10, backgroundColor: '#CFB368',marginRight:20,marginLeft:20,top:10,flexDirection:'row',marginBottom:30}}> <View style={{ height: 40, borderRadius: 10, width: '65%', backgroundColor: '#CFB368', marginRight: 20, marginLeft: 40, top: 15, flexDirection: 'row', marginBottom: 30 }}>
<Image source={(require('../assets/icon/icon-order.png'))} style={{height:50,width:40,tintColor:'white',}}></Image> <Image source={(require('../assets/icon/icon-order.png'))} style={{ height: 40, width: 40, tintColor: 'white', }}></Image>
<Text style={{ fontFamily: 'Gotham-Light', color: 'white', fontSize: 15,alignSelf:'center', textAlign: 'center' }}>View Cart</Text> <Text style={{ fontFamily: 'Gotham-Light', color: 'white', fontSize: 15, alignSelf: 'center', textAlign: 'center' }}>View Cart</Text>
</View> </View>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
...@@ -336,21 +336,20 @@ class MenuSelection extends React.Component { ...@@ -336,21 +336,20 @@ class MenuSelection extends React.Component {
) )
} }
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
flex: 1, flex: 1,
backgroundColor: 'white', backgroundColor: 'white',
}, },
shadow: { shadow: {
borderRadius: 2, borderWidth:1,
borderColor: '#ddd', borderColor: '#ddd',
borderBottomWidth: 0, borderBottomWidth: 0,
shadowColor: '#000', shadowColor: '#000',
shadowOffset: { width: 0, height: 2 }, shadowOffset: { width: 0, height: 0 },
shadowOpacity: 10, shadowOpacity: 10,
shadowRadius: 5, shadowRadius: 0,
elevation: 0.5, elevation: 0,
marginTop: 10, marginTop: 10,
flex: 0.5, flex: 0.5,
height: 50, height: 50,
...@@ -422,4 +421,6 @@ export default connect(mapStateToProps, mapDispatchToProps)(MenuSelection) ...@@ -422,4 +421,6 @@ export default connect(mapStateToProps, mapDispatchToProps)(MenuSelection)
// </View> // </View>
// ) // )
// } // }
\ No newline at end of file
...@@ -4,7 +4,7 @@ import { Image } from 'react-native-elements'; ...@@ -4,7 +4,7 @@ import { Image } from 'react-native-elements';
import Axios from 'axios'; import Axios from 'axios';
import { TouchableOpacity, ScrollView } from 'react-native-gesture-handler'; import { TouchableOpacity, ScrollView } from 'react-native-gesture-handler';
import HTML from 'react-native-render-html'; import HTML from 'react-native-render-html';
import { getStatusBarHeight } from 'react-native-status-bar-height';
export default class NewsDetail extends React.Component { export default class NewsDetail extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -13,14 +13,17 @@ export default class NewsDetail extends React.Component { ...@@ -13,14 +13,17 @@ export default class NewsDetail extends React.Component {
subtitle: '', subtitle: '',
image: '', image: '',
content: '', content: '',
image_height: 400 image_height: 400,
statusbar_height: 50
} }
} }
componentDidMount() { componentDidMount() {
const screenWidth = Math.round(Dimensions.get('window').width); const screenWidth = Math.round(Dimensions.get('window').width);
const statusBarHeight = getStatusBarHeight();
this.setState({ this.setState({
image_height: screenWidth image_height: screenWidth,
statusbar_height: statusBarHeight
}) })
this.get_news_detail(this.props.route.params.slug) this.get_news_detail(this.props.route.params.slug)
} }
...@@ -42,7 +45,7 @@ export default class NewsDetail extends React.Component { ...@@ -42,7 +45,7 @@ export default class NewsDetail extends React.Component {
render() { render() {
console.log('Image : ' + this.state.image) console.log('Image : ' + this.state.image)
return ( return (
<View style={styles.container}> <View style={styles.container(this.state.statusbar_height)}>
<View style={styles.header}> <View style={styles.header}>
<TouchableOpacity onPress={() => this.props.navigation.goBack()}> <TouchableOpacity onPress={() => this.props.navigation.goBack()}>
<Image source={require('../assets/icon/back.png')} style={{width: 35, height: 35}} /> <Image source={require('../assets/icon/back.png')} style={{width: 35, height: 35}} />
...@@ -66,11 +69,11 @@ export default class NewsDetail extends React.Component { ...@@ -66,11 +69,11 @@ export default class NewsDetail extends React.Component {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: (marginTop) => ({
flex: 1, flex: 1,
marginTop: 29, marginTop: marginTop,
backgroundColor: 'white', backgroundColor: 'white',
}, }),
header: { header: {
height: 60, height: 60,
paddingHorizontal: 5, paddingHorizontal: 5,
......
import React from 'react'; import React from 'react';
import { View, Text, TextInput, StyleSheet, Button, Alert } from 'react-native'; import { View, Text, TextInput, StyleSheet, Button, Alert ,ScrollView,TouchableOpacity,Image } from 'react-native';
import Axios from 'axios'; import Axios from 'axios';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
...@@ -79,60 +79,47 @@ class TransferBalance extends React.Component { ...@@ -79,60 +79,47 @@ class TransferBalance extends React.Component {
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}> <ScrollView>
<Text style={{ textAlign: 'center', marginTop: 10, fontSize: 25 }}>Transfer Balance</Text> <View style={{ flex: 3 }}>
</View> <View style={{ flex: 1, margin: 20,top:20 }}>
<View style={styles.content}> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Phone</Text>
<View style={styles.name_addrees_input}> <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
<View style={styles.field_name_addrees}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Phone</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(destination) => this.setState({ destination })} onChangeText={(destination) => this.setState({ destination })}
value={this.state.destination} value={this.state.destination}
keyboardType='number-pad' /> keyboardType='number-pad' />
</View> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Amount</Text>
</View> <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
<View style={styles.field_detail_addrees}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Amount</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(amount) => this.setState({ amount })} onChangeText={(amount) => this.setState({ amount })}
value={this.state.amount} value={this.state.amount}
keyboardType='number-pad'/> keyboardType='number-pad'/>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Current Balance</Text>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
onChangeText={(no_tlp) => this.setState({ no_tlp })}
editable={false}>
{this.state.balance}
</TextInput>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Message</Text>
<TextInput style={{ height: 100, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
onChangeText={(reference) => this.setState({ reference })}
value={this.state.reference}>
</TextInput>
</View>
</View>
<View style={{ flex: 2 }}>
<View style={{ flex: 1 }}>
<View style={{ flex: 1, flexDirection: 'row', top: 10, margin: 5,marginBottom:20,marginLeft:20,marginRight:20}}>
<View style={{ flex: 1, margin: 5 }}>
<TouchableOpacity title="Edit" onPress={() => this.handleSend()}>
<View style={{ height: 40, borderRadius: 20, backgroundColor: '#CFB368',marginRight:40,marginLeft:40,justifyContent:'center'}}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 19, textAlign: 'center', margin: 20 }}>Save</Text>
</View> </View>
</View> </TouchableOpacity>
<View style={styles.curent_balance}>
<View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontSize: 20 }} >Current Balance </Text>
</View>
<View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontSize: 20 }}>{this.state.balance}</Text>
</View>
</View>
<View style={styles.field_detail_addrees}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Reference</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 100, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(reference) => this.setState({ reference })}
value={this.state.reference} />
</View>
</View>
{/* <View style={{ justifyContent: 'center', margin: 5 }}>
<Button title="Activate" onPress={() => this.handle()}></Button>
</View> */}
<View style={{ justifyContent: 'center' }} >
<Button title="SEND" onPress={() => this.handleSend()}></Button>
</View> </View>
</View> </View>
</View> </View>
</View> </View>
</ScrollView>
</View>
) )
} }
} }
...@@ -207,4 +194,52 @@ const mapDispatchToProps = (dispacth) => { ...@@ -207,4 +194,52 @@ const mapDispatchToProps = (dispacth) => {
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(TransferBalance); export default connect(mapStateToProps, mapDispatchToProps)(TransferBalance);
\ No newline at end of file
{/* <View style={styles.content}>
<View style={styles.name_addrees_input}>
<View style={styles.field_name_addrees}>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(destination) => this.setState({ destination })}
value={this.state.destination}
keyboardType='number-pad' />
</View>
</View>
<View style={styles.field_detail_addrees}>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(amount) => this.setState({ amount })}
value={this.state.amount}
keyboardType='number-pad'/>
</View>
</View>
<View style={styles.curent_balance}>
<View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontSize: 20 }} >Current Balance </Text>
</View>
<View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontSize: 20 }}>{this.state.balance}</Text>
</View>
</View>
<View style={styles.field_detail_addrees}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Reference</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 100, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(reference) => this.setState({ reference })}
value={this.state.reference} />
</View>
</View>
{/* <View style={{ justifyContent: 'center', margin: 5 }}>
<Button title="Activate" onPress={() => this.handle()}></Button>
</View> */}
// <View style={{ justifyContent: 'center' }} >
// <Button title="SEND" onPress={() => this.handleSend()}></Button>
// </View>
// </View>
// </View> */}
\ No newline at end of file
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