muba-posting 9.0.0 → 9.0.1
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 +26 -26
- package/package.json +1 -1
package/Posting.js
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
import NetInfo from "@react-native-community/netinfo";
|
|
2
|
+
import { CommonActions } from '@react-navigation/native';
|
|
3
|
+
import CustomScrollView from 'muba-custom-scroll-view';
|
|
4
|
+
import { addFontList } from 'muba-font';
|
|
5
|
+
import { currentLocale, loadLocaleData, strings } from 'muba-i18n';
|
|
6
|
+
import OutputText from 'muba-output-text';
|
|
7
|
+
import PaymentOnlinePopup from 'muba-payment-online';
|
|
8
|
+
import PopupAdvice from 'muba-popup-advice';
|
|
9
|
+
import PopupPermissions from 'muba-popup-permissions';
|
|
1
10
|
import React from 'react';
|
|
2
11
|
import { BackHandler, TouchableOpacity, View } from 'react-native';
|
|
3
|
-
import
|
|
4
|
-
import { CommonActions } from '@react-navigation/native';
|
|
5
|
-
import { loadLocaleData, currentLocale, strings } from 'muba-i18n';
|
|
6
|
-
import { Views } from './utils/Views';
|
|
12
|
+
import { createIconSetFromFontello } from 'react-native-vector-icons';
|
|
7
13
|
import commonStyles from './commonStyles';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { addFontList } from 'muba-font';
|
|
14
|
+
import EditHead from './EditHead.js';
|
|
15
|
+
import fontelloConfig from './fonts/config.json';
|
|
11
16
|
import PostingEdit from './PostingEdit';
|
|
17
|
+
import Preview from './Preview';
|
|
12
18
|
import Publish1 from './Publish1';
|
|
13
19
|
import Publish2 from './Publish2';
|
|
14
20
|
import Publish2b from './Publish2b';
|
|
@@ -16,14 +22,8 @@ import Publish3 from './Publish3';
|
|
|
16
22
|
import Publish4 from './Publish4';
|
|
17
23
|
import Publish5 from './Publish5';
|
|
18
24
|
import Publish6 from './Publish6';
|
|
19
|
-
import Preview from './Preview';
|
|
20
25
|
import PublishProgressBar from './PublishProgressBar.js';
|
|
21
|
-
import
|
|
22
|
-
import PopupPermissions from 'muba-popup-permissions';
|
|
23
|
-
import PaymentOnlinePopup from 'muba-payment-online';
|
|
24
|
-
import { createIconSetFromFontello } from 'react-native-vector-icons';
|
|
25
|
-
import fontelloConfig from './fonts/config.json';
|
|
26
|
-
import NetInfo from "@react-native-community/netinfo";
|
|
26
|
+
import { Views } from './utils/Views';
|
|
27
27
|
const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
|
|
28
28
|
|
|
29
29
|
const CREATE_AD = { method: 'POST', url: '/controller/ads' };
|
|
@@ -231,12 +231,12 @@ export default class Posting extends React.Component {
|
|
|
231
231
|
this.popupNoListings.show();
|
|
232
232
|
} else {
|
|
233
233
|
const pendingAd = await this.props.request(this.props.context, LOAD_PENDING_CREATED, { businessId: this.state.businessId });
|
|
234
|
-
|
|
234
|
+
|
|
235
235
|
if (pendingAd.httpStatus === 200) {
|
|
236
236
|
delete pendingAd.phones;
|
|
237
237
|
const languages = pendingAd?.languages.length > 0 ? pendingAd?.languages : this.state.postingAd.languages
|
|
238
238
|
const languageId = languages[0].language;
|
|
239
|
-
|
|
239
|
+
|
|
240
240
|
this.setState({
|
|
241
241
|
postingAd: { ...this.state.postingAd, ...pendingAd, languageId: languageId, languages: languages },
|
|
242
242
|
originalAd: { ...this.state.postingAd, ...pendingAd, languageId: languageId, languages: languages }
|
|
@@ -252,7 +252,7 @@ export default class Posting extends React.Component {
|
|
|
252
252
|
this.getAllowedToModifyFields();
|
|
253
253
|
|
|
254
254
|
this._hideLoading()
|
|
255
|
-
BackHandler.addEventListener('hardwareBackPress', this.goBack);
|
|
255
|
+
this.backHandler = BackHandler.addEventListener('hardwareBackPress', this.goBack);
|
|
256
256
|
} else {
|
|
257
257
|
this.goBack();
|
|
258
258
|
this._hideLoading()
|
|
@@ -274,7 +274,7 @@ export default class Posting extends React.Component {
|
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
componentWillUnmount() {
|
|
277
|
-
|
|
277
|
+
this.backHandler?.remove();
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
async checkListings() {
|
|
@@ -383,7 +383,7 @@ export default class Posting extends React.Component {
|
|
|
383
383
|
if (!netState.isConnected) {
|
|
384
384
|
this.props.showConnectionError(this.props.context);
|
|
385
385
|
return;
|
|
386
|
-
}
|
|
386
|
+
}
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
let currentScreen = this.state.currentScreen;
|
|
@@ -432,8 +432,8 @@ export default class Posting extends React.Component {
|
|
|
432
432
|
onlyShowCreateBusiness = false;
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
|
-
|
|
436
|
-
this.setState({
|
|
435
|
+
|
|
436
|
+
this.setState({
|
|
437
437
|
view: view,
|
|
438
438
|
prevViews: prevViews,
|
|
439
439
|
currentScreen: currentScreen,
|
|
@@ -443,7 +443,7 @@ export default class Posting extends React.Component {
|
|
|
443
443
|
this.scroll.scrollTop();
|
|
444
444
|
if (this.props.changeView && Views.PAYMENT_ONLINE !== view) {
|
|
445
445
|
this.props.changeView(view);
|
|
446
|
-
}
|
|
446
|
+
}
|
|
447
447
|
});
|
|
448
448
|
}
|
|
449
449
|
|
|
@@ -490,7 +490,7 @@ export default class Posting extends React.Component {
|
|
|
490
490
|
if (photo.id == undefined) {
|
|
491
491
|
ad = { ...ad, newPictures: true };
|
|
492
492
|
}
|
|
493
|
-
}
|
|
493
|
+
}
|
|
494
494
|
|
|
495
495
|
if (this.state.originView === Views.EDIT_SELECTOR && Views.PUBLISH_4 !== this.state.view) {
|
|
496
496
|
delete ad.images;
|
|
@@ -515,12 +515,12 @@ export default class Posting extends React.Component {
|
|
|
515
515
|
this.setState({
|
|
516
516
|
showRatePopup: popupShowed
|
|
517
517
|
});
|
|
518
|
-
|
|
518
|
+
|
|
519
519
|
if (!popupShowed) {
|
|
520
520
|
this.checkPaymentOnline();
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
|
|
523
|
+
|
|
524
524
|
showRating = true;
|
|
525
525
|
});
|
|
526
526
|
}
|
|
@@ -571,7 +571,7 @@ export default class Posting extends React.Component {
|
|
|
571
571
|
render() {
|
|
572
572
|
return (
|
|
573
573
|
<View style={commonStyles.flex1}>
|
|
574
|
-
<PopupPermissions ref={(element) => this.popupPermissions = element} camera={true} mediaLibrary={true}
|
|
574
|
+
<PopupPermissions ref={(element) => this.popupPermissions = element} camera={true} mediaLibrary={true} message={strings('setup.permissionsMessage')} onClose={this.loadData} />
|
|
575
575
|
|
|
576
576
|
{this.state.fontLoaded ?
|
|
577
577
|
<View style={[this.props.containerStyle, this.state.showImageBrowser ? commonStyles.displayNone : '']}>
|