Alterações que restaram
This commit is contained in:
@@ -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<boolean>(false);
|
||||
const [message, setMessage] = useState<string>("");
|
||||
|
||||
const { name } = useParams<{ name: string; }>();
|
||||
|
||||
const handleLogin = () => {
|
||||
// validação de inputs
|
||||
if (!email) {
|
||||
@@ -56,10 +62,7 @@ const Page: React.FC = () => {
|
||||
<IonPage>
|
||||
<IonHeader>
|
||||
<IonToolbar>
|
||||
<IonButtons slot="start">
|
||||
<IonMenuButton />
|
||||
</IonButtons>
|
||||
<IonTitle>{name}</IonTitle>
|
||||
<IonTitle>Login</IonTitle>
|
||||
</IonToolbar>
|
||||
</IonHeader>
|
||||
|
||||
@@ -79,6 +82,20 @@ const Page: React.FC = () => {
|
||||
</IonToolbar>
|
||||
</IonHeader>
|
||||
|
||||
<IonRow>
|
||||
<IonCol>
|
||||
<IonAlert
|
||||
isOpen={iserror}
|
||||
onDidDismiss={() => setIserror(false)}
|
||||
cssClass="my-custom-class"
|
||||
header={"Error!"}
|
||||
message={message}
|
||||
buttons={["Dismiss"]}
|
||||
/>
|
||||
</IonCol>
|
||||
</IonRow>
|
||||
|
||||
|
||||
<IonRow>
|
||||
<IonCol>
|
||||
<IonItem>
|
||||
|
||||
Reference in New Issue
Block a user