From b3a5f4298031deb110eacc1d6e41e6693dd8874f Mon Sep 17 00:00:00 2001 From: Marek Jarolimek Date: Fri, 6 Nov 2026 20:51:23 +0100 Subject: [PATCH] Po kliknuti na celou kartu se otevre detail produtu --- .../Components/Pages/Shared/ProductCard.razor | 29 +++++++++++++++--- Web-Jarmark/Web-Jarmark/jarmark.db-shm | Bin 32768 -> 32768 bytes Web-Jarmark/Web-Jarmark/jarmark.db-wal | Bin 321392 -> 329632 bytes 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Web-Jarmark/Web-Jarmark/Components/Pages/Shared/ProductCard.razor b/Web-Jarmark/Web-Jarmark/Components/Pages/Shared/ProductCard.razor index 9da89ea..0edb88c 100644 --- a/Web-Jarmark/Web-Jarmark/Components/Pages/Shared/ProductCard.razor +++ b/Web-Jarmark/Web-Jarmark/Components/Pages/Shared/ProductCard.razor @@ -1,6 +1,13 @@ @using Web_Jarmark.Data.Models +@using Microsoft.AspNetCore.Components.Web +@inject NavigationManager NavigationManager + +
-
@if (!string.IsNullOrWhiteSpace(Product.ImageUrl) && !imageFailed) { @@ -23,9 +30,7 @@
- -

@Product.Name

-
+

@Product.Name

@if (!string.IsNullOrWhiteSpace(Product.Description)) { @@ -56,7 +61,8 @@ } @@ -77,6 +83,19 @@ imageFailed = false; } + private void OpenProductDetail() + { + NavigationManager.NavigateTo($"/produkt/{Product.Id}"); + } + + private void HandleCardKeyDown(KeyboardEventArgs e) + { + if (e.Key == "Enter" || e.Key == " ") + { + OpenProductDetail(); + } + } + private void HandleImageError() { imageFailed = true; diff --git a/Web-Jarmark/Web-Jarmark/jarmark.db-shm b/Web-Jarmark/Web-Jarmark/jarmark.db-shm index 6eff4399771ff1d94a1033c8adff5079b4fb8196..c989b1d8f26254f76f3f1417248f6371749d506c 100644 GIT binary patch delta 168 zcmZo@U}|V!s+V}A%K!q55G)V?q_u$f)%w26i94hh95?vN-xoD~r+<*!-NHrQaippT y8U+S^K=MBlfC@7)_-$;oXPkI}WAg#VUs0P6#pnq!`fvW2_n(O|VDra9em($|Y&jSJ delta 174 zcmZo@U}|V!s+V}A%K!q55G>#aq_u$9CAd>>;faQb;|5>(`=X}rv|PEs`~4c$2c)V8 z8U+SEK=MBlfC@7)_-t&nXWV>(@mJL32aFt>55?#SZN9{KglY1YLK`6C0PE%rr5D0h%h1Ox2|AVto5YP?{H846bIW9Lh oGdDFiF|& delta 17 YcmZ3`FY@7>a6=1Y3sVd87M6nN07LKxHUIzs