feat: enhance ReleaseNotesDialog with improved UI elements and animations; update button labels and alert messages
Build and Deploy / build (push) Successful in 1m26s

This commit is contained in:
masoodafar-web
2025-12-27 05:06:03 +03:30
parent 9cd275a777
commit 43cdf7c897
@@ -4,41 +4,54 @@
<MudDialog> <MudDialog>
<TitleContent> <TitleContent>
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2"> <MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
<MudIcon Icon="@Icons.Material.Filled.SystemUpdateAlt" Color="Color.Primary" Size="Size.Large"/> @if (IsForceUpdate)
<MudText Typo="Typo.h6"> {
@if (IsForceUpdate) <MudIcon Icon="@Icons.Material.Filled.Warning" Color="Color.Warning" Size="Size.Large"/>
{ <MudText Typo="Typo.h6" Color="Color.Warning">بروزرسانی اجباری</MudText>
<span>بروزرسانی اجباری</span> }
} else
else {
{ <MudIcon Icon="@Icons.Material.Filled.NewReleases" Color="Color.Success" Size="Size.Large"/>
<span>نسخه جدید موجود است</span> <MudText Typo="Typo.h6">نسخه جدید موجود است 🎉</MudText>
} }
</MudText>
</MudStack> </MudStack>
</TitleContent> </TitleContent>
<DialogContent> <DialogContent>
<MudStack Spacing="3"> <MudStack Spacing="3">
@* اطلاعات نسخه *@ @* اطلاعات نسخه با انیمیشن *@
<MudPaper Class="pa-3" Elevation="0" Style="background-color: var(--mud-palette-background-grey);"> <MudPaper Class="pa-4 rounded-lg" Elevation="0"
<MudStack Row="true" Justify="Justify.SpaceBetween"> Style="background: linear-gradient(135deg, var(--mud-palette-primary-lighten) 0%, var(--mud-palette-background) 100%);">
<MudText>نسخه فعلی:</MudText> <MudGrid Spacing="2">
<MudText Color="Color.Secondary">@(OldVersion ?? "---")</MudText> <MudItem xs="6">
</MudStack> <MudStack AlignItems="AlignItems.Center" Spacing="1">
<MudDivider Class="my-2"/> <MudIcon Icon="@Icons.Material.Outlined.History" Size="Size.Medium" Color="Color.Secondary"/>
<MudStack Row="true" Justify="Justify.SpaceBetween"> <MudText Typo="Typo.caption" Color="Color.Secondary">نسخه فعلی</MudText>
<MudText>نسخه جدید:</MudText> <MudChip T="string" Size="Size.Small" Variant="Variant.Outlined" Color="Color.Secondary">
<MudText Color="Color.Primary"><b>@NewVersion</b></MudText> @(OldVersion ?? "---")
</MudStack> </MudChip>
</MudStack>
</MudItem>
<MudItem xs="6">
<MudStack AlignItems="AlignItems.Center" Spacing="1">
<MudIcon Icon="@Icons.Material.Filled.Verified" Size="Size.Medium" Color="Color.Success"/>
<MudText Typo="Typo.caption" Color="Color.Success">نسخه جدید</MudText>
<MudChip T="string" Size="Size.Small" Variant="Variant.Filled" Color="Color.Success">
@NewVersion
</MudChip>
</MudStack>
</MudItem>
</MudGrid>
</MudPaper> </MudPaper>
@* پیام آپدیت *@ @* پیام آپدیت *@
@if (!string.IsNullOrWhiteSpace(UpdateMessage)) @if (!string.IsNullOrWhiteSpace(UpdateMessage))
{ {
<MudAlert Severity="@(IsForceUpdate ? Severity.Warning : Severity.Info)" <MudAlert Severity="@(IsForceUpdate ? Severity.Warning : Severity.Info)"
Variant="Variant.Outlined" Variant="Variant.Text"
Dense="true"> Dense="true"
Icon="@Icons.Material.Filled.Info"
Class="rounded-lg">
@UpdateMessage @UpdateMessage
</MudAlert> </MudAlert>
} }
@@ -46,18 +59,27 @@
@* یادداشت‌های انتشار *@ @* یادداشت‌های انتشار *@
@if (!string.IsNullOrWhiteSpace(ReleaseNotes)) @if (!string.IsNullOrWhiteSpace(ReleaseNotes))
{ {
<MudText Typo="Typo.subtitle2" Color="Color.Primary">تغییرات این نسخه:</MudText> <MudStack Spacing="1">
<MudPaper Class="pa-3" Elevation="1" Style="max-height: 250px; overflow-y: auto;"> <MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
@((MarkupString)ReleaseNotes) <MudIcon Icon="@Icons.Material.Filled.Article" Size="Size.Small" Color="Color.Primary"/>
</MudPaper> <MudText Typo="Typo.subtitle2" Color="Color.Primary">تغییرات این نسخه:</MudText>
</MudStack>
<MudPaper Class="pa-3 rounded-lg release-notes-content" Elevation="0"
Style="max-height: 220px; overflow-y: auto; background-color: var(--mud-palette-background-grey); border: 1px solid var(--mud-palette-lines-default);">
@((MarkupString)ReleaseNotes)
</MudPaper>
</MudStack>
} }
@if (IsForceUpdate) @if (IsForceUpdate)
{ {
<MudAlert Severity="Severity.Error" Variant="Variant.Filled" Dense="true"> <MudAlert Severity="Severity.Error" Variant="Variant.Filled" Dense="true" Class="rounded-lg">
<MudText Typo="Typo.body2"> <MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
این بروزرسانی اجباری است و باید انجام شود. <MudIcon Icon="@Icons.Material.Filled.Error" Size="Size.Small"/>
</MudText> <MudText Typo="Typo.body2">
این بروزرسانی اجباری است و باید انجام شود.
</MudText>
</MudStack>
</MudAlert> </MudAlert>
} }
</MudStack> </MudStack>
@@ -68,14 +90,17 @@
{ {
<MudButton OnClick="OnSkipClicked" <MudButton OnClick="OnSkipClicked"
Color="Color.Default" Color="Color.Default"
Variant="Variant.Text"> Variant="Variant.Text"
بعداً Size="Size.Medium">
بعداً یادآوری کن
</MudButton> </MudButton>
} }
<MudButton OnClick="OnUpdateClicked" <MudButton OnClick="OnUpdateClicked"
Color="Color.Primary" Color="@(IsForceUpdate ? Color.Warning : Color.Success)"
Variant="Variant.Filled" Variant="Variant.Filled"
StartIcon="@Icons.Material.Filled.Update"> Size="Size.Medium"
StartIcon="@(_isUpdating ? null : Icons.Material.Filled.SystemUpdateAlt)"
Class="px-6">
@if (_isUpdating) @if (_isUpdating)
{ {
<MudProgressCircular Size="Size.Small" Indeterminate="true" Color="Color.Surface"/> <MudProgressCircular Size="Size.Small" Indeterminate="true" Color="Color.Surface"/>
@@ -83,12 +108,29 @@
} }
else else
{ {
<span>بروزرسانی</span> <span>بروزرسانی کن!</span>
} }
</MudButton> </MudButton>
</DialogActions> </DialogActions>
</MudDialog> </MudDialog>
<style>
.release-notes-content {
font-size: 0.9rem;
line-height: 1.8;
}
.release-notes-content ul, .release-notes-content ol {
padding-right: 1.5rem;
margin: 0.5rem 0;
}
.release-notes-content li {
margin-bottom: 0.3rem;
}
.release-notes-content p {
margin: 0.5rem 0;
}
</style>
@code { @code {
[CascadingParameter] [CascadingParameter]
private IMudDialogInstance MudDialog { get; set; } = default!; private IMudDialogInstance MudDialog { get; set; } = default!;