mg-library 1.0.491 → 1.0.493
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/blocks.js +0 -101
- package/functions.js +4 -4
- package/package.json +1 -1
package/blocks.js
CHANGED
@@ -286,100 +286,6 @@ function getHeightForCamera() {
|
|
286
286
|
return Dimensions.get('window').height;
|
287
287
|
}
|
288
288
|
|
289
|
-
/* export function MGCamera(props) {
|
290
|
-
let camera;
|
291
|
-
let captureWidth = 0;
|
292
|
-
let captureHeight = 0;
|
293
|
-
try {
|
294
|
-
captureWidth = Math.floor(getWidthForCamera() * 0.47);
|
295
|
-
captureHeight = Math.floor(getHeightForCamera() * 0.31);
|
296
|
-
} catch (error) {
|
297
|
-
captureWidth = 205;
|
298
|
-
captureHeight = 275;
|
299
|
-
}
|
300
|
-
const __takePicture = async () => {
|
301
|
-
if (!camera)
|
302
|
-
return;
|
303
|
-
let photo = await camera.takePictureAsync({ quality: 1 });
|
304
|
-
props.dispatch(props.actions.startProcessing());
|
305
|
-
photo = await ImageManipulator.manipulateAsync(
|
306
|
-
photo.uri,
|
307
|
-
[{ resize: { width: captureWidth, height: captureHeight } }],
|
308
|
-
{ compress: 1, format: ImageManipulator.SaveFormat.JPEG }
|
309
|
-
);
|
310
|
-
photo = await ImageManipulator.manipulateAsync(
|
311
|
-
photo.uri,
|
312
|
-
[{ flip: 'horizontal' }],
|
313
|
-
{ compress: 1, format: ImageManipulator.SaveFormat.JPEG }
|
314
|
-
);
|
315
|
-
props.process.fileUri = photo.uri;
|
316
|
-
props.process.goForward(props.nextStep);
|
317
|
-
props.dispatch(props.actions.endProcessing());
|
318
|
-
}
|
319
|
-
const [type, setType] = useState(Camera.Constants.Type.front);
|
320
|
-
const FlipIcon = () => (
|
321
|
-
<MaterialCommunityIcons
|
322
|
-
name='camera-flip-outline'
|
323
|
-
size={30}
|
324
|
-
style={{ color: 'white' }} />
|
325
|
-
);
|
326
|
-
const TakeIcon = () => (
|
327
|
-
<MaterialCommunityIcons
|
328
|
-
name='camera-outline'
|
329
|
-
size={30}
|
330
|
-
style={{ color: 'white' }} />
|
331
|
-
);
|
332
|
-
const cardHeader = (
|
333
|
-
<View style={{ marginLeft: 15, marginTop: 10, marginBottom: 10 }}>
|
334
|
-
<Text category='h6'>{mgFunctionsLib.i18nString('photo', props.language)}</Text>
|
335
|
-
<Text>{mgFunctionsLib.i18nString('takePhoto', props.language)}</Text>
|
336
|
-
</View>
|
337
|
-
);
|
338
|
-
const cardFooter = (
|
339
|
-
<View>
|
340
|
-
<View style={{ flexDirection: 'row' }}>
|
341
|
-
<View style={{ flex: 1, alignItems: 'center' }}>
|
342
|
-
<Button
|
343
|
-
style={{ width: 150 }}
|
344
|
-
status='primary'
|
345
|
-
accessoryLeft={FlipIcon}
|
346
|
-
onPress={() => {
|
347
|
-
setType(
|
348
|
-
type === Camera.Constants.Type.back ? Camera.Constants.Type.front : Camera.Constants.Type.back
|
349
|
-
)
|
350
|
-
}}>
|
351
|
-
<Text>{mgFunctionsLib.i18nString('doInvertCamera', props.language)}</Text>
|
352
|
-
</Button>
|
353
|
-
</View>
|
354
|
-
<View style={{ flex: 1, alignItems: 'center' }}>
|
355
|
-
<Button
|
356
|
-
style={{ width: 150 }}
|
357
|
-
status='primary'
|
358
|
-
accessoryLeft={TakeIcon}
|
359
|
-
onPress={__takePicture}>
|
360
|
-
<Text>{mgFunctionsLib.i18nString('doTakePhoto', props.language)}</Text>
|
361
|
-
</Button>
|
362
|
-
</View>
|
363
|
-
</View>
|
364
|
-
</View>
|
365
|
-
);
|
366
|
-
return (
|
367
|
-
<View>
|
368
|
-
<Card header={cardHeader} footer={cardFooter}>
|
369
|
-
<View style={{ alignItems: 'center' }}>
|
370
|
-
<Camera
|
371
|
-
style={{ width: captureWidth, height: captureHeight }}
|
372
|
-
type={type}
|
373
|
-
ref={(r) => {
|
374
|
-
camera = r
|
375
|
-
}}>
|
376
|
-
</Camera>
|
377
|
-
</View>
|
378
|
-
</Card>
|
379
|
-
</View>
|
380
|
-
)
|
381
|
-
} */
|
382
|
-
|
383
289
|
export function MGCamera(props) {
|
384
290
|
let camera;
|
385
291
|
let captureWidth = 0;
|
@@ -616,13 +522,6 @@ export function MGGoBack(props) {
|
|
616
522
|
color={props.theme['color-primary-500']}
|
617
523
|
onPress={() => props.process.goBack()} />
|
618
524
|
);
|
619
|
-
/* return (
|
620
|
-
<View style={{ flexGrow: 1, alignItems: 'flex-start', marginTop: -20 }}>
|
621
|
-
<Button
|
622
|
-
appearance='ghost'
|
623
|
-
accessoryLeft={goBackIcon} />
|
624
|
-
</View>
|
625
|
-
) */
|
626
525
|
return (
|
627
526
|
<View style={{ alignItems: 'flex-start', marginTop: -20 }}>
|
628
527
|
<Button
|
package/functions.js
CHANGED
@@ -21,7 +21,7 @@ export function navigatorHeader(insets, theme, onPressLogout, company) {
|
|
21
21
|
if (companyDescription.length > 25)
|
22
22
|
companyDescription = companyDescription.substring(0, 25) + '...';
|
23
23
|
return (
|
24
|
-
<Layout style={[safeAreaViewForNavigatorHeaderStyleSheet(insets).safeAreaView, { backgroundColor: theme['color-primary-500'], flexDirection:'column', justifyContent: 'flex-end' }]}>
|
24
|
+
<Layout style={[safeAreaViewForNavigatorHeaderStyleSheet(insets).safeAreaView, { backgroundColor: theme['color-primary-500'], flexDirection: 'column', justifyContent: 'flex-end' }]}>
|
25
25
|
<View style={{ flexDirection: 'row', flexGrow: 1 }}>
|
26
26
|
<View style={{ flexGrow: 0.9, marginLeft: 10, alignSelf: 'center' }}>
|
27
27
|
<Text category='h5' style={{ color: 'white' }}>{companyDescription}</Text>
|
@@ -69,7 +69,7 @@ export function getCardHeader(title, subTitle) {
|
|
69
69
|
<View style={{ flexGrow: 0.95 }}>
|
70
70
|
<Text category='h6'>{title}</Text>
|
71
71
|
{subTitle != undefined &&
|
72
|
-
<Text category='p1' style={{fontStyle: 'italic'}}>{subTitle}</Text>
|
72
|
+
<Text category='p1' style={{ fontStyle: 'italic' }}>{subTitle}</Text>
|
73
73
|
}
|
74
74
|
</View>
|
75
75
|
</View>
|
@@ -194,8 +194,8 @@ export function safeAreaViewForNavigatorHeaderStyleSheet(insets) {
|
|
194
194
|
|
195
195
|
export function getBasicStyleSheet() {
|
196
196
|
return StyleSheet.create({
|
197
|
-
availableArea: {
|
198
|
-
flexGrow: 1,
|
197
|
+
availableArea: {
|
198
|
+
flexGrow: 1,
|
199
199
|
marginTop: 5,
|
200
200
|
marginBottom: 5,
|
201
201
|
marginLeft: 5,
|