mg-library 1.0.592 → 1.0.593

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 (3) hide show
  1. package/blocks.js +0 -11
  2. package/components.js +20 -0
  3. package/package.json +2 -2
package/blocks.js CHANGED
@@ -82,16 +82,6 @@ export function MGWelcome(props) {
82
82
  data={props.notices}
83
83
  keyExtractor={item => item.idNotice.toString()}
84
84
  renderItem={({ item }) => (
85
-
86
- /* <Card header={cardHeader(item)} style={{ marginBottom: 10, marginHorizontal: 10 }}>
87
- {item.imageUrl != undefined &&
88
- <View style={{ flexGrow: 1, alignItems: 'center', marginBottom: 10 }}>
89
- <Image source={{ uri: item.imageUrl }} style={{ width: '70%', resizeMode: 'contain', height: undefined, aspectRatio: 1 }} />
90
- </View>
91
- }
92
- <MGText style={{ marginBottom: 10 }}>{item.content}</MGText>
93
- </Card> */
94
-
95
85
  <MGCard header={cardHeader(item)}>
96
86
  {item.imageUrl && (
97
87
  <Box alignItems="center" mb={4}>
@@ -103,7 +93,6 @@ export function MGWelcome(props) {
103
93
  )}
104
94
  <MGText mb={2}>{item.content}</MGText>
105
95
  </MGCard>
106
-
107
96
  )}
108
97
  ListHeaderComponent={listHeaderComponent}
109
98
  ListFooterComponent={listFooterComponent}
package/components.js CHANGED
@@ -39,4 +39,24 @@ export function MGCard({ children, header = null, style = {}, ...props }) {
39
39
  {children}
40
40
  </Box>
41
41
  );
42
+ }
43
+
44
+ export default function MGCard({ children, header = null, footer = null, style = {}, ...props }) {
45
+ return (
46
+ <Box borderWidth={1} borderColor="coolGray.200" borderRadius="md" bg="white" shadow={2} overflow="hidden" mb={4} mx={2} style={style} {...props}>
47
+ {header && (
48
+ <>
49
+ <Box p={4}>{header}</Box>
50
+ <Divider />
51
+ </>
52
+ )}
53
+ <Box p={4}>{children}</Box>
54
+ {footer && (
55
+ <>
56
+ <Divider />
57
+ <Box p={4}>{footer}</Box>
58
+ </>
59
+ )}
60
+ </Box>
61
+ );
42
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mg-library",
3
- "version": "1.0.592",
3
+ "version": "1.0.593",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,4 +8,4 @@
8
8
  },
9
9
  "author": "",
10
10
  "license": "ISC"
11
- }
11
+ }