-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show what the user is doing on their profile
- Loading branch information
Showing
5 changed files
with
62 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import {Component, Input} from '@angular/core'; | ||
import {Room} from "../../../api/types/rooms/room"; | ||
import {LevelLinkComponent} from "../text/links/level-link.component"; | ||
|
||
@Component({ | ||
selector: 'app-user-status', | ||
standalone: true, | ||
imports: [ | ||
LevelLinkComponent | ||
], | ||
template: ` | ||
@if(activeRoom) { | ||
<div class="bg-green w-2 h-2 rounded-full inline-block align-middle mr-1"></div> | ||
<span class="text-secondary-bright"> | ||
Online, | ||
@switch (activeRoom.levelType) { | ||
@case (0) { | ||
<span>playing a story level</span> | ||
} | ||
@case(1) { | ||
<span>playing <app-level-link [level]="null" [levelId]="activeRoom.levelId"></app-level-link></span> | ||
} | ||
@case (2) { | ||
<span>on the moon</span> | ||
} | ||
@case (5) { | ||
<span>in the pod</span> | ||
} | ||
@default { | ||
<span>unhandled level type {{activeRoom.levelType}}</span> | ||
} | ||
} | ||
</span> | ||
} @else { | ||
<div class="bg-secondary w-2 h-2 rounded-full inline-block align-middle mr-1"></div> | ||
<span class="text-secondary">Offline</span> | ||
} | ||
` | ||
}) | ||
export class UserStatusComponent { | ||
@Input() activeRoom: Room | undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
@if (user) { | ||
<app-fancy-header [title]="user.username" [description]="user.description | default: user.username + ' hasn\'t introduced themselves yet.'"> | ||
<app-user-avatar [user]="user" [size]="(layout.isMobile | async) ? 90 : 176" avatar></app-user-avatar> | ||
<ng-container titleSubtext> | ||
Joined <app-date [date]="user.joinDate"></app-date> | ||
</ng-container> | ||
</app-fancy-header> | ||
<app-fancy-header [title]="user.username" | ||
[description]="user.description | default: user.username + ' hasn\'t introduced themselves yet.'"> | ||
<app-user-avatar [user]="user" [size]="(layout.isMobile | async) ? 90 : 176" avatar></app-user-avatar> | ||
<ng-container titleSubtext> | ||
Joined | ||
<app-date [date]="user.joinDate"></app-date> | ||
<br> | ||
</ng-container> | ||
<ng-container belowTitle> | ||
<app-user-status [activeRoom]="user.activeRoom"></app-user-status> | ||
</ng-container> | ||
</app-fancy-header> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters