native-pytech 1.0.57 → 1.0.60
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/dist/libs/components/Gradient/components/Gradient/index.d.ts +1 -1
- package/dist/libs/components/Gradient/components/Gradient/index.ios.d.ts +1 -1
- package/dist/libs/components/Gradient/components/Gradient/index.ios.js +13 -2
- package/dist/libs/components/Gradient/components/Gradient/index.js +1 -1
- package/dist/libs/components/Gradient/components/Gradient/types.d.ts +7 -2
- package/dist/libs/footer/src/components/Button/index.ios.js +10 -2
- package/package.json +1 -1
- package/dist/libs/footer/src/components/Button/index.ios (viejo).d.ts +0 -3
- package/dist/libs/footer/src/components/Button/index.ios (viejo).js +0 -52
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type Props from './types';
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({ text, color, type, systemName, iconSize, }: Props) => React.JSX.Element>;
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ text, color, type, sizeDiameter, systemName, iconSize, }: Props) => React.JSX.Element>;
|
|
4
4
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type Props from './types';
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({ text, color, type, systemName, iconSize, }: Props) => React.JSX.Element>;
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ text, color, type, sizeDiameter, systemName, iconSize, }: Props) => React.JSX.Element>;
|
|
4
4
|
export default _default;
|
|
@@ -2,8 +2,19 @@ import React, { memo, useMemo } from 'react';
|
|
|
2
2
|
import { frame, font, foregroundStyle, background, clipShape } from '@expo/ui/swift-ui/modifiers';
|
|
3
3
|
import { Text, Image } from '@expo/ui/swift-ui';
|
|
4
4
|
import colors, { sizes } from '../../constants';
|
|
5
|
-
export default memo(({ text, color, type = 'small', systemName, iconSize, }) => {
|
|
6
|
-
const typeSizes = useMemo(() =>
|
|
5
|
+
export default memo(({ text, color = 'default', type = 'small', sizeDiameter, systemName, iconSize, }) => {
|
|
6
|
+
const typeSizes = useMemo(() => {
|
|
7
|
+
if (!sizeDiameter)
|
|
8
|
+
return sizes[type];
|
|
9
|
+
return {
|
|
10
|
+
diameter: sizeDiameter,
|
|
11
|
+
fontSize: {
|
|
12
|
+
1: sizeDiameter * 0.53,
|
|
13
|
+
2: sizeDiameter * 0.48,
|
|
14
|
+
3: sizeDiameter * 0.43
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}, [type]);
|
|
7
18
|
const cantLetras = text?.length ?? 0;
|
|
8
19
|
const modifiers = useMemo(() => [
|
|
9
20
|
frame({ width: typeSizes.diameter, height: typeSizes.diameter }),
|
|
@@ -3,7 +3,7 @@ import { StyleSheet, Text } from 'react-native';
|
|
|
3
3
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
4
4
|
import colors, { sizes } from '../../constants';
|
|
5
5
|
import Icon from '../Icon';
|
|
6
|
-
export default memo(({ text, color, type = 'small', systemName, iconSize, }) => {
|
|
6
|
+
export default memo(({ text, color = 'default', type = 'small', sizeDiameter, systemName, iconSize, }) => {
|
|
7
7
|
const typeSizes = useMemo(() => sizes[type], [type]);
|
|
8
8
|
const textComponent = useMemo(() => {
|
|
9
9
|
const cantLetras = text?.length;
|
|
@@ -8,13 +8,18 @@ export type Props = Omit<IconProps, 'size'> & {
|
|
|
8
8
|
text?: string;
|
|
9
9
|
/**
|
|
10
10
|
The color of the gradient.
|
|
11
|
+
@default 'default'
|
|
11
12
|
*/
|
|
12
|
-
color
|
|
13
|
+
color?: keyof typeof colors;
|
|
13
14
|
/**
|
|
14
15
|
The size of the gradient.
|
|
15
16
|
@default 'small'
|
|
16
17
|
*/
|
|
17
|
-
type
|
|
18
|
+
type?: sizesType;
|
|
19
|
+
/**
|
|
20
|
+
The size of the gradient. If "type" is provided, this will be ignored.
|
|
21
|
+
*/
|
|
22
|
+
sizeDiameter?: number;
|
|
18
23
|
/**
|
|
19
24
|
The size of the icon.
|
|
20
25
|
@ios
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button, Text } from '@expo/ui/swift-ui';
|
|
2
2
|
import { frame, font, foregroundStyle, buttonStyle, controlSize, disabled } from '@expo/ui/swift-ui/modifiers';
|
|
3
|
-
import React, { memo, useMemo } from 'react';
|
|
3
|
+
import React, { memo, useCallback, useMemo } from 'react';
|
|
4
4
|
import { useWindowDimensions } from 'react-native';
|
|
5
5
|
export default memo(({ text, onPress, onSubmit, backgroundColorPage, enabled = true, themeColor = 'default' }) => {
|
|
6
6
|
const { width } = useWindowDimensions();
|
|
@@ -14,7 +14,15 @@ export default memo(({ text, onPress, onSubmit, backgroundColorPage, enabled = t
|
|
|
14
14
|
font({ weight: 'semibold' }),
|
|
15
15
|
...(enabled ? [foregroundStyle('#85fffd')] : []), // colors.especiales.celeste
|
|
16
16
|
], [width, enabled]);
|
|
17
|
-
|
|
17
|
+
const _onPress = useCallback(async () => {
|
|
18
|
+
if (onPress) {
|
|
19
|
+
const result = await onPress();
|
|
20
|
+
if (!result)
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
onSubmit?.();
|
|
24
|
+
}, [onPress, onSubmit]);
|
|
25
|
+
return (<Button onPress={_onPress} modifiers={modifiers}>
|
|
18
26
|
<Text modifiers={modifiersText}>
|
|
19
27
|
{text}
|
|
20
28
|
</Text>
|
package/package.json
CHANGED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import colors from '../../constants';
|
|
2
|
-
import { GlassView } from 'expo-glass-effect';
|
|
3
|
-
import { useApp } from "../../../../../libs/providers/App";
|
|
4
|
-
import { memo, useCallback, useMemo, useState } from 'react';
|
|
5
|
-
import { ActivityIndicator, Pressable, StyleSheet } from 'react-native';
|
|
6
|
-
import Utils from '../../../../../libs/constants/utils';
|
|
7
|
-
import Text from './Text';
|
|
8
|
-
export default memo(({ text, onPress, onSubmit, backgroundColorPage, enabled = true, themeColor = 'default' }) => {
|
|
9
|
-
const { colorScheme } = useApp();
|
|
10
|
-
const Theme = colors.theme[colorScheme];
|
|
11
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
12
|
-
const _onPress = useCallback(async () => {
|
|
13
|
-
if (isLoading)
|
|
14
|
-
return;
|
|
15
|
-
if (onPress) {
|
|
16
|
-
setIsLoading(true);
|
|
17
|
-
const result = await onPress();
|
|
18
|
-
setIsLoading(false);
|
|
19
|
-
if (!result)
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
onSubmit?.();
|
|
23
|
-
}, [onPress, onSubmit]);
|
|
24
|
-
const backgroundColor = useCallback((pressed) => {
|
|
25
|
-
return enabled ?
|
|
26
|
-
(themeColor === 'default' ? Utils.adjustLightness(colors.especiales.azul, -10) : undefined)
|
|
27
|
-
: Theme.colorButtonFooterDisabled;
|
|
28
|
-
}, [enabled, themeColor]);
|
|
29
|
-
const color = useMemo(() => themeColor === 'default' ? colors.especiales.celeste : Theme.text2, [themeColor]);
|
|
30
|
-
return (<Pressable disabled={!enabled} onPress={_onPress} style={{ width: '100%' }}>
|
|
31
|
-
<GlassView glassEffectStyle={themeColor === 'default' ? "clear" : "regular"} isInteractive={enabled} style={[
|
|
32
|
-
styles.button,
|
|
33
|
-
{ backgroundColor: backgroundColor(true) }
|
|
34
|
-
]}>
|
|
35
|
-
{!isLoading ? (<Text text={text} enabled={enabled} themeColor={themeColor}/>) : (<ActivityIndicator size='small' style={{ margin: 'auto' }} color={color}/>)}
|
|
36
|
-
</GlassView>
|
|
37
|
-
</Pressable>);
|
|
38
|
-
});
|
|
39
|
-
const styles = StyleSheet.create({
|
|
40
|
-
button: {
|
|
41
|
-
borderRadius: 99,
|
|
42
|
-
paddingHorizontal: 20,
|
|
43
|
-
paddingVertical: 15.5,
|
|
44
|
-
alignItems: 'center',
|
|
45
|
-
justifyContent: 'center',
|
|
46
|
-
width: '100%',
|
|
47
|
-
},
|
|
48
|
-
text: {
|
|
49
|
-
fontSize: 17,
|
|
50
|
-
fontWeight: '600',
|
|
51
|
-
}
|
|
52
|
-
});
|