mg-library 1.0.582 → 1.0.584

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 +68 -26
  2. package/package.json +1 -1
package/blocks.js CHANGED
@@ -595,37 +595,73 @@ export function MGButton(props) {
595
595
  )
596
596
  } */
597
597
 
598
+ import { useState } from 'react';
599
+ import { View } from 'react-native';
600
+ import { Button as NBButton, Box, Icon as NBIcon, Popover as NBPopover } from 'native-base';
601
+ import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
602
+ import MGText from './MGText'; // Ajustá este import si hace falta
603
+ import * as mgFunctionsLib from './mgFunctionsLib'; // Ajustá también si lo tenés en otro path
604
+
598
605
  export function MGPopover(props) {
599
606
  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
- </>
607
+
608
+ const footer = (
609
+ <View style={{
610
+ flexGrow: 1,
611
+ flexDirection: 'row',
612
+ justifyContent: 'space-around',
613
+ marginTop: 20,
614
+ marginBottom: 20
615
+ }}>
616
+ <NBButton
617
+ py={4}
618
+ colorScheme='primary'
619
+ style={{ flexGrow: 0.3 }}
620
+ onPress={() => {
621
+ setVisible(false);
622
+ props.callback();
623
+ }}
624
+ >
625
+ <MGText color="white">
626
+ {mgFunctionsLib.i18nString('yes', props.language)}
627
+ </MGText>
628
+ </NBButton>
629
+ <NBButton
630
+ py={4}
631
+ colorScheme='primary'
632
+ style={{ flexGrow: 0.3 }}
633
+ onPress={() => setVisible(false)}
634
+ >
635
+ <MGText color="white">
636
+ {mgFunctionsLib.i18nString('no', props.language)}
637
+ </MGText>
638
+ </NBButton>
639
+ </View>
622
640
  );
641
+
623
642
  return (
624
643
  <NBPopover
625
644
  isOpen={visible}
626
645
  onClose={() => setVisible(false)}
627
646
  trigger={triggerProps => (
628
- {button}
647
+ <NBButton
648
+ {...triggerProps}
649
+ py={4}
650
+ colorScheme='primary'
651
+ leftIcon={
652
+ <NBIcon
653
+ as={MaterialCommunityIcons}
654
+ name={props.icon}
655
+ size='lg'
656
+ color='white'
657
+ />
658
+ }
659
+ onPress={() => setVisible(true)}
660
+ >
661
+ <MGText category="p1" color="white">
662
+ {props.title}
663
+ </MGText>
664
+ </NBButton>
629
665
  )}
630
666
  >
631
667
  <NBPopover.Content w="300px" bg="white">
@@ -633,18 +669,24 @@ export function MGPopover(props) {
633
669
  <NBPopover.CloseButton />
634
670
  <NBPopover.Body>
635
671
  <Box alignItems="center" justifyContent="center">
636
- <NBIcon as={MaterialCommunityIcons} name="alert-outline" size={16} color={props.theme['color-primary-500']} mb={3} />
672
+ <NBIcon
673
+ as={MaterialCommunityIcons}
674
+ name="alert-outline"
675
+ size={16}
676
+ color={props.theme['color-primary-500']}
677
+ mb={3}
678
+ />
637
679
  <MGText textAlign="center">
638
680
  {mgFunctionsLib.i18nString('confirm', props.language)}?
639
681
  </MGText>
640
682
  </Box>
641
683
  </NBPopover.Body>
642
684
  <NBPopover.Footer>
643
- {cardFooter}
685
+ {footer}
644
686
  </NBPopover.Footer>
645
687
  </NBPopover.Content>
646
688
  </NBPopover>
647
- )
689
+ );
648
690
  }
649
691
 
650
692
  export function MGGoBack(props) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mg-library",
3
- "version": "1.0.582",
3
+ "version": "1.0.584",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {