Skip to content

Commit bb5906b

Browse files
committed
Added additional icons, animations and improved styling
Transactions for hold now have better notifications
1 parent 2ceb323 commit bb5906b

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

ChildAllowanceManager/Components/Pages/ChildrenListPage.razor

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<MudText Color="Color.Error">x @child.HoldDaysRemaining</MudText>
5151
</Authorized>
5252
<NotAuthorized>
53-
<MudChip Icon="fa-solid fa-ban"
53+
<MudChip Icon="fa-solid fa-ban fa-flip"
5454
IconColor="Color.Error"
5555
Variant="Variant.Outlined"
5656
Class="ma-2 px-1"
@@ -73,7 +73,7 @@
7373
T="string"/>
7474
</Authorized>
7575
<NotAuthorized>
76-
<MudChip Icon="fa-solid fa-ban"
76+
<MudChip Icon="fa-solid fa-ban fa-flip"
7777
IconColor="Color.Error"
7878
Variant="Variant.Outlined"
7979
Class="ma-2 px-1"
@@ -84,7 +84,10 @@
8484
}
8585
</MudChipSet>
8686
}
87-
<MudText Typo="Typo.body1">+@child.NextRegularChange.ToString("C2") @child.NextRegularChangeDate.ToLocalTime().Humanize()</MudText>
87+
<div style="display: flex; align-items: center; gap: 12px;">
88+
<MudIcon Icon="fa-solid fa-piggy-bank fa-fade" Style="@($"color:{Colors.Yellow.Darken2};")"></MudIcon>
89+
<MudText Typo="Typo.body1">+@child.NextRegularChange.ToString("C2") @child.NextRegularChangeDate.ToLocalTime().Humanize()</MudText>
90+
</div>
8891
</MudCardContent>
8992
<MudCardActions>
9093
<MudTooltip Text="Transactions">

ChildAllowanceManager/Components/Pages/ChildrenListPage.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private void ChildStateChangedNotification(object? sender, IGlobalNotificationSe
112112
Logger.LogDebug("Child {Child} has been updated", e.ChildId);
113113
if (!string.IsNullOrEmpty(e.NotificationMessage))
114114
{
115-
var child = Children.FirstOrDefault(c => c.Id == e.ChildId);
115+
var child = Children?.FirstOrDefault(c => c.Id == e.ChildId);
116116
if (child is not null)
117117
{
118118
Snackbar.Add($"{child.Name}\r\n{e.NotificationMessage}", Severity.Info);

ChildAllowanceManager/Services/TransactionService.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,19 @@ public async ValueTask<AllowanceTransaction> AddTransaction(AllowanceTransaction
110110
var result = await transactionRepository.CreateAsync(transaction, cancellationToken);
111111

112112
// notify global notification service
113+
string message;
114+
if (transaction.TransactionType != TransactionType.Hold)
115+
{
116+
message = $"Balance changed by {transaction.TransactionAmount:C} to {transaction.Balance:C}";
117+
}
118+
else
119+
{
120+
message = transaction.Description;
121+
}
122+
113123
globalNotificationService.OnChildStateChanged(transaction.ChildId,
114124
transaction.TenantId,
115-
$"Balance changed by {transaction.TransactionAmount:C} to {transaction.Balance:C}");
125+
message);
116126
return result;
117127
}
118128

0 commit comments

Comments
 (0)