@fto-consult/expo-ui 8.6.0 → 8.6.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "8.6.0",
3
+ "version": "8.6.1",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -174,8 +174,8 @@ export default function ImageComponent(props){
174
174
  setEditorProps({...editorProps,visible:true,...props})
175
175
  })
176
176
  },
177
- pickImage : (opts)=>{
178
- opts = getCropProps(opts);
177
+ pickImage : ()=>{
178
+ const opts = getCropProps(defaultObj(pickImageProps));
179
179
  opts.base64 = true;
180
180
  return pickImage(opts).then((image)=>handlePickedImage(image,opts));
181
181
  },
@@ -229,7 +229,9 @@ export default function ImageComponent(props){
229
229
  label : 'Enregistrer une photo',
230
230
  icon : 'camera',
231
231
  onPress : (a)=>{
232
- takePhoto().then(handlePickedImage);
232
+ const opts = getCropProps(defaultObj(pickImageProps));
233
+ opts.base64 = true;
234
+ takePhoto(opts).then(handlePickedImage);
233
235
  }
234
236
  })
235
237
  }
@@ -113,6 +113,7 @@ const UserProfileAvatarComponent = React.forwardRef(({drawerRef,chevronIconProps
113
113
  if(!withLabel){
114
114
  return <View testID={"RNProfilAvatar_AvatarContainer"} style={[theme.styles.row,theme.styles.alignItemsCenter]}>
115
115
  <Image
116
+ pickImageProps = {{quality:0.4}}
116
117
  {...props}
117
118
  {...aProps}
118
119
  size={size}
@@ -65,7 +65,7 @@ export const pickImageOrVideo = (options)=>{
65
65
  return checkPermission().then(()=>{
66
66
  return new Promise((resolve,reject)=>{
67
67
  ImagePicker.launchImageLibraryAsync(getFilePickerOptions(options)).then((result)=>{
68
- if(!result.cancelled) {
68
+ if(!result.cancelled && !result.canceled) {
69
69
  resolve(prepareImageResult(result));
70
70
  } else {
71
71
  notify.warning("Opération annulée par l'utilisateur");
@@ -116,7 +116,7 @@ export const takePhoto = (options)=>{
116
116
  return checkPermission(ImagePicker.requestCameraPermissionsAsync).then((perm)=>{
117
117
  options = {base64:true,...Object.assign({},options)}
118
118
  return ImagePicker.launchCameraAsync({...getFilePickerOptions(options)}).then((result)=>{
119
- if(!result.cancelled) {
119
+ if(!result.cancelled && !result.canceled) {
120
120
  resolve(prepareImageResult(result));
121
121
  } else {
122
122
  notify.warning("Opération annulée par l'utilisateur");
@@ -9,7 +9,7 @@ export const getFilePickerOptions = (options)=>{
9
9
  base64 : false, //Whether to also include the image data in Base64 format.
10
10
  exif : false, //Whether to also include the EXIF data for the image. On iOS the EXIF data does not include GPS tags in the camera case.
11
11
  mediaTypes : ImagePicker.MediaTypeOptions.All, //@see : https://docs.expo.dev/versions/latest/sdk/imagepicker/#mediatypeoptions
12
- quality : 1, //Specify the quality of compression, from 0 to 1. 0 means compress for small size, 1 means compress for maximum quality.
12
+ quality : 0.5, //Specify the quality of compression, from 0 to 1. 0 means compress for small size, 1 means compress for maximum quality.
13
13
  },options);
14
14
  }
15
15
  /*** retourne les ooptions pour la capture d'une photo