Skip to content

Commit 2f68d8c

Browse files
committed
add showing full size avatar
1 parent 6161fe9 commit 2f68d8c

6 files changed

Lines changed: 76 additions & 14 deletions

File tree

MangoAPI.Client/src/app/components/contacts/contacts.component.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<body class="d-flex">
22
<div class="menu" id="menu">
3+
<div *ngIf="_blackCoverStateService.isBlackCoverShowing" class="black-cover" (click)="closeBlackCoverClick()">
4+
<img
5+
*ngIf="_blackCoverStateService.picture"
6+
src="{{ _blackCoverStateService.picture }}"
7+
class="profile-avatar"
8+
alt=""
9+
(click)="$event.stopPropagation()"
10+
/>
11+
</div>
312
<app-navbar [activeComponent]="'contacts'"></app-navbar>
413
<aside class="sidebar contacts">
514
<header class="sidebar-header p-3">
@@ -39,7 +48,7 @@ <h5>Contacts</h5>
3948
*ngIf="contact.userId === activeUserId; else elseContact"
4049
(click)="onContactTabClick(contact)"
4150
>
42-
<img alt="Chat avatar" class="avatar" src="{{ contact.pictureUrl }}" />
51+
<img alt="Chat avatar" class="avatar" src="{{ contact.pictureUrl }}"/>
4352
<div class="content">
4453
<div class="title">
4554
<div class="info pl-1">
@@ -90,7 +99,7 @@ <h5>Contacts</h5>
9099
</div>
91100
<main class="contact">
92101
<div class="main-info background-pattern">
93-
<img src="{{ activeUser.pictureUrl }}" alt="User Avatar" class="avatar" />
102+
<img src="{{ activeUser.pictureUrl }}" alt="User Avatar" class="avatar" (click)="onOpenAvatarClick()"/>
94103
<div class="d-flex flex-column">
95104
<p>{{ activeUser.displayName }}</p>
96105
<p>{{ activeUser.bio }}</p>

MangoAPI.Client/src/app/components/contacts/contacts.component.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { Router } from '@angular/router';
1111
import { StartDirectChatQueryObject } from '../../types/query-objects/StartDirectChatQueryObject';
1212
import { RoutingService } from '../../services/messenger/routing.service';
1313
import { Subject, takeUntil } from 'rxjs';
14+
import { BlackCoverStateService } from 'src/app/services/states/blackCoverState.service';
1415

1516
@Component({
1617
selector: 'app-contacts',
@@ -24,7 +25,8 @@ export class ContactsComponent implements OnInit, OnDestroy {
2425
private _tokensService: TokensService,
2526
private _communitiesService: CommunitiesService,
2627
private _router: Router,
27-
private _routingService: RoutingService
28+
private _routingService: RoutingService,
29+
public _blackCoverStateService: BlackCoverStateService,
2830
) {}
2931

3032
public contacts: Contact[] = [];
@@ -88,6 +90,17 @@ export class ContactsComponent implements OnInit, OnDestroy {
8890
});
8991
}
9092

