mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-24 12:45:04 +00:00
UI refinements (#2859)
## Description: UI Refinements requested by @evanpelle check https://ui.openfront.dev ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: w.o.n
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { LitElement, html } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators.js";
|
||||
import type { DiscordUser } from "../../../../core/ApiSchemas";
|
||||
import { translateText } from "../../../Utils";
|
||||
import { getDiscordAvatarUrl, translateText } from "../../../Utils";
|
||||
|
||||
@customElement("discord-user-header")
|
||||
export class DiscordUserHeader extends LitElement {
|
||||
@@ -23,15 +23,7 @@ export class DiscordUserHeader extends LitElement {
|
||||
private get avatarUrl(): string | null {
|
||||
const u = this._data;
|
||||
if (!u) return null;
|
||||
if (u.avatar) {
|
||||
const ext = u.avatar.startsWith("a_") ? "gif" : "png";
|
||||
return `https://cdn.discordapp.com/avatars/${u.id}/${u.avatar}.${ext}`;
|
||||
}
|
||||
if (u.discriminator !== undefined) {
|
||||
const idx = Number(u.discriminator) % 5;
|
||||
return `https://cdn.discordapp.com/embed/avatars/${idx}.png`;
|
||||
}
|
||||
return null;
|
||||
return getDiscordAvatarUrl(u);
|
||||
}
|
||||
|
||||
private get discordDisplayName(): string {
|
||||
|
||||
Reference in New Issue
Block a user