From 6d2216ac1c35114c158aeb77afd957a4c47bc985 Mon Sep 17 00:00:00 2001 From: CloudAlb <49292956+CloudAlb@users.noreply.github.com> Date: Mon, 11 Apr 2022 21:20:53 -0300 Subject: [PATCH] =?UTF-8?q?Altera=C3=A7=C3=B5es=20que=20restaram?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/login/Page.tsx | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/src/pages/login/Page.tsx b/src/pages/login/Page.tsx index 29a430e..be05692 100644 --- a/src/pages/login/Page.tsx +++ b/src/pages/login/Page.tsx @@ -1,7 +1,15 @@ -import { IonButtons, IonContent, IonHeader, IonMenuButton, IonPage, IonTitle, IonToolbar } from '@ionic/react'; -import { useParams } from 'react-router'; -import ExploreContainer from '../components/ExploreContainer'; -import './Page.css'; +import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, IonButtons } from '@ionic/react'; +import React, { useState } from 'react'; +import axios from "axios"; +import { IonGrid, IonRow, IonCol } from '@ionic/react'; +import { personCircle } from "ionicons/icons"; +import { useHistory } from "react-router-dom"; +import { IonItem, IonLabel, IonInput, IonButton, IonIcon, IonAlert } from '@ionic/react'; + +function validateEmail(email: string) { + const re = /^((?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]))$/; + return re.test(String(email).toLowerCase()); +} const Page: React.FC = () => { const history = useHistory(); @@ -10,8 +18,6 @@ const Page: React.FC = () => { const [iserror, setIserror] = useState(false); const [message, setMessage] = useState(""); - const { name } = useParams<{ name: string; }>(); - const handleLogin = () => { // validação de inputs if (!email) { @@ -56,10 +62,7 @@ const Page: React.FC = () => { - - - - {name} + Login @@ -79,6 +82,20 @@ const Page: React.FC = () => { + + + setIserror(false)} + cssClass="my-custom-class" + header={"Error!"} + message={message} + buttons={["Dismiss"]} + /> + + + +