added some information on profile page

master
Max 5 years ago
parent 44cecfb74c
commit a2864205e2

@ -59,6 +59,7 @@ import {DomSanitizer} from '@angular/platform-browser';
import {MatIconRegistry} from '@angular/material/icon'; import {MatIconRegistry} from '@angular/material/icon';
import {MatDialogModule} from '@angular/material/dialog'; import {MatDialogModule} from '@angular/material/dialog';
import {MatTooltipModule} from '@angular/material/tooltip'; import {MatTooltipModule} from '@angular/material/tooltip';
import {MatExpansionModule} from '@angular/material/expansion';
// import logo from 'src/assets/gv-new-logo.svg'; // import logo from 'src/assets/gv-new-logo.svg';
import logo from '!!raw-loader!./gv-new-logo-white.svg'; import logo from '!!raw-loader!./gv-new-logo-white.svg';
@ -135,7 +136,8 @@ const appRoutes: Routes = [
MatBadgeModule, MatBadgeModule,
MatProgressSpinnerModule, MatProgressSpinnerModule,
MatDialogModule, MatDialogModule,
MatTooltipModule MatTooltipModule,
MatExpansionModule
], ],
entryComponents: [ DialogCreateGroupComponent ], entryComponents: [ DialogCreateGroupComponent ],
providers: [], providers: [],

@ -13,7 +13,12 @@
</button> </button>
</mat-toolbar-row> </mat-toolbar-row>
<mat-toolbar-row> <mat-toolbar-row>
<span id="info">{{rankname}} ({{userProfile.points}} points)</span> <div id="info-box">
<span class="info">{{rankname}} ({{userProfile.points}} points)</span>
<span class="info">{{userProfile.friendCount}} friends</span>
<span class="info">{{userProfile.groupCount}} groups</span>
<span class="info">joined on {{userProfile.joinedAt}}</span>
</div>
</mat-toolbar-row> </mat-toolbar-row>
</mat-toolbar> </mat-toolbar>
<div id="postlist"> <div id="postlist">

@ -27,14 +27,16 @@
margin-top: 32px margin-top: 32px
.mat-toolbar-row .mat-toolbar-row
max-height: 40px max-height: 40px
#info-box
font-size: 14px
margin-left: calc(100px + 0.5em)
.info
margin-right: 3em
#username
margin: 0 0.5em
#handle
font-size: 14px
#username
margin: 0 0.5em
#handle
font-size: 14px
#info
font-size: 14px
margin-left: calc(100px + 0.5em)
.mat-table .mat-table
width: 100% width: 100%

@ -12,6 +12,9 @@ export class User {
points: number; points: number;
level: number; level: number;
profilePicture: string; profilePicture: string;
joinedAt: string;
friendCount: number;
groupCount: number;
darkmode = false; darkmode = false;

@ -48,6 +48,8 @@ export class ProfileService {
points points
level level
friendCount friendCount
groupCount
joinedAt
friends{ friends{
id id
} }
@ -80,6 +82,8 @@ export class ProfileService {
points points
level level
friendCount friendCount
groupCount
joinedAt
friends{ friends{
id id
} }
@ -116,6 +120,11 @@ export class ProfileService {
profile.handle = response.data.getUser.handle; profile.handle = response.data.getUser.handle;
profile.points = response.data.getUser.points; profile.points = response.data.getUser.points;
profile.level = response.data.getUser.level; profile.level = response.data.getUser.level;
profile.friendCount = response.data.getUser.friendCount;
profile.groupCount = response.data.getUser.groupCount;
const temp = new Date(Number(response.data.getUser.joinedAt));
const date = temp.toLocaleString('en-GB');
profile.joinedAt = date;
for (const post of response.data.getUser.posts) { for (const post of response.data.getUser.posts) {
const id: number = post.id; const id: number = post.id;
const content: string = post.content; const content: string = post.content;

Loading…
Cancel
Save