muba-posting 3.0.9 → 3.0.13

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.
@@ -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) {
@@ -20,7 +21,7 @@ export default class PopupSpendProduct extends React.Component {
20
21
  }
21
22
 
22
23
  async componentDidMount() {
23
- const resultJson = await request(this, GET_COUNTRY_PHONE);
24
+ const resultJson = await this.props.request(this, GET_COUNTRY_PHONE);
24
25
  if (resultJson.success) {
25
26
  this.setState({ countryPhone: resultJson.countryPhones[0].formattedPhone });
26
27
  }
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) {
@@ -59,6 +61,7 @@ export default class Posting extends React.Component {
59
61
  adId: this.props.adId,
60
62
  maxPictures: 0,
61
63
  countryPhone: '',
64
+ picturesUploaded: 0,
62
65
  postingAd: {
63
66
  category: null,
64
67
  subCategory: null,
@@ -182,7 +185,7 @@ export default class Posting extends React.Component {
182
185
  loadData = async () => {
183
186
  const canPublish = await this.popupPermissions.open();
184
187
  if (canPublish) {
185
- const resultJson = await request(this, GET_COUNTRY_PHONE);
188
+ const resultJson = await this.props.request(this, GET_COUNTRY_PHONE);
186
189
  if (resultJson.success) {
187
190
  this.setState({ countryPhone: resultJson.countryPhones[0].formattedPhone });
188
191
  }
@@ -335,6 +338,14 @@ export default class Posting extends React.Component {
335
338
  let i = 0;
336
339
  for (let imageObject of this.state.postingAd.images) {
337
340
  if (imageObject.photo.url) {
341
+ if (imageObject.photo.extension === 'heic' || imageObject.photo.extension === 'heif') {
342
+ const manipResult = await manipulateAsync(
343
+ imageObject.photo.url.uri, [], {}
344
+ );
345
+
346
+ imageObject.photo.url.uri = manipResult.uri;
347
+ }
348
+
338
349
  formData.append('photo' + i, {
339
350
  uri: imageObject.photo.url.uri,
340
351
  name: imageObject.photo.fileName ? imageObject.photo.fileName : 'photo_' + i + '.' + imageObject.photo.extension,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muba-posting",
3
- "version": "3.0.9",
3
+ "version": "3.0.13",
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",