native-pytech 1.0.49 → 1.0.52

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.
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type Props from './types';
3
+ declare const _default: React.MemoExoticComponent<({ text, color, type, systemName, iconSize, }: Props) => React.JSX.Element>;
4
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import React, { memo, useMemo } from 'react';
2
+ import { frame, font, foregroundStyle, background, clipShape } from '@expo/ui/swift-ui/modifiers';
3
+ import { Text, Image } from '@expo/ui/swift-ui';
4
+ import colors, { sizes } from '../../constants';
5
+ export default memo(({ text, color, type = 'small', systemName, iconSize, }) => {
6
+ const typeSizes = useMemo(() => sizes[type], [type]);
7
+ const cantLetras = text?.length ?? 0;
8
+ const modifiers = useMemo(() => [
9
+ frame({ width: typeSizes.diameter, height: typeSizes.diameter }),
10
+ font({ weight: 'semibold', size: typeSizes.fontSize[cantLetras] }),
11
+ foregroundStyle('white'),
12
+ background(colors[color].dark),
13
+ clipShape('circle'),
14
+ ], [typeSizes]);
15
+ // Return
16
+ if (text && cantLetras <= 3) {
17
+ return (<Text modifiers={[
18
+ font({ weight: 'semibold', size: typeSizes.fontSize[cantLetras] }),
19
+ ...modifiers
20
+ ]}>
21
+ {text}
22
+ </Text>);
23
+ }
24
+ return (<Image systemName={systemName} color='white' size={iconSize ?? typeSizes.diameter / 2}/>);
25
+ });
@@ -51,34 +51,34 @@ function Component({ data = [], renderItem, onSave, }) {
51
51
  isUniqueItem: (data?.length ?? 0) === 1,
52
52
  textFieldsRefs
53
53
  }), []);
54
- return (<>
55
- <Stack.Toolbar placement="left">
56
- <Stack.Toolbar.Button onPress={() => router.back()}>
57
- <Stack.Toolbar.Icon sf="xmark"/>
58
- </Stack.Toolbar.Button>
59
- </Stack.Toolbar>
60
-
61
- <Stack.Toolbar placement="right">
62
- <Stack.Toolbar.Button disabled={!saveEnabled} variant="done" onPress={onPressSave}>
63
- <Stack.Toolbar.Icon sf="checkmark"/>
64
- </Stack.Toolbar.Button>
65
- </Stack.Toolbar>
66
-
67
- <Host style={{ flex: 1 }}>
68
- <List>
69
- <Section>
70
- <Provider value={value}>
54
+ return (<>
55
+ <Stack.Toolbar placement="left">
56
+ <Stack.Toolbar.Button onPress={() => router.back()}>
57
+ <Stack.Toolbar.Icon sf="xmark"/>
58
+ </Stack.Toolbar.Button>
59
+ </Stack.Toolbar>
60
+
61
+ <Stack.Toolbar placement="right">
62
+ <Stack.Toolbar.Button disabled={!saveEnabled} variant="done" onPress={onPressSave}>
63
+ <Stack.Toolbar.Icon sf="checkmark"/>
64
+ </Stack.Toolbar.Button>
65
+ </Stack.Toolbar>
66
+
67
+ <Host style={{ flex: 1 }}>
68
+ <List>
69
+ <Section>
70
+ <Provider value={value}>
71
71
  {data.map((item, index) => {
72
72
  const nextIndex = index + 1;
73
73
  const value = { index, nextIndex: nextIndex < data.length ? nextIndex : undefined };
74
- return (<ItemProvider key={index} value={value}>
75
- {renderItem?.(item)}
74
+ return (<ItemProvider key={index} value={value}>
75
+ {renderItem?.(item)}
76
76
  </ItemProvider>);
77
- })}
78
- </Provider>
79
- </Section>
80
- </List>
81
- </Host>
77
+ })}
78
+ </Provider>
79
+ </Section>
80
+ </List>
81
+ </Host>
82
82
  </>);
