Skip to content

Commit

Permalink
Changed approach to positioning div {
Browse files Browse the repository at this point in the history
  • Loading branch information
sobkiv committed Sep 24, 2023
1 parent 0e1ee57 commit 4c3fb90
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="profile-wrapper" *ngIf="userInfo">
<div class="left-column">
<app-profile-header class="app-profile-header" [userInfo]="userInfo" [progress]="progress"></app-profile-header>
<app-users-achievements class="app-users-achievements"></app-users-achievements>
<app-users-achievements class="app-users-achievements" [currLang]="currLang"></app-users-achievements>
<app-users-friends class="app-users-friends"></app-users-friends>
<app-eco-places class="app-eco-places" *ngIf="userInfo.showEcoPlace"></app-eco-places>
<app-shopping-list class="app-shopping-list" *ngIf="userInfo.showShoppingList"></app-shopping-list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { take } from 'rxjs/operators';
styleUrls: ['./profile.component.scss']
})
export class ProfileComponent implements OnInit, OnDestroy {
public currLang: string;
private langChangeSub: Subscription;
public userInfo: EditProfileModel;
public isDesktopWidth: boolean;
Expand All @@ -34,6 +35,7 @@ export class ProfileComponent implements OnInit, OnDestroy {
this.subscribeToLangChange();
this.bindLang(this.localStorageService.getCurrentLanguage());
this.checkUserActivities();
console.log(this.translate);
}

@HostListener('window:resize') public checkDisplayWidth() {
Expand All @@ -59,7 +61,10 @@ export class ProfileComponent implements OnInit, OnDestroy {
}

private subscribeToLangChange(): void {
this.langChangeSub = this.localStorageService.languageSubject.subscribe((lang) => this.bindLang(lang));
this.langChangeSub = this.localStorageService.languageSubject.subscribe((lang) => {
this.bindLang(lang);
this.currLang = lang;
});
}

private checkUserActivities(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
<p class="my-achievements">
{{ 'profile.my-achievements' | translate }}
</p>
<a *ngIf="this.currLang === 'en'" href="">{{ 'profile.see-all' | translate }}</a>
</div>
<div>
<div class="acheived-quantity">15 {{ 'profile.achieved' | translate }}</div>
<a href="">{{ 'profile.see-all' | translate }}</a>
<a *ngIf="this.currLang === 'ua'" href="" class="see-all-ukr">{{ 'profile.see-all' | translate }}</a>
</div>
</div>
<div class="body">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ p {
color: var(--tertiary-light-grey);
line-height: 16px;
position: relative;
}
}

div {
.see-all-ukr {
bottom: 20px;
}
}
Expand Down Expand Up @@ -72,10 +77,10 @@ p {
width: 184px;

.header {
a:nth-child(2) {
text-align: right;
bottom: 1px;
width: 80px;
div {
.see-all-ukr {
bottom: 0px;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, Input } from '@angular/core';
import { PROFILE_IMAGES } from 'src/app/main/image-pathes/profile-images';

@Component({
Expand All @@ -8,4 +8,5 @@ import { PROFILE_IMAGES } from 'src/app/main/image-pathes/profile-images';
})
export class UsersAchievementsComponent {
public achievementsImages = PROFILE_IMAGES.achs;
@Input() currLang: string;
}

0 comments on commit 4c3fb90

Please sign in to comment.