Refine bonus account detail card
This commit is contained in:
@@ -17,17 +17,11 @@ withDefaults(defineProps<{
|
|||||||
email?: string;
|
email?: string;
|
||||||
companyName?: string | null;
|
companyName?: string | null;
|
||||||
balance: number;
|
balance: number;
|
||||||
avatarSrc?: string;
|
|
||||||
initials?: string;
|
|
||||||
compact?: boolean;
|
|
||||||
stats?: BonusCardStat[];
|
stats?: BonusCardStat[];
|
||||||
sourceLinks?: BonusCardLink[];
|
sourceLinks?: BonusCardLink[];
|
||||||
}>(), {
|
}>(), {
|
||||||
email: '',
|
email: '',
|
||||||
companyName: null,
|
companyName: null,
|
||||||
avatarSrc: '',
|
|
||||||
initials: 'FR',
|
|
||||||
compact: false,
|
|
||||||
stats: () => [],
|
stats: () => [],
|
||||||
sourceLinks: () => [],
|
sourceLinks: () => [],
|
||||||
});
|
});
|
||||||
@@ -41,39 +35,7 @@ function formatAmount(value: number) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<article
|
<article class="surface-card rounded-[32px] p-6">
|
||||||
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>
|
|
||||||
<div class="space-y-1">
|
<div class="space-y-1">
|
||||||
<h1 class="text-2xl font-bold leading-tight text-[#123824]">{{ fullName }}</h1>
|
<h1 class="text-2xl font-bold leading-tight text-[#123824]">{{ fullName }}</h1>
|
||||||
<p v-if="companyName || email" class="text-sm text-[#5c7b69]">
|
<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>
|
<p class="mt-2 text-xs text-[#5c7b69]">Бонус {{ link.bonusPercent }}%</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
|
||||||
</article>
|
</article>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user