Skip to content

Commit b9f30b6

Browse files
committed
feat(Products): exibe listagem de produtos
1 parent c7ec71e commit b9f30b6

File tree

3 files changed

+30
-21
lines changed

3 files changed

+30
-21
lines changed

src/BlazingShop/Components/Layout/NavMenu.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
</div>
1616

1717
<div class="nav-item px-3">
18-
<NavLink class="nav-link" href="counter">
19-
<span class="bi bi-plus-square-fill-nav-menu" aria-hidden="true"></span> Counter
18+
<NavLink class="nav-link" href="products">
19+
<span class="bi bi-plus-square-fill-nav-menu" aria-hidden="true"></span> Products
2020
</NavLink>
2121
</div>
2222
</nav>

src/BlazingShop/Components/Pages/Counter.razor

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@page "/products"
2+
3+
<PageTitle>Products</PageTitle>
4+
5+
<h1>Products</h1>
6+
7+
<ul>
8+
@foreach (var product in _products)
9+
{
10+
<li>@product.Title</li>
11+
}
12+
</ul>
13+
14+
@code {
15+
private List<Product> _products = [];
16+
17+
protected override async Task OnInitializedAsync()
18+
{
19+
await Task.Delay(500);
20+
var category = new Category(1, $"Categoria 1");
21+
22+
for (var i = 0; i < 25; i++)
23+
{
24+
_products.Add(new Product(i, $"Título {i}", $"Descrição do produto {i}", $"imagem-produto-{i}", i * 13.75M, category));
25+
}
26+
27+
}
28+
}

0 commit comments

Comments
 (0)