Incluindo função para o botão de logout
This commit is contained in:
@@ -50,6 +50,11 @@ const Perfil: React.FC = () => {
|
|||||||
setShowToast(true);
|
setShowToast(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const logoff = () => {
|
||||||
|
LocalStorage.clearToken()
|
||||||
|
history.push('/login')
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const loadUserData = async () => {
|
const loadUserData = async () => {
|
||||||
let userId = ''
|
let userId = ''
|
||||||
@@ -159,7 +164,7 @@ const Perfil: React.FC = () => {
|
|||||||
<IonIcon icon={createOutline} slot="start" />
|
<IonIcon icon={createOutline} slot="start" />
|
||||||
<IonLabel>Editar perfil</IonLabel>
|
<IonLabel>Editar perfil</IonLabel>
|
||||||
</IonItem>
|
</IonItem>
|
||||||
<IonItem button>
|
<IonItem>
|
||||||
<IonIcon icon={shieldCheckmarkOutline} slot="start" />
|
<IonIcon icon={shieldCheckmarkOutline} slot="start" />
|
||||||
<IonLabel>Completar perfil</IonLabel>
|
<IonLabel>Completar perfil</IonLabel>
|
||||||
</IonItem>
|
</IonItem>
|
||||||
@@ -167,15 +172,15 @@ const Perfil: React.FC = () => {
|
|||||||
<IonIcon icon={carOutline} slot="start" />
|
<IonIcon icon={carOutline} slot="start" />
|
||||||
<IonLabel>Cadastrar Van</IonLabel>
|
<IonLabel>Cadastrar Van</IonLabel>
|
||||||
</IonItem>
|
</IonItem>
|
||||||
<IonItem button>
|
<IonItem>
|
||||||
<IonIcon icon={cardOutline} slot="start" />
|
<IonIcon icon={cardOutline} slot="start" />
|
||||||
<IonLabel>Pagamentos</IonLabel>
|
<IonLabel>Pagamentos</IonLabel>
|
||||||
</IonItem>
|
</IonItem>
|
||||||
<IonItem button>
|
<IonItem>
|
||||||
<IonIcon icon={starOutline} slot="start" />
|
<IonIcon icon={starOutline} slot="start" />
|
||||||
<IonLabel>Avaliações</IonLabel>
|
<IonLabel>Avaliações</IonLabel>
|
||||||
</IonItem>
|
</IonItem>
|
||||||
<IonItem button>
|
<IonItem button onClick={logoff}>
|
||||||
<IonIcon icon={exitOutline} slot="start" />
|
<IonIcon icon={exitOutline} slot="start" />
|
||||||
<IonLabel>Sair da conta</IonLabel>
|
<IonLabel>Sair da conta</IonLabel>
|
||||||
</IonItem>
|
</IonItem>
|
||||||
|
|||||||
Reference in New Issue
Block a user