diff --git a/src/components/FormInput/FormInput.tsx b/src/components/FormInput/FormInput.tsx index 037376f..260e22b 100644 --- a/src/components/FormInput/FormInput.tsx +++ b/src/components/FormInput/FormInput.tsx @@ -14,7 +14,16 @@ const FormInput = () => { instagram: "", }, validationSchema: Yup.object({ - nome: Yup.string().label("Seu nome completo").required(), + nome: Yup.string() + .required() + .test( + "is-full-name", + "Please enter both your first and last name", + function (value: any) { + const nameArr = value.split(" "); + return nameArr.length >= 2; + } + ), email: Yup.string().email().required(), cpf: Yup.string().required(), nascimento: Yup.string().required(), @@ -35,54 +44,66 @@ const FormInput = () => {
  • - + ); diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 41d6b3b..8df5d33 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -1,11 +1,11 @@ import React from "react"; -import { NavigationBar } from "../components/NavigationBar/NavigationBar"; +import { FormInput } from "../components/FormInput/FormInput"; const Home = () => { //const style = { background: "black" }; return (
    - +
    ); };