muba-posting 4.1.28 → 4.2.0
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 +157 -147
- package/PostingEdit.js +8 -2
- package/Preview.js +128 -136
- package/Publish1.js +53 -71
- package/Publish2.js +13 -31
- package/Publish2b.js +68 -82
- package/Publish3.js +165 -198
- package/Publish4.js +77 -90
- package/Publish5.js +344 -353
- package/Publish6.js +119 -134
- package/package.json +1 -1
package/Preview.js
CHANGED
|
@@ -18,35 +18,29 @@ export default class Preview extends React.Component {
|
|
|
18
18
|
premiumActive: false,
|
|
19
19
|
superPremiumActive: false,
|
|
20
20
|
remaining: 0,
|
|
21
|
-
product: ''
|
|
22
|
-
viewLoaded: false
|
|
21
|
+
product: ''
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
if (!prevProps.showView && this.props.showView && !this.state.viewLoaded) {
|
|
28
|
-
this.setState({
|
|
29
|
-
viewLoaded: true
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
25
|
+
componentDidMount = () => {
|
|
33
26
|
const componentsHeight = this.props.headerHeight + this.props.progressBarHeight + (StatusBar.currentHeight ? StatusBar.currentHeight : 0);
|
|
34
27
|
const minHeight = window.height - componentsHeight;
|
|
35
28
|
if (this.state.minHeight != minHeight) {
|
|
36
29
|
this.setState({ minHeight: minHeight })
|
|
37
30
|
}
|
|
31
|
+
this.refreshData();
|
|
38
32
|
}
|
|
39
33
|
|
|
40
|
-
refreshData(
|
|
34
|
+
refreshData() {
|
|
41
35
|
this.setState({
|
|
42
|
-
mainPicture: params.mainPicture,
|
|
43
|
-
location: params.location,
|
|
44
|
-
transaction: params.transactionName,
|
|
45
|
-
adType: params.adTypeName,
|
|
46
|
-
surface: params.surface,
|
|
47
|
-
showPrice: params.showPrice,
|
|
48
|
-
price: params.price,
|
|
49
|
-
currency: params.currency
|
|
36
|
+
mainPicture: this.props.params.mainPicture,
|
|
37
|
+
location: this.props.params.location,
|
|
38
|
+
transaction: this.props.params.transactionName,
|
|
39
|
+
adType: this.props.params.adTypeName,
|
|
40
|
+
surface: this.props.params.surface,
|
|
41
|
+
showPrice: this.props.params.showPrice,
|
|
42
|
+
price: this.props.params.price,
|
|
43
|
+
currency: this.props.params.currency
|
|
50
44
|
});
|
|
51
45
|
}
|
|
52
46
|
|
|
@@ -68,147 +62,145 @@ export default class Preview extends React.Component {
|
|
|
68
62
|
|
|
69
63
|
render() {
|
|
70
64
|
return (
|
|
71
|
-
<View
|
|
72
|
-
{this.state.
|
|
73
|
-
<View style={
|
|
74
|
-
<View style={commonStyles.
|
|
75
|
-
<View style={commonStyles.
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
65
|
+
<View>
|
|
66
|
+
<View style={{ minHeight: this.state.minHeight }}>
|
|
67
|
+
<View style={commonStyles.formFieldset}>
|
|
68
|
+
<View style={commonStyles.confirmNote}>
|
|
69
|
+
<View style={commonStyles.row}>
|
|
70
|
+
<FontAwesomeIcon style={commonStyles.confirmIcon} name="ok" />
|
|
71
|
+
<Text style={commonStyles.confirmNoteText}>{this.props.businessId ? strings('setup.publishOK') : strings('setup.publishWait')}</Text>
|
|
72
|
+
</View>
|
|
73
|
+
</View>
|
|
74
|
+
|
|
75
|
+
{this.state.mainPicture !== null ?
|
|
76
|
+
<View style={commonStyles.progressbarInputArea}>
|
|
77
|
+
<ImageBackground style={[commonStyles.previewBox, commonStyles.photoBoxImage]} source={{ uri: this.state.mainPicture }} resizeMode='cover' borderRadius={10}>
|
|
78
|
+
{this.props.postingAd.reference ?
|
|
79
|
+
<View style={commonStyles.previewReference}>
|
|
80
|
+
<Text style={commonStyles.previewTitleText}>{strings('setup.ref')} {this.props.postingAd.reference}</Text>
|
|
81
|
+
</View>
|
|
82
|
+
:
|
|
83
|
+
<View />
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
<ImageBackground style={[commonStyles.photoControls, commonStyles.previewControls]} source={require('./assets/images/bg-shadow.png')} resizeMode='stretch' borderRadius={1.5}>
|
|
87
|
+
<View style={commonStyles.previewTitle}>
|
|
88
|
+
<Text style={commonStyles.previewTitleText}>{this.props.postingAd.languages[0].title}</Text>
|
|
89
|
+
</View>
|
|
90
|
+
<Text style={[commonStyles.subNote, commonStyles.subNotePreview, commonStyles.previewText]}>{this.props.postingAd.languages[0].description != null && this.props.postingAd.languages[0].description.length > 114 ? this.props.postingAd.languages[0].description.substring(0, 114) + '...' : this.props.postingAd.languages[0].description}</Text>
|
|
91
|
+
</ImageBackground>
|
|
92
|
+
</ImageBackground>
|
|
80
93
|
</View>
|
|
94
|
+
: null}
|
|
81
95
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
96
|
+
{this.props.businessId ?
|
|
97
|
+
<View style={commonStyles.promoBox}>
|
|
98
|
+
<View style={commonStyles.row}>
|
|
99
|
+
<View style={this.state.superPremiumActive ? [commonStyles.col, commonStyles.col6, commonStyles.promoColPremium, commonStyles.disabled] : [commonStyles.col, commonStyles.col6, commonStyles.promoColPremium]}>
|
|
100
|
+
<View style={[commonStyles.row, { marginBottom: 5 }]}>
|
|
101
|
+
<View style={[commonStyles.col, commonStyles.col30]}>
|
|
102
|
+
<Image style={commonStyles.imgPremium} source={require('./assets/images/premium.png')} resizeMode='contain' />
|
|
103
|
+
</View>
|
|
104
|
+
<View style={[commonStyles.col, commonStyles.col70]}>
|
|
105
|
+
<Text style={commonStyles.promoSub}>{strings('setup.makeIt')}</Text>
|
|
106
|
+
<Text style={[commonStyles.promoTitle, commonStyles.blueTitle]}>{strings('setup.premium').toUpperCase()}</Text>
|
|
107
|
+
</View>
|
|
108
|
+
</View>
|
|
109
|
+
<Text style={[commonStyles.legalNoteText, commonStyles.promoNote]}>{strings('setup.makePremium')}</Text>
|
|
110
|
+
{this.state.premiumActive ?
|
|
111
|
+
<View style={[commonStyles.row, commonStyles.superBtn, commonStyles.btnBlue2]} >
|
|
112
|
+
<Text style={commonStyles.superBtnText}>{strings('setup.active').toUpperCase()}</Text>
|
|
88
113
|
</View>
|
|
89
114
|
:
|
|
90
|
-
<
|
|
115
|
+
<TouchableOpacity style={[commonStyles.superBtn, commonStyles.btnBlue1]} underlayColor="#104a7a" onPress={() => this.makePremium()} disabled={this.state.superPremiumActive}>
|
|
116
|
+
<Text style={commonStyles.superBtnText}>{strings('setup.useIt').toUpperCase()}</Text>
|
|
117
|
+
</TouchableOpacity>
|
|
91
118
|
}
|
|
119
|
+
</View>
|
|
92
120
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
121
|
+
<View style={this.state.premiumActive ? [commonStyles.col, commonStyles.col6, commonStyles.promoColSuper, commonStyles.disabled] : [commonStyles.col, commonStyles.col6, commonStyles.promoColSuper]}>
|
|
122
|
+
<View style={[commonStyles.row, { marginBottom: 5 }]}>
|
|
123
|
+
<View style={[commonStyles.col, commonStyles.col30]}>
|
|
124
|
+
<Image style={commonStyles.imgPremium} source={require('./assets/images/superpremium.png')} resizeMode='contain' />
|
|
96
125
|
</View>
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
</ImageBackground>
|
|
100
|
-
</View>
|
|
101
|
-
: null}
|
|
102
|
-
|
|
103
|
-
{this.props.businessId ?
|
|
104
|
-
<View style={commonStyles.promoBox}>
|
|
105
|
-
<View style={commonStyles.row}>
|
|
106
|
-
<View style={this.state.superPremiumActive ? [commonStyles.col, commonStyles.col6, commonStyles.promoColPremium, commonStyles.disabled] : [commonStyles.col, commonStyles.col6, commonStyles.promoColPremium]}>
|
|
107
|
-
<View style={[commonStyles.row, { marginBottom: 5 }]}>
|
|
108
|
-
<View style={[commonStyles.col, commonStyles.col30]}>
|
|
109
|
-
<Image style={commonStyles.imgPremium} source={require('./assets/images/premium.png')} resizeMode='contain' />
|
|
110
|
-
</View>
|
|
111
|
-
<View style={[commonStyles.col, commonStyles.col70]}>
|
|
126
|
+
<View style={[commonStyles.col, commonStyles.col70]}>
|
|
127
|
+
<View style={[commonStyles.row, { justifyContent: 'center' }]}>
|
|
112
128
|
<Text style={commonStyles.promoSub}>{strings('setup.makeIt')}</Text>
|
|
113
|
-
<Text style={[commonStyles.
|
|
129
|
+
<Text style={[commonStyles.promoSubItalic, commonStyles.orangeTitle]}> {strings('setup.super').toUpperCase()}</Text>
|
|
114
130
|
</View>
|
|
131
|
+
<Text style={[commonStyles.promoTitle, commonStyles.orangeTitle]}>{strings('setup.premium').toUpperCase()}</Text>
|
|
115
132
|
</View>
|
|
116
|
-
<Text style={[commonStyles.legalNoteText, commonStyles.promoNote]}>{strings('setup.makePremium')}</Text>
|
|
117
|
-
{this.state.premiumActive ?
|
|
118
|
-
<View style={[commonStyles.row, commonStyles.superBtn, commonStyles.btnBlue2]} >
|
|
119
|
-
<Text style={commonStyles.superBtnText}>{strings('setup.active').toUpperCase()}</Text>
|
|
120
|
-
</View>
|
|
121
|
-
:
|
|
122
|
-
<TouchableOpacity style={[commonStyles.superBtn, commonStyles.btnBlue1]} underlayColor="#104a7a" onPress={() => this.makePremium()} disabled={this.state.superPremiumActive}>
|
|
123
|
-
<Text style={commonStyles.superBtnText}>{strings('setup.useIt').toUpperCase()}</Text>
|
|
124
|
-
</TouchableOpacity>
|
|
125
|
-
}
|
|
126
133
|
</View>
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<View style={[commonStyles.row,
|
|
130
|
-
<
|
|
131
|
-
<Image style={commonStyles.imgPremium} source={require('./assets/images/superpremium.png')} resizeMode='contain' />
|
|
132
|
-
</View>
|
|
133
|
-
<View style={[commonStyles.col, commonStyles.col70]}>
|
|
134
|
-
<View style={[commonStyles.row, { justifyContent: 'center' }]}>
|
|
135
|
-
<Text style={commonStyles.promoSub}>{strings('setup.makeIt')}</Text>
|
|
136
|
-
<Text style={[commonStyles.promoSubItalic, commonStyles.orangeTitle]}> {strings('setup.super').toUpperCase()}</Text>
|
|
137
|
-
</View>
|
|
138
|
-
<Text style={[commonStyles.promoTitle, commonStyles.orangeTitle]}>{strings('setup.premium').toUpperCase()}</Text>
|
|
139
|
-
</View>
|
|
134
|
+
<Text style={[commonStyles.legalNoteText, commonStyles.promoNote]}>{strings('setup.makeSuperpremium')}</Text>
|
|
135
|
+
{this.state.superPremiumActive ?
|
|
136
|
+
<View style={[commonStyles.row, commonStyles.superBtn, commonStyles.btnOrange2]} >
|
|
137
|
+
<Text style={commonStyles.superBtnText}>{strings('setup.active').toUpperCase()}</Text>
|
|
140
138
|
</View>
|
|
141
|
-
|
|
142
|
-
{this.state.
|
|
143
|
-
<
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
:
|
|
147
|
-
<TouchableOpacity style={[commonStyles.superBtn, commonStyles.btnOrange1]} underlayColor="#ff5d00" onPress={() => this.makeSuperPremium()} disabled={this.state.premiumActive}>
|
|
148
|
-
<Text style={commonStyles.superBtnText}>{strings('setup.useIt').toUpperCase()}</Text>
|
|
149
|
-
</TouchableOpacity>
|
|
150
|
-
}
|
|
151
|
-
</View>
|
|
139
|
+
:
|
|
140
|
+
<TouchableOpacity style={[commonStyles.superBtn, commonStyles.btnOrange1]} underlayColor="#ff5d00" onPress={() => this.makeSuperPremium()} disabled={this.state.premiumActive}>
|
|
141
|
+
<Text style={commonStyles.superBtnText}>{strings('setup.useIt').toUpperCase()}</Text>
|
|
142
|
+
</TouchableOpacity>
|
|
143
|
+
}
|
|
152
144
|
</View>
|
|
153
145
|
</View>
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
</
|
|
162
|
-
<View style={commonStyles.row}>
|
|
163
|
-
<FontAwesomeIcon style={commonStyles.previewIcon} name="key" />
|
|
164
|
-
<Text style={commonStyles.previewInfoText}>{this.state.transaction}</Text>
|
|
165
|
-
</View>
|
|
166
|
-
<View style={commonStyles.row}>
|
|
167
|
-
<FontAwesomeIcon style={commonStyles.previewIcon} name="tags" />
|
|
168
|
-
<Text style={commonStyles.previewInfoText}>{this.state.adType}</Text>
|
|
169
|
-
</View>
|
|
146
|
+
</View>
|
|
147
|
+
:
|
|
148
|
+
<View style={commonStyles.infoPreview}>
|
|
149
|
+
<View style={commonStyles.row}>
|
|
150
|
+
<View style={commonStyles.col7}>
|
|
151
|
+
<View style={commonStyles.row}>
|
|
152
|
+
<FontAwesomeIcon style={[commonStyles.previewIcon, commonStyles.blue]} name="location" />
|
|
153
|
+
<Text style={commonStyles.previewInfoText}>{this.state.location}</Text>
|
|
170
154
|
</View>
|
|
171
|
-
<View style={commonStyles.
|
|
172
|
-
<
|
|
173
|
-
|
|
155
|
+
<View style={commonStyles.row}>
|
|
156
|
+
<FontAwesomeIcon style={commonStyles.previewIcon} name="key" />
|
|
157
|
+
<Text style={commonStyles.previewInfoText}>{this.state.transaction}</Text>
|
|
158
|
+
</View>
|
|
159
|
+
<View style={commonStyles.row}>
|
|
160
|
+
<FontAwesomeIcon style={commonStyles.previewIcon} name="tags" />
|
|
161
|
+
<Text style={commonStyles.previewInfoText}>{this.state.adType}</Text>
|
|
162
|
+
</View>
|
|
163
|
+
</View>
|
|
164
|
+
<View style={commonStyles.col5}>
|
|
165
|
+
<View style={commonStyles.row}>
|
|
166
|
+
<FontAwesomeIcon style={[commonStyles.previewIcon, commonStyles.blue]} name="money" />
|
|
174
167
|
|
|
175
|
-
|
|
176
|
-
<View style={commonStyles.row}>
|
|
177
|
-
< DisplayPrice style={commonStyles.previewInfoText} value={this.state.price} currency={this.state.currency} country={this.props.country} />
|
|
178
|
-
</View>
|
|
179
|
-
:
|
|
180
|
-
<Text style={commonStyles.previewInfoText}>{strings('setup.contactOwner')}</Text>
|
|
181
|
-
}
|
|
182
|
-
</View>
|
|
183
|
-
{this.state.surface !== undefined ?
|
|
168
|
+
{this.state.showPrice ?
|
|
184
169
|
<View style={commonStyles.row}>
|
|
185
|
-
<
|
|
186
|
-
<Text style={commonStyles.previewInfoText}>{this.state.surface}</Text>
|
|
170
|
+
< DisplayPrice style={commonStyles.previewInfoText} value={this.state.price} currency={this.state.currency} country={this.props.country} />
|
|
187
171
|
</View>
|
|
188
|
-
:
|
|
172
|
+
:
|
|
173
|
+
<Text style={commonStyles.previewInfoText}>{strings('setup.contactOwner')}</Text>
|
|
174
|
+
}
|
|
189
175
|
</View>
|
|
176
|
+
{this.state.surface !== undefined ?
|
|
177
|
+
<View style={commonStyles.row}>
|
|
178
|
+
<FontAwesomeIcon style={commonStyles.previewIcon} name="users" />
|
|
179
|
+
<Text style={commonStyles.previewInfoText}>{this.state.surface}</Text>
|
|
180
|
+
</View>
|
|
181
|
+
: null}
|
|
190
182
|
</View>
|
|
191
183
|
</View>
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
</
|
|
199
|
-
</
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
184
|
+
</View>
|
|
185
|
+
}
|
|
186
|
+
{!this.props.businessId ?
|
|
187
|
+
<View style={commonStyles.previewHighlightContainer}>
|
|
188
|
+
<TouchableOpacity style={[commonStyles.previewHighlightButton, commonStyles.alignCenter]} activeOpacity={0.5} onPress={() => this.props.highlight()}>
|
|
189
|
+
<Image style={commonStyles.previewHighlightImage} source={require('./assets/images/sparks.png')} />
|
|
190
|
+
<Text style={commonStyles.previewHighlightText}>{strings('setup.highlight')}</Text>
|
|
191
|
+
</TouchableOpacity>
|
|
192
|
+
</View>
|
|
193
|
+
:
|
|
194
|
+
null
|
|
195
|
+
}
|
|
196
|
+
</View>
|
|
204
197
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
</View>
|
|
198
|
+
<View style={commonStyles.previewBackButton}>
|
|
199
|
+
<TouchableOpacity activeOpacity={0.5} onPress={() => this.props.goBack()}>
|
|
200
|
+
<Text style={commonStyles.carteNote}>{strings('setup.returnHome')}</Text>
|
|
201
|
+
</TouchableOpacity>
|
|
210
202
|
</View>
|
|
211
|
-
|
|
203
|
+
</View>
|
|
212
204
|
<PopupSpendProduct adId={this.props.postingAd.id} ref={(popupShowAdvice) => { this.popupShowAdvice = popupShowAdvice }} businessId={this.props.businessId} request={this.props.request}
|
|
213
205
|
showLoading={this.props.showLoading} hideLoading={this.props.hideLoading} />
|
|
214
206
|
</View>
|
package/Publish1.js
CHANGED
|
@@ -19,50 +19,34 @@ export default class Publish1 extends React.Component {
|
|
|
19
19
|
isLoading: false,
|
|
20
20
|
showTypeBienError: false,
|
|
21
21
|
transactionOptions: { elements: [], selectedItem: this.props.postingAd.transaction },
|
|
22
|
-
typeBienOptions: { elements: [], selectedItem: this.props.postingAd.adType }
|
|
22
|
+
typeBienOptions: { elements: [], selectedItem: this.props.postingAd.adType }
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
this.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
await this.setState({
|
|
43
|
-
transactionOptions: { elements: this.jsonTransactions.map(jsonTransaction => { return { label: jsonTransaction.label, value: jsonTransaction.value } }), selectedItem: this.props.postingAd.transaction },
|
|
44
|
-
typeBienOptions: { elements: this.getAdTypes(this.props.postingAd.transaction), selectedItem: this.props.postingAd.adType }
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
this.props.hideLoading();
|
|
26
|
+
componentDidMount = async () => {
|
|
27
|
+
this.props.showLoading();
|
|
28
|
+
|
|
29
|
+
const responseJson = await this.props.request(this.props.context, GET_TRANSACTIONS, {
|
|
30
|
+
userId: this.props.postingAd.userId
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
if (responseJson.httpStatus === 200) {
|
|
34
|
+
this.jsonTransactions = responseJson.list;
|
|
35
|
+
this.props.postingAd.transaction = this.props.postingAd.transaction != null ? this.props.postingAd.transaction : this.jsonTransactions[0].value;
|
|
36
|
+
this.props.postingAd.adType = this.props.postingAd.adType != null ? this.props.postingAd.adType : this.jsonTransactions[0].subList[0].value;
|
|
37
|
+
|
|
38
|
+
await this.setState({
|
|
39
|
+
transactionOptions: { elements: this.jsonTransactions.map(jsonTransaction => { return { label: jsonTransaction.label, value: jsonTransaction.value } }), selectedItem: this.props.postingAd.transaction },
|
|
40
|
+
typeBienOptions: { elements: this.getAdTypes(this.props.postingAd.transaction), selectedItem: this.props.postingAd.adType }
|
|
41
|
+
})
|
|
48
42
|
}
|
|
43
|
+
this.props.hideLoading();
|
|
49
44
|
|
|
50
45
|
const componentsHeight = this.props.headerHeight + this.props.progressBarHeight;
|
|
51
46
|
const minHeight = window.height - componentsHeight;
|
|
52
47
|
if (this.state.minHeight != minHeight) {
|
|
53
48
|
this.setState({ minHeight: minHeight })
|
|
54
49
|
}
|
|
55
|
-
|
|
56
|
-
if (prevProps.postingAd.transaction !== this.props.postingAd.transaction
|
|
57
|
-
|| prevProps.postingAd.adType !== this.props.postingAd.adType) {
|
|
58
|
-
this.oldTransaction = this.props.postingAd.transaction;
|
|
59
|
-
this.oldAdType = this.props.postingAd.adType;
|
|
60
|
-
|
|
61
|
-
this.setState({
|
|
62
|
-
transactionOptions: { ...this.state.transactionOptions, selectedItem: this.props.postingAd.transaction },
|
|
63
|
-
typeBienOptions: { elements: this.getAdTypes(this.props.postingAd.transaction), selectedItem: this.props.postingAd.adType }
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
50
|
}
|
|
67
51
|
|
|
68
52
|
getAdTypes(transaction) {
|
|
@@ -135,45 +119,43 @@ export default class Publish1 extends React.Component {
|
|
|
135
119
|
|
|
136
120
|
render() {
|
|
137
121
|
return (
|
|
138
|
-
<View style={this.
|
|
139
|
-
<View style={
|
|
140
|
-
<View style={commonStyles.
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
ref={(element) => this.radioButtonAdType = element} />
|
|
164
|
-
</View>
|
|
165
|
-
</View>
|
|
166
|
-
<View style={commonStyles.buttomButton}>
|
|
167
|
-
<TouchableHighlight style={commonStyles.actionButton} underlayColor="#ff5d00" onPress={() => this.nextStep()}>
|
|
168
|
-
<Text style={commonStyles.actionButtonText}>
|
|
169
|
-
{this.props.postingAd.id == null || this.props.fullPosting || this.oldTransaction != this.state.transactionOptions.selectedItem || this.oldAdType != this.state.typeBienOptions.selectedItem ?
|
|
170
|
-
strings('setup.next').toUpperCase()
|
|
171
|
-
:
|
|
172
|
-
strings('setup.enregistrer').toUpperCase()}
|
|
173
|
-
</Text>
|
|
174
|
-
</TouchableHighlight>
|
|
122
|
+
<View style={{ minHeight: this.state.minHeight }}>
|
|
123
|
+
<View style={commonStyles.formFieldset}>
|
|
124
|
+
<View style={commonStyles.progressbarInputArea}>
|
|
125
|
+
<Text style={commonStyles.progressbarInputAreaH3}>{strings('setup.typeTransaction')}</Text>
|
|
126
|
+
|
|
127
|
+
<RadioButtonGroup
|
|
128
|
+
style={commonStyles.progressbarFieldContainer}
|
|
129
|
+
required={true}
|
|
130
|
+
direction='column'
|
|
131
|
+
title={strings('setup.transaction')}
|
|
132
|
+
titleStyle={commonStyles.progressbarField}
|
|
133
|
+
radioButtonStyle={commonStyles.radioButton}
|
|
134
|
+
options={this.state.transactionOptions}
|
|
135
|
+
onClick={(value) => this.changeTransaction(value)} />
|
|
136
|
+
|
|
137
|
+
<RadioButtonGroup
|
|
138
|
+
style={commonStyles.progressbarFieldContainer}
|
|
139
|
+
required={true}
|
|
140
|
+
direction='column'
|
|
141
|
+
title={strings('setup.typeBien')}
|
|
142
|
+
titleStyle={commonStyles.progressbarField}
|
|
143
|
+
radioButtonStyle={commonStyles.radioButton}
|
|
144
|
+
options={this.state.typeBienOptions}
|
|
145
|
+
onClick={(value) => this.changeAdType(value)}
|
|
146
|
+
ref={(element) => this.radioButtonAdType = element} />
|
|
175
147
|
</View>
|
|
176
148
|
</View>
|
|
149
|
+
<View style={commonStyles.buttomButton}>
|
|
150
|
+
<TouchableHighlight style={commonStyles.actionButton} underlayColor="#ff5d00" onPress={() => this.nextStep()}>
|
|
151
|
+
<Text style={commonStyles.actionButtonText}>
|
|
152
|
+
{this.props.postingAd.id == null || this.props.fullPosting || this.oldTransaction != this.state.transactionOptions.selectedItem || this.oldAdType != this.state.typeBienOptions.selectedItem ?
|
|
153
|
+
strings('setup.next').toUpperCase()
|
|
154
|
+
:
|
|
155
|
+
strings('setup.enregistrer').toUpperCase()}
|
|
156
|
+
</Text>
|
|
157
|
+
</TouchableHighlight>
|
|
158
|
+
</View>
|
|
177
159
|
</View>
|
|
178
160
|
);
|
|
179
161
|
}
|
package/Publish2.js
CHANGED
|
@@ -17,7 +17,6 @@ export default class Publish2 extends React.Component {
|
|
|
17
17
|
super(props);
|
|
18
18
|
|
|
19
19
|
this.state = {
|
|
20
|
-
viewLoaded: false,
|
|
21
20
|
latitude: props.postingAd.latitude,
|
|
22
21
|
longitude: props.postingAd.longitude,
|
|
23
22
|
zoom: props.postingAd.latitude != null && props.postingAd.longitude != null ? 15 : 9,
|
|
@@ -25,21 +24,6 @@ export default class Publish2 extends React.Component {
|
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
componentDidUpdate = (prevProps) => {
|
|
29
|
-
if (prevProps.postingAd?.latitude !== this.props.postingAd?.latitude || prevProps.postingAd?.longitude !== this.props.postingAd?.longitude) {
|
|
30
|
-
this.setState({
|
|
31
|
-
latitude: this.props.postingAd.latitude,
|
|
32
|
-
longitude: this.props.postingAd.longitude,
|
|
33
|
-
zoom: this.props.postingAd.latitude != null && this.props.postingAd.longitude != null ? 15 : 9,
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
if (!prevProps.showView && this.props.showView && !this.state.viewLoaded) {
|
|
37
|
-
this.setState({
|
|
38
|
-
viewLoaded: true
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
27
|
async nextStep() {
|
|
44
28
|
if (await this.validateLocation()) {
|
|
45
29
|
if (this.props.postingAd.id == null || this.props.fullPosting) {
|
|
@@ -114,21 +98,19 @@ export default class Publish2 extends React.Component {
|
|
|
114
98
|
|
|
115
99
|
render() {
|
|
116
100
|
return (
|
|
117
|
-
<View
|
|
118
|
-
{this.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
onMapReady={() => this.props.hideLoading()} />
|
|
131
|
-
: null}
|
|
101
|
+
<View>
|
|
102
|
+
<Map hereAppId={this.props.hereAppId} hereAppCode={this.props.hereAppCode}
|
|
103
|
+
containerStyle={{ height: this.state.mapHeight }}
|
|
104
|
+
showPopupPermissions={true}
|
|
105
|
+
location={{ latitude: this.state.latitude, longitude: this.state.longitude, zoom: this.state.zoom }}
|
|
106
|
+
editLocation={true}
|
|
107
|
+
approximated={true}
|
|
108
|
+
showLoading={false}
|
|
109
|
+
ref={(element) => this.map = element}
|
|
110
|
+
request={this.props.request}
|
|
111
|
+
context={this.props.context}
|
|
112
|
+
baseUrl={this.props.baseUrl}
|
|
113
|
+
onMapReady={() => this.props.hideLoading()} />
|
|
132
114
|
<View style={commonStyles.buttomButton} onLayout={this.onLayout}>
|
|
133
115
|
<TouchableHighlight style={commonStyles.actionButton} underlayColor="#ff5d00" onPress={() => this.nextStep()}>
|
|
134
116
|
<Text style={commonStyles.actionButtonText}>{this.props.postingAd.id == null || this.props.fullPosting ? strings('setup.next').toUpperCase() : strings('setup.enregistrer').toUpperCase()}</Text>
|