Skip to content

Commit d9be70b

Browse files
Updated: Send bid form
1 parent 4cbeae7 commit d9be70b

File tree

4 files changed

+91
-5
lines changed

4 files changed

+91
-5
lines changed

package-lock.json

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"native-base": "^2.15.2",
2727
"react": "16.13.1",
2828
"react-coming-soon": "^1.0.6",
29+
"react-dom": "^17.0.2",
2930
"react-native": "0.63.4",
3031
"react-native-bootsplash": "^3.2.2",
3132
"react-native-braintree": "^0.5.0",

screens/payment/PaymentScreen.js

+68-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const PaymentScreen = (props) => {
1818
try {
1919
const stripeResponse = await axios.post('http://localhost:8000/payment', {
2020
21-
product: cartInfo,
21+
product: order,
2222
authToken: jsonResponse,
2323
});
2424

@@ -37,14 +37,77 @@ const PaymentScreen = (props) => {
3737
setPaymentStatus(' Payment failed due to some issue');
3838
}
3939
};
40+
const paymentUI = () => {
41+
if (!makePayment) {
42+
return (
43+
<View
44+
style={{
45+
display: 'flex',
46+
flexDirection: 'column',
47+
justifyContent: 'center',
48+
alignItems: 'center',
49+
height: 300,
50+
marginTop: 50,
51+
}}>
52+
<Text style={{fontSize: 25, margin: 10}}> Make Payment </Text>
53+
<Text style={{fontSize: 16, margin: 10}}>
54+
{' '}
55+
Product Description: {order.description}{' '}
56+
</Text>
57+
<Text style={{fontSize: 16, margin: 10}}>
58+
{' '}
59+
Payable Amount: {order.budget}{' '}
60+
</Text>
61+
62+
<TouchableOpacity
63+
style={{
64+
height: 60,
65+
width: 300,
66+
backgroundColor: '#FF5733',
67+
borderRadius: 30,
68+
justifyContent: 'center',
69+
alignItems: 'center',
70+
}}
71+
onPress={() => {
72+
setMakePayment(true);
73+
}}>
74+
<Text style={{color: '#FFF', fontSize: 20}}>Proceed To Pay</Text>
75+
</TouchableOpacity>
76+
</View>
77+
);
78+
79+
// show to make payment
80+
} else {
81+
if (response !== undefined) {
82+
return (
83+
<View
84+
style={{
85+
display: 'flex',
86+
flexDirection: 'column',
87+
justifyContent: 'center',
88+
alignItems: 'center',
89+
height: 300,
90+
marginTop: 50,
91+
}}>
92+
<Text style={{fontSize: 25, margin: 10}}> {paymentStatus} </Text>
93+
<Text style={{fontSize: 16, margin: 10}}> {response} </Text>
94+
</View>
95+
);
96+
} else {
97+
return (
98+
<PaymentView
99+
order={props.route.params.order}
100+
onCheckStatus={onCheckStatus}
101+
/>
102+
);
103+
}
104+
}
105+
};
40106

41107
return (
42108
<View style={styles.container}>
43109
<Text style={styles.heading}>Payment</Text>
44-
<PaymentView
45-
order={props.route.params.order}
46-
onCheckStatus={onCheckStatus}
47-
/>
110+
{paymentUI()}
48111
</View>
49112
);
50113
};

screens/seller/SendBid.js

+1
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ const SendBid = (props) => {
225225
onChangeText={propss.handleChange('budget')}
226226
value={propss.values.budget}
227227
onBlur={propss.handleBlur('budget')}
228+
keyboardType="number-pad"
228229
/>
229230
<Text
230231
style={{

0 commit comments

Comments
 (0)