muba-posting 4.2.3 → 4.2.5
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 +10 -9
- package/Publish4.js +15 -11
- package/package.json +2 -2
package/Posting.js
CHANGED
|
@@ -66,7 +66,6 @@ export default class Posting extends React.Component {
|
|
|
66
66
|
countryPhone: '',
|
|
67
67
|
businessId: this.props.businessId,
|
|
68
68
|
picturesUploaded: 0,
|
|
69
|
-
images: [],
|
|
70
69
|
params: null,
|
|
71
70
|
postingAd: {
|
|
72
71
|
transaction: null,
|
|
@@ -433,8 +432,11 @@ export default class Posting extends React.Component {
|
|
|
433
432
|
|
|
434
433
|
imageBrowserCallback = async (photos) => {
|
|
435
434
|
this.setState({
|
|
436
|
-
showImageBrowser: false
|
|
437
|
-
|
|
435
|
+
showImageBrowser: false
|
|
436
|
+
}, () => {
|
|
437
|
+
for (let photo of photos) {
|
|
438
|
+
this.publish4?.loadUri(photo)
|
|
439
|
+
}
|
|
438
440
|
});
|
|
439
441
|
}
|
|
440
442
|
|
|
@@ -448,9 +450,8 @@ export default class Posting extends React.Component {
|
|
|
448
450
|
|
|
449
451
|
_savePicture = async (picture) => {
|
|
450
452
|
this.setState({
|
|
451
|
-
showImageBrowser: false
|
|
452
|
-
|
|
453
|
-
});
|
|
453
|
+
showImageBrowser: false
|
|
454
|
+
}, () => this.publish4?.loadUri(picture));
|
|
454
455
|
}
|
|
455
456
|
|
|
456
457
|
render() {
|
|
@@ -558,6 +559,7 @@ export default class Posting extends React.Component {
|
|
|
558
559
|
|
|
559
560
|
{this.state.view === Views.PUBLISH_4 ?
|
|
560
561
|
<Publish4 postingAd={this.state.postingAd}
|
|
562
|
+
ref={publish4 => this.publish4 = publish4}
|
|
561
563
|
saveEditAd={() => this._saveEditAd()}
|
|
562
564
|
goToPage={(view) => this._goToPage(view)}
|
|
563
565
|
request={this.props.request}
|
|
@@ -568,8 +570,7 @@ export default class Posting extends React.Component {
|
|
|
568
570
|
progressBarHeight={this.state.progressBarHeight}
|
|
569
571
|
headerHeight={this.state.headerHeight}
|
|
570
572
|
openPictureSelector={() => this._openPictureSelector()}
|
|
571
|
-
maxPictures={this.state.maxPictures}
|
|
572
|
-
images={this.state.images} />
|
|
573
|
+
maxPictures={this.state.maxPictures} />
|
|
573
574
|
:
|
|
574
575
|
null
|
|
575
576
|
}
|
|
@@ -648,7 +649,7 @@ export default class Posting extends React.Component {
|
|
|
648
649
|
}
|
|
649
650
|
|
|
650
651
|
</CustomScrollView>
|
|
651
|
-
<PopupAdvice icon={<FontAwesomeIcon name='block' />} title={strings('setup.noPromoteTitle', { product: '' })} headerColor={commonStyles.red} ref={
|
|
652
|
+
<PopupAdvice icon={<FontAwesomeIcon name='block' />} title={strings('setup.noPromoteTitle', { product: '' })} headerColor={commonStyles.red} ref={popupAdvice => this.popupNoListings = popupAdvice}
|
|
652
653
|
onClose={async () => this.state.view !== Views.PREVIEW ? this.goBack() : null} hideButton={true}>
|
|
653
654
|
<OutputText style={commonStyles.popupText}>{strings('setup.noPromoteSubtitle', { countryPhone: this.state.countryPhone })}</OutputText>
|
|
654
655
|
<TouchableOpacity style={[commonStyles.okBtnBoxPopup, commonStyles.okBtnPopup]} onPress={() => this.popupNoListings.hide()} >
|
package/Publish4.js
CHANGED
|
@@ -25,7 +25,7 @@ export default class Publish4 extends React.Component {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
componentDidMount() {
|
|
28
|
-
for (let photo of this.props.images) {
|
|
28
|
+
for (let photo of this.props.postingAd.images) {
|
|
29
29
|
this.loadImage(photo);
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -37,9 +37,9 @@ export default class Publish4 extends React.Component {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
componentDidUpdate = async (prevProps) => {
|
|
40
|
-
if (!this.isSameList(prevProps.images, this.props.images)) {
|
|
40
|
+
if (!this.isSameList(prevProps.postingAd.images, this.props.postingAd.images)) {
|
|
41
41
|
this.setState({ images: [] }, () => {
|
|
42
|
-
for (let photo of this.props.images) {
|
|
42
|
+
for (let photo of this.props.postingAd.images) {
|
|
43
43
|
this.loadImage(photo);
|
|
44
44
|
}
|
|
45
45
|
});
|
|
@@ -58,7 +58,7 @@ export default class Publish4 extends React.Component {
|
|
|
58
58
|
return true;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
async
|
|
61
|
+
async loadUri(imgUri) {
|
|
62
62
|
if (imgUri) {
|
|
63
63
|
let fileType = imgUri.substring(imgUri.lastIndexOf('.') + 1).toLowerCase();
|
|
64
64
|
|
|
@@ -72,20 +72,24 @@ export default class Publish4 extends React.Component {
|
|
|
72
72
|
extraInfo: this.state.images.length
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
this.loadImage(image);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
});
|
|
79
|
+
loadImage(image) {
|
|
80
|
+
let imagesArray = this.state.images;
|
|
81
|
+
imagesArray.push(image);
|
|
82
82
|
|
|
83
|
+
this.setState({
|
|
84
|
+
showErrorNoSelectedImages: false,
|
|
85
|
+
images: imagesArray
|
|
86
|
+
}, () => {
|
|
83
87
|
if (this.state.images.length == this.props.maxPictures) {
|
|
84
88
|
this.setState({ allPhotosSelected: true });
|
|
85
89
|
} else if (this.state.images.length == 1) {
|
|
86
90
|
this.selectMainPhoto(this.state.images[0]);
|
|
87
91
|
}
|
|
88
|
-
}
|
|
92
|
+
});
|
|
89
93
|
}
|
|
90
94
|
|
|
91
95
|
async deleteImage(itemId, index) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muba-posting",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.5",
|
|
4
4
|
"description": "Posting",
|
|
5
5
|
"main": "Posting.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/Mubawab/muba-posting#readme",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@react-native-async-storage/async-storage": "~1.
|
|
20
|
+
"@react-native-async-storage/async-storage": "~1.15.0",
|
|
21
21
|
"muba-custom-scroll-view": "4",
|
|
22
22
|
"muba-display-price": "4",
|
|
23
23
|
"muba-font": "4",
|