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 {
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
fontSize:18,
fontSize: 18,
color: 'white',
textAlign: 'center'
}, title: 'LANGUAGE'
......@@ -264,7 +264,18 @@ class Auth extends React.Component {
<Stack.Screen name="Renewal" component={Renewal} />
<Stack.Screen name="Account" component={Account} />
<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="Email Confirmation" component={EmailConfirmation} />
<Stack.Screen name="Upgrade Premium" component={UpgradePremium} />
......@@ -392,7 +403,7 @@ class Auth extends React.Component {
<Stack.Screen name="Transaction Detail" component={TransactionDetail} />
{/* <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="Date Time" component={DateTime} />
<Stack.Screen name="New Register" component={NewRegister}
......
......@@ -222,7 +222,6 @@ class Home extends React.Component {
</TouchableOpacity>
</View>
</View>
<View>
<SliderBox
images={this.state.images}
onCurrentImagePressed={index => console.log(`image ${index} pressed`)}
......@@ -258,8 +257,6 @@ class Home extends React.Component {
onCurrentImagePressed={(index) => this.props.navigation.navigate('News Detail', {slug: this.state.slugs[index]})}
/>
</View>
</View>
<View style={styles.content}>
<View style={styles.card}>
<Card>
......
......@@ -10,6 +10,7 @@ import session from '../function/session';
import * as Location from 'expo-location';
import * as Permissions from 'expo-permissions';
import * as Device from 'expo-device';
import NumberFormat from 'react-number-format';
class MenuSelection extends React.Component {
constructor(props) {
......@@ -307,23 +308,22 @@ class MenuSelection extends React.Component {
)}
</View>
<View>
</View>
<View style={styles.shadow}>
<View style={{ flex: 1, flexDirection: 'row' }}>
<View style={{ flex: 0.7}}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black',top:10 }}> {this.props.order_quantity} Item | {this.props.type_pickup == true ? (null) : (
<View style={{ flex: 1}}>
<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>
<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 style={{ flex: 1, height: 100 }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Shopping Cart')}>
<View>
<View style={{ height: 50, borderRadius: 10, backgroundColor: '#CFB368',marginRight:20,marginLeft:20,top:10,flexDirection:'row',marginBottom:30}}>
<Image source={(require('../assets/icon/icon-order.png'))} style={{height:50,width:40,tintColor:'white',}}></Image>
<Text style={{ fontFamily: 'Gotham-Light', color: 'white', fontSize: 15,alignSelf:'center', textAlign: 'center' }}>View Cart</Text>
<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: 40, width: 40, tintColor: 'white', }}></Image>
<Text style={{ fontFamily: 'Gotham-Light', color: 'white', fontSize: 15, alignSelf: 'center', textAlign: 'center' }}>View Cart</Text>
</View>
</View>
</TouchableOpacity>
......@@ -336,21 +336,20 @@ class MenuSelection extends React.Component {
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
},
shadow: {
borderRadius: 2,
borderWidth:1,
borderColor: '#ddd',
borderBottomWidth: 0,
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOffset: { width: 0, height: 0 },
shadowOpacity: 10,
shadowRadius: 5,
elevation: 0.5,
shadowRadius: 0,
elevation: 0,
marginTop: 10,
flex: 0.5,
height: 50,
......@@ -423,3 +422,5 @@ export default connect(mapStateToProps, mapDispatchToProps)(MenuSelection)
// )
// }
......@@ -4,7 +4,7 @@ import { Image } from 'react-native-elements';
import Axios from 'axios';
import { TouchableOpacity, ScrollView } from 'react-native-gesture-handler';
import HTML from 'react-native-render-html';
import { getStatusBarHeight } from 'react-native-status-bar-height';
export default class NewsDetail extends React.Component {
constructor(props) {
super(props);
......@@ -13,14 +13,17 @@ export default class NewsDetail extends React.Component {
subtitle: '',
image: '',
content: '',
image_height: 400
image_height: 400,
statusbar_height: 50
}
}
componentDidMount() {
const screenWidth = Math.round(Dimensions.get('window').width);
const statusBarHeight = getStatusBarHeight();
this.setState({
image_height: screenWidth
image_height: screenWidth,
statusbar_height: statusBarHeight
})
this.get_news_detail(this.props.route.params.slug)
}
......@@ -42,7 +45,7 @@ export default class NewsDetail extends React.Component {
render() {
console.log('Image : ' + this.state.image)
return (
<View style={styles.container}>
<View style={styles.container(this.state.statusbar_height)}>
<View style={styles.header}>
<TouchableOpacity onPress={() => this.props.navigation.goBack()}>
<Image source={require('../assets/icon/back.png')} style={{width: 35, height: 35}} />
......@@ -66,11 +69,11 @@ export default class NewsDetail extends React.Component {
const styles = StyleSheet.create({
container: {
container: (marginTop) => ({
flex: 1,
marginTop: 29,
marginTop: marginTop,
backgroundColor: 'white',
},
}),
header: {
height: 60,
paddingHorizontal: 5,
......
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 { connect } from 'react-redux';
import ActionType from '../redux/globalActionType';
......@@ -79,59 +79,46 @@ class TransferBalance extends React.Component {
render() {
return (
<View style={styles.container}>
<View style={styles.header}>
<Text style={{ textAlign: 'center', marginTop: 10, fontSize: 25 }}>Transfer Balance</Text>
</View>
<View style={styles.content}>
<View style={styles.name_addrees_input}>
<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 }}
<ScrollView>
<View style={{ flex: 3 }}>
<View style={{ flex: 1, margin: 20,top:20 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Phone</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={(destination) => this.setState({ destination })}
value={this.state.destination}
keyboardType='number-pad' />
</View>
</View>
<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 }}
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Amount</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={(amount) => this.setState({ amount })}
value={this.state.amount}
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={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: 2 }}>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 100, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(reference) => this.setState({ reference })}
value={this.state.reference} />
<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>
</TouchableOpacity>
</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>
</ScrollView>
</View>
)
}
......@@ -208,3 +195,51 @@ const mapDispatchToProps = (dispacth) => {
}
export default connect(mapStateToProps, mapDispatchToProps)(TransferBalance);
{/* <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