diff --git a/ShoppingAssistantWebClient.Web/Pages/ConfirmationModal.razor b/ShoppingAssistantWebClient.Web/Pages/ConfirmationModal.razor
new file mode 100644
index 0000000..e43a5bb
--- /dev/null
+++ b/ShoppingAssistantWebClient.Web/Pages/ConfirmationModal.razor
@@ -0,0 +1,24 @@
+
+
+
+@code {
+ [CascadingParameter] BlazoredModalInstance BlazoredModal { get; set; } = default!;
+
+ private async Task Close() => await BlazoredModal.CloseAsync(ModalResult.Ok(true));
+ private async Task ConfirmDelete() => await BlazoredModal.CloseAsync(ModalResult.Ok(true));
+ private async Task Cancel() => await BlazoredModal.CloseAsync(ModalResult.Cancel());
+
+}
\ No newline at end of file
diff --git a/ShoppingAssistantWebClient.Web/Pages/ConfirmationModal.razor.css b/ShoppingAssistantWebClient.Web/Pages/ConfirmationModal.razor.css
new file mode 100644
index 0000000..a5ffb15
--- /dev/null
+++ b/ShoppingAssistantWebClient.Web/Pages/ConfirmationModal.razor.css
@@ -0,0 +1,48 @@
+.modal-dialog.modal-sm {
+ max-width: 300px;
+}
+
+.medium-text {
+ font-size: 1rem;
+}
+
+.btn-sm {
+ font-size: 0.9rem;
+ padding: 6px 12px;
+}
+
+.btn-yes {
+ color: #FFFFFF;
+ background-color: #FF0000;
+}
+
+.btn:active {
+ transform: scale(0.95);
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
+}
+
+.btn:focus {
+ outline: none !important;
+ box-shadow: none !important;
+}
+
+.modal-header, .modal-footer {
+ padding: 8px;
+}
+
+@media (max-width: 600px) {
+ .modal-dialog {
+ max-width: 100%;
+ margin: 10px auto;
+ }
+ .modal-content {
+ margin: 0;
+ }
+}
+
+
+.close {
+ background: none;
+ border: none;
+ outline: none;
+}
\ No newline at end of file
diff --git a/ShoppingAssistantWebClient.Web/Program.cs b/ShoppingAssistantWebClient.Web/Program.cs
index 99b9198..bae7570 100644
--- a/ShoppingAssistantWebClient.Web/Program.cs
+++ b/ShoppingAssistantWebClient.Web/Program.cs
@@ -1,3 +1,4 @@
+using Blazored.Modal;
using GraphQL.Client.Http;
using ShoppingAssistantWebClient.Web.Configurations;
using ShoppingAssistantWebClient.Web.Data;
diff --git a/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor b/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor
index b1c3d14..c96b47b 100644
--- a/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor
+++ b/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor
@@ -41,8 +41,10 @@
RedirectToPage(item.Id)">@item.Name
-
DeleteWishlist(item.Id)" src="/images/icon_delete.svg" alt="Delete wishlist">
-
RedirectToCart(item.Id)" src="/images/icon_open_card.svg" alt="Card open">
+
}
}
@@ -188,8 +190,17 @@
}
private async void DeleteWishlist(string itemId) {
- await DeleteWish(itemId);
+ var options = new ModalOptions
+ {
+ UseCustomLayout = true
+ };
+ var parameters = new ModalParameters();
+
+ var result = await Modal.Show("", parameters, options).Result;
+
+ if (!result.Cancelled)
+ await DeleteWish(itemId);
}
/*
private int savedScrollTop = 0;
@@ -212,6 +223,4 @@
}
*/
-
-
}
\ No newline at end of file
diff --git a/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor.css b/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor.css
index f055940..4505df3 100644
--- a/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor.css
+++ b/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor.css
@@ -83,15 +83,17 @@
.wishlist_name {
padding-left: 0.7em;
padding-right: 5em;
- width: 10.5em;
+ width: 15.5em;
white-space: nowrap;
overflow: hidden;
position: absolute;
height: 2.5em;
line-height: 2.5em;
cursor: pointer;
+ z-index: 1;
}
+
.cont_wishlist {
margin-top: 0.4375em;
margin-bottom: 0.4375em;
@@ -100,7 +102,7 @@
font-size: 1.1em;
width: 100%;
height: 2.5em;
-
+ position: relative;
}
.cont_wishlist:hover {
@@ -126,7 +128,7 @@
font-size: 1.1em;
width: 100%;
height: 2.5em;
- background-color: #e6e6e6;
+ background-color: #e6e6e6;
transition: 0.2s;
}
@@ -172,11 +174,27 @@
margin-top: 0.55em;
margin-right: 1em;
float: right;
- visibility: hidden;
height: 1.4em;
width: 1.5em;
}
+
+.wishlist_buttons {
+ display: none;
+ position: absolute;
+ right: 0;
+ width: 4.9em;
+ height: 2.5em;
+ background-color: #e6e6e6;
+ border-radius: 0.6em;
+ z-index: 10;
+}
+
+.cont_wishlist:hover .wishlist_buttons
+{
+ display: block;
+}
+
.wishlist_names::-webkit-scrollbar {
border-radius: 20px;
width: 0.2em;
@@ -184,9 +202,7 @@
.wishlist_names::-webkit-scrollbar-thumb {
background-color: #0052CC;
- /* Колір позиції покажчика */
border-radius: 10px;
- /* Закруглення країв позиції покажчика */
width: 0.2em;
}