mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-08 07:17:27 +08:00
[+] Wrapper for pfp path
This commit is contained in:
@@ -15,7 +15,8 @@ import moment from 'moment/moment'
|
||||
import CalHeatmap from 'cal-heatmap'
|
||||
// @ts-expect-error Cal-heatmap does not have proper types
|
||||
import CalTooltip from 'cal-heatmap/plugins/Tooltip'
|
||||
import { DEFAULT_PFP } from "./config";
|
||||
import { DEFAULT_PFP, IMG_HOST } from "./config";
|
||||
import type { UserMe } from "./generalTypes";
|
||||
|
||||
export function title(t: string) {
|
||||
document.title = `AquaNet - ${t}`
|
||||
@@ -152,3 +153,8 @@ export function tooltip(element: HTMLElement, params: { text: string } | string)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function pfp(node: HTMLImageElement, me: UserMe) {
|
||||
node.src = me.profilePicture ? `${IMG_HOST}/${me.profilePicture}` : DEFAULT_PFP
|
||||
node.onerror = e => pfpNotFound(e as Event)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user