Remove all native base dependencies.

This commit is contained in:
Patrick Fic
2021-03-11 11:53:42 -07:00
parent 373f215ffa
commit 59f6605a40
19 changed files with 34349 additions and 7016 deletions

View File

@@ -1,17 +1,7 @@
import { Formik } from "formik";
import {
Button,
Container,
Content,
H1,
Input,
Item,
Label,
Text,
} from "native-base";
import React from "react";
import { useTranslation } from "react-i18next";
import { ActivityIndicator, Image, StyleSheet, View } from "react-native";
import { ActivityIndicator, Image, StyleSheet, View, Text } from "react-native";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import Logo from "../../assets/logo192.png";
@@ -22,6 +12,7 @@ import {
} from "../../redux/user/user.selectors";
import SignInErrorAlertComponent from "../sign-in-error-alert/sign-in-error-alert.component";
import styles from "../styles";
import { TextInput, Button, Subheading } from "react-native-paper";
const mapStateToProps = createStructuredSelector({
currentUser: selectCurrentUser,
@@ -42,52 +33,46 @@ export function SignIn({ emailSignInStart, signingIn }) {
};
return (
<Container>
<Content
scrollEnabled={false}
padder
contentContainerStyle={styles.contentContainer__centered}
style={localStyles.content}
>
<View style={styles.evenlySpacedRow}>
<Image style={localStyles.logo} source={Logo} />
<H1>{t("app.title")}</H1>
</View>
<Formik
initialValues={{ email: "", password: "" }}
onSubmit={formSubmit}
>
{({ handleChange, handleBlur, handleSubmit, values }) => (
<View
scrollEnabled={false}
contentContainerStyle={styles.contentContainer__centered}
style={localStyles.content}
>
<View style={styles.evenlySpacedRow}>
<Image style={localStyles.logo} source={Logo} />
<Text>{t("app.title")}</Text>
</View>
<Formik initialValues={{ email: "", password: "" }} onSubmit={formSubmit}>
{({ handleChange, handleBlur, handleSubmit, values }) => (
<View>
<View>
<Item>
<Label>{t("signin.fields.email")}</Label>
<Input
autoCapitalize="none"
keyboardType="email-address"
onChangeText={handleChange("email")}
onBlur={handleBlur("email")}
value={values.email}
/>
</Item>
<Item>
<Label>{t("signin.fields.password")}</Label>
<Input
secureTextEntry={true}
onChangeText={handleChange("password")}
onBlur={handleBlur("password")}
value={values.password}
/>
</Item>
<SignInErrorAlertComponent />
<Button full onPress={handleSubmit}>
<Text>{t("signin.actions.signin")}</Text>
{signingIn ? <ActivityIndicator size="large" /> : null}
</Button>
<Subheading>{t("signin.fields.email")}</Subheading>
<TextInput
autoCapitalize="none"
keyboardType="email-address"
onChangeText={handleChange("email")}
onBlur={handleBlur("email")}
value={values.email}
/>
</View>
)}
</Formik>
</Content>
</Container>
<View>
<Subheading>{t("signin.fields.password")}</Subheading>
<TextInput
secureTextEntry={true}
onChangeText={handleChange("password")}
onBlur={handleBlur("password")}
value={values.password}
/>
</View>
<SignInErrorAlertComponent />
<Button full onPress={handleSubmit}>
<Text>{t("signin.actions.signin")}</Text>
{signingIn ? <ActivityIndicator size="large" /> : null}
</Button>
</View>
)}
</Formik>
</View>
);
}