native-pytech 1.0.1
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/LICENSE +21 -0
- package/README.md +30 -0
- package/dist/app/assets/components/removeCircle.d.ts +2 -0
- package/dist/app/assets/components/removeCircle.js +2 -0
- package/dist/app/assets/components/reorderThreeOutline.d.ts +2 -0
- package/dist/app/assets/components/reorderThreeOutline.js +2 -0
- package/dist/app/assets/ionicons.d.ts +2 -0
- package/dist/app/assets/ionicons.js +2 -0
- package/dist/app/components/closeButton.d.ts +2 -0
- package/dist/app/components/closeButton.js +2 -0
- package/dist/app/components/gradient.d.ts +2 -0
- package/dist/app/components/gradient.js +2 -0
- package/dist/app/components/link.d.ts +2 -0
- package/dist/app/components/link.js +2 -0
- package/dist/app/components/text.d.ts +2 -0
- package/dist/app/components/text.js +2 -0
- package/dist/app/components/theme.d.ts +2 -0
- package/dist/app/components/theme.js +2 -0
- package/dist/app/constants/colors.d.ts +2 -0
- package/dist/app/constants/colors.js +2 -0
- package/dist/app/constants/consts.d.ts +1 -0
- package/dist/app/constants/consts.js +1 -0
- package/dist/app/constants/handleFontObserver.d.ts +2 -0
- package/dist/app/constants/handleFontObserver.js +2 -0
- package/dist/app/constants/hooks.d.ts +1 -0
- package/dist/app/constants/hooks.js +1 -0
- package/dist/app/constants/utils.d.ts +1 -0
- package/dist/app/constants/utils.js +1 -0
- package/dist/app/footer.d.ts +2 -0
- package/dist/app/footer.js +2 -0
- package/dist/app/login.d.ts +2 -0
- package/dist/app/login.js +2 -0
- package/dist/app/page.d.ts +2 -0
- package/dist/app/page.js +2 -0
- package/dist/app/providers/app.d.ts +2 -0
- package/dist/app/providers/app.js +2 -0
- package/dist/app/segmentedControl.d.ts +2 -0
- package/dist/app/segmentedControl.js +2 -0
- package/dist/app/sql.d.ts +2 -0
- package/dist/app/sql.js +2 -0
- package/dist/app/supabase.d.ts +2 -0
- package/dist/app/supabase.js +2 -0
- package/dist/app/swiftui.d.ts +1 -0
- package/dist/app/swiftui.js +1 -0
- package/dist/app/table.d.ts +2 -0
- package/dist/app/table.js +2 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/libs/assets/components/RemoveCircle.d.ts +6 -0
- package/dist/libs/assets/components/RemoveCircle.js +25 -0
- package/dist/libs/assets/components/ReorderThreeOutline.d.ts +5 -0
- package/dist/libs/assets/components/ReorderThreeOutline.js +15 -0
- package/dist/libs/assets/images/android-icon-background-nuevo.png +0 -0
- package/dist/libs/assets/images/android-icon-background.png +0 -0
- package/dist/libs/assets/images/android-icon-foreground-nuevo.png +0 -0
- package/dist/libs/assets/images/android-icon-foreground-nuevo2.png +0 -0
- package/dist/libs/assets/images/android-icon-foreground.png +0 -0
- package/dist/libs/assets/images/android-icon-monochrome.png +0 -0
- package/dist/libs/assets/images/arrow.png +0 -0
- package/dist/libs/assets/images/check.svg +1 -0
- package/dist/libs/assets/images/favicon.ico +0 -0
- package/dist/libs/assets/images/favicon.png +0 -0
- package/dist/libs/assets/images/flecha-hacia-abajo.png +0 -0
- package/dist/libs/assets/images/icon-viejo.png +0 -0
- package/dist/libs/assets/images/icon.png +0 -0
- package/dist/libs/assets/images/icono_tango.svg +1 -0
- package/dist/libs/assets/images/incoming-call.png +0 -0
- package/dist/libs/assets/images/incoming.png +0 -0
- package/dist/libs/assets/images/login.png +0 -0
- package/dist/libs/assets/images/login_apple.svg +28 -0
- package/dist/libs/assets/images/login_letras.svg +41 -0
- package/dist/libs/assets/images/login_letras_dark.svg +41 -0
- package/dist/libs/assets/images/login_sol.svg +59 -0
- package/dist/libs/assets/images/login_transparente.png +0 -0
- package/dist/libs/assets/images/logo_letras.svg +29 -0
- package/dist/libs/assets/images/logo_letras_dark.svg +29 -0
- package/dist/libs/assets/images/partial-react-logo.png +0 -0
- package/dist/libs/assets/images/pencil.png +0 -0
- package/dist/libs/assets/images/react-logo.png +0 -0
- package/dist/libs/assets/images/react-logo@2x.png +0 -0
- package/dist/libs/assets/images/react-logo@3x.png +0 -0
- package/dist/libs/assets/images/remove-circle.svg +4 -0
- package/dist/libs/assets/images/splash-icon.png +0 -0
- package/dist/libs/assets/images/test.svg +22 -0
- package/dist/libs/assets/ionicons/Ionicons.d.ts +35 -0
- package/dist/libs/assets/ionicons/Ionicons.js +16 -0
- package/dist/libs/assets/ionicons/index.d.ts +6 -0
- package/dist/libs/assets/ionicons/index.js +23 -0
- package/dist/libs/components/CloseButton.d.ts +9 -0
- package/dist/libs/components/CloseButton.js +19 -0
- package/dist/libs/components/Gradient/constants.d.ts +80 -0
- package/dist/libs/components/Gradient/constants.js +34 -0
- package/dist/libs/components/Gradient/index.d.ts +21 -0
- package/dist/libs/components/Gradient/index.js +33 -0
- package/dist/libs/components/Link.d.ts +13 -0
- package/dist/libs/components/Link.js +20 -0
- package/dist/libs/components/Text.d.ts +6 -0
- package/dist/libs/components/Text.js +11 -0
- package/dist/libs/components/Theme.d.ts +9 -0
- package/dist/libs/components/Theme.js +10 -0
- package/dist/libs/constants/colors.d.ts +218 -0
- package/dist/libs/constants/colors.js +170 -0
- package/dist/libs/constants/consts.d.ts +13 -0
- package/dist/libs/constants/consts.js +23 -0
- package/dist/libs/constants/handleFontObserver.d.ts +2 -0
- package/dist/libs/constants/handleFontObserver.js +18 -0
- package/dist/libs/constants/hooks.d.ts +5 -0
- package/dist/libs/constants/hooks.js +50 -0
- package/dist/libs/constants/utils.d.ts +10 -0
- package/dist/libs/constants/utils.js +69 -0
- package/dist/libs/footer/index.d.ts +1 -0
- package/dist/libs/footer/index.js +1 -0
- package/dist/libs/footer/src/Background/index.d.ts +4 -0
- package/dist/libs/footer/src/Background/index.ios.d.ts +4 -0
- package/dist/libs/footer/src/Background/index.ios.js +22 -0
- package/dist/libs/footer/src/Background/index.js +21 -0
- package/dist/libs/footer/src/Button/Text.d.ts +3 -0
- package/dist/libs/footer/src/Button/Text.js +18 -0
- package/dist/libs/footer/src/Button/index.d.ts +3 -0
- package/dist/libs/footer/src/Button/index.ios.d.ts +3 -0
- package/dist/libs/footer/src/Button/index.ios.js +52 -0
- package/dist/libs/footer/src/Button/index.js +55 -0
- package/dist/libs/footer/src/Button/types.d.ts +20 -0
- package/dist/libs/footer/src/Button/types.js +1 -0
- package/dist/libs/footer/src/constants.d.ts +20 -0
- package/dist/libs/footer/src/constants.js +21 -0
- package/dist/libs/footer/src/index.d.ts +3 -0
- package/dist/libs/footer/src/index.js +40 -0
- package/dist/libs/footer/src/types.d.ts +9 -0
- package/dist/libs/footer/src/types.js +1 -0
- package/dist/libs/login/index.d.ts +3 -0
- package/dist/libs/login/index.js +3 -0
- package/dist/libs/login/src/Pages/Home/index.d.ts +3 -0
- package/dist/libs/login/src/Pages/Home/index.js +20 -0
- package/dist/libs/login/src/Pages/Home/types.d.ts +19 -0
- package/dist/libs/login/src/Pages/Home/types.js +1 -0
- package/dist/libs/login/src/Pages/Perfil.d.ts +5 -0
- package/dist/libs/login/src/Pages/Perfil.js +19 -0
- package/dist/libs/login/src/Pages/SignIn/Form/Input.d.ts +9 -0
- package/dist/libs/login/src/Pages/SignIn/Form/Input.js +10 -0
- package/dist/libs/login/src/Pages/SignIn/Form/index.d.ts +6 -0
- package/dist/libs/login/src/Pages/SignIn/Form/index.js +34 -0
- package/dist/libs/login/src/Pages/SignIn/index.d.ts +3 -0
- package/dist/libs/login/src/Pages/SignIn/index.js +149 -0
- package/dist/libs/login/src/Pages/SignIn/types.d.ts +31 -0
- package/dist/libs/login/src/Pages/SignIn/types.js +1 -0
- package/dist/libs/login/src/Pages/index.d.ts +3 -0
- package/dist/libs/login/src/Pages/index.js +3 -0
- package/dist/libs/login/src/Pages/utils.d.ts +20 -0
- package/dist/libs/login/src/Pages/utils.js +49 -0
- package/dist/libs/login/src/Screen/Container.d.ts +4 -0
- package/dist/libs/login/src/Screen/Container.ios.d.ts +4 -0
- package/dist/libs/login/src/Screen/Container.ios.js +20 -0
- package/dist/libs/login/src/Screen/Container.js +25 -0
- package/dist/libs/login/src/Screen/components/Gradient.d.ts +6 -0
- package/dist/libs/login/src/Screen/components/Gradient.js +23 -0
- package/dist/libs/login/src/Screen/components/Input/index.d.ts +4 -0
- package/dist/libs/login/src/Screen/components/Input/index.js +128 -0
- package/dist/libs/login/src/Screen/components/Input/types.d.ts +46 -0
- package/dist/libs/login/src/Screen/components/Input/types.js +1 -0
- package/dist/libs/login/src/Screen/components/SvgLogoPytech.d.ts +4 -0
- package/dist/libs/login/src/Screen/components/SvgLogoPytech.js +11 -0
- package/dist/libs/login/src/Screen/components/SvgPytech.d.ts +4 -0
- package/dist/libs/login/src/Screen/components/SvgPytech.js +11 -0
- package/dist/libs/login/src/Screen/components/index.d.ts +4 -0
- package/dist/libs/login/src/Screen/components/index.js +4 -0
- package/dist/libs/login/src/Screen/index.d.ts +4 -0
- package/dist/libs/login/src/Screen/index.js +59 -0
- package/dist/libs/login/src/Screen/types.d.ts +14 -0
- package/dist/libs/login/src/Screen/types.js +1 -0
- package/dist/libs/login/src/constants.d.ts +98 -0
- package/dist/libs/login/src/constants.js +48 -0
- package/dist/libs/page/index.d.ts +1 -0
- package/dist/libs/page/index.js +1 -0
- package/dist/libs/page/src/components/Page/index.android.d.ts +4 -0
- package/dist/libs/page/src/components/Page/index.android.js +11 -0
- package/dist/libs/page/src/components/Page/index.d.ts +4 -0
- package/dist/libs/page/src/components/Page/index.js +7 -0
- package/dist/libs/page/src/components/PageWrapper/index.d.ts +6 -0
- package/dist/libs/page/src/components/PageWrapper/index.js +13 -0
- package/dist/libs/page/src/components/PageWrapper/types.d.ts +16 -0
- package/dist/libs/page/src/components/PageWrapper/types.js +1 -0
- package/dist/libs/page/src/components/Subtitle.d.ts +5 -0
- package/dist/libs/page/src/components/Subtitle.js +9 -0
- package/dist/libs/page/src/components/WithIcon/index.d.ts +3 -0
- package/dist/libs/page/src/components/WithIcon/index.js +47 -0
- package/dist/libs/page/src/components/WithIcon/types.d.ts +15 -0
- package/dist/libs/page/src/components/WithIcon/types.js +1 -0
- package/dist/libs/page/src/constants.d.ts +12 -0
- package/dist/libs/page/src/constants.js +12 -0
- package/dist/libs/providers/App/index.d.ts +10 -0
- package/dist/libs/providers/App/index.js +62 -0
- package/dist/libs/providers/App/types.d.ts +35 -0
- package/dist/libs/providers/App/types.js +1 -0
- package/dist/libs/providers/constants.d.ts +10 -0
- package/dist/libs/providers/constants.js +10 -0
- package/dist/libs/segmentedControl/index.d.ts +2 -0
- package/dist/libs/segmentedControl/index.js +2 -0
- package/dist/libs/segmentedControl/src/colors.d.ts +15 -0
- package/dist/libs/segmentedControl/src/colors.js +16 -0
- package/dist/libs/segmentedControl/src/components/AnimatedChip/index.d.ts +4 -0
- package/dist/libs/segmentedControl/src/components/AnimatedChip/index.js +79 -0
- package/dist/libs/segmentedControl/src/components/AnimatedChip/types.d.ts +28 -0
- package/dist/libs/segmentedControl/src/components/AnimatedChip/types.js +1 -0
- package/dist/libs/segmentedControl/src/components/Container/index.d.ts +4 -0
- package/dist/libs/segmentedControl/src/components/Container/index.ios.d.ts +4 -0
- package/dist/libs/segmentedControl/src/components/Container/index.ios.js +15 -0
- package/dist/libs/segmentedControl/src/components/Container/index.js +18 -0
- package/dist/libs/segmentedControl/src/components/Container/types.d.ts +16 -0
- package/dist/libs/segmentedControl/src/components/Container/types.js +1 -0
- package/dist/libs/segmentedControl/src/components/Item/index.d.ts +4 -0
- package/dist/libs/segmentedControl/src/components/Item/index.js +26 -0
- package/dist/libs/segmentedControl/src/components/Item/types.d.ts +20 -0
- package/dist/libs/segmentedControl/src/components/Item/types.js +1 -0
- package/dist/libs/segmentedControl/src/components/Segmented/index.d.ts +4 -0
- package/dist/libs/segmentedControl/src/components/Segmented/index.js +93 -0
- package/dist/libs/segmentedControl/src/components/Segmented/types.d.ts +12 -0
- package/dist/libs/segmentedControl/src/components/Segmented/types.js +1 -0
- package/dist/libs/segmentedControl/src/components/Wrapper/index.d.ts +4 -0
- package/dist/libs/segmentedControl/src/components/Wrapper/index.js +21 -0
- package/dist/libs/segmentedControl/src/components/Wrapper/types.d.ts +38 -0
- package/dist/libs/segmentedControl/src/components/Wrapper/types.js +1 -0
- package/dist/libs/segmentedControl/src/context/shared.d.ts +11 -0
- package/dist/libs/segmentedControl/src/context/shared.js +13 -0
- package/dist/libs/segmentedControl/src/utils.d.ts +10 -0
- package/dist/libs/segmentedControl/src/utils.js +29 -0
- package/dist/libs/sql/index.d.ts +4 -0
- package/dist/libs/sql/index.js +4 -0
- package/dist/libs/sql/src/init.d.ts +24 -0
- package/dist/libs/sql/src/init.js +31 -0
- package/dist/libs/sql/src/queryLocal.d.ts +6 -0
- package/dist/libs/sql/src/queryLocal.js +15 -0
- package/dist/libs/sql/src/utils.d.ts +11 -0
- package/dist/libs/sql/src/utils.js +56 -0
- package/dist/libs/supabase/index.d.ts +4 -0
- package/dist/libs/supabase/index.js +2 -0
- package/dist/libs/supabase/src/clients/admin/config.d.ts +2 -0
- package/dist/libs/supabase/src/clients/admin/config.js +18 -0
- package/dist/libs/supabase/src/clients/admin/index.d.ts +8 -0
- package/dist/libs/supabase/src/clients/admin/index.js +7 -0
- package/dist/libs/supabase/src/clients/admin/utils.d.ts +4 -0
- package/dist/libs/supabase/src/clients/admin/utils.js +5 -0
- package/dist/libs/supabase/src/clients/app/config.d.ts +3 -0
- package/dist/libs/supabase/src/clients/app/config.js +30 -0
- package/dist/libs/supabase/src/clients/app/index.d.ts +15 -0
- package/dist/libs/supabase/src/clients/app/index.js +7 -0
- package/dist/libs/supabase/src/clients/app/utils.d.ts +11 -0
- package/dist/libs/supabase/src/clients/app/utils.js +9 -0
- package/dist/libs/supabase/src/utils/index.d.ts +18 -0
- package/dist/libs/supabase/src/utils/index.js +21 -0
- package/dist/libs/supabase/src/utils/types.d.ts +20 -0
- package/dist/libs/supabase/src/utils/types.js +1 -0
- package/dist/libs/swiftui/index.d.ts +7 -0
- package/dist/libs/swiftui/index.js +7 -0
- package/dist/libs/swiftui/src/Icon.d.ts +10 -0
- package/dist/libs/swiftui/src/Icon.js +8 -0
- package/dist/libs/swiftui/src/IconSection/Icon.d.ts +27 -0
- package/dist/libs/swiftui/src/IconSection/Icon.js +31 -0
- package/dist/libs/swiftui/src/IconSection/Section.d.ts +7 -0
- package/dist/libs/swiftui/src/IconSection/Section.js +16 -0
- package/dist/libs/swiftui/src/IconSection/index.d.ts +7 -0
- package/dist/libs/swiftui/src/IconSection/index.js +5 -0
- package/dist/libs/swiftui/src/List/Editable/index.d.ts +5 -0
- package/dist/libs/swiftui/src/List/Editable/index.js +51 -0
- package/dist/libs/swiftui/src/List/Editable/types.d.ts +76 -0
- package/dist/libs/swiftui/src/List/Editable/types.js +1 -0
- package/dist/libs/swiftui/src/List/index.d.ts +16 -0
- package/dist/libs/swiftui/src/List/index.js +21 -0
- package/dist/libs/swiftui/src/NavigationLink/Trailing.d.ts +4 -0
- package/dist/libs/swiftui/src/NavigationLink/Trailing.js +14 -0
- package/dist/libs/swiftui/src/NavigationLink/index.d.ts +4 -0
- package/dist/libs/swiftui/src/NavigationLink/index.js +20 -0
- package/dist/libs/swiftui/src/NavigationLink/types.d.ts +27 -0
- package/dist/libs/swiftui/src/NavigationLink/types.js +1 -0
- package/dist/libs/swiftui/src/Picker.d.ts +11 -0
- package/dist/libs/swiftui/src/Picker.js +11 -0
- package/dist/libs/swiftui/src/Text.d.ts +6 -0
- package/dist/libs/swiftui/src/Text.js +7 -0
- package/dist/libs/swiftui/src/TextSubtitle.d.ts +22 -0
- package/dist/libs/swiftui/src/TextSubtitle.js +9 -0
- package/dist/libs/table/index.d.ts +5 -0
- package/dist/libs/table/index.js +5 -0
- package/dist/libs/table/src/components/Borders.d.ts +6 -0
- package/dist/libs/table/src/components/Borders.js +83 -0
- package/dist/libs/table/src/components/Delete/index.d.ts +4 -0
- package/dist/libs/table/src/components/Delete/index.js +141 -0
- package/dist/libs/table/src/components/Delete/types.d.ts +27 -0
- package/dist/libs/table/src/components/Delete/types.js +1 -0
- package/dist/libs/table/src/components/Detail.d.ts +4 -0
- package/dist/libs/table/src/components/Detail.js +11 -0
- package/dist/libs/table/src/components/Option/index.d.ts +6 -0
- package/dist/libs/table/src/components/Option/index.js +106 -0
- package/dist/libs/table/src/components/Option/types.d.ts +61 -0
- package/dist/libs/table/src/components/Option/types.js +1 -0
- package/dist/libs/table/src/components/OptionComponents/deleteIcon.d.ts +6 -0
- package/dist/libs/table/src/components/OptionComponents/deleteIcon.js +14 -0
- package/dist/libs/table/src/components/OptionComponents/dragIcon.d.ts +6 -0
- package/dist/libs/table/src/components/OptionComponents/dragIcon.js +18 -0
- package/dist/libs/table/src/components/OptionComponents/icon.d.ts +10 -0
- package/dist/libs/table/src/components/OptionComponents/icon.js +12 -0
- package/dist/libs/table/src/components/OptionComponents/image.d.ts +9 -0
- package/dist/libs/table/src/components/OptionComponents/image.js +12 -0
- package/dist/libs/table/src/components/OptionComponents/index.d.ts +8 -0
- package/dist/libs/table/src/components/OptionComponents/index.js +8 -0
- package/dist/libs/table/src/components/OptionComponents/text.d.ts +16 -0
- package/dist/libs/table/src/components/OptionComponents/text.js +20 -0
- package/dist/libs/table/src/components/OptionComponents/textInput.d.ts +25 -0
- package/dist/libs/table/src/components/OptionComponents/textInput.js +49 -0
- package/dist/libs/table/src/components/OptionComponents/textInputCurrency.d.ts +9 -0
- package/dist/libs/table/src/components/OptionComponents/textInputCurrency.js +17 -0
- package/dist/libs/table/src/components/OptionComponents/textView.d.ts +14 -0
- package/dist/libs/table/src/components/OptionComponents/textView.js +18 -0
- package/dist/libs/table/src/components/OptionWrapper/index.d.ts +3 -0
- package/dist/libs/table/src/components/OptionWrapper/index.js +9 -0
- package/dist/libs/table/src/components/OptionWrapper/types.d.ts +35 -0
- package/dist/libs/table/src/components/OptionWrapper/types.js +1 -0
- package/dist/libs/table/src/components/Table/index.d.ts +3 -0
- package/dist/libs/table/src/components/Table/index.js +90 -0
- package/dist/libs/table/src/components/Table/types.d.ts +70 -0
- package/dist/libs/table/src/components/Table/types.js +1 -0
- package/dist/libs/table/src/components/Wrapper.d.ts +4 -0
- package/dist/libs/table/src/components/Wrapper.js +49 -0
- package/dist/libs/table/src/constants.d.ts +108 -0
- package/dist/libs/table/src/constants.js +107 -0
- package/dist/libs/table/src/context/borders.d.ts +10 -0
- package/dist/libs/table/src/context/borders.js +11 -0
- package/dist/libs/table/src/context/delete.d.ts +1 -0
- package/dist/libs/table/src/context/delete.js +2 -0
- package/dist/libs/table/src/context/table.d.ts +21 -0
- package/dist/libs/table/src/context/table.js +4 -0
- package/package.json +73 -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 { adjustLightness } 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' ? 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
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import colors from '../constants';
|
|
2
|
+
import { useApp } from "../../../../libs/providers/App";
|
|
3
|
+
import { memo, useCallback, useMemo, useState } from 'react';
|
|
4
|
+
import { ActivityIndicator, Pressable, StyleSheet } from 'react-native';
|
|
5
|
+
import { adjustLightness } from '../../../../libs/constants/utils';
|
|
6
|
+
import Text from './Text';
|
|
7
|
+
export default memo(({ text, onPress, onSubmit, backgroundColorPage, enabled = true, themeColor = 'default' }) => {
|
|
8
|
+
const { colorScheme } = useApp();
|
|
9
|
+
const Theme = colors.theme[colorScheme];
|
|
10
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
11
|
+
const backgroundColor = useCallback((pressed) => {
|
|
12
|
+
return enabled ? (pressed ?
|
|
13
|
+
themeColor === 'default' ?
|
|
14
|
+
colors.especiales.azul_pressed :
|
|
15
|
+
colorScheme === 'dark' ? adjustLightness(backgroundColorPage, 10) : backgroundColorPage
|
|
16
|
+
: themeColor === 'default' ?
|
|
17
|
+
adjustLightness(colors.especiales.azul, -10) :
|
|
18
|
+
colorScheme === 'dark' ? backgroundColorPage : adjustLightness(backgroundColorPage, -1))
|
|
19
|
+
: Theme.colorButtonFooterDisabled;
|
|
20
|
+
}, [enabled, themeColor, backgroundColorPage, colorScheme]);
|
|
21
|
+
const _onPress = useCallback(async () => {
|
|
22
|
+
if (isLoading)
|
|
23
|
+
return;
|
|
24
|
+
if (onPress) {
|
|
25
|
+
setIsLoading(true);
|
|
26
|
+
const result = await onPress();
|
|
27
|
+
setIsLoading(false);
|
|
28
|
+
if (!result)
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
onSubmit?.();
|
|
32
|
+
}, [onPress, onSubmit]);
|
|
33
|
+
const color = useMemo(() => themeColor === 'default' ? colors.especiales.celeste : Theme.text2, [themeColor]);
|
|
34
|
+
return (<Pressable disabled={!enabled} onPress={_onPress} style={({ pressed }) => [
|
|
35
|
+
styles.button,
|
|
36
|
+
{
|
|
37
|
+
backgroundColor: backgroundColor(pressed),
|
|
38
|
+
borderColor: backgroundColor(true)
|
|
39
|
+
}
|
|
40
|
+
]}>
|
|
41
|
+
{!isLoading ? (<Text text={text} enabled={enabled} themeColor={themeColor}/>) : (<ActivityIndicator size='small' style={{ margin: 'auto' }} color={color}/>)}
|
|
42
|
+
</Pressable>);
|
|
43
|
+
});
|
|
44
|
+
const styles = StyleSheet.create({
|
|
45
|
+
button: {
|
|
46
|
+
borderRadius: 99,
|
|
47
|
+
paddingHorizontal: 20,
|
|
48
|
+
paddingVertical: 15.5,
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
justifyContent: 'center',
|
|
51
|
+
width: '100%',
|
|
52
|
+
borderWidth: 1,
|
|
53
|
+
boxShadow: '0 0 40px 0 rgba(0, 0, 0, 0.1)',
|
|
54
|
+
}
|
|
55
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type TextProps = {
|
|
2
|
+
text: string;
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
themeColor?: 'default' | 'special';
|
|
5
|
+
};
|
|
6
|
+
export type Props = {
|
|
7
|
+
/**
|
|
8
|
+
Función que se ejecuta cuando se presiona el botón.
|
|
9
|
+
Devuelve true/false si se debe continuar con la acción.
|
|
10
|
+
*/
|
|
11
|
+
onPress?: () => boolean | Promise<boolean>;
|
|
12
|
+
/**
|
|
13
|
+
Función que se ejecuta cuando hubo onPress exitoso.
|
|
14
|
+
*/
|
|
15
|
+
onSubmit?: () => void;
|
|
16
|
+
/**
|
|
17
|
+
Color de fondo de la página.
|
|
18
|
+
*/
|
|
19
|
+
backgroundColorPage: string;
|
|
20
|
+
} & TextProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const colors: {
|
|
2
|
+
theme: {
|
|
3
|
+
light: {
|
|
4
|
+
text2: string;
|
|
5
|
+
colorButtonFooterDisabled: string;
|
|
6
|
+
colorTextButtonFooterDisabled: string;
|
|
7
|
+
};
|
|
8
|
+
dark: {
|
|
9
|
+
text2: string;
|
|
10
|
+
colorButtonFooterDisabled: string;
|
|
11
|
+
colorTextButtonFooterDisabled: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
especiales: {
|
|
15
|
+
azul: string;
|
|
16
|
+
celeste: string;
|
|
17
|
+
azul_pressed: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default colors;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import colorsLib from "../../../libs/constants/colors";
|
|
2
|
+
const colors = {
|
|
3
|
+
theme: {
|
|
4
|
+
light: {
|
|
5
|
+
text2: colorsLib.light.text2Libretas,
|
|
6
|
+
colorButtonFooterDisabled: 'hsl(0, 0%, 80%)',
|
|
7
|
+
colorTextButtonFooterDisabled: 'hsl(240, 1%, 62%)',
|
|
8
|
+
},
|
|
9
|
+
dark: {
|
|
10
|
+
text2: colorsLib.dark.text2Libretas,
|
|
11
|
+
colorButtonFooterDisabled: 'hsl(240, 2%, 26%)',
|
|
12
|
+
colorTextButtonFooterDisabled: 'hsl(240, 1%, 50%)',
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
especiales: {
|
|
16
|
+
azul: colorsLib.especiales.azul,
|
|
17
|
+
celeste: colorsLib.especiales.celeste,
|
|
18
|
+
azul_pressed: colorsLib.especiales.azul_pressed
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export default colors;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { View, StyleSheet } from 'react-native';
|
|
2
|
+
import MaskedView from '@react-native-masked-view/masked-view';
|
|
3
|
+
import { BlurView } from 'expo-blur';
|
|
4
|
+
import { LinearGradient } from 'expo-linear-gradient';
|
|
5
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
+
import { memo } from 'react';
|
|
7
|
+
import Background from './Background';
|
|
8
|
+
import Button from './Button';
|
|
9
|
+
const Footer = memo(({ children, backgroundColorPage }) => {
|
|
10
|
+
const insets = useSafeAreaInsets();
|
|
11
|
+
return (<View style={styles.footer}>
|
|
12
|
+
<MaskedView style={[StyleSheet.absoluteFillObject]} maskElement={<LinearGradient colors={['transparent', 'transparent', 'rgba(0, 0, 0, 0.8)', 'black', 'black']} locations={[0, 0.05, 0.2, 0.5, 1]} style={StyleSheet.absoluteFillObject}/>}>
|
|
13
|
+
<BlurView intensity={6} tint='dark' style={StyleSheet.absoluteFillObject}/>
|
|
14
|
+
</MaskedView>
|
|
15
|
+
|
|
16
|
+
<Background backgroundColorPage={backgroundColorPage}/>
|
|
17
|
+
|
|
18
|
+
<View style={[styles.view, { paddingBottom: insets.bottom + 5 }]}>
|
|
19
|
+
{children}
|
|
20
|
+
</View>
|
|
21
|
+
|
|
22
|
+
</View>);
|
|
23
|
+
});
|
|
24
|
+
Footer.Button = Button;
|
|
25
|
+
export default Footer;
|
|
26
|
+
const styles = StyleSheet.create({
|
|
27
|
+
footer: {
|
|
28
|
+
position: 'absolute',
|
|
29
|
+
bottom: 0,
|
|
30
|
+
width: '100%',
|
|
31
|
+
},
|
|
32
|
+
view: {
|
|
33
|
+
position: 'relative',
|
|
34
|
+
paddingHorizontal: 17 * 2,
|
|
35
|
+
paddingTop: 70,
|
|
36
|
+
justifyContent: 'center',
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
gap: 10,
|
|
39
|
+
}
|
|
40
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useRouter } from 'expo-router';
|
|
2
|
+
import { memo, useEffect } from 'react';
|
|
3
|
+
import supabase from '../../../../../libs/supabase';
|
|
4
|
+
import Screen from '../../Screen';
|
|
5
|
+
import { handleSubmitLogIn } from '../utils';
|
|
6
|
+
import Link from '../../../../../libs/components/Link';
|
|
7
|
+
export default memo(({ title = 'MiApp', subtitle = 'Inicia sesión con un correo electrónico o nombre de usuario para usar la aplicación.', iconPage = <Screen.SvgPytech />, textCreateAccount, enableCreateAccount = false, }) => {
|
|
8
|
+
const router = useRouter();
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
(async () => {
|
|
11
|
+
const { error } = await supabase.logIn();
|
|
12
|
+
if (!error)
|
|
13
|
+
console.log('LogIn exitoso');
|
|
14
|
+
})();
|
|
15
|
+
}, []);
|
|
16
|
+
return (<Screen iconPage={iconPage} title={title} subtitle={subtitle} bottomElements={<>
|
|
17
|
+
<Screen.Input placeholder='Correo o nombre de usuario' keyboardType='email-address' autoComplete='email' handleSubmit={async ({ value }) => await handleSubmitLogIn({ username: value, router })}/>
|
|
18
|
+
{enableCreateAccount && (<Link text={textCreateAccount || `Crear tu cuenta de ${title}`} onPress={({ router }) => router.push({ pathname: '/login/inicio/signIn' })}/>)}
|
|
19
|
+
</>}/>);
|
|
20
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Props as ScreenProps } from "../../Screen";
|
|
2
|
+
type Props = Omit<ScreenProps, 'inputElement' | 'subtitle'> & {
|
|
3
|
+
/**
|
|
4
|
+
Texto que aparece como subtítulo en la página.
|
|
5
|
+
@default "Inicia sesión con un correo electrónico o nombre de usuario para usar la aplicación."
|
|
6
|
+
*/
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
/**
|
|
9
|
+
Texto que aparece como enlace para crear una cuenta.
|
|
10
|
+
@default "Crear tu cuenta de ${title}"
|
|
11
|
+
*/
|
|
12
|
+
textCreateAccount?: string;
|
|
13
|
+
/**
|
|
14
|
+
Indica si se debe mostrar el botón para crear una cuenta.
|
|
15
|
+
@default false
|
|
16
|
+
*/
|
|
17
|
+
enableCreateAccount?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export default Props;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useLocalSearchParams, useRouter } from 'expo-router';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import Screen from '../Screen';
|
|
5
|
+
import { getAbbreviatedName, handleSubmitLogInPerfil } from './utils';
|
|
6
|
+
export default memo(({ routeOnSuccess, onSuccess }) => {
|
|
7
|
+
const { user_id, mail, first_name, second_name, last_name, color } = useLocalSearchParams();
|
|
8
|
+
const router = useRouter();
|
|
9
|
+
const handleSubmit = async ({ value }) => {
|
|
10
|
+
const { succeded, message } = await handleSubmitLogInPerfil({ mail, password: value });
|
|
11
|
+
if (succeded) {
|
|
12
|
+
await onSuccess?.();
|
|
13
|
+
if (routeOnSuccess)
|
|
14
|
+
router.replace(routeOnSuccess);
|
|
15
|
+
}
|
|
16
|
+
return { succeded, message };
|
|
17
|
+
};
|
|
18
|
+
return (<Screen iconPage={<Screen.Gradient text={getAbbreviatedName({ first_name, last_name, mail })} 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
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Observable } from "@legendapp/state";
|
|
2
|
+
import Screen from "../../../Screen";
|
|
3
|
+
import { Store } from "../types";
|
|
4
|
+
type Props = {
|
|
5
|
+
store: Observable<Store>;
|
|
6
|
+
fieldName: keyof Store['fields'];
|
|
7
|
+
} & Omit<React.ComponentProps<typeof Screen.Input>, 'onFocus' | 'onChangeText' | 'messageError'>;
|
|
8
|
+
declare const _default: import("react").MemoExoticComponent<({ store, fieldName, ...props }: Props) => import("react").JSX.Element>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useValue } from "@legendapp/state/react";
|
|
2
|
+
import { memo, useRef } from "react";
|
|
3
|
+
import Screen from "../../../Screen";
|
|
4
|
+
export default memo(({ store, fieldName, ...props }) => {
|
|
5
|
+
const textRef = useRef(null);
|
|
6
|
+
const onChangeText = (text) => textRef.current = text;
|
|
7
|
+
const onBlur = () => store.fields[fieldName].value.set(textRef.current || '');
|
|
8
|
+
const messageError = useValue(() => store.fields[fieldName].error.get());
|
|
9
|
+
return (<Screen.Input {...props} onChangeText={onChangeText} onBlur={onBlur} messageError={messageError} styleMessageError={{ textAlign: 'left' }}/>);
|
|
10
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { memo } from "react";
|
|
2
|
+
import { Platform, StyleSheet, View } from "react-native";
|
|
3
|
+
import { useApp } from "../../../../../../libs/providers/App";
|
|
4
|
+
import colors from "../../../constants";
|
|
5
|
+
import Input from "./Input";
|
|
6
|
+
export default memo(({ store }) => {
|
|
7
|
+
const { colorScheme } = useApp();
|
|
8
|
+
const Theme = colors.theme[colorScheme];
|
|
9
|
+
return (<>
|
|
10
|
+
<View style={styles.view}>
|
|
11
|
+
<Input store={store} fieldName="name" placeholder='Nombre' autoComplete='given-name' autoFocus={Platform.OS === 'web'} buttonSend={false} autoCapitalize='words'/>
|
|
12
|
+
<Input store={store} fieldName="lastName" placeholder='Apellidos' autoComplete='family-name' autoFocus={Platform.OS === 'web'} buttonSend={false} autoCapitalize='words'/>
|
|
13
|
+
</View>
|
|
14
|
+
|
|
15
|
+
<View style={[styles.hr, { backgroundColor: Theme.borderColor5 }]}/>
|
|
16
|
+
|
|
17
|
+
<View style={styles.view}>
|
|
18
|
+
<Input store={store} fieldName="email" placeholder='nombre@example.com' autoComplete='email' autoFocus={Platform.OS === 'web'} buttonSend={false}/>
|
|
19
|
+
<Input store={store} fieldName="newPassword" placeholder='Contraseña' autoComplete='new-password' autoFocus={Platform.OS === 'web'} buttonSend={false} secureTextEntry={true}/>
|
|
20
|
+
<Input store={store} fieldName="confirmPassword" placeholder='Contraseña' autoComplete='new-password' autoFocus={Platform.OS === 'web'} buttonSend={false} secureTextEntry={true}/>
|
|
21
|
+
</View>
|
|
22
|
+
</>);
|
|
23
|
+
});
|
|
24
|
+
const styles = StyleSheet.create({
|
|
25
|
+
view: {
|
|
26
|
+
flex: 1,
|
|
27
|
+
gap: 15,
|
|
28
|
+
display: 'flex',
|
|
29
|
+
},
|
|
30
|
+
hr: {
|
|
31
|
+
height: 1,
|
|
32
|
+
opacity: 0.6,
|
|
33
|
+
}
|
|
34
|
+
});
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
2
|
+
import { useObservable, useValue } from '@legendapp/state/react';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
5
|
+
import { useRouter } from 'expo-router';
|
|
6
|
+
import Link from '../../../../../libs/components/Link';
|
|
7
|
+
import Footer from '../../../../../libs/footer';
|
|
8
|
+
import Page from '../../../../../libs/page';
|
|
9
|
+
import { useApp } from "../../../../../libs/providers/App";
|
|
10
|
+
import supabase from "../../../../../libs/supabase";
|
|
11
|
+
import colors from '../../constants';
|
|
12
|
+
import Screen from '../../Screen';
|
|
13
|
+
import Form from './Form';
|
|
14
|
+
export default memo(({ title = 'Apple', subtitle, iconPage = <Screen.SvgLogoPytech size={40}/> }) => {
|
|
15
|
+
const { colorScheme } = useApp();
|
|
16
|
+
const Theme = colors.theme[colorScheme];
|
|
17
|
+
const router = useRouter();
|
|
18
|
+
const store = useObservable({
|
|
19
|
+
fields: {
|
|
20
|
+
name: {
|
|
21
|
+
value: null,
|
|
22
|
+
error: (() => {
|
|
23
|
+
const value = store.fields.name.value.get();
|
|
24
|
+
if (value === '')
|
|
25
|
+
return 'Ingresa tu nombre.';
|
|
26
|
+
return null;
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
29
|
+
lastName: {
|
|
30
|
+
value: null,
|
|
31
|
+
error: (() => {
|
|
32
|
+
const value = store.fields.lastName.value.get();
|
|
33
|
+
if (value === '')
|
|
34
|
+
return 'Ingresa tus apellidos.';
|
|
35
|
+
return null;
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
email: {
|
|
39
|
+
value: null,
|
|
40
|
+
error: (() => {
|
|
41
|
+
const value = store.fields.email.value.get();
|
|
42
|
+
if (value === null)
|
|
43
|
+
return null;
|
|
44
|
+
const message = 'Ingresa una dirección válida para usarla como tu correo electrónico principal.';
|
|
45
|
+
if (value === '')
|
|
46
|
+
return message;
|
|
47
|
+
if (!value.includes('@'))
|
|
48
|
+
return message;
|
|
49
|
+
if (!value.includes('.'))
|
|
50
|
+
return message;
|
|
51
|
+
return null;
|
|
52
|
+
}),
|
|
53
|
+
},
|
|
54
|
+
newPassword: {
|
|
55
|
+
value: null,
|
|
56
|
+
error: (() => {
|
|
57
|
+
const value = store.fields.newPassword.value.get();
|
|
58
|
+
if (value === null)
|
|
59
|
+
return null;
|
|
60
|
+
if (value.length < 8)
|
|
61
|
+
return 'La contraseña debe tener al menos 8 caracteres';
|
|
62
|
+
return null;
|
|
63
|
+
}),
|
|
64
|
+
},
|
|
65
|
+
confirmPassword: {
|
|
66
|
+
value: null,
|
|
67
|
+
error: (() => {
|
|
68
|
+
const newPassword = store.fields.newPassword.value.get() || '';
|
|
69
|
+
const confirmPassword = store.fields.confirmPassword.value.get();
|
|
70
|
+
if (confirmPassword !== newPassword && confirmPassword !== null)
|
|
71
|
+
return 'Las contraseñas que ingresaste no coinciden';
|
|
72
|
+
return null;
|
|
73
|
+
}),
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
createAccountEnabled: () => {
|
|
77
|
+
const fields = store.fields.get();
|
|
78
|
+
const hasErrors = Object.values(fields).some(field => typeof field.error === 'string');
|
|
79
|
+
const hasValues = Object.values(fields).every(field => field.value !== null);
|
|
80
|
+
return !hasErrors && hasValues;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
const createAccountEnabled = useValue(() => store.createAccountEnabled.get());
|
|
84
|
+
const _subtitle = subtitle || `Solo necesitas una cuenta de ${title} para acceder a todos los servicios de ${title}.\n¿Ya tienes una cuenta de ${title}?`;
|
|
85
|
+
const onPress = async ({ name, lastName, email, password }) => {
|
|
86
|
+
const { data, error } = await supabase.signUp({ email, password });
|
|
87
|
+
console.log('data', data);
|
|
88
|
+
console.log('error', error);
|
|
89
|
+
return !error;
|
|
90
|
+
};
|
|
91
|
+
const onSubmit = () => router.replace('/login/inicio');
|
|
92
|
+
return (<>
|
|
93
|
+
<Page style={{ paddingHorizontal: 40, marginTop: 34, paddingBottom: 200 }}>
|
|
94
|
+
<View style={styles.viewTitle}>
|
|
95
|
+
|
|
96
|
+
{iconPage}
|
|
97
|
+
|
|
98
|
+
<Text style={[styles.title, { color: Theme.text }]} adjustsFontSizeToFit numberOfLines={1} minimumFontScale={0.5}>
|
|
99
|
+
{`Crear tu cuenta de ${title}`}
|
|
100
|
+
</Text>
|
|
101
|
+
|
|
102
|
+
<View style={{ alignItems: 'center', justifyContent: 'center', gap: 1 }}>
|
|
103
|
+
<Text style={[styles.subtitle, { color: Theme.text }]}>{_subtitle}</Text>
|
|
104
|
+
<Link text='Inicia sesión' onPress={({ router }) => router.replace('/login/inicio')} renderItems={({ pressed }) => <Ionicons name="arrow-forward-outline" size={15} color='hsl(207, 100%, 50%)' style={{ transform: [{ rotate: '315deg' }] }}/>} style={{ fontSize: 17 }}/>
|
|
105
|
+
</View>
|
|
106
|
+
</View>
|
|
107
|
+
|
|
108
|
+
<View style={styles.container}>
|
|
109
|
+
<Form store={store}/>
|
|
110
|
+
</View>
|
|
111
|
+
</Page>
|
|
112
|
+
|
|
113
|
+
<Footer backgroundColorPage={Theme.backgroundColorModal2}>
|
|
114
|
+
<Footer.Button text='Crear cuenta' enabled={createAccountEnabled} backgroundColorPage={Theme.backgroundColorModal2} onPress={async () => {
|
|
115
|
+
const fields = store.fields.peek();
|
|
116
|
+
return await onPress({
|
|
117
|
+
name: fields.name.value || '',
|
|
118
|
+
lastName: fields.lastName.value || '',
|
|
119
|
+
email: fields.email.value || '',
|
|
120
|
+
password: fields.newPassword.value || ''
|
|
121
|
+
});
|
|
122
|
+
}} onSubmit={onSubmit}/>
|
|
123
|
+
</Footer>
|
|
124
|
+
</>);
|
|
125
|
+
});
|
|
126
|
+
const styles = StyleSheet.create({
|
|
127
|
+
viewTitle: {
|
|
128
|
+
gap: 13,
|
|
129
|
+
display: 'flex',
|
|
130
|
+
alignItems: 'center',
|
|
131
|
+
justifyContent: 'center',
|
|
132
|
+
marginBottom: 22,
|
|
133
|
+
},
|
|
134
|
+
title: {
|
|
135
|
+
fontSize: 27.5,
|
|
136
|
+
fontWeight: '600',
|
|
137
|
+
textAlign: 'center',
|
|
138
|
+
},
|
|
139
|
+
subtitle: {
|
|
140
|
+
fontSize: 17,
|
|
141
|
+
textAlign: 'center',
|
|
142
|
+
lineHeight: 24,
|
|
143
|
+
},
|
|
144
|
+
container: {
|
|
145
|
+
flex: 1,
|
|
146
|
+
gap: 32,
|
|
147
|
+
display: 'flex',
|
|
148
|
+
},
|
|
149
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
title: string;
|
|
3
|
+
subtitle?: string;
|
|
4
|
+
iconPage?: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export type Store = {
|
|
7
|
+
fields: {
|
|
8
|
+
name: {
|
|
9
|
+
value: string | null;
|
|
10
|
+
error: string | null;
|
|
11
|
+
};
|
|
12
|
+
lastName: {
|
|
13
|
+
value: string | null;
|
|
14
|
+
error: string | null;
|
|
15
|
+
};
|
|
16
|
+
email: {
|
|
17
|
+
value: string | null;
|
|
18
|
+
error: string | null;
|
|
19
|
+
};
|
|
20
|
+
newPassword: {
|
|
21
|
+
value: string | null;
|
|
22
|
+
error: string | null;
|
|
23
|
+
};
|
|
24
|
+
confirmPassword: {
|
|
25
|
+
value: string | null;
|
|
26
|
+
error: string | null;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
createAccountEnabled: boolean;
|
|
30
|
+
};
|
|
31
|
+
export default Props;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Router } from 'expo-router';
|
|
2
|
+
export declare const getAbbreviatedName: ({ first_name, last_name, mail }: {
|
|
3
|
+
first_name?: string;
|
|
4
|
+
last_name?: string;
|
|
5
|
+
mail: string;
|
|
6
|
+
}) => string;
|
|
7
|
+
export declare const handleSubmitLogIn: ({ username, router }: {
|
|
8
|
+
username: string;
|
|
9
|
+
router: Router;
|
|
10
|
+
}) => Promise<{
|
|
11
|
+
succeded: boolean;
|
|
12
|
+
message: string;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const handleSubmitLogInPerfil: ({ mail, password }: {
|
|
15
|
+
mail: string;
|
|
16
|
+
password: string;
|
|
17
|
+
}) => Promise<{
|
|
18
|
+
succeded: boolean;
|
|
19
|
+
message: string;
|
|
20
|
+
}>;
|