mg-library 1.0.490 → 1.0.492

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 CHANGED
@@ -81,14 +81,18 @@ export function MGWelcome(props) {
81
81
  keyExtractor={item => item.idNotice.toString()}
82
82
  renderItem={({ item }) => (
83
83
  <Card header={cardHeader(item)} style={{ marginBottom: 10, marginHorizontal: 10 }}>
84
-
85
84
  {item.imageUrl != undefined &&
86
- <Image source={{ uri: item.imageUrl }} style={{ width: 200, height: 200 }} />
85
+ <View style={{ flexGrow: 1, alignItems: 'center', marginBottom: 10 }}>
86
+ <Image source={{ uri: item.imageUrl }} style={{ width: 200, height: 200 }} />
87
+ </View>
87
88
  }
88
-
89
89
  <Text>
90
90
  <Text style={{ marginBottom: 10 }}>{item.content}</Text>
91
91
  </Text>
92
+ <Text>
93
+ <Text style={{ marginBottom: 10 }}>{item.imageUrl}</Text>
94
+ </Text>
95
+
92
96
  </Card>
93
97
  )}
94
98
  ListHeaderComponent={listHeaderComponent}
@@ -99,6 +103,20 @@ export function MGWelcome(props) {
99
103
 
100
104
  }
101
105
 
106
+ async function getImageDimensions(uuid) {
107
+ try {
108
+ const response = await fetch('https://ucarecdn.com/${uuid}/-/metadata/');
109
+ const data = await response.json();
110
+ return data.image_info ? {
111
+ width: data.image_info.width,
112
+ height: data.image_info.height
113
+ } : null;
114
+ } catch (error) {
115
+ console.error(error);
116
+ return null;
117
+ }
118
+ }
119
+
102
120
  export function MGLogin(props) {
103
121
 
104
122
  const [isKeyboardVisible, setIsKeyboardVisible] = useState(false);
package/functions.js CHANGED
@@ -21,7 +21,7 @@ export function navigatorHeader(insets, theme, onPressLogout, company) {
21
21
  if (companyDescription.length > 25)
22
22
  companyDescription = companyDescription.substring(0, 25) + '...';
23
23
  return (
24
- <Layout style={[safeAreaViewForNavigatorHeaderStyleSheet(insets).safeAreaView, { backgroundColor: theme['color-primary-500'], flexDirection:'column', justifyContent: 'flex-end' }]}>
24
+ <Layout style={[safeAreaViewForNavigatorHeaderStyleSheet(insets).safeAreaView, { backgroundColor: theme['color-primary-500'], flexDirection: 'column', justifyContent: 'flex-end' }]}>
25
25
  <View style={{ flexDirection: 'row', flexGrow: 1 }}>
26
26
  <View style={{ flexGrow: 0.9, marginLeft: 10, alignSelf: 'center' }}>
27
27
  <Text category='h5' style={{ color: 'white' }}>{companyDescription}</Text>
@@ -69,7 +69,7 @@ export function getCardHeader(title, subTitle) {
69
69
  <View style={{ flexGrow: 0.95 }}>
70
70
  <Text category='h6'>{title}</Text>
71
71
  {subTitle != undefined &&
72
- <Text category='p1' style={{fontStyle: 'italic'}}>{subTitle}</Text>
72
+ <Text category='p1' style={{ fontStyle: 'italic' }}>{subTitle}</Text>
73
73
  }
74
74
  </View>
75
75
  </View>
@@ -194,8 +194,8 @@ export function safeAreaViewForNavigatorHeaderStyleSheet(insets) {
194
194
 
195
195
  export function getBasicStyleSheet() {
196
196
  return StyleSheet.create({
197
- availableArea: {
198
- flexGrow: 1,
197
+ availableArea: {
198
+ flexGrow: 1,
199
199
  marginTop: 5,
200
200
  marginBottom: 5,
201
201
  marginLeft: 5,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mg-library",
3
- "version": "1.0.490",
3
+ "version": "1.0.492",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {