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 { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, IonButtons } from '@ionic/react';
|
||||||
import { useParams } from 'react-router';
|
import React, { useState } from 'react';
|
||||||
import ExploreContainer from '../components/ExploreContainer';
|
import axios from "axios";
|
||||||
import './Page.css';
|
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 Page: React.FC = () => {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
@@ -10,8 +18,6 @@ const Page: React.FC = () => {
|
|||||||
const [iserror, setIserror] = useState<boolean>(false);
|
const [iserror, setIserror] = useState<boolean>(false);
|
||||||
const [message, setMessage] = useState<string>("");
|
const [message, setMessage] = useState<string>("");
|
||||||
|
|
||||||
const { name } = useParams<{ name: string; }>();
|
|
||||||
|
|
||||||
const handleLogin = () => {
|
const handleLogin = () => {
|
||||||
// validação de inputs
|
// validação de inputs
|
||||||
if (!email) {
|
if (!email) {
|
||||||
@@ -56,10 +62,7 @@ const Page: React.FC = () => {
|
|||||||
<IonPage>
|
<IonPage>
|
||||||
<IonHeader>
|
<IonHeader>
|
||||||
<IonToolbar>
|
<IonToolbar>
|
||||||
<IonButtons slot="start">
|
<IonTitle>Login</IonTitle>
|
||||||
<IonMenuButton />
|
|
||||||
</IonButtons>
|
|
||||||
<IonTitle>{name}</IonTitle>
|
|
||||||
</IonToolbar>
|
</IonToolbar>
|
||||||
</IonHeader>
|
</IonHeader>
|
||||||
|
|
||||||
@@ -79,6 +82,20 @@ const Page: React.FC = () => {
|
|||||||
</IonToolbar>
|
</IonToolbar>
|
||||||
</IonHeader>
|
</IonHeader>
|
||||||
|
|
||||||
|
<IonRow>
|
||||||
|
<IonCol>
|
||||||
|
<IonAlert
|
||||||
|
isOpen={iserror}
|
||||||
|
onDidDismiss={() => setIserror(false)}
|
||||||
|
cssClass="my-custom-class"
|
||||||
|
header={"Error!"}
|
||||||
|
message={message}
|
||||||
|
buttons={["Dismiss"]}
|
||||||
|
/>
|
||||||
|
</IonCol>
|
||||||
|
</IonRow>
|
||||||
|
|
||||||
|
|
||||||
<IonRow>
|
<IonRow>
|
||||||
<IonCol>
|
<IonCol>
|
||||||
<IonItem>
|
<IonItem>
|
||||||
|
|||||||
Reference in New Issue
Block a user