muba-posting 3.0.8 → 3.0.12
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/PopupSpendProduct.js +10 -1
- package/Posting.js +17 -1
- package/locales/ar.json +1 -1
- package/locales/en.json +1 -1
- package/locales/es.json +1 -1
- package/locales/fr.json +1 -1
- package/locales/it.json +1 -1
- package/locales/nl.json +1 -1
- package/package.json +2 -1
package/PopupSpendProduct.js
CHANGED
|
@@ -8,6 +8,7 @@ import { strings } from 'muba-i18n';
|
|
|
8
8
|
import commonStyles from './commonStyles';
|
|
9
9
|
|
|
10
10
|
export const PROMOTE_AD = '/api/posting/PromoteAd';
|
|
11
|
+
const GET_COUNTRY_PHONE = '/api/common/GetCountryPhone';
|
|
11
12
|
|
|
12
13
|
export default class PopupSpendProduct extends React.Component {
|
|
13
14
|
constructor(props) {
|
|
@@ -15,6 +16,14 @@ export default class PopupSpendProduct extends React.Component {
|
|
|
15
16
|
|
|
16
17
|
this.state = {
|
|
17
18
|
remaining: 0,
|
|
19
|
+
countryPhone: ''
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async componentDidMount() {
|
|
24
|
+
const resultJson = await this.props.request(this, GET_COUNTRY_PHONE);
|
|
25
|
+
if (resultJson.success) {
|
|
26
|
+
this.setState({ countryPhone: resultJson.countryPhones[0].formattedPhone });
|
|
18
27
|
}
|
|
19
28
|
}
|
|
20
29
|
|
|
@@ -78,7 +87,7 @@ export default class PopupSpendProduct extends React.Component {
|
|
|
78
87
|
<Icon style={[commonStyles.popupIcon, commonStyles.red]} name="exclamation-circle" />
|
|
79
88
|
<OutputText style={[commonStyles.popupTitle, commonStyles.red]}>{strings('setup.noPromoteTitle', { product: this.state.product })}</OutputText>
|
|
80
89
|
</View>
|
|
81
|
-
<OutputText style={commonStyles.popupText}>{strings('setup.noPromoteSubtitle')}</OutputText>
|
|
90
|
+
<OutputText style={commonStyles.popupText}>{strings('setup.noPromoteSubtitle', { countryPhone: this.state.countryPhone })}</OutputText>
|
|
82
91
|
</View>
|
|
83
92
|
:
|
|
84
93
|
<View>
|
package/Posting.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BackHandler, Text, TouchableOpacity, View } from 'react-native';
|
|
3
|
+
import { manipulateAsync } from 'expo-image-manipulator';
|
|
3
4
|
import CustomScrollView from 'muba-custom-scroll-view';
|
|
4
5
|
import { CommonActions } from '@react-navigation/native';
|
|
5
6
|
import { loadLocaleData, currentLocale, strings } from 'muba-i18n';
|
|
@@ -31,6 +32,7 @@ const SET_AD = '/api/posting/SetAd';
|
|
|
31
32
|
const GET_AD = '/api/posting/GetPostingAd';
|
|
32
33
|
const GET_BUSINESS_PRODUCTS = '/api/posting/GetBusinessProducts';
|
|
33
34
|
const GET_MAX_PICTURES = '/api/posting/GetMaxPictures';
|
|
35
|
+
const GET_COUNTRY_PHONE = '/api/common/GetCountryPhone';
|
|
34
36
|
|
|
35
37
|
export default class Posting extends React.Component {
|
|
36
38
|
constructor(props) {
|
|
@@ -58,6 +60,7 @@ export default class Posting extends React.Component {
|
|
|
58
60
|
progressBarHeight: 0,
|
|
59
61
|
adId: this.props.adId,
|
|
60
62
|
maxPictures: 0,
|
|
63
|
+
countryPhone: '',
|
|
61
64
|
postingAd: {
|
|
62
65
|
category: null,
|
|
63
66
|
subCategory: null,
|
|
@@ -181,6 +184,11 @@ export default class Posting extends React.Component {
|
|
|
181
184
|
loadData = async () => {
|
|
182
185
|
const canPublish = await this.popupPermissions.open();
|
|
183
186
|
if (canPublish) {
|
|
187
|
+
const resultJson = await this.props.request(this, GET_COUNTRY_PHONE);
|
|
188
|
+
if (resultJson.success) {
|
|
189
|
+
this.setState({ countryPhone: resultJson.countryPhones[0].formattedPhone });
|
|
190
|
+
}
|
|
191
|
+
|
|
184
192
|
this.getMaxPictures();
|
|
185
193
|
const hasListings = await this.checkListings();
|
|
186
194
|
if (this.state.adId != null) {
|
|
@@ -329,6 +337,14 @@ export default class Posting extends React.Component {
|
|
|
329
337
|
let i = 0;
|
|
330
338
|
for (let imageObject of this.state.postingAd.images) {
|
|
331
339
|
if (imageObject.photo.url) {
|
|
340
|
+
if (imageObject.photo.extension === 'heic' || imageObject.photo.extension === 'heif') {
|
|
341
|
+
const manipResult = await manipulateAsync(
|
|
342
|
+
imageObject.photo.url.uri, [], {}
|
|
343
|
+
);
|
|
344
|
+
|
|
345
|
+
imageObject.photo.url.uri = manipResult.uri;
|
|
346
|
+
}
|
|
347
|
+
|
|
332
348
|
formData.append('photo' + i, {
|
|
333
349
|
uri: imageObject.photo.url.uri,
|
|
334
350
|
name: imageObject.photo.fileName ? imageObject.photo.fileName : 'photo_' + i + '.' + imageObject.photo.extension,
|
|
@@ -573,7 +589,7 @@ export default class Posting extends React.Component {
|
|
|
573
589
|
</CustomScrollView>
|
|
574
590
|
<PopupAdvice icon={<FontAwesomeIcon name='block' />} title={strings('setup.noPromoteTitle', { product: '' })} headerColor={commonStyles.red} ref={(popupAdvice) => { this.popupNoListings = popupAdvice; }}
|
|
575
591
|
onClose={async () => this.state.view !== Views.PREVIEW ? this.goBack() : null} hideButton={true}>
|
|
576
|
-
<OutputText style={commonStyles.popupText}>{strings('setup.noPromoteSubtitle')}</OutputText>
|
|
592
|
+
<OutputText style={commonStyles.popupText}>{strings('setup.noPromoteSubtitle', { countryPhone: this.state.countryPhone })}</OutputText>
|
|
577
593
|
<TouchableOpacity style={[commonStyles.okBtnBoxPopup, commonStyles.okBtnPopup]} onPress={() => this.popupNoListings.hide()} >
|
|
578
594
|
<OutputText style={commonStyles.okBtnTextPopup}>{strings('setup.adviceOK')}</OutputText>
|
|
579
595
|
</TouchableOpacity>
|
package/locales/ar.json
CHANGED
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"congratulationsPromoteAdSubTitle1": "سيكون إعلانكم في نتائج البحث الأولى",
|
|
72
72
|
"congratulationsPromoteAdSubTitle2": "لا يزال لديكم: {{remaining}} إعلان {{product}}",
|
|
73
73
|
"noPromoteTitle": "عذرا! لا تتوفرون على إعلانات {{product}} متوفرة",
|
|
74
|
-
"noPromoteSubtitle": "إذا كنتم ترغبون في إعادة شحن حسابكم ، فاتصلوا بنا:
|
|
74
|
+
"noPromoteSubtitle": "إذا كنتم ترغبون في إعادة شحن حسابكم ، فاتصلوا بنا: {{countryPhone}}",
|
|
75
75
|
"new": "جديد",
|
|
76
76
|
"good": "حالة جيدة",
|
|
77
77
|
"reform": "للتجديد",
|
package/locales/en.json
CHANGED
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"congratulationsPromoteAdSubTitle1": "Your ad will be in the first search results",
|
|
72
72
|
"congratulationsPromoteAdSubTitle2": "You still have: {{remaining}} ad {{product}}",
|
|
73
73
|
"noPromoteTitle": "Sorry! You have no more {{product}} ads available",
|
|
74
|
-
"noPromoteSubtitle": "If you want to recharge your account, contact us:
|
|
74
|
+
"noPromoteSubtitle": "If you want to recharge your account, contact us: {{countryPhone}}",
|
|
75
75
|
"new": "New",
|
|
76
76
|
"good": "Good condition",
|
|
77
77
|
"reform": "Due for reform",
|
package/locales/es.json
CHANGED
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"congratulationsPromoteAdSubTitle1": "Tu anuncio se posicionará en los primeros resultados",
|
|
72
72
|
"congratulationsPromoteAdSubTitle2": "Todavía tienes: {{remaining}} anuncios {{product}}",
|
|
73
73
|
"noPromoteTitle": "Lo sentimos! No dispones de más {{product}} anuncios disponibles",
|
|
74
|
-
"noPromoteSubtitle": "Si deseas recargar tu cuenta, contáctanos:
|
|
74
|
+
"noPromoteSubtitle": "Si deseas recargar tu cuenta, contáctanos: {{countryPhone}}",
|
|
75
75
|
"new": "Nuevo",
|
|
76
76
|
"good": "Buen estado",
|
|
77
77
|
"reform": "A reformar",
|
package/locales/fr.json
CHANGED
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"congratulationsPromoteAdSubTitle1": "Votre annonce sera dans les premiers résultats de recherche",
|
|
72
72
|
"congratulationsPromoteAdSubTitle2": "Il vous reste encore: {{remaining}} annonce {{product}}",
|
|
73
73
|
"noPromoteTitle": "Désolé! Vous n'avez plus d'annonces {{product}} disponible",
|
|
74
|
-
"noPromoteSubtitle": "Si vous souhaitez recharger votre compte, contactez-nous:
|
|
74
|
+
"noPromoteSubtitle": "Si vous souhaitez recharger votre compte, contactez-nous: {{countryPhone}}",
|
|
75
75
|
"new": "Nouveau",
|
|
76
76
|
"good": "Bon état",
|
|
77
77
|
"reform": "À rénover",
|
package/locales/it.json
CHANGED
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"congratulationsPromoteAdSubTitle1": "Il tuo annuncio apparirà tra i primi risultati",
|
|
72
72
|
"congratulationsPromoteAdSubTitle2": "Hai ancora: {{remaining}} annunci {{product}}",
|
|
73
73
|
"noPromoteTitle": "Non hai altri {{product}} annunci disponibili",
|
|
74
|
-
"noPromoteSubtitle": "Contattaci per ricaricare il tuo account:
|
|
74
|
+
"noPromoteSubtitle": "Contattaci per ricaricare il tuo account: {{countryPhone}}",
|
|
75
75
|
"new": "Nuovo",
|
|
76
76
|
"good": "Buone condizioni",
|
|
77
77
|
"reform": "Da ristrutturare",
|
package/locales/nl.json
CHANGED
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"congratulationsPromoteAdSubTitle1": "Uw advertentie komt bovenaan in de zoekresultaten te staan",
|
|
72
72
|
"congratulationsPromoteAdSubTitle2": "U hebt nog: {{remaining}} {{product}}-advertenties",
|
|
73
73
|
"noPromoteTitle": "Sorry, u hebt geen {{product}}-advertenties meer",
|
|
74
|
-
"noPromoteSubtitle": "Als u uw account wilt heractiveren, kunt u ons bellen op:
|
|
74
|
+
"noPromoteSubtitle": "Als u uw account wilt heractiveren, kunt u ons bellen op: {{countryPhone}}",
|
|
75
75
|
"new": "Nieuw",
|
|
76
76
|
"good": "In goede staat",
|
|
77
77
|
"reform": "Moet verbouwd worden",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muba-posting",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.12",
|
|
4
4
|
"description": "Posting",
|
|
5
5
|
"main": "Posting.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"homepage": "https://github.com/Mubawab/muba-posting#readme",
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@react-native-async-storage/async-storage": "~1.15.0",
|
|
21
|
+
"expo-image-manipulator": "~9.2.2",
|
|
21
22
|
"muba-custom-scroll-view": "3",
|
|
22
23
|
"muba-display-price": "3",
|
|
23
24
|
"muba-font": "3",
|