native-pytech 1.0.53 → 1.0.54
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/footer/src/components/Button/index.ios (viejo).d.ts +3 -0
- package/dist/libs/footer/src/components/Button/index.ios (viejo).js +52 -0
- package/dist/libs/footer/src/components/Button/index.ios.d.ts +2 -1
- package/dist/libs/footer/src/components/Button/index.ios.js +20 -49
- package/dist/libs/footer/src/components/Footer/index.ios.d.ts +7 -0
- package/dist/libs/footer/src/components/Footer/index.ios.js +7 -0
- package/dist/libs/footer/src/components/{Footer.js → Footer/index.js} +2 -2
- package/package.json +1 -1
- /package/dist/libs/footer/src/components/{Footer.d.ts → Footer/index.d.ts} +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { Props } from './types';
|
|
2
|
-
declare const _default:
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ text, onPress, onSubmit, backgroundColorPage, enabled, themeColor }: Props) => React.JSX.Element>;
|
|
3
4
|
export default _default;
|
|
@@ -1,52 +1,23 @@
|
|
|
1
|
+
import { Button, Text } from '@expo/ui/swift-ui';
|
|
2
|
+
import { frame, font, foregroundStyle, buttonStyle, controlSize, disabled } from '@expo/ui/swift-ui/modifiers';
|
|
3
|
+
import React, { memo, useMemo } from 'react';
|
|
4
|
+
import { useWindowDimensions } from 'react-native';
|
|
1
5
|
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
6
|
export default memo(({ text, onPress, onSubmit, backgroundColorPage, enabled = true, themeColor = 'default' }) => {
|
|
9
|
-
const {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
}
|
|
7
|
+
const { width } = useWindowDimensions();
|
|
8
|
+
const modifiers = useMemo(() => [
|
|
9
|
+
disabled(!enabled),
|
|
10
|
+
buttonStyle('glassProminent'),
|
|
11
|
+
controlSize('large')
|
|
12
|
+
], [enabled]);
|
|
13
|
+
const modifiersText = useMemo(() => [
|
|
14
|
+
frame({ width: width - 110 }),
|
|
15
|
+
font({ weight: 'semibold' }),
|
|
16
|
+
foregroundStyle(colors.especiales.celeste)
|
|
17
|
+
], [width]);
|
|
18
|
+
return (<Button onPress={onSubmit} modifiers={modifiers}>
|
|
19
|
+
<Text modifiers={modifiersText}>
|
|
20
|
+
Siguiente
|
|
21
|
+
</Text>
|
|
22
|
+
</Button>);
|
|
52
23
|
});
|
|
@@ -4,8 +4,8 @@ import { BlurView } from 'expo-blur';
|
|
|
4
4
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
6
|
import { memo } from 'react';
|
|
7
|
-
import Background from '
|
|
8
|
-
import ButtonView from '
|
|
7
|
+
import Background from '../Background';
|
|
8
|
+
import ButtonView from '../View';
|
|
9
9
|
export default memo(({ children, backgroundColorPage }) => {
|
|
10
10
|
const insets = useSafeAreaInsets();
|
|
11
11
|
return (<View style={styles.footer}>
|
package/package.json
CHANGED
|
File without changes
|