Migliorata gestione e visualizzazione notifiche

This commit is contained in:
2025-09-12 15:42:56 +02:00
parent b798b01da0
commit 223e74c490
20 changed files with 229 additions and 60 deletions

View File

@@ -6,12 +6,14 @@
@using salesbook.Shared.Core.Messages.Activity.Copy
@using salesbook.Shared.Core.Messages.Activity.New
@using salesbook.Shared.Core.Messages.Contact
@using salesbook.Shared.Core.Messages.Notification
@using salesbook.Shared.Core.Messages.Notification.Loaded
@using salesbook.Shared.Core.Messages.Notification.NewPush
@inject IDialogService Dialog
@inject IMessenger Messenger
@inject CopyActivityService CopyActivityService
@inject NewPushNotificationService NewPushNotificationService
@inject NotificationState Notification
@inject NotificationsLoadedService NotificationsLoadedService
<div class="container animated-navbar @(IsVisible ? "show-nav" : "hide-nav") @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
<nav class="navbar @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
@@ -68,8 +70,7 @@
protected override Task OnInitializedAsync()
{
CopyActivityService.OnCopyActivity += async dto => await CreateActivity(dto);
NewPushNotificationService.OnNotificationReceived += NewNotificationReceived;
InitMessage();
NavigationManager.LocationChanged += (_, args) =>
{
@@ -117,4 +118,11 @@
Notification.ReceivedNotifications.Add(notification);
InvokeAsync(StateHasChanged);
}
private void InitMessage()
{
CopyActivityService.OnCopyActivity += async dto => await CreateActivity(dto);
NewPushNotificationService.OnNotificationReceived += NewNotificationReceived;
NotificationsLoadedService.OnNotificationsLoaded += () => InvokeAsync(StateHasChanged);
}
}

View File

@@ -0,0 +1,12 @@
<MudOverlay Visible="Visible" DarkBackground="false">
<div class="overlay-container">
<span>Caricamento</span>
<MudProgressLinear Color="Color.Primary" Rounded="true" Size="Size.Medium" Indeterminate="true" />
</div>
</MudOverlay>
@code
{
[Parameter] public bool Visible { get; set; }
}

View File

@@ -0,0 +1,18 @@
.overlay-container {
background: var(--mud-palette-background);
width: 20rem;
height: 6rem;
padding: 0 1rem;
display: flex;
gap: .5rem;
flex-direction: column;
justify-content: center;
border-radius: 20px;
box-shadow: var(--custom-box-shadow);
}
.overlay-container > span {
text-align: center;
font-size: 20px;
font-weight: 600;
}