83
83
  }
84
84
  export default memo(Component);
@@ -4,7 +4,7 @@ import { memo } from 'react';
4
4
  import Screen from '../Screen';
5
5
  import { handleSubmitLogInPerfil } from './utils';
6
6
  export default memo(({ routeOnSuccess, onSuccess }) => {
7
- const { mail, first_name, gradient_text, color } = useLocalSearchParams();
7
+ const { mail, first_name, abbreviation, color } = useLocalSearchParams();
8
8
  const router = useRouter();
9
9
  const handleSubmit = async ({ value }) => {
10
10
  const { succeded, message } = await handleSubmitLogInPerfil({ mail, password: value });
@@ -15,5 +15,5 @@ export default memo(({ routeOnSuccess, onSuccess }) => {
15
15
  }
16
16
  return { succeded, message };
17
17
  };
18
- return (<Screen iconPage={<Screen.Gradient text={`${gradient_text}`} color={color}/>} title={`¡Hola${first_name ? ` ${first_name}` : ''}!`} bottomElements={<Screen.Input placeholder='Contraseña' keyboardType='default' secureTextEntry={true} autoComplete='password' handleSubmit={handleSubmit} autoFocus={Platform.OS === 'web'}/>}/>);
18
+ return (<Screen iconPage={<Screen.Gradient text={`${abbreviation}`} color={color}/>} title={`¡Hola${first_name ? ` ${first_name}` : ''}!`} bottomElements={<Screen.Input placeholder='Contraseña' keyboardType='default' secureTextEntry={true} autoComplete='password' handleSubmit={handleSubmit} autoFocus={Platform.OS === 'web'}/>}/>);
19
19
  });
@@ -2,7 +2,7 @@ import { Router } from 'expo-router';
2
2
  import { PerfilColorType } from '../constants';
3
3
  export type LoginData = {
4
4
  first_name: string;
5
- gradient_text: string;
5
+ abbreviation: string;
6
6
  color: PerfilColorType;
7
7
  mail: string;
8
8
  };
@@ -1,4 +1,4 @@
1
- import { Button, RNHostView, VStack } from '@expo/ui/swift-ui';
1
+ import { Button, VStack } from '@expo/ui/swift-ui';
2
2
  import { frame, font, buttonStyle } from '@expo/ui/swift-ui/modifiers';
3
3
  import React, { memo } from 'react';
4
4
  import Gradient from '../../../../../libs/components/Gradient';
@@ -7,9 +7,7 @@ import Section from './Section';
7
7
  export default memo(({ title, subtitle, gradientProps, buttonProps, }) => {
8
8
  const spacing = gradientProps?.type === 'extraLarge' ? 10 : 20;
9
9
  return (<Section spacing={spacing}>
10
- {gradientProps && (<RNHostView matchContents>
11
- <Gradient {...gradientProps}/>
12
- </RNHostView>)}
10
+ {gradientProps && (<Gradient {...gradientProps}/>)}
13
11
 
14
12
  {(title || subtitle) && (subtitle ? (<VStack modifiers={[frame({ alignment: 'center' })]} spacing={2}>
15
13
  <Title title={title}/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.49",
3
+ "version": "1.0.52",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  "build": "node scripts/build.js",
11
11
  "typecheck": "tsc --noEmit",
12
12
  "prepublishOnly": "npm run build",
13
- "release": "npm version patch && npm publish"
13
+ "release": "dev git && npm version patch && npm publish"
14
14
  },
15
15
  "files": [
16
16
  "dist",
@@ -1,3 +0,0 @@
1
- import type Props from './types';
2
- declare const _default: ({ systemName, size }: Props) => import("react").JSX.Element;
3
- export default _default;
@@ -1,6 +0,0 @@
1
- import { Host, Image } from '@expo/ui/swift-ui';
2
- export default ({ systemName, size = 100 }) => {
3
- return (<Host matchContents>
4
- <Image systemName={systemName} color='white' size={size}/>
5
- </Host>);
6
- };