Browse Source

Enabling phone number form string to be editable or not

master
GabrielTrettel 3 years ago
parent
commit
67b3c9d5aa
  1. 10
      src/app/components/forms/PhoneNumberFormField.js

10
src/app/components/forms/PhoneNumberFormField.js

@ -1,13 +1,9 @@
import React, { useState, useEffect } from "react";
import React from "react";
import { useFormikContext } from "formik"; import { useFormikContext } from "formik";
import { unMask, mask } from "react-native-mask-text"; import { unMask, mask } from "react-native-mask-text";
import TextInput from "../TextInput"; import TextInput from "../TextInput";
import ErrorMessage from "./ErrorMessage"; import ErrorMessage from "./ErrorMessage";
import { View, Text, StyleSheet } from "react-native";
import { TouchableOpacity } from "react-native-gesture-handler";
import colors from "../../config/colors";
import defaultStyles from "../../config/styles";
// import { MaskedTextInput } from "react-native-mask-text";
import { View } from "react-native";
function PhoneNumberFormField({ function PhoneNumberFormField({
name, name,
@ -16,6 +12,7 @@ function PhoneNumberFormField({
placeholder = "", placeholder = "",
paddingLeft = 16, paddingLeft = 16,
paddingRight = 16, paddingRight = 16,
editable = true,
}) { }) {
const { const {
values, values,
@ -37,6 +34,7 @@ function PhoneNumberFormField({
}} }}
> >
<TextInput <TextInput
editable={editable}
height={48} height={48}
onBlur={() => setFieldTouched(name)} onBlur={() => setFieldTouched(name)}
onChangeText={(val) => { onChangeText={(val) => {

Loading…
Cancel
Save