mg-library 1.0.578 → 1.0.579
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 +57 -3
- package/package.json +1 -1
package/blocks.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useCallback, useState, useEffect } from 'react';
|
|
2
2
|
import { useForm, Controller } from 'react-hook-form';
|
|
3
3
|
import { View, ActivityIndicator, Pressable, Image, FlatList, Keyboard, Dimensions } from 'react-native';
|
|
4
|
-
import {
|
|
4
|
+
import { Card, Input } from '@ui-kitten/components';
|
|
5
5
|
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
6
6
|
import * as ImageManipulator from 'expo-image-manipulator';
|
|
7
7
|
import { Camera, CameraType, CameraView } from 'expo-camera';
|
|
8
8
|
import axios from 'axios';
|
|
9
|
-
import { Divider, Box, Button as NBButton, Icon as NBIcon } from 'native-base';
|
|
9
|
+
import { Divider, Box, Button as NBButton, Icon as NBIcon, Popover as NBPopover } from 'native-base';
|
|
10
10
|
import { uploadFile } from '@uploadcare/upload-client';
|
|
11
11
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
12
12
|
|
|
@@ -554,7 +554,7 @@ export function MGButton(props) {
|
|
|
554
554
|
)
|
|
555
555
|
}
|
|
556
556
|
|
|
557
|
-
export function MGPopover(props) {
|
|
557
|
+
/* export function MGPopover(props) {
|
|
558
558
|
const [visible, setVisible] = useState(false);
|
|
559
559
|
const button = () => (
|
|
560
560
|
<NBButton py={4} colorScheme='primary'
|
|
@@ -593,6 +593,60 @@ export function MGPopover(props) {
|
|
|
593
593
|
</Card>
|
|
594
594
|
</Popover>
|
|
595
595
|
)
|
|
596
|
+
} */
|
|
597
|
+
|
|
598
|
+
export function MGPopover(props) {
|
|
599
|
+
const [visible, setVisible] = useState(false);
|
|
600
|
+
const button = () => (
|
|
601
|
+
<NBButton py={4} colorScheme='primary'
|
|
602
|
+
leftIcon={
|
|
603
|
+
<NBIcon as={MaterialCommunityIcons} name={props.icon} size='lg' color='white' />
|
|
604
|
+
}
|
|
605
|
+
onPress={() => setVisible(true)}>
|
|
606
|
+
<MGText category="p1" color="white">
|
|
607
|
+
{props.title}
|
|
608
|
+
</MGText>
|
|
609
|
+
</NBButton>
|
|
610
|
+
);
|
|
611
|
+
let cardFooter = (
|
|
612
|
+
<>
|
|
613
|
+
<View style={{ flexGrow: 1, flexDirection: 'row', justifyContent: 'space-around', marginTop: 20, marginBottom: 20 }}>
|
|
614
|
+
<NBButton py={4} colorScheme='primary' style={{ flexGrow: 0.3 }} onPress={() => { setVisible(false); props.callback() }}>
|
|
615
|
+
<MGText color="white">{mgFunctionsLib.i18nString('yes', props.language)}</MGText>
|
|
616
|
+
</NBButton>
|
|
617
|
+
<NBButton py={4} colorScheme='primary' style={{ flexGrow: 0.3 }} onPress={() => { setVisible(false) }}>
|
|
618
|
+
<MGText color="white">{mgFunctionsLib.i18nString('no', props.language)}</MGText>
|
|
619
|
+
</NBButton>
|
|
620
|
+
</View>
|
|
621
|
+
</>
|
|
622
|
+
);
|
|
623
|
+
return (
|
|
624
|
+
<NBPopover
|
|
625
|
+
isOpen={visible}
|
|
626
|
+
onClose={() => setVisible(false)}
|
|
627
|
+
trigger={triggerProps => (
|
|
628
|
+
<Box {...triggerProps}>
|
|
629
|
+
{button}
|
|
630
|
+
</Box>
|
|
631
|
+
)}
|
|
632
|
+
>
|
|
633
|
+
<NBPopover.Content w="300px" bg="white">
|
|
634
|
+
<NBPopover.Arrow />
|
|
635
|
+
<NBPopover.CloseButton />
|
|
636
|
+
<NBPopover.Body>
|
|
637
|
+
<Box alignItems="center" justifyContent="center">
|
|
638
|
+
<NBIcon as={MaterialCommunityIcons} name="alert-outline" size={16} color={props.theme['color-primary-500']} mb={3} />
|
|
639
|
+
<MGText textAlign="center">
|
|
640
|
+
{mgFunctionsLib.i18nString('confirm', props.language)}?
|
|
641
|
+
</MGText>
|
|
642
|
+
</Box>
|
|
643
|
+
</NBPopover.Body>
|
|
644
|
+
<NBPopover.Footer>
|
|
645
|
+
{cardFooter}
|
|
646
|
+
</NBPopover.Footer>
|
|
647
|
+
</NBPopover.Content>
|
|
648
|
+
</NBPopover>
|
|
649
|
+
)
|
|
596
650
|
}
|
|
597
651
|
|
|
598
652
|
export function MGGoBack(props) {
|