93+
onOpenAvatarClick(): void {
94+
console.log(1);
95+
this._blackCoverStateService.setIsBlackCoverShowing(true)
96+
this._blackCoverStateService.setPicture(this.activeUser.pictureUrl)
97+
}
98+
99+
closeBlackCoverClick(): void {
100+
this._blackCoverStateService.setIsBlackCoverShowing(false)
101+
this._blackCoverStateService.setPictureNull()
102+
}
103+
91104
getUsersContacts(): void {
92105
this._contactsService
93106
.getCurrentUserContacts()

MangoAPI.Client/src/app/components/navbar/navbar.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<ul class="text-center menu-buttons">
66
<li>
77
<a [routerLink]="[routingConstants.Chats]">
8-
<!-- <a routerLink="{{ routingConstants.Chats }}"> -->
98
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
109
<path
1110
[ngClass]="activeComponent === 'chats' ? 'path active' : 'path'"

MangoAPI.Client/src/app/components/settings/settings.component.html

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<div class="d-flex">
22
<div class="menu" id="menu">
3+
<div *ngIf="_blackCoverStateService.isBlackCoverShowing" class="black-cover" (click)="closeBlackCoverClick()">
4+
<img
5+
*ngIf="_blackCoverStateService.picture"
6+
src="{{ _blackCoverStateService.picture }}"
7+
class="profile-avatar"
8+
alt=""
9+
(click)="$event.stopPropagation()"
10+
/>
11+
</div>
312
<app-navbar [activeComponent]="'settings'"></app-navbar>
413
<aside class="sidebar">
514
<header class="sidebar-header p-3">
@@ -10,7 +19,12 @@ <h5>Profile</h5>
1019
</header>
1120
<div class="p-3 overflow height-fix">
1221
<div class="main-info background-pattern">
13-
<img src="{{ currentUser.pictureUrl }}" alt="User Avatar" class="avatar" />
22+
<img
23+
src="{{ currentUser.pictureUrl }}"
24+
alt="User Avatar"
25+
class="avatar"
26+
(click)="onOpenAvatarClick()"
27+
/>
1428
<div class="d-flex flex-column">
1529
<p>{{ currentUser.displayName }}</p>
1630
</div>
@@ -92,7 +106,7 @@ <h5>Profile</h5>
92106
<li>
93107
<div class="info">
94108
<p class="title">Api Version</p>
95-
<p>{{apiVersion}}</p>
109+
<p>{{ apiVersion }}</p>
96110
</div>
97111
<img src="./../../../assets/svg/api.svg" alt="Api Icon" />
98112
</li>
@@ -116,12 +130,13 @@ <h5 class="mb-2">Account</h5>
116130
<li class="d-flex flex-column w-50 profile-form-group">
117131
<label for="BirthdayDate">Birthday</label>
118132
<input
119-
class='profile-form-input'
120-
type='date'
121-
value="{{currentUser.birthdayDate}}"
122-
id='BirthdayDate'
123-
placeholder='Type your birthday'
124-
[(ngModel)]="currentUser.birthdayDate">
133+
class="profile-form-input"
134+
type="date"
135+
value="{{ currentUser.birthdayDate }}"
136+
id="BirthdayDate"
137+
placeholder="Type your birthday"
138+
[(ngModel)]="currentUser.birthdayDate"
139+
/>
125140
</li>
126141

127142
<li class="d-flex flex-column w-50 profile-form-group">

MangoAPI.Client/src/app/components/settings/settings.component.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,25 @@ import { User } from '../../types/models/User';
1010
import { ValidationService } from '../../services/messenger/validation.service';
1111
import { UpdateAccountInformationCommand } from '../../types/requests/UpdateAccountInformationCommand';
1212
import { SessionService } from '../../services/api/session.service';
13-
import { Router } from '@angular/router';
13+
import { Event, Router } from '@angular/router';
1414
import { Subject, takeUntil } from 'rxjs';
1515
import { RoutingConstants } from 'src/app/types/constants/RoutingConstants';
1616
import { AppInfoService } from 'src/app/services/api/app-info.service';
17+
import { BlackCoverStateService } from 'src/app/services/states/blackCoverState.service';
1718

1819
@Component({
1920
selector: 'app-settings',
2021
templateUrl: './settings.component.html'
2122
})
2223
export class SettingsComponent implements OnInit, OnDestroy {
2324
constructor(
24-
private _contactsService: ContactsService,
2525
private _errorNotificationService: ErrorNotificationService,
2626
private _usersService: UsersService,
2727
private _appInfoService: AppInfoService,
2828
private _tokensService: TokensService,
2929
private _validationService: ValidationService,
3030
private _sessionService: SessionService,
31+
public _blackCoverStateService: BlackCoverStateService,
3132
private _router: Router
3233
) {}
3334

@@ -106,6 +107,16 @@ export class SettingsComponent implements OnInit, OnDestroy {
106107
this.componentDestroyed$.complete();
107108
}
108109

110+
onOpenAvatarClick(): void {
111+
this._blackCoverStateService.setIsBlackCoverShowing(true)
112+
this._blackCoverStateService.setPicture(this.currentUser.pictureUrl)
113+
}
114+
115+
closeBlackCoverClick(): void {
116+
this._blackCoverStateService.setIsBlackCoverShowing(false)
117+
this._blackCoverStateService.setPictureNull()
118+
}
119+
109120
onLogoutClick(): void {
110121
const refreshToken = this._tokensService.getTokens()?.refreshToken as string;
111122
this._sessionService

MangoAPI.Client/src/styles.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ $dark-gray: #505558;
55
$orange: #cf7d1f;
66
$orange-dark: #c18d1a;
77
$red: #ff3333;
8+
$transparentBlackLight: rgba(0, 0, 0, 0.300);
89

910
* {
1011
box-sizing: border-box;
@@ -127,6 +128,20 @@ i {
127128
height: 50px;
128129
}
129130

131+
.black-cover {
132+
display: flex;
133+
position: absolute;
134+
z-index: 3;
135+
width: 100vw;
136+
height: 100vh;
137+
background-color: $transparentBlackLight;
138+
139+
.profile-avatar {
140+
margin: auto;
141+
max-width: 100%;
142+
}
143+
}
144+
130145
.contacts {
131146
.list {
132147
li {

0 commit comments

Comments
 (0)