muba-posting 5.0.7 → 5.0.9
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/Publish4.js +12 -5
- package/package.json +1 -1
package/Publish4.js
CHANGED
|
@@ -63,7 +63,8 @@ export default class Publish4 extends React.Component {
|
|
|
63
63
|
|
|
64
64
|
async loadUri(photo) {
|
|
65
65
|
if (photo) {
|
|
66
|
-
|
|
66
|
+
const photoStr = photo.uri.lastIndexOf('.') > 0 && photo.uri.lastIndexOf('.') > photo.uri.length - 5 ? photo.uri : photo.filename;
|
|
67
|
+
const fileType = photoStr.substring(photoStr.lastIndexOf('.') + 1).toLowerCase();
|
|
67
68
|
|
|
68
69
|
const image = {
|
|
69
70
|
uri: photo.uri,
|
|
@@ -129,14 +130,19 @@ export default class Publish4 extends React.Component {
|
|
|
129
130
|
|
|
130
131
|
selectMainPhoto(itemSelected) {
|
|
131
132
|
let imagesArray = this.state.images.slice();
|
|
133
|
+
let imageSize = this.state.imageSize.slice();
|
|
132
134
|
|
|
133
135
|
for (let imageObject of imagesArray) {
|
|
134
136
|
imageObject.mainPicture = false;
|
|
135
137
|
|
|
136
138
|
if (imageObject.uri === itemSelected.uri) {
|
|
137
139
|
imageObject.mainPicture = true;
|
|
138
|
-
imagesArray.
|
|
140
|
+
const imageIndex = imagesArray.indexOf(imageObject);
|
|
141
|
+
imagesArray.splice(imageIndex, 1);
|
|
139
142
|
imagesArray.splice(0, 0, imageObject);
|
|
143
|
+
|
|
144
|
+
const size = imageSize.splice(imageIndex, 1);
|
|
145
|
+
imageSize.splice(0, 0, ...size);
|
|
140
146
|
}
|
|
141
147
|
}
|
|
142
148
|
let index = 0;
|
|
@@ -148,7 +154,8 @@ export default class Publish4 extends React.Component {
|
|
|
148
154
|
|
|
149
155
|
this.setState({
|
|
150
156
|
updateMainPhoto: true,
|
|
151
|
-
images: imagesArray
|
|
157
|
+
images: imagesArray,
|
|
158
|
+
imageSize: imageSize
|
|
152
159
|
});
|
|
153
160
|
}
|
|
154
161
|
|
|
@@ -296,8 +303,8 @@ export default class Publish4 extends React.Component {
|
|
|
296
303
|
return (
|
|
297
304
|
<View style={[commonStyles.photoBox]} onLayout={this.setContainerWidth} key={index}>
|
|
298
305
|
<Image style={{ width: this.state.imageSize[index]?.width, height: this.state.imageSize[index]?.height, marginVertical: this.state.imageSize[index]?.marginVertical, marginHorizontal: this.state.imageSize[index]?.marginHorizontal }}
|
|
299
|
-
resizeMode='
|
|
300
|
-
<ImageBackground style={[commonStyles.photoControls, commonStyles.row]} source={require('./assets/images/bg-shadow.png')} resizeMode='
|
|
306
|
+
resizeMode='cover' source={{ uri: item.uri }} borderRadius={10} onError={() => this.rerenderImage(index)} />
|
|
307
|
+
<ImageBackground style={[commonStyles.photoControls, commonStyles.row]} source={require('./assets/images/bg-shadow.png')} resizeMode='stretch' borderRadius={1.5}>
|
|
301
308
|
|
|
302
309
|
<TouchableHighlight style={commonStyles.leftIcon} onPress={() => this.deleteImage(item.id, index)}>
|
|
303
310
|
<FontAwesomeIcon style={commonStyles.whiteIcon} name="cancel-circled" />
|