mg-library 1.0.797 → 1.0.799

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 +99 -92
  2. package/package.json +1 -1
package/blocks.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { useCallback, useState, useEffect } from 'react';
2
+ import { KeyboardAvoidingView, Platform } from "react-native";
2
3
  import { useForm, Controller } from 'react-hook-form';
3
4
  import { View, ActivityIndicator, Pressable, Image, FlatList, Keyboard, Dimensions, StyleSheet } from 'react-native';
4
5
  import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
@@ -116,7 +117,7 @@ export function MGBenefits(props) {
116
117
  subTitle = props.subTitle;
117
118
 
118
119
  let listHeaderComponent = (
119
- <View style={{marginBottom: 10}}>
120
+ <View style={{ marginBottom: 10 }}>
120
121
  <MGSessionHeader module={subTitle} person={props.person} colors={props.colors} />
121
122
  {props.beforeBenefits != undefined &&
122
123
  <>
@@ -221,99 +222,105 @@ export function MGLogin(props) {
221
222
  );
222
223
 
223
224
  return (
224
- <View style={{ flex: 1 }}>
225
- <Box style={[mgFunctionsLib.safeAreaViewStyleSheet(insets).safeAreaView, { display: 'flex', flexDirection: 'column', flexGrow: 1 }]}>
226
- <View style={{ flexDirection: 'column', flexGrow: 1, justifyContent: 'center' }}>
227
- {isKeyboardVisible &&
228
- <View style={{ flexDirection: 'column', alignItems: 'center', marginBottom: 10 }}>
229
- <>
230
- <Image
231
- source={require('./assets/clubonline.png')}
232
- style={{ width: 180, height: 90 }} />
233
- </>
234
- </View>
235
- }
236
- {!isKeyboardVisible &&
237
- <View style={{ flexDirection: 'column', alignItems: 'center', marginBottom: 100 }}>
238
- <>
239
- <Image
240
- source={require('./assets/clubonline.png')}
241
- style={{ width: 300, height: 150 }} />
242
- <View style={{ marginHorizontal: 10, flexDirection: 'column', alignItems: 'center' }}>
243
- <MGText style={{ alignSelf: 'center', textAlign: 'center' }} category='h6'>{props.appDescription}</MGText>
244
- <MGText style={{ alignSelf: 'center' }} category='p2'>{props.appVersion}</MGText>
245
- </View>
246
- </>
247
- </View>
248
- }
249
- <View>
250
- <MGCard style={{ flexDirection: 'column', justifyContent: 'center', alignContent: 'center', marginLeft: 30, marginRight: 30 }}
251
- header={cardHeader}
252
- footer={cardFooter}>
253
- <Controller
254
- control={control}
255
- rules={{ maxLength: 50 }}
256
- render={({ field: { onChange, value } }) => (
257
- <Input size="lg"
258
- variant="outline"
259
- px="$3"
260
- rounded="$md"
261
- bg="$white"
262
- borderColor="$gray300"
263
- mb={10}>
264
- <InputField
265
- placeholder={mgFunctionsLib.i18nString('userName', props.language)}
266
- placeholderTextColor="$gray300"
267
- value={value}
268
- onChangeText={onChange}
269
- autoCapitalize="none"
270
- />
271
- </Input>
272
- )}
273
- name="userName" />
274
- <Controller
275
- control={control}
276
- rules={{ maxLength: 50 }}
277
- render={({ field: { onChange, value } }) => (
278
- <Input
279
- size="lg"
280
- variant="outline"
281
- px="$3"
282
- rounded="$md"
283
- bg="$white"
284
- borderColor="$gray300"
285
- >
286
- <InputField
287
- placeholder={isKeyboardNumericForPassword ? mgFunctionsLib.i18nString('password', props.language) : mgFunctionsLib.i18nString('passwordAlphanumeric', props.language)}
288
- placeholderTextColor="$gray300"
289
- value={value}
290
- onChangeText={onChange}
291
- secureTextEntry
292
- maxLength={12}
293
- keyboardType={isKeyboardNumericForPassword ? "numeric" : "default"}
294
- autoCapitalize="none"
295
- autoCorrect={false}
296
- returnKeyType="done"
297
- />
298
- </Input>
299
- )}
300
- name="password" />
301
- </MGCard>
302
- <View style={{ flex: 1, alignItems: 'center' }}>
303
- <Button
304
- action="primary"
305
- variant="outline"
306
- onPress={() => {
307
- setIsKeyboardNumericForPassword(!isKeyboardNumericForPassword)
308
- }}
309
- >
310
- <Icon as={MaterialCommunityIcons} name="keyboard" color="$primary500" />
311
- </Button>
225
+ <View style={{ flex: 1, backgroundColor: 'white' }}>
226
+ <KeyboardAvoidingView
227
+ style={{ flex: 1 }}
228
+ behavior={Platform.OS === "ios" ? "padding" : undefined}
229
+ keyboardVerticalOffset={0}
230
+ >
231
+ <Box style={[mgFunctionsLib.safeAreaViewStyleSheet(insets).safeAreaView, { display: 'flex', flexDirection: 'column', flex: 1 }]}>
232
+ <View style={{ flexDirection: 'column', flex: 1, justifyContent: 'center' }}>
233
+ {isKeyboardVisible &&
234
+ <View style={{ flexDirection: 'column', alignItems: 'center', marginBottom: 10 }}>
235
+ <>
236
+ <Image
237
+ source={require('./assets/clubonline.png')}
238
+ style={{ width: 180, height: 90 }} />
239
+ </>
240
+ </View>
241
+ }
242
+ {!isKeyboardVisible &&
243
+ <View style={{ flexDirection: 'column', alignItems: 'center', marginBottom: 100 }}>
244
+ <>
245
+ <Image
246
+ source={require('./assets/clubonline.png')}
247
+ style={{ width: 300, height: 150 }} />
248
+ <View style={{ marginHorizontal: 10, flexDirection: 'column', alignItems: 'center' }}>
249
+ <MGText style={{ alignSelf: 'center', textAlign: 'center' }} category='h6'>{props.appDescription}</MGText>
250
+ <MGText style={{ alignSelf: 'center' }} category='p2'>{props.appVersion}</MGText>
251
+ </View>
252
+ </>
253
+ </View>
254
+ }
255
+ <View>
256
+ <MGCard style={{ flexDirection: 'column', justifyContent: 'center', alignContent: 'center', marginLeft: 30, marginRight: 30 }}
257
+ header={cardHeader}
258
+ footer={cardFooter}>
259
+ <Controller
260
+ control={control}
261
+ rules={{ maxLength: 50 }}
262
+ render={({ field: { onChange, value } }) => (
263
+ <Input size="lg"
264
+ variant="outline"
265
+ px="$3"
266
+ rounded="$md"
267
+ bg="$white"
268
+ borderColor="$gray300"
269
+ mb={10}>
270
+ <InputField
271
+ placeholder={mgFunctionsLib.i18nString('userName', props.language)}
272
+ placeholderTextColor="$gray300"
273
+ value={value}
274
+ onChangeText={onChange}
275
+ autoCapitalize="none"
276
+ />
277
+ </Input>
278
+ )}
279
+ name="userName" />
280
+ <Controller
281
+ control={control}
282
+ rules={{ maxLength: 50 }}
283
+ render={({ field: { onChange, value } }) => (
284
+ <Input
285
+ size="lg"
286
+ variant="outline"
287
+ px="$3"
288
+ rounded="$md"
289
+ bg="$white"
290
+ borderColor="$gray300"
291
+ >
292
+ <InputField
293
+ placeholder={isKeyboardNumericForPassword ? mgFunctionsLib.i18nString('password', props.language) : mgFunctionsLib.i18nString('passwordAlphanumeric', props.language)}
294
+ placeholderTextColor="$gray300"
295
+ value={value}
296
+ onChangeText={onChange}
297
+ secureTextEntry
298
+ maxLength={12}
299
+ keyboardType={isKeyboardNumericForPassword ? "numeric" : "default"}
300
+ autoCapitalize="none"
301
+ autoCorrect={false}
302
+ returnKeyType="done"
303
+ />
304
+ </Input>
305
+ )}
306
+ name="password" />
307
+ </MGCard>
308
+ <View style={{ flex: 1, alignItems: 'center' }}>
309
+ <Button
310
+ action="primary"
311
+ variant="outline"
312
+ onPress={() => {
313
+ setIsKeyboardNumericForPassword(!isKeyboardNumericForPassword)
314
+ }}
315
+ >
316
+ <Icon as={MaterialCommunityIcons} name="keyboard" color="$primary500" />
317
+ </Button>
318
+ </View>
312
319
  </View>
313
320
  </View>
314
- </View>
315
- </Box>
316
- </View>
321
+ </Box>
322
+ </KeyboardAvoidingView>
323
+ </View >
317
324
  );
318
325
 
319
326
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mg-library",
3
- "version": "1.0.797",
3
+ "version": "1.0.799",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "react-native": "index.js",