mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-01-24 14:24:47 +08:00
Remove avatar background in header
This commit is contained in:
parent
5dedc4f188
commit
66fe3a9c00
@ -8,12 +8,14 @@ const props = withDefaults(
|
||||
imgSrc?: string;
|
||||
to?: string;
|
||||
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
||||
background?: boolean;
|
||||
}>(),
|
||||
{
|
||||
avatarUrl: undefined,
|
||||
imgSrc: undefined,
|
||||
size: "lg",
|
||||
to: "",
|
||||
background: true,
|
||||
}
|
||||
);
|
||||
|
||||
@ -28,6 +30,10 @@ const sizeClass = computed(() => {
|
||||
return "w-200px h-200px";
|
||||
});
|
||||
|
||||
const backgroundClass = computed(() => {
|
||||
return props.background ? "bg-light-300 dark:bg-dark-500 " : "";
|
||||
});
|
||||
|
||||
const src = computed(() => {
|
||||
if (errored.value) {
|
||||
return "https://docs.papermc.io/img/paper.png";
|
||||
@ -52,7 +58,7 @@ const url = computed(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="'bg-light-300 dark:bg-dark-500 rounded-lg ' + sizeClass">
|
||||
<div :class="'rounded-lg ' + backgroundClass + sizeClass">
|
||||
<router-link :to="url">
|
||||
<img class="rounded-lg w-full h-full" :title="username" :src="src" :alt="username" @error="errored = true" />
|
||||
</router-link>
|
||||
|
@ -149,7 +149,7 @@ authLog("render with user " + authStore.user?.name);
|
||||
<Menu>
|
||||
<MenuButton>
|
||||
<div class="flex items-center gap-2 rounded-md p-2" hover="text-primary-100 bg-primary-50">
|
||||
<UserAvatar :username="name" size="xs"></UserAvatar>
|
||||
<UserAvatar :username="authStore.user.name" size="xs" :background="false"></UserAvatar>
|
||||
{{ authStore.user.name }}
|
||||
</div>
|
||||
</MenuButton>
|
||||
|
Loading…
Reference in New Issue
Block a user