🐛 Fix the share modal window position and removal of some css
continuous-integration/drone/push Build is passing Details

timeline
Alexis Feron 1 week ago
parent 28d2f95206
commit 11310baf99

@ -59,9 +59,8 @@
<div *ngIf="listUser" class="text-gray-500 text-sm"> <div *ngIf="listUser" class="text-gray-500 text-sm">
<div <div
style="padding-top: 10px"
*ngFor="let user of listUser" *ngFor="let user of listUser"
class="friend flex items-center justify-between space-x-3" class="friend flex items-center justify-between space-x-3 pt-10"
> >
<div class="friend flex items-center space-x-3"> <div class="friend flex items-center space-x-3">
<img <img

@ -1,9 +0,0 @@
#authentication-modal.show {
opacity: 1;
transition: opacity 0.3s ease-in-out;
}
#authentication-modal.hidden {
opacity: 0;
transition: opacity 0.3s ease-in-out;
}

@ -18,7 +18,6 @@ import { ModalService } from '../../services/modal/modal.service';
selector: 'app-login-page', selector: 'app-login-page',
imports: [FormsModule, ReactiveFormsModule, NgIf, CommonModule], imports: [FormsModule, ReactiveFormsModule, NgIf, CommonModule],
templateUrl: './login-page.component.html', templateUrl: './login-page.component.html',
styleUrl: './login-page.component.css',
}) })
export class LoginPageComponent { export class LoginPageComponent {
modalId: string = 'login-modal'; modalId: string = 'login-modal';
@ -69,7 +68,7 @@ export class LoginPageComponent {
this.loginService.login(this.user.login, this.user.password).subscribe({ this.loginService.login(this.user.login, this.user.password).subscribe({
next: (response) => { next: (response) => {
this.localStorageService.setToken(response.access_token); this.localStorageService.setToken(response.access_token);
this.localStorageService.setUsername(this.user.login) this.localStorageService.setUsername(this.user.login);
this.closeLoginModal(); this.closeLoginModal();
setTimeout(() => { setTimeout(() => {
this.router.navigate(['/map']); this.router.navigate(['/map']);

@ -72,9 +72,8 @@
<div *ngIf="listUser" class="text-gray-500 text-sm"> <div *ngIf="listUser" class="text-gray-500 text-sm">
<div <div
style="padding-top: 10px"
*ngFor="let user of listUser" *ngFor="let user of listUser"
class="friend flex items-center justify-between space-x-3" class="friend flex items-center justify-between space-x-3 pt-10"
> >
<div class="friend flex items-center space-x-3"> <div class="friend flex items-center space-x-3">
<img <img

@ -1,7 +1,9 @@
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { NavigationEnd, Router } from '@angular/router';
import { Subject, Subscription } from 'rxjs'; import { Subject, Subscription } from 'rxjs';
import { filter } from 'rxjs/operators';
import { FriendsService } from '../../services/friends/friends.service'; import { FriendsService } from '../../services/friends/friends.service';
import { ModalService } from '../../services/modal/modal.service'; import { ModalService } from '../../services/modal/modal.service';
import { PinService } from '../../services/pin/pin.service'; import { PinService } from '../../services/pin/pin.service';
@ -16,6 +18,7 @@ export class ShareModalComponent implements OnInit, OnDestroy {
modalId: string = 'share-modal'; modalId: string = 'share-modal';
isShareModalOpen = false; isShareModalOpen = false;
private modalSub!: Subscription; private modalSub!: Subscription;
private routerSubscription!: Subscription;
isFriendModalOpen: boolean = false; isFriendModalOpen: boolean = false;
hasAcceptedFriends: boolean = false; hasAcceptedFriends: boolean = false;
hasPendingFriends: boolean = false; hasPendingFriends: boolean = false;
@ -28,7 +31,8 @@ export class ShareModalComponent implements OnInit, OnDestroy {
constructor( constructor(
private modalService: ModalService, private modalService: ModalService,
private friendService: FriendsService, private friendService: FriendsService,
private pinService: PinService private pinService: PinService,
private router: Router
) {} ) {}
ngOnInit() { ngOnInit() {
@ -39,12 +43,24 @@ export class ShareModalComponent implements OnInit, OnDestroy {
if (open) { if (open) {
this.getFriend(); this.getFriend();
this.pinId = this.modalService.getCurrentPinId(); this.pinId = this.modalService.getCurrentPinId();
setTimeout(() => this.moveModalToBody(), 0);
} }
}); });
// S'abonner aux événements de navigation du router
this.routerSubscription = this.router.events
.pipe(filter((event) => event instanceof NavigationEnd))
.subscribe(() => {
// Attendre que le DOM soit mis à jour après la navigation
setTimeout(() => this.moveModalToBody(), 0);
});
} }
ngOnDestroy() { ngOnDestroy() {
this.modalSub?.unsubscribe(); this.modalSub?.unsubscribe();
if (this.routerSubscription) {
this.routerSubscription.unsubscribe();
}
} }
openShareModal() { openShareModal() {

Loading…
Cancel
Save