muba-posting 4.2.1 → 4.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Posting.js +6 -0
- package/Preview.js +5 -4
- package/package.json +1 -1
package/Posting.js
CHANGED
|
@@ -35,6 +35,7 @@ const BUSINESS_PRODUCTS = { method: 'GET', url: '/controller/products/{key}/rema
|
|
|
35
35
|
const MAX_PICTURES = { method: 'GET', url: '/controller/posting/max-pictures' };
|
|
36
36
|
const COUNTRY_PHONE = { method: 'GET', url: '/controller/countries/{countryCode}/phones' };
|
|
37
37
|
const LOAD_PENDING_CREATED = { method: 'GET', url: '/controller/ads/pending-created/posting' };
|
|
38
|
+
const PAYMENT_ONLINE_ACTIVE = { method: 'GET', url: '/controller/payments-online/{countryCode}/active' };
|
|
38
39
|
|
|
39
40
|
export default class Posting extends React.Component {
|
|
40
41
|
constructor(props) {
|
|
@@ -400,6 +401,11 @@ export default class Posting extends React.Component {
|
|
|
400
401
|
} else {
|
|
401
402
|
await this.setState({ postingAd: { ...this.state.postingAd, adId: response.id } });
|
|
402
403
|
this._goToPage(Views.PREVIEW, null, response);
|
|
404
|
+
|
|
405
|
+
const paymentOnlineActive = await this.props.request(this, PAYMENT_ONLINE_ACTIVE, { regionId: this.state.postingAd.region });
|
|
406
|
+
if (!this.businessId && paymentOnlineActive.value === 'true') {
|
|
407
|
+
this._goToPage(Views.PAYMENT_ONLINE);
|
|
408
|
+
}
|
|
403
409
|
}
|
|
404
410
|
this._hideLoading();
|
|
405
411
|
|
package/Preview.js
CHANGED
|
@@ -20,7 +20,8 @@ export default class Preview extends React.Component {
|
|
|
20
20
|
premiumActive: false,
|
|
21
21
|
superPremiumActive: false,
|
|
22
22
|
remaining: 0,
|
|
23
|
-
product: ''
|
|
23
|
+
product: '',
|
|
24
|
+
showPaymentOnline: false
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -30,8 +31,8 @@ export default class Preview extends React.Component {
|
|
|
30
31
|
if (this.state.minHeight != minHeight) {
|
|
31
32
|
this.setState({ minHeight: minHeight })
|
|
32
33
|
}
|
|
33
|
-
const paymentOnlineActive = await this.props.request(this, PAYMENT_ONLINE_ACTIVE, { regionId: this.props.postingAd.
|
|
34
|
-
|
|
34
|
+
const paymentOnlineActive = await this.props.request(this, PAYMENT_ONLINE_ACTIVE, { regionId: this.props.postingAd.region });
|
|
35
|
+
this.setState({ showPaymentOnline: paymentOnlineActive.value === 'true' });
|
|
35
36
|
this.refreshData();
|
|
36
37
|
}
|
|
37
38
|
|
|
@@ -187,7 +188,7 @@ export default class Preview extends React.Component {
|
|
|
187
188
|
</View>
|
|
188
189
|
</View>
|
|
189
190
|
}
|
|
190
|
-
{!this.props.businessId ?
|
|
191
|
+
{!this.props.businessId && this.state.showPaymentOnline ?
|
|
191
192
|
<View style={commonStyles.previewHighlightContainer}>
|
|
192
193
|
<TouchableOpacity style={[commonStyles.previewHighlightButton, commonStyles.alignCenter]} activeOpacity={0.5} onPress={() => this.props.highlight()}>
|
|
193
194
|
<Image style={commonStyles.previewHighlightImage} source={require('./assets/images/sparks.png')} />
|