Skip to content

Commit

Permalink
Merge remote-tracking branch 'blattersturm/tweak/premium-tooltips' in…
Browse files Browse the repository at this point in the history
…to master-pub
  • Loading branch information
blattersturm committed Aug 14, 2021
2 parents 977fb77 + a81ae13 commit 56b0b6a
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
[class.ag]="server.premium === 'ag'"
[class.au]="server.premium === 'au'"
[class.pt]="server.premium === 'pt'"
data-balloon-pos="right"
[attr.aria-label]="premiumName"
>
<span>{{ server.premium }}</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ export class ServersDetailComponent implements OnInit, OnDestroy {
});
}

get premiumName() {
return this.serversService.getNameForPremium(this.server.premium);
}

apFeedInitialized = false;

private updateServer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
[class.ag]="premium === 'ag'"
[class.au]="premium === 'au'"
[class.pt]="premium === 'pt'"
data-balloon-pos="right"
[attr.aria-label]="premiumName"
>
<span><div>{{ premium }}</div></span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
bottom: 2px;

width: var(--q4);
pointer-events: none;

z-index: 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export class ServersListItemComponent implements OnInit, OnChanges, OnDestroy, A
return this.rawServer.data.vars.premium;
}

get premiumName() {
return this.serversService.getNameForPremium(this.premium);
}

public ngOnInit() {
this.hoverIntent = hoverintent(this.elementRef.nativeElement, () => {
this.serversService.getServer(this.rawServer.address, true);
Expand Down
13 changes: 13 additions & 0 deletions ext/cfx-ui/src/app/servers/servers.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,19 @@ export class ServersService {
.catch(() => new PinConfig());
}

getNameForPremium(premium: string) {
switch (premium) {
case 'pt':
return 'Element Club Platinum';
case 'au':
return 'Element Club Aurum';
case 'ag':
return 'Element Club Argentum';
}

return '';
}

parseAddress(addr: string): [string, number] {
if (!addr) {
return null;
Expand Down

0 comments on commit 56b0b6a

Please sign in to comment.