mg-library 1.0.583 → 1.0.585
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 +61 -26
- package/package.json +1 -1
package/blocks.js
CHANGED
|
@@ -597,35 +597,64 @@ export function MGButton(props) {
|
|
|
597
597
|
|
|
598
598
|
export function MGPopover(props) {
|
|
599
599
|
const [visible, setVisible] = useState(false);
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
600
|
+
|
|
601
|
+
const footer = (
|
|
602
|
+
<View style={{
|
|
603
|
+
flexGrow: 1,
|
|
604
|
+
flexDirection: 'row',
|
|
605
|
+
justifyContent: 'space-around',
|
|
606
|
+
marginTop: 20,
|
|
607
|
+
marginBottom: 20
|
|
608
|
+
}}>
|
|
609
|
+
<NBButton
|
|
610
|
+
py={4}
|
|
611
|
+
colorScheme='primary'
|
|
612
|
+
style={{ flexGrow: 0.3 }}
|
|
613
|
+
onPress={() => {
|
|
614
|
+
setVisible(false);
|
|
615
|
+
props.callback();
|
|
616
|
+
}}
|
|
617
|
+
>
|
|
618
|
+
<MGText color="white">
|
|
619
|
+
{mgFunctionsLib.i18nString('yes', props.language)}
|
|
620
|
+
</MGText>
|
|
621
|
+
</NBButton>
|
|
622
|
+
<NBButton
|
|
623
|
+
py={4}
|
|
624
|
+
colorScheme='primary'
|
|
625
|
+
style={{ flexGrow: 0.3 }}
|
|
626
|
+
onPress={() => setVisible(false)}
|
|
627
|
+
>
|
|
628
|
+
<MGText color="white">
|
|
629
|
+
{mgFunctionsLib.i18nString('no', props.language)}
|
|
630
|
+
</MGText>
|
|
631
|
+
</NBButton>
|
|
632
|
+
</View>
|
|
622
633
|
);
|
|
634
|
+
|
|
623
635
|
return (
|
|
624
636
|
<NBPopover
|
|
625
637
|
isOpen={visible}
|
|
626
638
|
onClose={() => setVisible(false)}
|
|
627
639
|
trigger={triggerProps => (
|
|
628
|
-
|
|
640
|
+
<NBButton
|
|
641
|
+
{...triggerProps}
|
|
642
|
+
py={4}
|
|
643
|
+
colorScheme='primary'
|
|
644
|
+
leftIcon={
|
|
645
|
+
<NBIcon
|
|
646
|
+
as={MaterialCommunityIcons}
|
|
647
|
+
name={props.icon}
|
|
648
|
+
size='lg'
|
|
649
|
+
color='white'
|
|
650
|
+
/>
|
|
651
|
+
}
|
|
652
|
+
onPress={() => setVisible(true)}
|
|
653
|
+
>
|
|
654
|
+
<MGText category="p1" color="white">
|
|
655
|
+
{props.title}
|
|
656
|
+
</MGText>
|
|
657
|
+
</NBButton>
|
|
629
658
|
)}
|
|
630
659
|
>
|
|
631
660
|
<NBPopover.Content w="300px" bg="white">
|
|
@@ -633,18 +662,24 @@ export function MGPopover(props) {
|
|
|
633
662
|
<NBPopover.CloseButton />
|
|
634
663
|
<NBPopover.Body>
|
|
635
664
|
<Box alignItems="center" justifyContent="center">
|
|
636
|
-
<NBIcon
|
|
665
|
+
<NBIcon
|
|
666
|
+
as={MaterialCommunityIcons}
|
|
667
|
+
name="alert-outline"
|
|
668
|
+
size={16}
|
|
669
|
+
color={props.theme['color-primary-500']}
|
|
670
|
+
mb={3}
|
|
671
|
+
/>
|
|
637
672
|
<MGText textAlign="center">
|
|
638
673
|
{mgFunctionsLib.i18nString('confirm', props.language)}?
|
|
639
674
|
</MGText>
|
|
640
675
|
</Box>
|
|
641
676
|
</NBPopover.Body>
|
|
642
677
|
<NBPopover.Footer>
|
|
643
|
-
{
|
|
678
|
+
{footer}
|
|
644
679
|
</NBPopover.Footer>
|
|
645
680
|
</NBPopover.Content>
|
|
646
681
|
</NBPopover>
|
|
647
|
-
)
|
|
682
|
+
);
|
|
648
683
|
}
|
|
649
684
|
|
|
650
685
|
export function MGGoBack(props) {
|