Skip to content

Commit

Permalink
Fix profile
Browse files Browse the repository at this point in the history
  • Loading branch information
FazCodeFR committed Jul 17, 2024
1 parent d72b7f8 commit fb417d5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="bg-white px-2 py-8 sm:py-10 lg:px-8">
<div *ngIf="!profileContext" class="bg-white px-2 py-8 sm:py-10 lg:px-8">
<div class="mx-auto max-w-2xl text-center">
<h1 class="text-2xl font-bold tracking-tight text-gray-900 sm:text-4xl">Les chats à adopter</h1>
<p class="mt-4 text-md leading-6 text-gray-500">Nous avons plusieurs adorables chats qui cherchent un foyer
Expand All @@ -9,7 +9,7 @@ <h1 class="text-2xl font-bold tracking-tight text-gray-900 sm:text-4xl">Les chat
<app-loader *ngIf="!isLoaded"></app-loader>

<!-- Filter Inputs -->
<div *ngIf="isLoaded" class="px-4 py-4 mx-auto sm:max-w-xl md:max-w-full lg:max-w-screen-xl md:px-24 lg:px-8">
<div *ngIf="isLoaded && !profileContext" class="px-4 py-4 mx-auto sm:max-w-xl md:max-w-full lg:max-w-screen-xl md:px-24 lg:px-8">
<form [formGroup]="form" (ngSubmit)="onSearch()" class="flex flex-wrap gap-4 justify-center items-center mb-8">
<select formControlName="ville"
class="form-select block w-full sm:w-auto px-3 py-2 border border-gray-300 rounded-md text-gray-900 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
Expand Down Expand Up @@ -38,7 +38,7 @@ <h1 class="text-2xl font-bold tracking-tight text-gray-900 sm:text-4xl">Les chat
<div *ngIf="isLoaded && chats && chats.length > 0"
class="px-4 py-12 mx-auto sm:max-w-xl md:max-w-full lg:max-w-screen-xl md:px-24 lg:px-8 lg:py-16">

<div class="text-left mb-8">
<div class="text-left mb-8" *ngIf="!profileContext">
<p class="text-lg font-medium text-gray-700">Nombre de chats disponibles : {{ chats.length }}</p>
</div>
<div class="grid gap-8 lg:grid-cols-3 sm:max-w-sm sm:mx-auto lg:max-w-full">
Expand Down
34 changes: 13 additions & 21 deletions src/app/components/profil/profil.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,36 @@
<div class="w-full lg:w-3/12 px-4 lg:order-2 flex justify-center">
<div class="relative">
<img alt="..." [src]='user.picture' loading="lazy" decoding="async" referrerpolicy="no-referrer"
class="shadow-xl rounded-full h-auto align-middle border-none absolute -m-16 -ml-20 lg:-ml-16 max-w-150-px">
class="shadow-xl rounded-full h-auto align-middle border-none -mt-12 max-w-150-px">
</div>
</div>
<div class="w-full lg:w-4/12 px-4 lg:order-3 lg:text-right lg:self-center">
<div class="py-6 px-3 mt-32 sm:mt-0">
<button
class="text-white bg-orange-700 hover:bg-orange-800 font-medium rounded-lg text-sm px-4 lg:px-5 py-2 lg:py-2.5 mr-2 dark:bg-orange-600 dark:hover:bg-orange-700 focus:outline-none">
Editer
</button>
</div>
</div>
<div class="w-full lg:w-4/12 px-4 lg:order-1">
<div class="py-6 px-3 mt-32 sm:mt-0">
<button [routerLink]="'/'"
class="text-white bg-orange-700 hover:bg-orange-800 font-medium rounded-lg text-sm px-4 lg:px-5 py-2 lg:py-2.5 mr-2 dark:bg-orange-600 dark:hover:bg-orange-700 focus:outline-none">
Retour
</button>
<div class="py-6 px-3 sm:mt-0">
<button [routerLink]="'/'" class="text-white bg-orange-700 hover:bg-orange-800 font-medium rounded-lg text-sm px-4 lg:px-5 py-2 lg:py-2.5 mr-2 dark:bg-orange-600 dark:hover:bg-orange-700 focus:outline-none">Retour</button>
</div>
</div>
</div>
<div class="text-center mt-12">
<h3 class="text-4xl font-semibold leading-normal mb-2 text-blueGray-700 mb-2">{{user.name}}
</h3>
<div class="text-sm leading-normal mt-0 mb-2 text-blueGray-400 font-bold uppercase">
<i class="fas fa-map-marker-alt mr-2 text-lg text-blueGray-400"></i>
user.adresse, user.codePostal user.ville
<h3 class="text-4xl font-semibold leading-normal mb-2 text-blueGray-700 mb-2">{{ user.name }}</h3>
<div class="mt-0 mb-2 text-blueGray-600">
<i class="fas fa-briefcase mr-2 text-lg text-blueGray-400"></i>{{ user.email }}
</div>
<div class="mt-0 mb-2 text-blueGray-600">
<i class="fas fa-check mr-2 text-lg text-blueGray-400"></i> E-mail Vérifié : <span class="text-green-500" *ngIf="user.email_verified">Oui</span><span class="text-red-500" *ngIf="!user.email_verified">Non</span>
</div>
<div class="mt-0 mb-2 text-blueGray-600">
<i class="fas fa-briefcase mr-2 text-lg text-blueGray-400"></i>{{user.email}}
<i class="fas fa-user-tag mr-2 text-lg text-blueGray-400"></i> Rôle : {{ user?.['https://potits-chats.com/roles'][0] ? user?.['https://potits-chats.com/roles'][0] : 'Utilisateur' }}
</div>
<div class="mt-0 mb-2 text-blueGray-600">
<i class="fas fa-university mr-2 text-lg text-blueGray-400"></i>user.telephone
<i class="fas fa-sign-in-alt mr-2 text-lg text-blueGray-400"></i> Connecté via : {{ getLoginMethod(user.sub || "") }}
</div>
</div>
<div class="mt-10 py-10 border-t border-blueGray-200 text-center">
<div class="flex flex-wrap justify-center">
<div>
<h2 class="text-center">Mes favoris:</h2>
<h2 class="text-center">Mes favoris :</h2>
<div>
<app-animaux-list [profileContext]="true"></app-animaux-list>
</div>
Expand All @@ -69,4 +61,4 @@ <h2 class="text-center">Mes favoris:</h2>
</div>
</div>
</section>
</div>
</div>
11 changes: 11 additions & 0 deletions src/app/components/profil/profil.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,15 @@ export class ProfilComponent {
faXmark = faXmark;

constructor(public auth: AuthService) {}


getLoginMethod(sub: string): string {
if (sub.startsWith('google-oauth2')) {
return 'Google';
} else if (sub.startsWith('auth0')) {
return 'Compte manuel';
} else {
return 'Autre';
}
}
}

0 comments on commit fb417d5

Please sign in to comment.