mg-library 1.0.412 → 1.0.414

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.
Files changed (2) hide show
  1. package/blocks.js +22 -1
  2. package/package.json +1 -1
package/blocks.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { useCallback, useState, useEffect } from 'react';
2
2
  import { useForm, Controller } from 'react-hook-form';
3
- import { View, ActivityIndicator, Pressable, Image, FlatList, Keyboard } from 'react-native';
3
+ import { View, ActivityIndicator, Pressable, Image, FlatList, Keyboard, Dimensions } from 'react-native';
4
4
  import { Text, Divider, Button, Popover, Card, Layout, Input } from '@ui-kitten/components';
5
5
  import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
6
6
  import * as ImageManipulator from 'expo-image-manipulator';
@@ -251,10 +251,31 @@ export function MGCurrentAccount(props) {
251
251
  )
252
252
  }
253
253
 
254
+ export function getWidthForCamera() {
255
+ return Dimensions.get('window').width;
256
+ }
257
+
258
+ export function getHeightForCamera() {
259
+ return Dimensions.get('window').height;
260
+ }
261
+
254
262
  export function MGCamera(props) {
255
263
  let camera;
264
+
256
265
  let captureWidth = 205;
257
266
  let captureHeight = 275;
267
+
268
+ try {
269
+ captureWidth = Math.floor(getWidthForCamera() * 0.47);
270
+ captureHeight = Math.floor(getHeightForCamera() * 0.31);
271
+ } catch (error) {
272
+ let captureWidth = 205;
273
+ let captureHeight = 275;
274
+ }
275
+
276
+ console.log(captureWidth);
277
+ console.log(captureHeight);
278
+
258
279
  const __takePicture = async () => {
259
280
  if (!camera)
260
281
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mg-library",
3
- "version": "1.0.412",
3
+ "version": "1.0.414",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {