shopping-assistant-web-client/ShoppingAssistantWebClient.Web/Pages/Cart.razor
2023-11-20 15:48:48 +00:00

62 lines
2.0 KiB
Plaintext

@page "/cart/{currentWishlistId}"
@inject NavigationManager navigationManager;
<head>
<link rel="stylesheet" href="css/Cart.css" />
</head>
<div class="cart">
<div class="head">
<div id="button_open" class="open_menu">
<a class="button_open_menu">
<span></span>
<span></span>
<span></span>
</a>
</div>
<p class="header-text">Cart</p>
</div>
<div class="container">
@if (!isError) {
@if (Products != null) {
@foreach (var product in Products) {
<div class="product-div">
<img class="product-img" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSe7MHcuWUvuNJsttl3MEVxEayUGVNH4tA2Ha0K4szpgKvH7QYuiaBa_hCzUgW96I6LXqM&usqp=CAU">
<label class="product-description">@product.Description</label>
<div class="button-row">
<img class="star" src="/images/star.png">
<label class="rating">@product.Rating</label>
<label class="price-label">@product.Price</label>
</div>
<button class="button-amazon">
<img src="/images/amazon.png">
</button>
</div>
}
}
else{
<p class="error">Cart is empty</p>
}
}
else
{
<p class="error">Something went wrong<br>We are having some trouble loading the cart</p>
}
</div>
</div>
<script>
document.getElementById('button_open').addEventListener('click', changetyle);
</script>
@code
{
[Parameter] public string currentWishlistId {get; set; }
[Parameter] public string chatId {get; set; }
private void NavigateToMainPage()
{
navigationManager.NavigateTo($"/chat/{chatId}");
}
}