analuizaff
3 years ago
5 changed files with 26173 additions and 111 deletions
-
64src/app/components/forms/CheckBox.js
-
6src/app/navigation/AuthNavigator.js
-
120src/app/screens/RegisterScreen.js
-
10src/app/screens/UserAgreement.js
-
26084src/package-lock.json
@ -0,0 +1,64 @@ |
|||
import React, { useEffect, useState } from "react"; |
|||
import { CheckBox, View, Text } from "react-native"; |
|||
import { useFormikContext } from "formik"; |
|||
import colors from "../../config/colors"; |
|||
import { TouchableOpacity } from "react-native-gesture-handler"; |
|||
import ErrorMessage from "./ErrorMessage"; |
|||
import { dimensions } from "../../config/dimensions"; |
|||
|
|||
const Checkbox = ({ name, children, navigate, ...props }) => { |
|||
const { setFieldValue, errors, touched } = useFormikContext(); |
|||
const [toggleCheckBox, setToggleCheckBox] = useState(false); |
|||
|
|||
useEffect(() => { |
|||
setFieldValue(name, toggleCheckBox, true); |
|||
}, [toggleCheckBox]); |
|||
|
|||
return ( |
|||
<View> |
|||
<View |
|||
style={{ |
|||
flexDirection: "row", |
|||
alignItems: "center", |
|||
}} |
|||
> |
|||
<View width={35}> |
|||
<CheckBox |
|||
value={toggleCheckBox} |
|||
onValueChange={(newValue) => setToggleCheckBox(newValue)} |
|||
type={"checkbox"} |
|||
tintColors={{ true: colors.primary }} |
|||
onCheckColor={colors.primary} |
|||
{...props} |
|||
/> |
|||
</View> |
|||
|
|||
<TouchableOpacity |
|||
onPress={() => { |
|||
setToggleCheckBox(!toggleCheckBox); |
|||
}} |
|||
> |
|||
<Text |
|||
style={{ |
|||
fontSize: dimensions.text.default, |
|||
color: colors.medium, |
|||
}} |
|||
>Li e estou de acordo com os{" "}</Text> |
|||
</TouchableOpacity> |
|||
</View> |
|||
|
|||
<TouchableOpacity onPress={() => navigate()}> |
|||
<Text |
|||
style={{ |
|||
marginLeft: 35, |
|||
color: colors.lightBlue, |
|||
fontSize: dimensions.text.default, |
|||
}} |
|||
>Termos de uso e condições</Text> |
|||
</TouchableOpacity> |
|||
<ErrorMessage error={errors[name]} visible={touched[name]} /> |
|||
</View> |
|||
); |
|||
}; |
|||
|
|||
export default Checkbox; |
@ -0,0 +1,10 @@ |
|||
import React from "react"; |
|||
import { View, Text } from "react-native"; |
|||
|
|||
export default function UserAgreement(props) { |
|||
return ( |
|||
<View> |
|||
<Text>tela Termos de uso</Text> |
|||
</View> |
|||
); |
|||
} |
26084
src/package-lock.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue