mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-12-21 06:51:19 +08:00
feat(frontend): remove user avatar background in all cases, not just header
This commit is contained in:
parent
344f4bc2a2
commit
e010689954
@ -8,7 +8,6 @@ const props = withDefaults(
|
||||
imgSrc?: string;
|
||||
to?: string;
|
||||
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
||||
background?: boolean;
|
||||
disableLink?: boolean;
|
||||
}>(),
|
||||
{
|
||||
@ -16,7 +15,6 @@ const props = withDefaults(
|
||||
imgSrc: undefined,
|
||||
size: "lg",
|
||||
to: "",
|
||||
background: true,
|
||||
disableLink: false,
|
||||
}
|
||||
);
|
||||
@ -39,10 +37,6 @@ 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";
|
||||
@ -67,7 +61,7 @@ const url = computed(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="'rounded-lg ' + backgroundClass + sizeClass">
|
||||
<div :class="'rounded-lg ' + sizeClass">
|
||||
<component :is="disableLink ? 'span' : 'router-link'" :key="url" :to="url">
|
||||
<img class="rounded-lg w-full h-full" :title="username" :src="src" :alt="username" @error="errored = true" />
|
||||
</component>
|
||||
|
@ -295,7 +295,7 @@ function isRecent(date: string): boolean {
|
||||
<div v-if="authStore.user">
|
||||
<Popper placement="bottom-end">
|
||||
<button class="flex items-center gap-2 rounded-md p-2 hover:(text-primary-400 bg-primary-0)" @click="updateNavData">
|
||||
<UserAvatar :username="authStore.user.name" :avatar-url="authStore.user.avatarUrl" size="xs" :background="false" :disable-link="true" />
|
||||
<UserAvatar :username="authStore.user.name" :avatar-url="authStore.user.avatarUrl" size="xs" :disable-link="true" />
|
||||
{{ authStore.user.name }}
|
||||
</button>
|
||||
<template #content="{ close }">
|
||||
|
Loading…
Reference in New Issue
Block a user