feature: main page

This commit is contained in:
antv
2026-07-06 15:06:14 +07:00
parent 11a6568717
commit 64027eb8f2
2 changed files with 23 additions and 11 deletions
+8 -5
View File
@@ -49,7 +49,7 @@
</x-stat-card> </x-stat-card>
</div> </div>
<div class="flex flex-col gap-6 xl:flex-row xl:items-start xl:gap-8"> <div class="flex flex-col gap-6 lg:flex-row lg:items-start lg:gap-8">
<div class="flex-1 min-w-0 flex flex-col gap-6"> <div class="flex-1 min-w-0 flex flex-col gap-6">
@@ -89,12 +89,12 @@
</div> </div>
</div> </div>
<div class="w-full"> <div class="w-full mt-4">
<x-info-card /> <x-info-card />
</div> </div>
</div> </div>
<div class="w-full xl:w-[380px] xl:flex-shrink-0 flex flex-col gap-6"> <div class="w-full lg:w-[32%] lg:min-w-[340px] lg:max-w-[400px] flex flex-col gap-6">
<div class="bg-white rounded-[24px] shadow-[0_10px_30px_rgba(15,23,42,0.05)] p-6 flex flex-col h-full"> <div class="bg-white rounded-[24px] shadow-[0_10px_30px_rgba(15,23,42,0.05)] p-6 flex flex-col h-full">
<div class="flex items-center justify-between mb-3 pl-1 pr-1"> <div class="flex items-center justify-between mb-3 pl-1 pr-1">
@@ -123,16 +123,19 @@
<x-ranking-item rank="1" name="Lê Quỳnh Chi" team="Marketing Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Chi&backgroundColor=fef3c7" score="95" unit="thẻ" /> <x-ranking-item rank="1" name="Lê Quỳnh Chi" team="Marketing Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Chi&backgroundColor=fef3c7" score="95" unit="thẻ" />
<x-ranking-item rank="2" name="Trần Hoàng Nam" team="Dev Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Nam&backgroundColor=e2e8f0" score="82" unit="thẻ" /> <x-ranking-item rank="2" name="Trần Hoàng Nam" team="Dev Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Nam&backgroundColor=e2e8f0" score="82" unit="thẻ" />
<x-ranking-item rank="3" name="Phạm Đức Huy" team="Product Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Huy&backgroundColor=e2e8f0" score="67" unit="thẻ" /> <x-ranking-item rank="3" name="Phạm Đức Huy" team="Product Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Huy&backgroundColor=e2e8f0" score="67" unit="thẻ" />
<x-ranking-item rank="4" name="Hoàng Anh Tuấn" team="Dev Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Tuan&backgroundColor=e2e8f0" score="58" unit="thẻ" />
<div class="my-3 border-t border-dashed border-gray-100 mx-2"></div> <div class="my-3 border-t border-dashed border-gray-100 mx-2"></div>
<x-ranking-item rank="5" name="{{ Auth::check() ? (Auth::user()->name ?? 'Nguyễn Minh Anh') : 'Nguyễn Minh Anh' }}" team="Product Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed={{ Auth::id() ?? 'MinhAnh' }}&backgroundColor=bfdbfe" score="45" unit="thẻ" :isCurrent="true" /> <x-ranking-item rank="7" name="{{ Auth::check() ? (Auth::user()->name ?? 'Nguyễn Minh Anh') : 'Nguyễn Minh Anh' }}" team="Product Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed={{ Auth::id() ?? 'MinhAnh' }}&backgroundColor=bfdbfe" score="45" unit="thẻ" :isCurrent="true" />
</div> </div>
<div id="ranking-sent" class="flex-1 flex flex-col mb-2 hidden"> <div id="ranking-sent" class="flex-1 flex flex-col mb-2 hidden">
<x-ranking-item rank="1" name="Nguyễn Văn Lâm" team="HR Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Lam&backgroundColor=fef3c7" score="88" unit="thẻ" /> <x-ranking-item rank="1" name="Nguyễn Văn Lâm" team="HR Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Lam&backgroundColor=fef3c7" score="88" unit="thẻ" />
<x-ranking-item rank="2" name="Phạm Thu Thủy" team="Admin Team" avatar="https://api.dicebear.com/7.x:notionists/svg?seed=Thuy&backgroundColor=e2e8f0" score="75" unit="thẻ" /> <x-ranking-item rank="2" name="Phạm Thu Thủy" team="Admin Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Thuy&backgroundColor=e2e8f0" score="75" unit="thẻ" />
<x-ranking-item rank="3" name="Lê Quỳnh Chi" team="Marketing Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Chi&backgroundColor=e2e8f0" score="64" unit="thẻ" /> <x-ranking-item rank="3" name="Lê Quỳnh Chi" team="Marketing Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Chi&backgroundColor=e2e8f0" score="64" unit="thẻ" />
<x-ranking-item rank="4" name="Đỗ Thùy Linh" team="Marketing Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Linh&backgroundColor=e2e8f0" score="55" unit="thẻ" />
<x-ranking-item rank="5" name="Vũ Minh Đức" team="Dev Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Duc&backgroundColor=e2e8f0" score="48" unit="thẻ" />
<div class="my-3 border-t border-dashed border-gray-100 mx-2"></div> <div class="my-3 border-t border-dashed border-gray-100 mx-2"></div>
+14 -5
View File
@@ -11,9 +11,17 @@ class UserDashboardLayoutTest extends TestCase
public function test_dashboard_renders_two_column_layout_for_desktop(): void public function test_dashboard_renders_two_column_layout_for_desktop(): void
{ {
$user = \App\Models\User::factory()->create([ $user = \App\Models\User::create([
'email' => 'admin@runsystem.net', 'msnv' => 5001,
'name' => 'System Admin', 'name' => 'System Admin',
'mail' => 'admin@runsystem.net',
'pass' => md5('password'),
'departments' => 1,
'role' => \App\Models\User::ROLE_ADMIN,
'status' => \App\Models\User::STATUS_ACTIVE,
'card' => 10,
'flag_send' => \App\Models\User::FLAG_SEND_ENABLED,
'first_login' => \App\Models\User::FIRST_LOGIN_FALSE,
]); ]);
$this->actingAs($user); $this->actingAs($user);
@@ -23,9 +31,10 @@ class UserDashboardLayoutTest extends TestCase
$response->assertOk(); $response->assertOk();
$response->assertSee('Thanks gần đây', false); $response->assertSee('Thanks gần đây', false);
$response->assertSee('Bảng xếp hạng', false); $response->assertSee('Bảng xếp hạng', false);
$response->assertSee('xl:flex-row', false); $response->assertSee('lg:flex-row', false);
$response->assertSee('xl:w-[380px]', false);
$response->assertSee('xl:flex-shrink-0', false);
$response->assertSee('flex-1 min-w-0', false); $response->assertSee('flex-1 min-w-0', false);
$response->assertSee('lg:w-[32%]', false);
$response->assertSee('lg:min-w-[340px]', false);
$response->assertSee('lg:max-w-[400px]', false);
} }
} }