Merge branch 'main' into upload-profile-images

This commit is contained in:
João Ferreiro
2022-12-05 10:39:06 +00:00
4 changed files with 14 additions and 16 deletions
+2 -2
View File
@@ -48,12 +48,12 @@
</dict>
</dict>
</dict>
<key>NSCameraUsageDescription</key>
<string></string>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>NSPhotoLibraryUsageDescription</key>
<string></string>
<key>NSCameraUsageDescription</key>
<string></string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
+2 -2
View File
@@ -18,8 +18,8 @@ export class UserLocalPhotosModel {
}
private async _getPhotos() {
runInAction(() => {
CameraRoll.getPhotos({first: 20}).then(r => {
CameraRoll.getPhotos({first: 20}).then(r => {
runInAction(() => {
this.photos = r.edges
})
})
+9 -11
View File
@@ -23,9 +23,14 @@ export const PhotoCarouselPicker = ({
cropping: true,
width: 1000,
height: 1000,
}).then(item => {
setSelectedPhotos([item.path, ...selectedPhotos])
})
}).then(
item => {
setSelectedPhotos([item.path, ...selectedPhotos])
},
_err => {
// ignore
},
)
}, [selectedPhotos, setSelectedPhotos])
const handleSelectPhoto = useCallback(
@@ -58,14 +63,7 @@ export const PhotoCarouselPicker = ({
})
result.push(img.path)
}
setSelectedPhotos([
// ...items.reduce(
// (accum, cur) => accum.concat(cur.sourceURL!),
// [] as string[],
// ),
...result,
...selectedPhotos,
])
setSelectedPhotos([...result, ...selectedPhotos])
})
}, [selectedPhotos, setSelectedPhotos])
+1 -1
View File
@@ -1,7 +1,7 @@
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'
import React, {useCallback} from 'react'
import {Alert, StyleSheet, View, TouchableOpacity} from 'react-native'
import Svg, {Rect, Defs, LinearGradient, Stop} from 'react-native-svg'
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
import {getGradient} from '../../lib/asset-gen'
import {colors} from '../../lib/styles'