v1.0.0
This commit is contained in:
1 parent
070168639d
commit
b05cbe61e8
23 files changed
+983
No files matched your search
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<base href="./" />
|
||||
<link rel="stylesheet" href="HA_Shopping_List.Server.styles.css" />
|
||||
<HeadOutlet />
|
||||
</head>
|
||||
|
||||
<body style="margin: 0; background-color: #f1f5f9; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;">
|
||||
<Routes />
|
||||
<script src="_framework/blazor.web.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
<div style="min-height: 100vh;">
|
||||
@Body
|
||||
</div>
|
||||
|
||||
<div id="blazor-error-ui" style="display: none; background: #fef2f2; color: #991b1b; padding: 0.75rem; position: fixed; bottom: 0; width: 100%; border-top: 1px solid #fecaca; text-align: center;">
|
||||
Une erreur inattendue est survenue.
|
||||
<a href="" style="color: #0284c7; margin-left: 0.5rem;">Recharger</a>
|
||||
</div>
|
||||
@@ -0,0 +1,18 @@
|
||||
#blazor-error-ui {
|
||||
background: lightyellow;
|
||||
bottom: 0;
|
||||
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
|
||||
display: none;
|
||||
left: 0;
|
||||
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#blazor-error-ui .dismiss {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0.75rem;
|
||||
top: 0.5rem;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
@page "/Error"
|
||||
@using System.Diagnostics
|
||||
|
||||
<PageTitle>Error</PageTitle>
|
||||
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
|
||||
@if (ShowRequestId)
|
||||
{
|
||||
<p>
|
||||
<strong>Request ID:</strong> <code>@RequestId</code>
|
||||
</p>
|
||||
}
|
||||
|
||||
<h3>Development Mode</h3>
|
||||
<p>
|
||||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||
</p>
|
||||
<p>
|
||||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||
It can result in displaying sensitive information from exceptions to end users.
|
||||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||
and restarting the app.
|
||||
</p>
|
||||
|
||||
@code{
|
||||
[CascadingParameter]
|
||||
private HttpContext? HttpContext { get; set; }
|
||||
|
||||
private string? RequestId { get; set; }
|
||||
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
|
||||
protected override void OnInitialized() =>
|
||||
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
|
||||
}
|
||||
@@ -0,0 +1,445 @@
|
||||
@page "/"
|
||||
@rendermode InteractiveServer
|
||||
@using HA_Shopping_List.Server.Data
|
||||
@using HA_Shopping_List.Server.Enum
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@inject IDbContextFactory<AppDbContext> DbFactory
|
||||
|
||||
<PageTitle>Liste de Courses</PageTitle>
|
||||
|
||||
<div style="max-width: 760px; margin: 1rem auto; padding: 0 1rem;">
|
||||
<!-- En-tête -->
|
||||
<h2 style="color: #0f172a; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem;">
|
||||
🛒 <span>Courses de la Maison</span>
|
||||
</h2>
|
||||
|
||||
<!-- Navigation par 3 onglets en partie haute -->
|
||||
<div style="display: flex; gap: 0.5rem; margin-bottom: 1.25rem; border-bottom: 2px solid #e2e8f0; padding-bottom: 0.5rem;">
|
||||
<button type="button" @onclick="() => currentTab = Tab.ShoppingList"
|
||||
style="flex: 1; padding: 0.65rem 0.5rem; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; transition: all 0.2s;
|
||||
background: @(currentTab == Tab.ShoppingList ? "#0284c7" : "#e2e8f0");
|
||||
color: @(currentTab == Tab.ShoppingList ? "#ffffff" : "#475569");">
|
||||
📝 Liste de courses (@activeItems.Count)
|
||||
</button>
|
||||
|
||||
<button type="button" @onclick="() => currentTab = Tab.Cart"
|
||||
style="flex: 1; padding: 0.65rem 0.5rem; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; transition: all 0.2s;
|
||||
background: @(currentTab == Tab.Cart ? "#0284c7" : "#e2e8f0");
|
||||
color: @(currentTab == Tab.Cart ? "#ffffff" : "#475569");">
|
||||
🛒 Dans le chariot (@cartItems.Count)
|
||||
</button>
|
||||
|
||||
<button type="button" @onclick="() => currentTab = Tab.History"
|
||||
style="flex: 1; padding: 0.65rem 0.5rem; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; transition: all 0.2s;
|
||||
background: @(currentTab == Tab.History ? "#0284c7" : "#e2e8f0");
|
||||
color: @(currentTab == Tab.History ? "#ffffff" : "#475569");">
|
||||
🕒 Historique (@historySuggestions.Count)
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- ========================================== -->
|
||||
<!-- ONGLET 1 : LISTE DE COURSES -->
|
||||
<!-- ========================================== -->
|
||||
@if (currentTab == Tab.ShoppingList)
|
||||
{
|
||||
<!-- Formulaire d'ajout rapide avec autocomplétion issue de l'historique -->
|
||||
<div style="background: #ffffff; border: 1px solid #cbd5e1; border-radius: 8px; padding: 1rem; margin-bottom: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05);">
|
||||
<div style="display: flex; gap: 0.5rem; flex-wrap: wrap;">
|
||||
<!-- Champ avec datalist liée à l'historique -->
|
||||
<input type="text"
|
||||
list="historySuggestionsList"
|
||||
@bind="newItemName"
|
||||
placeholder="Ajouter un article (ex: Lait, Pommes, Café...)"
|
||||
style="flex: 3; min-width: 200px; padding: 0.55rem; border: 1px solid #cbd5e1; border-radius: 6px;" />
|
||||
<datalist id="historySuggestionsList">
|
||||
@foreach (var suggestion in historySuggestions)
|
||||
{
|
||||
<option value="@suggestion"></option>
|
||||
}
|
||||
</datalist>
|
||||
|
||||
<!-- Quantité -->
|
||||
<input type="number"
|
||||
@bind="newItemQuantity"
|
||||
min="1"
|
||||
style="width: 60px; padding: 0.55rem; border: 1px solid #cbd5e1; border-radius: 6px; text-align: center;" />
|
||||
|
||||
<button type="button"
|
||||
@onclick="AddItem"
|
||||
style="background: #16a34a; color: white; border: none; padding: 0.55rem 1.25rem; border-radius: 6px; font-weight: bold; cursor: pointer;">
|
||||
+ Ajouter
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Liste des articles à acheter -->
|
||||
<div style="background: #ffffff; border: 1px solid #cbd5e1; border-radius: 8px; padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05);">
|
||||
@if (!activeItems.Any())
|
||||
{
|
||||
<div style="text-align: center; color: #64748b; padding: 2rem 0;">
|
||||
La liste est vide ! Utilisez le champ ci-dessus ou piochez dans l'historique.
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var item in activeItems)
|
||||
{
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid #f1f5f9;">
|
||||
<div>
|
||||
<span style="font-weight: 600; color: #1e293b; font-size: 1.05rem;">@item.Name</span>
|
||||
@if (item.Quantity > 1)
|
||||
{
|
||||
<span style="background: #e2e8f0; color: #334155; font-size: 0.8rem; padding: 0.15rem 0.5rem; border-radius: 12px; margin-left: 0.5rem; font-weight: bold;">
|
||||
x@(item.Quantity)
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div style="display: flex; align-items: center; gap: 0.5rem;">
|
||||
<!-- Contrôles de quantité (- et +) -->
|
||||
<div style="display: flex; align-items: center; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 6px; padding: 0.15rem;">
|
||||
<button type="button"
|
||||
@onclick="() => DecreaseQuantity(item)"
|
||||
title="Diminuer la quantité"
|
||||
style="background: transparent; border: none; color: #475569; width: 28px; height: 28px; font-weight: bold; font-size: 1rem; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center;">
|
||||
-
|
||||
</button>
|
||||
<span style="font-weight: 600; min-width: 24px; text-align: center; font-size: 0.95rem; color: #1e293b;">
|
||||
@item.Quantity
|
||||
</span>
|
||||
<button type="button"
|
||||
@onclick="() => IncreaseQuantity(item)"
|
||||
title="Augmenter la quantité"
|
||||
style="background: transparent; border: none; color: #475569; width: 28px; height: 28px; font-weight: bold; font-size: 1rem; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center;">
|
||||
+
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Mettre dans le panier -->
|
||||
<button type="button"
|
||||
@onclick="() => MoveToCart(item)"
|
||||
title="Mettre dans le chariot"
|
||||
style="background: #0284c7; color: white; border: none; padding: 0.45rem 0.8rem; border-radius: 6px; cursor: pointer; font-weight: 500;">
|
||||
🛒 Au chariot
|
||||
</button>
|
||||
|
||||
<!-- Supprimer de la liste -->
|
||||
<button type="button"
|
||||
@onclick="() => RemoveActiveItem(item)"
|
||||
title="Supprimer"
|
||||
style="background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; padding: 0.45rem 0.65rem; border-radius: 6px; cursor: pointer;">
|
||||
✕
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- ========================================== -->
|
||||
<!-- ONGLET 2 : DANS LE CHARIOT -->
|
||||
<!-- ========================================== -->
|
||||
@if (currentTab == Tab.Cart)
|
||||
{
|
||||
<div style="background: #ffffff; border: 1px solid #cbd5e1; border-radius: 8px; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.75rem;">
|
||||
<h4 style="margin: 0; color: #1e293b;">Articles actuellement dans le panier</h4>
|
||||
@if (cartItems.Any())
|
||||
{
|
||||
<button type="button"
|
||||
@onclick="ClearCartAndArchive"
|
||||
style="background: #dc2626; color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-weight: bold;">
|
||||
🗑️ Vider le chariot
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (!cartItems.Any())
|
||||
{
|
||||
<div style="text-align: center; color: #64748b; padding: 2rem 0;">
|
||||
Votre chariot est vide pour l'instant.
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var item in cartItems)
|
||||
{
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid #f1f5f9;">
|
||||
<div>
|
||||
<span style="text-decoration: line-through; color: #64748b; font-size: 1rem;">@item.Name</span>
|
||||
@if (item.Quantity > 1)
|
||||
{
|
||||
<span style="color: #94a3b8; font-size: 0.8rem; margin-left: 0.4rem;">(x@(item.Quantity))</span>
|
||||
}
|
||||
</div>
|
||||
<button type="button"
|
||||
@onclick="() => ReturnToList(item)"
|
||||
title="Remettre dans la liste"
|
||||
style="background: #f8fafc; border: 1px solid #cbd5e1; color: #475569; padding: 0.35rem 0.65rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem;">
|
||||
↩ Remettre en liste
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- ========================================== -->
|
||||
<!-- ONGLET 3 : HISTORIQUE -->
|
||||
<!-- ========================================== -->
|
||||
@if (currentTab == Tab.History)
|
||||
{
|
||||
<div style="background: #ffffff; border: 1px solid #cbd5e1; border-radius: 8px; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05);">
|
||||
<!-- Barre de recherche -->
|
||||
<div style="margin-bottom: 1rem;">
|
||||
<input type="text"
|
||||
@bind="searchQuery"
|
||||
@bind:event="oninput"
|
||||
placeholder="🔍 Rechercher dans l'historique des achats..."
|
||||
style="width: 100%; padding: 0.6rem; border: 1px solid #cbd5e1; border-radius: 6px; box-sizing: border-box;" />
|
||||
</div>
|
||||
|
||||
@{
|
||||
var filteredHistory = string.IsNullOrWhiteSpace(searchQuery)
|
||||
? historyItems
|
||||
: historyItems.Where(h => h.Name.Contains(searchQuery, StringComparison.OrdinalIgnoreCase)).ToList();
|
||||
}
|
||||
|
||||
@if (!filteredHistory.Any())
|
||||
{
|
||||
<div style="text-align: center; color: #64748b; padding: 2rem 0;">
|
||||
Aucun article trouvé dans l'historique.
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var item in filteredHistory)
|
||||
{
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid #f1f5f9;">
|
||||
<div>
|
||||
<strong style="color: #1e293b;">@item.Name</strong>
|
||||
<div style="font-size: 0.8rem; color: #94a3b8;">
|
||||
Dernier achat : @item.LastPurchasedAt.ToString("dd/MM/yyyy")
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; gap: 0.5rem;">
|
||||
<button type="button"
|
||||
@onclick="() => ReAddFromHistory(item)"
|
||||
style="background: #0284c7; color: white; border: none; padding: 0.4rem 0.8rem; border-radius: 6px; cursor: pointer; font-weight: 500;">
|
||||
+ Ajouter à la liste
|
||||
</button>
|
||||
<button type="button"
|
||||
@onclick="() => DeleteFromHistory(item.Id)"
|
||||
style="background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; padding: 0.4rem 0.6rem; border-radius: 6px; cursor: pointer;">
|
||||
✕
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private enum Tab { ShoppingList, Cart, History }
|
||||
private Tab currentTab = Tab.ShoppingList;
|
||||
|
||||
private List<ShoppingItem> activeItems = new();
|
||||
private List<ShoppingItem> cartItems = new();
|
||||
private List<ShoppingItem> historyItems = new();
|
||||
private List<string> historySuggestions = new();
|
||||
|
||||
private string newItemName = string.Empty;
|
||||
private int newItemQuantity = 1;
|
||||
private string searchQuery = string.Empty;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadAllData();
|
||||
}
|
||||
|
||||
private async Task LoadAllData()
|
||||
{
|
||||
using var db = await DbFactory.CreateDbContextAsync();
|
||||
|
||||
var all = await db.Items.ToListAsync();
|
||||
|
||||
activeItems = all.Where(i => i.Status == ShoppingItemStatus.Active)
|
||||
.OrderBy(i => i.Name)
|
||||
.ToList();
|
||||
|
||||
cartItems = all.Where(i => i.Status == ShoppingItemStatus.InCart)
|
||||
.OrderBy(i => i.Name)
|
||||
.ToList();
|
||||
|
||||
// L'historique regroupe les articles par nom distinct pour l'affichage et l'autocomplétion
|
||||
historyItems = all.GroupBy(i => i.Name.Trim().ToLowerInvariant())
|
||||
.Select(g => g.OrderByDescending(x => x.LastPurchasedAt).First())
|
||||
.OrderBy(i => i.Name)
|
||||
.ToList();
|
||||
|
||||
historySuggestions = historyItems.Select(h => h.Name).ToList();
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private async Task AddItem()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(newItemName)) return;
|
||||
|
||||
using var db = await DbFactory.CreateDbContextAsync();
|
||||
var normalizedName = newItemName.Trim();
|
||||
|
||||
// Vérifie si l'article est déjà présent dans la liste active
|
||||
var existingActive = await db.Items.FirstOrDefaultAsync(i =>
|
||||
i.Status == ShoppingItemStatus.Active &&
|
||||
i.Name.ToLower() == normalizedName.ToLower());
|
||||
|
||||
if (existingActive != null)
|
||||
{
|
||||
existingActive.Quantity += newItemQuantity;
|
||||
}
|
||||
else
|
||||
{
|
||||
db.Items.Add(new ShoppingItem
|
||||
{
|
||||
Name = normalizedName,
|
||||
Quantity = newItemQuantity,
|
||||
Status = ShoppingItemStatus.Active,
|
||||
LastPurchasedAt = DateTime.Now
|
||||
});
|
||||
}
|
||||
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
newItemName = string.Empty;
|
||||
newItemQuantity = 1;
|
||||
await LoadAllData();
|
||||
}
|
||||
|
||||
private async Task MoveToCart(ShoppingItem item)
|
||||
{
|
||||
using var db = await DbFactory.CreateDbContextAsync();
|
||||
var entity = await db.Items.FindAsync(item.Id);
|
||||
if (entity != null)
|
||||
{
|
||||
entity.Status = ShoppingItemStatus.InCart;
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
await LoadAllData();
|
||||
}
|
||||
|
||||
private async Task ReturnToList(ShoppingItem item)
|
||||
{
|
||||
using var db = await DbFactory.CreateDbContextAsync();
|
||||
var entity = await db.Items.FindAsync(item.Id);
|
||||
if (entity != null)
|
||||
{
|
||||
entity.Status = ShoppingItemStatus.Active;
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
await LoadAllData();
|
||||
}
|
||||
|
||||
private async Task RemoveActiveItem(ShoppingItem item)
|
||||
{
|
||||
using var db = await DbFactory.CreateDbContextAsync();
|
||||
var entity = await db.Items.FindAsync(item.Id);
|
||||
if (entity != null)
|
||||
{
|
||||
// Passe en statut Purchased pour rester consultable dans l'historique
|
||||
entity.Status = ShoppingItemStatus.Purchased;
|
||||
entity.LastPurchasedAt = DateTime.Now;
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
await LoadAllData();
|
||||
}
|
||||
|
||||
private async Task ClearCartAndArchive()
|
||||
{
|
||||
using var db = await DbFactory.CreateDbContextAsync();
|
||||
var inCart = await db.Items.Where(i => i.Status == ShoppingItemStatus.InCart).ToListAsync();
|
||||
|
||||
foreach (var item in inCart)
|
||||
{
|
||||
item.Status = ShoppingItemStatus.Purchased;
|
||||
item.LastPurchasedAt = DateTime.Now;
|
||||
}
|
||||
|
||||
await db.SaveChangesAsync();
|
||||
await LoadAllData();
|
||||
}
|
||||
|
||||
private async Task ReAddFromHistory(ShoppingItem item)
|
||||
{
|
||||
using var db = await DbFactory.CreateDbContextAsync();
|
||||
var existingActive = await db.Items.FirstOrDefaultAsync(i =>
|
||||
i.Status == ShoppingItemStatus.Active &&
|
||||
i.Name.ToLower() == item.Name.ToLower());
|
||||
|
||||
if (existingActive != null)
|
||||
{
|
||||
existingActive.Quantity += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
db.Items.Add(new ShoppingItem
|
||||
{
|
||||
Name = item.Name,
|
||||
Quantity = 1,
|
||||
Status = ShoppingItemStatus.Active,
|
||||
LastPurchasedAt = DateTime.Now
|
||||
});
|
||||
}
|
||||
|
||||
await db.SaveChangesAsync();
|
||||
await LoadAllData();
|
||||
}
|
||||
|
||||
private async Task DeleteFromHistory(int id)
|
||||
{
|
||||
using var db = await DbFactory.CreateDbContextAsync();
|
||||
var entity = await db.Items.FindAsync(id);
|
||||
if (entity != null)
|
||||
{
|
||||
db.Items.Remove(entity);
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
await LoadAllData();
|
||||
}
|
||||
|
||||
private async Task IncreaseQuantity(ShoppingItem item)
|
||||
{
|
||||
using var db = await DbFactory.CreateDbContextAsync();
|
||||
var entity = await db.Items.FindAsync(item.Id);
|
||||
if (entity != null)
|
||||
{
|
||||
entity.Quantity++;
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
await LoadAllData();
|
||||
}
|
||||
|
||||
private async Task DecreaseQuantity(ShoppingItem item)
|
||||
{
|
||||
using var db = await DbFactory.CreateDbContextAsync();
|
||||
var entity = await db.Items.FindAsync(item.Id);
|
||||
if (entity != null)
|
||||
{
|
||||
if (entity.Quantity > 1)
|
||||
{
|
||||
entity.Quantity--;
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Si la quantité passe en dessous de 1, l'article est retiré de la liste active vers l'historique
|
||||
await RemoveActiveItem(item);
|
||||
return;
|
||||
}
|
||||
}
|
||||
await LoadAllData();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<Router AppAssembly="typeof(Program).Assembly">
|
||||
<Found Context="routeData">
|
||||
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" />
|
||||
<FocusOnNavigate RouteData="routeData" Selector="h1" />
|
||||
</Found>
|
||||
</Router>
|
||||
@@ -0,0 +1,10 @@
|
||||
@using System.Net.Http
|
||||
@using System.Net.Http.Json
|
||||
@using Microsoft.AspNetCore.Components.Forms
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||
@using Microsoft.JSInterop
|
||||
@using HA_Shopping_List.Server
|
||||
@using HA_Shopping_List.Server.Components
|
||||
Reference in new issue
Block a user