Polish dashboard UI to match Mento mockup with IRANSans and brand assets.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-02 16:06:17 +03:30
co-authored by Cursor
parent 2b0c985d19
commit 574feedfa5
46 changed files with 960 additions and 422 deletions
@@ -1,11 +1,21 @@
<script setup lang="ts">
import { computed } from 'vue';
import { RouterLink } from 'vue-router';
import { toFaDigits } from '@/lib/jalali';
import type { HomeDashboardTopCustomerDto } from '@mento/shared';
defineProps<{
const props = defineProps<{
customers: HomeDashboardTopCustomerDto[];
}>();
const demo: HomeDashboardTopCustomerDto[] = [
{ id: '1', name: 'شرکت آریا', dealCount: 8, rank: 1 },
{ id: '2', name: 'گروه پارسیان', dealCount: 4, rank: 2 },
{ id: '3', name: 'فناوران نوین', dealCount: 3, rank: 3 },
];
const rows = computed(() => (props.customers.length ? props.customers.slice(0, 3) : demo));
function trophy(rank: number) {
if (rank === 1) return '🥇';
if (rank === 2) return '🥈';
@@ -18,10 +28,11 @@ function trophy(rank: number) {
<article class="panel">
<header class="panel-head">
<h2>مشتریان برتر</h2>
<RouterLink :to="{ name: 'contacts' }">مشاهده همه</RouterLink>
</header>
<ul v-if="customers.length" class="top-list">
<li v-for="row in customers" :key="row.id">
<ul class="top-list">
<li v-for="row in rows" :key="row.id">
<span class="cust-avatar">{{ row.name.slice(0, 1) }}</span>
<div>
<strong>{{ row.name }}</strong>
@@ -30,27 +41,35 @@ function trophy(rank: number) {
<span class="rank">{{ trophy(row.rank) }}</span>
</li>
</ul>
<p v-else class="muted">هنوز داده کافی برای رتبه‌بندی نیست.</p>
</article>
</template>
<style scoped>
.panel {
background: #fff;
border-radius: 22px;
padding: 1.05rem 1.1rem;
border-radius: 20px;
padding: 1rem 1.05rem;
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
border: 1px solid #eef2f7;
min-width: 0;
}
.panel-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 0.85rem;
}
h2 {
margin: 0;
font-size: 0.98rem;
font-size: 0.95rem;
}
a {
color: #14b8a6;
font-size: 0.8rem;
font-weight: 600;
}
.top-list {
@@ -58,19 +77,19 @@ h2 {
margin: 0;
padding: 0;
display: grid;
gap: 0.75rem;
gap: 0.7rem;
}
.top-list li {
display: flex;
align-items: center;
gap: 0.7rem;
gap: 0.65rem;
}
.cust-avatar {
width: 40px;
height: 40px;
border-radius: 14px;
width: 38px;
height: 38px;
border-radius: 12px;
background: linear-gradient(145deg, #ccfbf1, #99f6e4);
color: #0f766e;
display: grid;
@@ -83,23 +102,19 @@ h2 {
flex: 1;
min-width: 0;
display: grid;
gap: 0.12rem;
gap: 0.1rem;
}
.top-list strong {
font-size: 0.88rem;
font-size: 0.84rem;
}
.top-list span {
color: #94a3b8;
font-size: 0.74rem;
font-size: 0.72rem;
}
.rank {
font-size: 1.2rem;
}
.muted {
color: #94a3b8;
font-size: 1.15rem;
}
</style>