muba-posting 4.1.21 → 4.1.23
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 +40 -11
- package/Preview.js +11 -0
- package/Publish6.js +2 -1
- package/assets/images/sparks.png +0 -0
- package/commonStyles.js +30 -0
- package/package.json +2 -1
package/Posting.js
CHANGED
|
@@ -22,6 +22,7 @@ import PublishProgressBar from './PublishProgressBar.js';
|
|
|
22
22
|
import EditHead from './EditHead.js';
|
|
23
23
|
import PictureSelector from 'muba-picture';
|
|
24
24
|
import PopupPermissions from 'muba-popup-permissions';
|
|
25
|
+
import PaymentOnlinePopup from 'muba-payment-online';
|
|
25
26
|
import { createIconSetFromFontello } from 'react-native-vector-icons';
|
|
26
27
|
import fontelloConfig from './fonts/config.json';
|
|
27
28
|
const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
|
|
@@ -209,10 +210,14 @@ export default class Posting extends React.Component {
|
|
|
209
210
|
this.popupNoListings.show();
|
|
210
211
|
} else {
|
|
211
212
|
const pendingAd = await this.props.request(this, LOAD_PENDING_CREATED);
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
if (pendingAd.httpStatus === 200) {
|
|
214
|
+
const languages = pendingAd?.languages.length > 0 ? pendingAd?.languages : this.state.postingAd.languages
|
|
215
|
+
const languageId = languages[0].language;
|
|
216
|
+
await this.setState({
|
|
217
|
+
postingAd: { ...this.state.postingAd, ...pendingAd, languageId: languageId, languages: languages },
|
|
218
|
+
isLoading: false
|
|
219
|
+
});
|
|
220
|
+
}
|
|
216
221
|
|
|
217
222
|
this.setState({ view: this.state.originView });
|
|
218
223
|
if (this.props.changeView) {
|
|
@@ -281,8 +286,12 @@ export default class Posting extends React.Component {
|
|
|
281
286
|
|
|
282
287
|
prevViews.unshift(this.state.view);
|
|
283
288
|
|
|
284
|
-
if (this.state.postingAd.town) {
|
|
285
|
-
const
|
|
289
|
+
if (this.state.fullPosting && this.state.postingAd.town && Views.PUBLISH_6 !== this.state.view) {
|
|
290
|
+
const ad = { ...this.state.postingAd };
|
|
291
|
+
if (Views.PUBLISH_4 !== this.state.view) {
|
|
292
|
+
delete ad.images;
|
|
293
|
+
}
|
|
294
|
+
const response = await this.props.request(this, CREATE_AD, ad);
|
|
286
295
|
if (response.httpStatus === 200) {
|
|
287
296
|
await this.setState({
|
|
288
297
|
postingAd: { ...this.state.postingAd, id: response.id }
|
|
@@ -330,14 +339,16 @@ export default class Posting extends React.Component {
|
|
|
330
339
|
this.setState({ currentScreen: 6 });
|
|
331
340
|
break;
|
|
332
341
|
case Views.PREVIEW:
|
|
333
|
-
|
|
342
|
+
if (params) {
|
|
343
|
+
await this.previewScreen.refreshData(params);
|
|
344
|
+
}
|
|
334
345
|
break;
|
|
335
346
|
case Views.EDIT_SELECTOR:
|
|
336
347
|
await this.setState({ prevViews: [] })
|
|
337
348
|
}
|
|
338
349
|
this.scroll.scrollTop();
|
|
339
350
|
this.setState({ view: view });
|
|
340
|
-
if (this.props.changeView) {
|
|
351
|
+
if (this.props.changeView && Views.PAYMENT_ONLINE !== view) {
|
|
341
352
|
this.props.changeView(view)
|
|
342
353
|
}
|
|
343
354
|
}
|
|
@@ -370,6 +381,7 @@ export default class Posting extends React.Component {
|
|
|
370
381
|
}
|
|
371
382
|
|
|
372
383
|
async _saveEditAd() {
|
|
384
|
+
this._showLoading();
|
|
373
385
|
const ad = { ...this.state.postingAd, id: { adId: this.state.postingAd.id } };
|
|
374
386
|
if (this.state.originView === Views.EDIT_SELECTOR && Views.PUBLISH_4 !== this.state.view) {
|
|
375
387
|
delete ad.images;
|
|
@@ -388,6 +400,7 @@ export default class Posting extends React.Component {
|
|
|
388
400
|
await this.setState({ postingAd: { ...this.state.postingAd, adId: response.id } });
|
|
389
401
|
this._goToPage(Views.PREVIEW, null, response);
|
|
390
402
|
}
|
|
403
|
+
this._hideLoading();
|
|
391
404
|
|
|
392
405
|
if (this.props.showRatingPopup) {
|
|
393
406
|
this.props.showRatingPopup();
|
|
@@ -441,7 +454,7 @@ export default class Posting extends React.Component {
|
|
|
441
454
|
|
|
442
455
|
<View style={commonStyles.flex1}>
|
|
443
456
|
<View onLayout={(event) => this.setState({ headerHeight: event.nativeEvent.layout.height })}>
|
|
444
|
-
{!this.state.showImageBrowser ? this.props.topBar : null}
|
|
457
|
+
{!this.state.showImageBrowser && this.state.view !== Views.PAYMENT_ONLINE ? this.props.topBar : null}
|
|
445
458
|
</View>
|
|
446
459
|
{this.state.showImageBrowser ?
|
|
447
460
|
<PictureSelector max={this.state.maxPictures - this.state.postingAd.images.length} callback={this.imageBrowserCallback} savePicture={this._savePicture} goBack={() => this.goBack(true)} />
|
|
@@ -453,7 +466,7 @@ export default class Posting extends React.Component {
|
|
|
453
466
|
{this.state.fontLoaded ?
|
|
454
467
|
<View style={[this.props.containerStyle, this.state.showImageBrowser ? commonStyles.displayNone : '']}>
|
|
455
468
|
<CustomScrollView ref={(element) => this.scroll = element}>
|
|
456
|
-
{this.state.view !== Views.PREVIEW ?
|
|
469
|
+
{this.state.view !== Views.PREVIEW && this.state.view !== Views.PAYMENT_ONLINE ?
|
|
457
470
|
<View onLayout={(event) => this.setState({ progressBarHeight: event.nativeEvent.layout.height })}>
|
|
458
471
|
{
|
|
459
472
|
this.state.adId == null ?
|
|
@@ -582,7 +595,8 @@ export default class Posting extends React.Component {
|
|
|
582
595
|
showView={this.state.view === Views.PREVIEW}
|
|
583
596
|
progressBarHeight={this.state.progressBarHeight}
|
|
584
597
|
request={this.props.request}
|
|
585
|
-
headerHeight={this.state.headerHeight}
|
|
598
|
+
headerHeight={this.state.headerHeight}
|
|
599
|
+
highlight={() => this._goToPage(Views.PAYMENT_ONLINE)} />
|
|
586
600
|
|
|
587
601
|
<PostingEdit ref={(view) => this.editSelector = view}
|
|
588
602
|
postingAd={this.state.postingAd}
|
|
@@ -590,6 +604,21 @@ export default class Posting extends React.Component {
|
|
|
590
604
|
topBar={this.props.topBar}
|
|
591
605
|
goToPage={(view) => this._goToPage(view)} />
|
|
592
606
|
|
|
607
|
+
{this.state.view === Views.PAYMENT_ONLINE ?
|
|
608
|
+
<PaymentOnlinePopup
|
|
609
|
+
context={this.props.context}
|
|
610
|
+
request={this.props.request}
|
|
611
|
+
topBar={this.props.topBar}
|
|
612
|
+
adId={this.state.postingAd.id}
|
|
613
|
+
country={this.props.country}
|
|
614
|
+
goToPrivacy={this.props.goToPrivacy}
|
|
615
|
+
changeView={this.props.changeView}
|
|
616
|
+
close={this.goBack}
|
|
617
|
+
goBack={() => this.setState({ view: Views.PREVIEW }, () => this.goBack())} />
|
|
618
|
+
:
|
|
619
|
+
null
|
|
620
|
+
}
|
|
621
|
+
|
|
593
622
|
</CustomScrollView>
|
|
594
623
|
<PopupAdvice icon={<FontAwesomeIcon name='block' />} title={strings('setup.noPromoteTitle', { product: '' })} headerColor={commonStyles.red} ref={(popupAdvice) => { this.popupNoListings = popupAdvice; }}
|
|
595
624
|
onClose={async () => this.state.view !== Views.PREVIEW ? this.goBack() : null} hideButton={true}>
|
package/Preview.js
CHANGED
|
@@ -190,7 +190,18 @@ export default class Preview extends React.Component {
|
|
|
190
190
|
</View>
|
|
191
191
|
</View>
|
|
192
192
|
}
|
|
193
|
+
{!this.props.businessId ?
|
|
194
|
+
<View style={commonStyles.previewHighlightContainer}>
|
|
195
|
+
<TouchableOpacity style={[commonStyles.previewHighlightButton, commonStyles.alignCenter]} activeOpacity={0.5} onPress={() => this.props.highlight()}>
|
|
196
|
+
<Image style={commonStyles.previewHighlightImage} source={require('./assets/images/sparks.png')} />
|
|
197
|
+
<Text style={commonStyles.previewHighlightText}>Highlight</Text>
|
|
198
|
+
</TouchableOpacity>
|
|
199
|
+
</View>
|
|
200
|
+
:
|
|
201
|
+
null
|
|
202
|
+
}
|
|
193
203
|
</View>
|
|
204
|
+
|
|
194
205
|
<View style={commonStyles.previewBackButton}>
|
|
195
206
|
<TouchableOpacity activeOpacity={0.5} onPress={() => this.props.goBack()}>
|
|
196
207
|
<Text style={commonStyles.carteNote}>{strings('setup.returnHome')}</Text>
|
package/Publish6.js
CHANGED
|
@@ -62,7 +62,8 @@ export default class Publish6 extends React.Component {
|
|
|
62
62
|
return false;
|
|
63
63
|
}
|
|
64
64
|
for (let index = 0; index < firstList?.length; ++index) {
|
|
65
|
-
if (firstList[index].
|
|
65
|
+
if (firstList[index].title != secondList[index].title
|
|
66
|
+
|| firstList[index].description != secondList[index].description) {
|
|
66
67
|
return false;
|
|
67
68
|
}
|
|
68
69
|
}
|
|
Binary file
|
package/commonStyles.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StyleSheet, Dimensions, Platform } from 'react-native';
|
|
2
2
|
import { isRTL } from 'muba-i18n';
|
|
3
3
|
import Constants from 'expo-constants';
|
|
4
|
+
import { Fonts } from '../../app/utils/Common';
|
|
4
5
|
|
|
5
6
|
const window = Dimensions.get('window');
|
|
6
7
|
|
|
@@ -1323,6 +1324,35 @@ export default StyleSheet.create({
|
|
|
1323
1324
|
left: 0,
|
|
1324
1325
|
right: 0,
|
|
1325
1326
|
bottom: 0
|
|
1327
|
+
},
|
|
1328
|
+
|
|
1329
|
+
previewHighlightContainer: {
|
|
1330
|
+
marginTop: 30
|
|
1331
|
+
},
|
|
1332
|
+
|
|
1333
|
+
previewHighlightButton: {
|
|
1334
|
+
backgroundColor: 'rgb(241, 255, 254)',
|
|
1335
|
+
fontSize: 16,
|
|
1336
|
+
marginBottom: 10,
|
|
1337
|
+
borderWidth: 1,
|
|
1338
|
+
borderStyle: 'solid',
|
|
1339
|
+
borderColor: 'rgb(15, 179, 166)',
|
|
1340
|
+
borderRadius: 5,
|
|
1341
|
+
paddingVertical: 10
|
|
1342
|
+
},
|
|
1343
|
+
|
|
1344
|
+
previewHighlightImage: {
|
|
1345
|
+
position: 'absolute',
|
|
1346
|
+
top: -13,
|
|
1347
|
+
left: 6,
|
|
1348
|
+
width: 35,
|
|
1349
|
+
height: 36
|
|
1350
|
+
},
|
|
1351
|
+
|
|
1352
|
+
previewHighlightText: {
|
|
1353
|
+
fontFamily: Fonts.Button,
|
|
1354
|
+
textTransform: 'uppercase',
|
|
1355
|
+
color: 'rgb(15, 179, 166)'
|
|
1326
1356
|
}
|
|
1327
1357
|
|
|
1328
1358
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muba-posting",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.23",
|
|
4
4
|
"description": "Posting",
|
|
5
5
|
"main": "Posting.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"muba-output-text": "4",
|
|
30
30
|
"muba-phone-group": "4",
|
|
31
31
|
"muba-picture": "4",
|
|
32
|
+
"muba-payment-online": "4",
|
|
32
33
|
"muba-popup-advice": "4",
|
|
33
34
|
"muba-popup-permissions": "4",
|
|
34
35
|
"muba-radio-button-group": "4"
|