This commit is contained in:
MeysamMoghaddam
2025-10-20 20:55:55 +03:30
parent 566ec21555
commit 4c022f18c6
5 changed files with 40 additions and 9 deletions

View File

@@ -60,8 +60,8 @@
Dense="true"
Elevation="0"
Class="mb-2">
@(_errorMessage)
</MudAlert>
@(_errorMessage)
</MudAlert>
}
@if (!string.IsNullOrWhiteSpace(_infoMessage))
@@ -70,8 +70,8 @@
Dense="true"
Elevation="0"
Class="mb-2">
@(_infoMessage)
</MudAlert>
@(_infoMessage)
</MudAlert>
}
<MudStack Spacing="2">
@@ -104,9 +104,12 @@
}
</DialogContent>
<DialogActions>
<MudButton Variant="Variant.Text"
OnClick="Cancel"
Disabled="_isBusy">لغو</MudButton>
@if (!HideCancelButton)
{
<MudButton Variant="Variant.Text"
OnClick="Cancel"
Disabled="_isBusy">لغو</MudButton>
}
@if (_currentStep == AuthStep.Phone)
{
<MudButton Variant="Variant.Filled"

View File

@@ -11,6 +11,9 @@ namespace FrontOffice.Main.Shared;
public partial class AuthDialog : IDisposable
{
[Parameter]
public bool HideCancelButton { get; set; } = false;
private enum AuthStep { Phone, Verify }
private const int DefaultResendCooldown = 120;
public const int MaxVerificationAttempts = 5;
@@ -439,5 +442,5 @@ public partial class AuthDialog : IDisposable
_resendTimer?.Dispose();
_resendTimer = null;
}
private string GetDialogTitle() => _currentStep == AuthStep.Phone ? "ورود به حساب کاربری" : "تأیید رمز پویا";
private string GetDialogTitle() => _currentStep == AuthStep.Phone ? "ورود/ثبت‌نام به حساب کاربری" : "تأیید رمز پویا";
}

View File

@@ -48,6 +48,7 @@ public partial class MainLayout
if (!result.Canceled)
{
await CheckAuthStatus();
Snackbar.Add(GlobalConstants.SuccessMsg, Severity.Success);
StateHasChanged();
}
}