Add picture on group page

master
Max 5 years ago
parent 08872565f9
commit 3708164a72

@ -7,7 +7,7 @@
<img class="profile-picture" [src]="groupProfile.picture"/> <img class="profile-picture" [src]="groupProfile.picture"/>
<mat-icon id="icon">camera_alt</mat-icon> <mat-icon id="icon">camera_alt</mat-icon>
</div> </div>
<div *ngIf="!isAdmin"> <div *ngIf="!isAdmin" (click)="openPfpLightbox()">
<img class="profile-picture" [src]="groupProfile.picture"/> <img class="profile-picture" [src]="groupProfile.picture"/>
</div> </div>
@ -63,7 +63,7 @@
<img class="profile-picture" [src]="groupProfile.picture"/> <img class="profile-picture" [src]="groupProfile.picture"/>
<mat-icon id="icon">camera_alt</mat-icon> <mat-icon id="icon">camera_alt</mat-icon>
</div> </div>
<div *ngIf="!isAdmin"> <div *ngIf="!isAdmin" (click)="openPfpLightbox()">
<img class="profile-picture" [src]="groupProfile.picture"/> <img class="profile-picture" [src]="groupProfile.picture"/>
</div> </div>
<span id="username">{{groupProfile.name}}</span> <span id="username">{{groupProfile.name}}</span>
@ -108,7 +108,7 @@
</mat-toolbar-row> </mat-toolbar-row>
</mat-toolbar> </mat-toolbar>
<div id="accordion"> <div id="accordion">
<mat-accordion> <mat-accordion multi="true">
<mat-expansion-panel *ngIf="groupProfile.events.length > 0" expanded> <mat-expansion-panel *ngIf="groupProfile.events.length > 0" expanded>
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title> <mat-panel-title>
@ -139,7 +139,7 @@
</mat-card> </mat-card>
</div> </div>
</mat-expansion-panel> </mat-expansion-panel>
<mat-expansion-panel [expanded]="groupProfile.events.length < 1"> <mat-expansion-panel expanded>
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title> <mat-panel-title>
Members Members

@ -73,13 +73,14 @@ $mat-card-header-size: 100px !default
// in IE, but we're using it as a progressive enhancement. // in IE, but we're using it as a progressive enhancement.
.profile-picture .profile-picture
cursor: pointer
height: $mat-card-header-size height: $mat-card-header-size
width: $mat-card-header-size width: $mat-card-header-size
border-radius: 50% border-radius: 50%
flex-shrink: 0 flex-shrink: 0
background-size: cover background-size: cover
transition-duration: 0.5s transition-duration: 0.5s
z-index: 10 z-index: 99
object-fit: cover object-fit: cover
.card .card

@ -9,6 +9,7 @@ import {Group} from 'src/app/models/group';
import {Event} from 'src/app/models/event'; import {Event} from 'src/app/models/event';
import {MatDialog, MatDialogRef} from '@angular/material/dialog'; import {MatDialog, MatDialogRef} from '@angular/material/dialog';
import {DialogGroupFileUploadComponent} from './fileUpload/fileUpload.component'; import {DialogGroupFileUploadComponent} from './fileUpload/fileUpload.component';
import {Lightbox} from 'ngx-lightbox';
// DIALOG COMPONENT to create events // DIALOG COMPONENT to create events
@Component({ @Component({
@ -85,6 +86,7 @@ export class GroupComponent implements OnInit {
private requestService: RequestService, private requestService: RequestService,
private data: DatasharingService, private data: DatasharingService,
private groupService: GroupService, private groupService: GroupService,
private lightbox: Lightbox,
private datasharingService: DatasharingService) { private datasharingService: DatasharingService) {
router.events.forEach((event) => { router.events.forEach((event) => {
// check if url changes // check if url changes
@ -196,4 +198,11 @@ export class GroupComponent implements OnInit {
}); });
} }
openPfpLightbox() {
this.lightbox.open([{
src: this.groupProfile.picture,
thumb: this.groupProfile.picture,
}], 0, {disableScrolling: true});
}
} }

Loading…
Cancel
Save