From 4c022f18c654915cd54e3287564abff251f9c1b6 Mon Sep 17 00:00:00 2001 From: MeysamMoghaddam <65253484+MeysamMoghaddam@users.noreply.github.com> Date: Mon, 20 Oct 2025 20:55:55 +0330 Subject: [PATCH] u --- src/FrontOffice.Main/App.razor.cs | 24 +++++++++++++++++++ .../Pages/Profile/Index.razor | 2 +- src/FrontOffice.Main/Shared/AuthDialog.razor | 17 +++++++------ .../Shared/AuthDialog.razor.cs | 5 +++- .../Shared/MainLayout.razor.cs | 1 + 5 files changed, 40 insertions(+), 9 deletions(-) diff --git a/src/FrontOffice.Main/App.razor.cs b/src/FrontOffice.Main/App.razor.cs index 5f555ca..ca667f3 100644 --- a/src/FrontOffice.Main/App.razor.cs +++ b/src/FrontOffice.Main/App.razor.cs @@ -1,6 +1,9 @@ using Blazored.LocalStorage; +using FrontOffice.Main.Shared; +using FrontOffice.Main.Utilities; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.WebUtilities; +using MudBlazor; namespace FrontOffice.Main; @@ -23,6 +26,27 @@ public partial class App { // Store referral code in local storage await LocalStorage.SetItemAsync("referral:code", referralCode); + + var options = new DialogOptions + { + BackdropClick = false, + CloseOnEscapeKey = false + }; + + var parameters = new DialogParameters + { + { x => x.HideCancelButton, true } + }; + var dialog = await DialogService.ShowAsync("ورود به حساب کاربری", parameters, options); + var result = await dialog.Result; + + if (!result.Canceled) + { + Snackbar.Add(GlobalConstants.SuccessMsg, Severity.Success); + await Task.Delay(1000); + Navigation.NavigateTo(Navigation.Uri, forceLoad: true); + StateHasChanged(); + } } } } diff --git a/src/FrontOffice.Main/Pages/Profile/Index.razor b/src/FrontOffice.Main/Pages/Profile/Index.razor index 76ab08e..dbe45e7 100644 --- a/src/FrontOffice.Main/Pages/Profile/Index.razor +++ b/src/FrontOffice.Main/Pages/Profile/Index.razor @@ -64,7 +64,7 @@
- + - @(_errorMessage) - + @(_errorMessage) + } @if (!string.IsNullOrWhiteSpace(_infoMessage)) @@ -70,8 +70,8 @@ Dense="true" Elevation="0" Class="mb-2"> - @(_infoMessage) - + @(_infoMessage) + } @@ -104,9 +104,12 @@ } - لغو + @if (!HideCancelButton) + { + لغو + } @if (_currentStep == AuthStep.Phone) { _currentStep == AuthStep.Phone ? "ورود به حساب کاربری" : "تأیید رمز پویا"; + private string GetDialogTitle() => _currentStep == AuthStep.Phone ? "ورود/ثبت‌نام به حساب کاربری" : "تأیید رمز پویا"; } \ No newline at end of file diff --git a/src/FrontOffice.Main/Shared/MainLayout.razor.cs b/src/FrontOffice.Main/Shared/MainLayout.razor.cs index 18c7dec..813a127 100644 --- a/src/FrontOffice.Main/Shared/MainLayout.razor.cs +++ b/src/FrontOffice.Main/Shared/MainLayout.razor.cs @@ -48,6 +48,7 @@ public partial class MainLayout if (!result.Canceled) { await CheckAuthStatus(); + Snackbar.Add(GlobalConstants.SuccessMsg, Severity.Success); StateHasChanged(); } }