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.
Files changed (2) hide show
  1. package/blocks.js +61 -26
  2. 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
- 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
- </>
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
- button()
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 as={MaterialCommunityIcons} name="alert-outline" size={16} color={props.theme['color-primary-500']} mb={3} />
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
- {cardFooter}
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mg-library",
3
- "version": "1.0.583",
3
+ "version": "1.0.585",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {