Frontend: Made proxy loading placeholders actually take up space
ci/woodpecker/push/ociImagePush Pipeline is running Details

This commit is contained in:
Natty 2024-04-30 00:53:28 +02:00
parent 7c44e55597
commit ea4751400b
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
2 changed files with 28 additions and 3 deletions

View File

@ -52,5 +52,7 @@ watch(
justify-content: center;
font-size: 1.2em;
gap: 0.4em;
// Approximate height guess
padding: 150px 0;
}
</style>

View File

@ -1,5 +1,11 @@
<template>
<MagAvatar v-if="userResolved" :user="userResolved" />
<span
class="avatar-placeholder"
:class="{ square: $store.state.squareAvatars }"
v-else
>
</span>
</template>
<script lang="ts" setup>
@ -20,7 +26,7 @@ const props = withDefaults(
target: null,
disableLink: false,
disablePreview: false,
},
}
);
const userResolved = ref<packed.PackUserBase | null>(null);
@ -35,9 +41,26 @@ watch(
userResolved.value = await os.magApi(
endpoints.GetUserById,
{},
{ user_id: val.id },
{ user_id: val.id }
);
},
{ immediate: true },
{ immediate: true }
);
</script>
<style lang="scss" scoped>
.avatar-placeholder {
display: inline-block;
background-color: var(--buttonBg);
opacity: 0.6;
border-radius: 100%;
&.square {
border-radius: 20%;
> .inner {
border-radius: 20%;
}
}
}
</style>