muba-posting 6.0.9 → 6.0.11

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 CHANGED
@@ -58,8 +58,6 @@ export default class Posting extends React.Component {
58
58
  currentScreen: 1,
59
59
  fontLoaded: false,
60
60
  isLoading: false,
61
- headerHeight: 0,
62
- progressBarHeight: 0,
63
61
  adId: this.props.adId,
64
62
  maxPictures: 0,
65
63
  countryPhone: '',
@@ -445,17 +443,17 @@ export default class Posting extends React.Component {
445
443
  <LoadingCursor loading={this.state.isLoading} />
446
444
 
447
445
  <View style={commonStyles.flex1}>
448
- <View onLayout={(event) => this.setState({ headerHeight: event.nativeEvent.layout.height })}>
446
+ <View>
449
447
  {!this.state.showImageBrowser && this.state.view !== Views.PAYMENT_ONLINE ? this.props.topBar : null}
450
448
  </View>
451
449
 
452
- <PopupPermissions ref={(element) => this.popupPermissions = element} camera={true} mediaLibrary={true} message={strings('setup.permissionsMessage')} onClose={this.loadData} />
450
+ <PopupPermissions ref={(element) => this.popupPermissions = element} camera={true} mediaLibrary={true} sensor={true} message={strings('setup.permissionsMessage')} onClose={this.loadData} />
453
451
 
454
452
  {this.state.fontLoaded ?
455
453
  <View style={[this.props.containerStyle, this.state.showImageBrowser ? commonStyles.displayNone : '']}>
456
454
  <CustomScrollView ref={(element) => this.scroll = element}>
457
455
  {this.state.view !== Views.PREVIEW && this.state.view !== Views.PAYMENT_ONLINE ?
458
- <View onLayout={(event) => this.setState({ progressBarHeight: event.nativeEvent.layout.height })}>
456
+ <View>
459
457
  {
460
458
  this.state.adId == null ?
461
459
  <PublishProgressBar currentScreen={this.state.currentScreen} />
@@ -477,9 +475,7 @@ export default class Posting extends React.Component {
477
475
  fullPosting={this.state.fullPosting}
478
476
  goToPage={(view, editingStepOne) => this._goToPage(view, editingStepOne)}
479
477
  saveEditAd={() => this._saveEditAd()}
480
- realEstateDeveloper={this.state.realEstateDeveloper}
481
- progressBarHeight={this.state.progressBarHeight}
482
- headerHeight={this.state.headerHeight} />
478
+ realEstateDeveloper={this.state.realEstateDeveloper} />
483
479
  :
484
480
  null
485
481
  }
@@ -497,8 +493,6 @@ export default class Posting extends React.Component {
497
493
  hideLoading={() => this._hideLoading()}
498
494
  hereApiKey={this.props.hereApiKey}
499
495
  fullPosting={this.state.fullPosting}
500
- progressBarHeight={this.state.progressBarHeight}
501
- headerHeight={this.state.headerHeight}
502
496
  businessId={this.state.businessId} />
503
497
  :
504
498
  null
@@ -515,8 +509,6 @@ export default class Posting extends React.Component {
515
509
  showLoading={() => this._showLoading()}
516
510
  hideLoading={() => this._hideLoading()}
517
511
  fullPosting={this.state.fullPosting}
518
- progressBarHeight={this.state.progressBarHeight}
519
- headerHeight={this.state.headerHeight}
520
512
  businessId={this.state.businessId} />
521
513
  :
522
514
  null
@@ -533,9 +525,7 @@ export default class Posting extends React.Component {
533
525
  context={this.props.context}
534
526
  showLoading={() => this._showLoading()}
535
527
  hideLoading={() => this._hideLoading()}
536
- fullPosting={this.state.fullPosting}
537
- progressBarHeight={this.state.progressBarHeight}
538
- headerHeight={this.state.headerHeight} />
528
+ fullPosting={this.state.fullPosting}/>
539
529
  :
540
530
  null
541
531
  }
@@ -550,8 +540,6 @@ export default class Posting extends React.Component {
550
540
  showLoading={() => this._showLoading()}
551
541
  hideLoading={() => this._hideLoading()}
552
542
  fullPosting={this.state.fullPosting}
553
- progressBarHeight={this.state.progressBarHeight}
554
- headerHeight={this.state.headerHeight}
555
543
  maxPictures={this.state.maxPictures} />
556
544
  :
557
545
  null
@@ -567,9 +555,7 @@ export default class Posting extends React.Component {
567
555
  context={this.props.context}
568
556
  showLoading={() => this._showLoading()}
569
557
  hideLoading={() => this._hideLoading()}
570
- fullPosting={this.state.fullPosting}
571
- progressBarHeight={this.state.progressBarHeight}
572
- headerHeight={this.state.headerHeight} />
558
+ fullPosting={this.state.fullPosting} />
573
559
  :
574
560
  null
575
561
  }
@@ -585,9 +571,7 @@ export default class Posting extends React.Component {
585
571
  context={this.props.context}
586
572
  showLoading={() => this._showLoading()}
587
573
  hideLoading={() => this._hideLoading()}
588
- fullPosting={this.state.fullPosting}
589
- progressBarHeight={this.state.progressBarHeight}
590
- headerHeight={this.state.headerHeight} />
574
+ fullPosting={this.state.fullPosting}/>
591
575
  :
592
576
  null
593
577
  }
@@ -599,9 +583,7 @@ export default class Posting extends React.Component {
599
583
  showLoading={() => this._showLoading()}
600
584
  hideLoading={() => this._hideLoading()}
601
585
  businessId={this.state.businessId}
602
- progressBarHeight={this.state.progressBarHeight}
603
586
  request={this.props.request}
604
- headerHeight={this.state.headerHeight}
605
587
  highlight={() => this._goToPage(Views.PAYMENT_ONLINE)}
606
588
  params={this.state.params} />
607
589
  :
package/Preview.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Text, View, TouchableOpacity, ImageBackground, Dimensions, StatusBar, Image } from 'react-native';
2
+ import { Text, View, TouchableOpacity, ImageBackground, Image } from 'react-native';
3
3
  import DisplayPrice from 'muba-display-price'
4
4
  import { strings } from 'muba-i18n';
5
5
  import commonStyles from './commonStyles';
@@ -7,7 +7,6 @@ import PopupSpendProduct from './PopupSpendProduct';
7
7
  import { createIconSetFromFontello } from 'react-native-vector-icons';
8
8
  import fontelloConfig from './fonts/config.json';
9
9
  const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
10
- const window = Dimensions.get('window');
11
10
 
12
11
  const PAYMENT_ONLINE_ACTIVE = { method: 'GET', url: '/controller/payments-online/{countryCode}/active' };
13
12
 
@@ -26,11 +25,6 @@ export default class Preview extends React.Component {
26
25
  }
27
26
 
28
27
  componentDidMount = async () => {
29
- const componentsHeight = this.props.headerHeight + this.props.progressBarHeight + (StatusBar.currentHeight ? StatusBar.currentHeight : 0);
30
- const minHeight = window.height - componentsHeight;
31
- if (this.state.minHeight != minHeight) {
32
- this.setState({ minHeight: minHeight })
33
- }
34
28
  const paymentOnlineActive = await this.props.request(this, PAYMENT_ONLINE_ACTIVE, { regionId: this.props.postingAd.region });
35
29
  this.setState({ showPaymentOnline: paymentOnlineActive.value === 'true' });
36
30
  this.refreshData();
@@ -68,7 +62,7 @@ export default class Preview extends React.Component {
68
62
  render() {
69
63
  return (
70
64
  <View>
71
- <View style={{ minHeight: this.state.minHeight }}>
65
+ <View style={{ flex: 1 }}>
72
66
  <View style={commonStyles.formFieldset}>
73
67
  <View style={commonStyles.confirmNote}>
74
68
  <View style={commonStyles.row}>
package/Publish1.js CHANGED
@@ -1,11 +1,10 @@
1
1
  import React from 'react';
2
- import { Text, View, TouchableHighlight, Dimensions } from 'react-native';
2
+ import { Text, View, TouchableHighlight } from 'react-native';
3
3
  import { strings } from 'muba-i18n';
4
4
  import commonStyles from './commonStyles';
5
5
  import RadioButtonGroup from 'muba-radio-button-group';
6
6
  import InputSelect from 'muba-input-select';
7
7
  import { Views } from './utils/Views';
8
- const window = Dimensions.get('window');
9
8
 
10
9
  const GET_PROMOTIONS = { method: 'GET', url: '/controller/posting/promotions' };
11
10
  const PROMOTION_LOCATION = { method: 'GET', url: '/controller/promotions/{promotionId}/location' };
@@ -49,12 +48,6 @@ export default class Publish1 extends React.Component {
49
48
  }
50
49
  this.props.hideLoading();
51
50
 
52
- const componentsHeight = this.props.headerHeight + this.props.progressBarHeight;
53
- const minHeight = window.height - componentsHeight;
54
- if (this.state.minHeight != minHeight) {
55
- this.setState({ minHeight: minHeight })
56
- }
57
-
58
51
  if (this.props.realEstateDeveloper) {
59
52
  this.loadPromotions();
60
53
  }
@@ -167,7 +160,7 @@ export default class Publish1 extends React.Component {
167
160
 
168
161
  render() {
169
162
  return (
170
- <View style={{ minHeight: this.state.minHeight }}>
163
+ <View style={{ flex: 1 }}>
171
164
  <View style={commonStyles.formFieldset}>
172
165
  <View style={commonStyles.progressbarInputArea}>
173
166
  <Text style={commonStyles.progressbarInputAreaH3}>{strings('setup.typeTransaction')}</Text>
package/Publish2.js CHANGED
@@ -101,14 +101,9 @@ export default class Publish2 extends React.Component {
101
101
  this.setState({ latitude: region.latitude, longitude: region.longitude, zoom: region.zoom });
102
102
  }
103
103
 
104
- onLayout = (event) => {
105
- const componentsHeight = this.props.headerHeight + this.props.progressBarHeight + event.nativeEvent.layout.height;
106
- this.setState({ mapHeight: window.height - componentsHeight })
107
- }
108
-
109
104
  render() {
110
105
  return (
111
- <View>
106
+ <View style={{ flex: 1 }}>
112
107
  <Map hereApiKey={this.props.hereApiKey}
113
108
  containerStyle={{ height: this.state.mapHeight }}
114
109
  showPopupPermissions={true}
package/Publish2b.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Text, View, TouchableHighlight, Dimensions } from 'react-native';
2
+ import { Text, View, TouchableHighlight } from 'react-native';
3
3
  import { strings } from 'muba-i18n';
4
4
  import commonStyles from './commonStyles';
5
5
  import InputSelect from 'muba-input-select';
@@ -9,7 +9,6 @@ import { Views } from './utils/Views';
9
9
  import { createIconSetFromFontello } from 'react-native-vector-icons';
10
10
  import fontelloConfig from './fonts/config.json';
11
11
  const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
12
- const window = Dimensions.get('window');
13
12
 
14
13
  const GET_REGIONS = { method: 'GET', url: '/controller/countries/{countryCode}/regions' };
15
14
  const GET_CITIES_FROM_REGION = { method: 'GET', url: '/controller/regions/{regionId}/cities' };
@@ -43,12 +42,6 @@ export default class Publish2b extends React.Component {
43
42
  }
44
43
 
45
44
  componentDidMount = () => {
46
- const componentsHeight = this.props.headerHeight + this.props.progressBarHeight;
47
- const minHeight = window.height - componentsHeight;
48
- if (this.state.minHeight != minHeight) {
49
- this.setState({ minHeight: minHeight })
50
- }
51
-
52
45
  this.loadData();
53
46
  }
54
47
 
@@ -253,7 +246,7 @@ export default class Publish2b extends React.Component {
253
246
 
254
247
  render() {
255
248
  return (
256
- <View style={{ minHeight: this.state.minHeight }}>
249
+ <View style={{ flex: 1}}>
257
250
  <View style={commonStyles.formFieldset}>
258
251
  <View style={commonStyles.progressbarInputArea}>
259
252
  <Text style={commonStyles.progressbarInputAreaH3}>{strings('setup.location')}</Text>
package/Publish3.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Text, View, TouchableHighlight, Dimensions } from 'react-native';
2
+ import { Text, View, TouchableHighlight } from 'react-native';
3
3
  import { strings } from 'muba-i18n';
4
4
  import commonStyles from './commonStyles';
5
5
  import RadioButtonGroup from 'muba-radio-button-group';
@@ -7,7 +7,6 @@ import InputNumber from './shared/InputNumber.js';
7
7
  import InputSelect from 'muba-input-select';
8
8
  import InputText from 'muba-input-text';
9
9
  import { Views } from './utils/Views';
10
- const window = Dimensions.get('window');
11
10
 
12
11
  const GET_CURRENCIES = { method: 'GET', url: '/controller/countries/{countryCode}/currencies' };
13
12
 
@@ -73,12 +72,6 @@ export default class Publish3 extends React.Component {
73
72
 
74
73
  this.setState({ priceOptions: priceOptions });
75
74
  this.refreshData();
76
-
77
- const componentsHeight = this.props.headerHeight + this.props.progressBarHeight;
78
- const minHeight = window.height - componentsHeight;
79
- if (this.state.minHeight != minHeight) {
80
- this.setState({ minHeight: minHeight })
81
- }
82
75
  }
83
76
 
84
77
  async refreshData() {
@@ -193,7 +186,7 @@ export default class Publish3 extends React.Component {
193
186
 
194
187
  render() {
195
188
  return (
196
- <View style={{ minHeight: this.state.minHeight }}>
189
+ <View style={{ flex: 1 }}>
197
190
  <View style={commonStyles.formFieldset}>
198
191
  <View style={commonStyles.progressbarInputArea}>
199
192
  <Text style={commonStyles.progressbarInputAreaH3}>{strings('setup.propertyCharacteristics')}</Text>
package/Publish4.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Text, View, TouchableHighlight, TouchableOpacity, ImageBackground, Dimensions, Image } from 'react-native';
2
+ import { Text, View, TouchableHighlight, TouchableOpacity } from 'react-native';
3
3
  import PopupAdvice from 'muba-popup-advice';
4
4
  import PictureSelector from 'muba-picture';
5
5
  import { strings } from 'muba-i18n';
@@ -8,26 +8,16 @@ import { Views } from './utils/Views';
8
8
  import { createIconSetFromFontello } from 'react-native-vector-icons';
9
9
  import fontelloConfig from './fonts/config.json';
10
10
  const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
11
- const window = Dimensions.get('window');
12
11
 
13
12
  export default class Publish4 extends React.Component {
14
13
  constructor(props) {
15
14
  super(props);
16
15
 
17
16
  this.state = {
18
- minHeight: 0,
19
17
  video: this.props.postingAd.video
20
18
  }
21
19
  }
22
20
 
23
- componentDidMount() {
24
- const componentsHeight = this.props.headerHeight + this.props.progressBarHeight;
25
- const minHeight = window.height - componentsHeight;
26
- if (this.state.minHeight != minHeight) {
27
- this.setState({ minHeight: minHeight })
28
- }
29
- }
30
-
31
21
  nextStep() {
32
22
  if (this.pictureSelector.onSubmitValidate()) {
33
23
  this.props.postingAd.video = this.state.video;
@@ -49,7 +39,7 @@ export default class Publish4 extends React.Component {
49
39
 
50
40
  render() {
51
41
  return (
52
- <View style={{ minHeight: this.state.minHeight }}>
42
+ <View style={{ flex: 1 }}>
53
43
  <View style={commonStyles.formFieldset}>
54
44
  <PictureSelector
55
45
  ref={(pictureSelector) => this.pictureSelector = pictureSelector}
package/Publish5.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
- import { Text, View, TouchableHighlight, Image, TouchableOpacity, Dimensions } from 'react-native';
2
+ import { Text, View, TouchableHighlight, Image, TouchableOpacity } from 'react-native';
3
3
  import { strings } from 'muba-i18n';
4
4
  import commonStyles from './commonStyles';
5
5
  import InputSelect from 'muba-input-select';
6
6
  import { Views } from './utils/Views';
7
- const window = Dimensions.get('window');
8
7
 
9
8
  export default class Publish5 extends React.Component {
10
9
  constructor(props) {
@@ -93,12 +92,6 @@ export default class Publish5 extends React.Component {
93
92
  }
94
93
 
95
94
  componentDidMount = () => {
96
- const componentsHeight = this.props.headerHeight + this.props.progressBarHeight;
97
- const minHeight = window.height - componentsHeight;
98
- if (this.state.minHeight != minHeight) {
99
- this.setState({ minHeight: minHeight })
100
- }
101
-
102
95
  this.refreshData();
103
96
  }
104
97
 
@@ -170,7 +163,7 @@ export default class Publish5 extends React.Component {
170
163
 
171
164
  render() {
172
165
  return (
173
- <View style={{ minHeight: this.state.minHeight }}>
166
+ <View style={{ flex: 1 }}>
174
167
  <View style={commonStyles.formFieldset}>
175
168
  <View style={commonStyles.progressbarInputArea}>
176
169
  <Text style={commonStyles.progressbarInputAreaH3}>{strings('setup.features')}</Text>
package/Publish6.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Text, View, TouchableHighlight, TouchableOpacity, Dimensions } from 'react-native';
2
+ import { Text, View, TouchableHighlight, TouchableOpacity } from 'react-native';
3
3
  import { strings } from 'muba-i18n';
4
4
  import commonStyles from './commonStyles';
5
5
  import InputText from 'muba-input-text';
@@ -11,7 +11,6 @@ const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
11
11
 
12
12
  const GENERATE_TITLE_DESCRIPTION = { method: 'GET', url: '/controller/posting/generate-title-description' };
13
13
  const PHONE_REGISTERED = { method: 'GET', url: '/controller/posting/phone-registered' };
14
- const window = Dimensions.get('window');
15
14
  const PHONE_SEPARATOR = '###';
16
15
 
17
16
  let submitClicked;
@@ -35,13 +34,7 @@ export default class Publish6 extends React.Component {
35
34
  this.resetSubmitClicked();
36
35
  }
37
36
 
38
- componentDidMount = (prevProps) => {
39
- const componentsHeight = this.props.headerHeight + this.props.progressBarHeight;
40
- const minHeight = window.height - componentsHeight;
41
- if (this.state.minHeight != minHeight) {
42
- this.setState({ minHeight: minHeight })
43
- }
44
-
37
+ componentDidMount = () => {
45
38
  this.generateTitleDescription();
46
39
  this.resetSubmitClicked();
47
40
  }
@@ -151,7 +144,7 @@ export default class Publish6 extends React.Component {
151
144
 
152
145
  render() {
153
146
  return (
154
- <View style={{ minHeight: this.state.minHeight }}>
147
+ <View style={{ flex: 1 }}>
155
148
  <View style={commonStyles.formFieldset}>
156
149
  <View style={commonStyles.progressbarInputArea}>
157
150
  <Text style={commonStyles.progressbarInputAreaH3}>{strings('setup.checkPublication')}</Text>
package/commonStyles.js CHANGED
@@ -1,7 +1,6 @@
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';
5
4
 
6
5
  const window = Dimensions.get('window');
7
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muba-posting",
3
- "version": "6.0.9",
3
+ "version": "6.0.11",
4
4
  "description": "Posting",
5
5
  "main": "Posting.js",
6
6
  "scripts": {