Refine bonus account detail card
This commit is contained in:
@@ -17,17 +17,11 @@ withDefaults(defineProps<{
|
||||
email?: string;
|
||||
companyName?: string | null;
|
||||
balance: number;
|
||||
avatarSrc?: string;
|
||||
initials?: string;
|
||||
compact?: boolean;
|
||||
stats?: BonusCardStat[];
|
||||
sourceLinks?: BonusCardLink[];
|
||||
}>(), {
|
||||
email: '',
|
||||
companyName: null,
|
||||
avatarSrc: '',
|
||||
initials: 'FR',
|
||||
compact: false,
|
||||
stats: () => [],
|
||||
sourceLinks: () => [],
|
||||
});
|
||||
@@ -41,39 +35,7 @@ function formatAmount(value: number) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<article
|
||||
class="surface-card rounded-[32px]"
|
||||
:class="compact ? 'flex min-h-[280px] flex-col p-6' : 'p-6'"
|
||||
>
|
||||
<template v-if="compact">
|
||||
<div class="flex justify-center">
|
||||
<img
|
||||
v-if="avatarSrc"
|
||||
:src="avatarSrc"
|
||||
:alt="fullName"
|
||||
class="h-24 w-24 rounded-[32px] object-cover shadow-[0_12px_30px_rgba(18,56,36,0.14)]"
|
||||
>
|
||||
<div
|
||||
v-else
|
||||
class="flex h-24 w-24 items-center justify-center rounded-[32px] bg-[linear-gradient(135deg,#dff7e9_0%,#c2ead3_100%)] text-3xl font-black text-[#123824] shadow-[inset_0_1px_0_rgba(255,255,255,0.65)]"
|
||||
>
|
||||
{{ initials }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-1" />
|
||||
|
||||
<div class="pt-8 text-center">
|
||||
<h2 class="text-lg font-bold leading-tight text-[#123824]">{{ fullName }}</h2>
|
||||
</div>
|
||||
|
||||
<div class="pt-6 text-left">
|
||||
<p class="text-[11px] font-semibold uppercase tracking-[0.18em] text-[#6a8a76]">Доступный бонус</p>
|
||||
<p class="mt-2 text-2xl font-black leading-none text-[#123824]">{{ formatAmount(balance) }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<article class="surface-card rounded-[32px] p-6">
|
||||
<div class="space-y-1">
|
||||
<h1 class="text-2xl font-bold leading-tight text-[#123824]">{{ fullName }}</h1>
|
||||
<p v-if="companyName || email" class="text-sm text-[#5c7b69]">
|
||||
@@ -108,6 +70,5 @@ function formatAmount(value: number) {
|
||||
<p class="mt-2 text-xs text-[#5c7b69]">Бонус {{ link.bonusPercent }}%</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user