Adds Local Profile Pictures Implementation

This commit is contained in:
2023-08-27 23:15:06 -03:00
parent f881c16f7f
commit c5d70020b6
11 changed files with 1875 additions and 2418 deletions

View File

@@ -0,0 +1,35 @@
import {Component, EventEmitter, Output} from '@angular/core';
import {AuthService} from "../../../../shared/auth/auth.service";
@Component({
selector: 'app-profile-picture-picker',
templateUrl: './profile-picture-picker.component.html',
styleUrls: ['./profile-picture-picker.component.css']
})
export class ProfilePicturePickerComponent {
@Output()
imageSent = new EventEmitter<boolean>();
private profilePicture!: File;
constructor(private authService: AuthService) { }
handleFileInput(event: Event) {
const element = event.currentTarget as HTMLInputElement;
const fileList: FileList | null = element.files;
if (fileList != null && fileList.length > 0 && fileList[0] != null) {
this.profilePicture = fileList[0];
}
}
uploadProfilePicture() {
this.authService.addProfilePicture(this.profilePicture);
this.imageSent.emit(true);
}
get isProfilePictureSelected(): boolean {
return !this.profilePicture;
}
}