u
This commit is contained in:
@@ -50,7 +50,16 @@ public static class ConfigureServices
|
|||||||
{
|
{
|
||||||
var credentials = CallCredentials.FromInterceptor(async (context, metadata) =>
|
var credentials = CallCredentials.FromInterceptor(async (context, metadata) =>
|
||||||
{
|
{
|
||||||
await Task.CompletedTask;
|
// Get token from local storage if available
|
||||||
|
var localStorage = serviceProvider.GetService(typeof(ILocalStorageService)) as ILocalStorageService;
|
||||||
|
if (localStorage != null)
|
||||||
|
{
|
||||||
|
var token = await localStorage.GetItemAsync<string>("auth:token");
|
||||||
|
if (!string.IsNullOrWhiteSpace(token))
|
||||||
|
{
|
||||||
|
metadata.Add("Authorization", $"Bearer {token}");
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// SslCredentials is used here because this channel is using TLS.
|
// SslCredentials is used here because this channel is using TLS.
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="DateTimeConverterCL" Version="1.0.0" />
|
||||||
<PackageReference Include="Foursat.FrontOffice.BFF.Package.Protobuf" Version="0.0.112" />
|
<PackageReference Include="Foursat.FrontOffice.BFF.Package.Protobuf" Version="0.0.112" />
|
||||||
<PackageReference Include="Foursat.FrontOffice.BFF.User.Protobuf" Version="0.0.113" />
|
<PackageReference Include="Foursat.FrontOffice.BFF.User.Protobuf" Version="0.0.113" />
|
||||||
<PackageReference Include="Foursat.FrontOffice.BFF.UserAddress.Protobuf" Version="0.0.112" />
|
<PackageReference Include="Foursat.FrontOffice.BFF.UserAddress.Protobuf" Version="0.0.112" />
|
||||||
|
|||||||
@@ -14,268 +14,242 @@
|
|||||||
</MudAvatar>
|
</MudAvatar>
|
||||||
<div>
|
<div>
|
||||||
<MudText Typo="Typo.h5" Class="mud-typography-subtitle1">@_userProfile.FirstName @_userProfile.LastName</MudText>
|
<MudText Typo="Typo.h5" Class="mud-typography-subtitle1">@_userProfile.FirstName @_userProfile.LastName</MudText>
|
||||||
<MudText Typo="Typo.body2" Class="mud-text-secondary">@_userProfile.Email</MudText>
|
<MudText Typo="Typo.body2" Class="mud-text-secondary">@_userProfile.Mobile</MudText>
|
||||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">عضو از @_userProfile.JoinDate</MudText>
|
<MudText Typo="Typo.caption" Class="mud-text-secondary">عضو از @(_userProfile.MobileVerifiedAt?.ToDateTime().MiladiToJalali())</MudText>
|
||||||
</div>
|
|
||||||
</MudStack>
|
|
||||||
</MudPaper>
|
|
||||||
</MudItem>
|
|
||||||
|
|
||||||
<!-- Profile Content -->
|
|
||||||
<MudItem xs="12">
|
|
||||||
<MudPaper Elevation="4" Class="mud-elevation-4 rounded-2xl mud-theme-surface">
|
|
||||||
<MudTabs Elevation="0" Rounded="true" ApplyEffectsToContainer="true" Class="px-4 pt-4">
|
|
||||||
<!-- Personal Information Tab -->
|
|
||||||
<MudTabPanel Text="اطلاعات شخصی" Icon="@Icons.Material.Filled.Person">
|
|
||||||
<div class="pa-4">
|
|
||||||
<MudText Typo="Typo.h6" Class="mb-4 mud-typography-subtitle1">اطلاعات شخصی</MudText>
|
|
||||||
|
|
||||||
<MudForm @ref="_personalForm" Model="_userProfile" Validation="@((Func<object, IEnumerable<FluentValidation.Results.ValidationFailure>>)((model) => _personalValidator.Validate((UserProfile)model).Errors))">
|
|
||||||
<MudGrid Spacing="3">
|
|
||||||
<MudItem xs="12" md="6">
|
|
||||||
<MudTextField @bind-Value="_userProfile.FirstName"
|
|
||||||
For="@(() => _userProfile.FirstName)"
|
|
||||||
Label="نام"
|
|
||||||
Variant="Variant.Outlined"
|
|
||||||
Required="true"
|
|
||||||
RequiredError="وارد کردن نام الزامی است." />
|
|
||||||
</MudItem>
|
|
||||||
|
|
||||||
<MudItem xs="12" md="6">
|
|
||||||
<MudTextField @bind-Value="_userProfile.LastName"
|
|
||||||
For="@(() => _userProfile.LastName)"
|
|
||||||
Label="نام خانوادگی"
|
|
||||||
Variant="Variant.Outlined"
|
|
||||||
Required="true"
|
|
||||||
RequiredError="وارد کردن نام خانوادگی الزامی است." />
|
|
||||||
</MudItem>
|
|
||||||
|
|
||||||
<MudItem xs="12" md="6">
|
|
||||||
<MudTextField @bind-Value="_userProfile.Email"
|
|
||||||
For="@(() => _userProfile.Email)"
|
|
||||||
Label="ایمیل"
|
|
||||||
Variant="Variant.Outlined"
|
|
||||||
InputType="InputType.Email"
|
|
||||||
Required="true"
|
|
||||||
RequiredError="وارد کردن ایمیل الزامی است." />
|
|
||||||
</MudItem>
|
|
||||||
|
|
||||||
<MudItem xs="12" md="6">
|
|
||||||
<MudTextField @bind-Value="_userProfile.PhoneNumber"
|
|
||||||
For="@(() => _userProfile.PhoneNumber)"
|
|
||||||
Label="شماره موبایل"
|
|
||||||
Variant="Variant.Outlined"
|
|
||||||
InputType="InputType.Text"
|
|
||||||
Required="true"
|
|
||||||
RequiredError="وارد کردن شماره موبایل الزامی است." />
|
|
||||||
</MudItem>
|
|
||||||
|
|
||||||
<MudItem xs="12" md="6">
|
|
||||||
<MudTextField @bind-Value="_userProfile.NationalCode"
|
|
||||||
For="@(() => _userProfile.NationalCode)"
|
|
||||||
Label="کد ملی"
|
|
||||||
Variant="Variant.Outlined"
|
|
||||||
InputType="InputType.Text" />
|
|
||||||
</MudItem>
|
|
||||||
|
|
||||||
<MudItem xs="12" md="6">
|
|
||||||
<MudTextField @bind-Value="_userProfile.BirthDate"
|
|
||||||
For="@(() => _userProfile.BirthDate)"
|
|
||||||
Label="تاریخ تولد"
|
|
||||||
Variant="Variant.Outlined"
|
|
||||||
InputType="InputType.Date" />
|
|
||||||
</MudItem>
|
|
||||||
|
|
||||||
<MudItem xs="12">
|
|
||||||
<MudTextField @bind-Value="_userProfile.Address"
|
|
||||||
For="@(() => _userProfile.Address)"
|
|
||||||
Label="آدرس"
|
|
||||||
Variant="Variant.Outlined"
|
|
||||||
Lines="3"
|
|
||||||
InputType="InputType.Text" />
|
|
||||||
</MudItem>
|
|
||||||
</MudGrid>
|
|
||||||
|
|
||||||
<MudStack Row="true" Spacing="2" Justify="Justify.FlexEnd" Class="mt-4">
|
|
||||||
<MudButton Variant="Variant.Outlined" Color="Color.Secondary" OnClick="CancelPersonalChanges">
|
|
||||||
لغو
|
|
||||||
</MudButton>
|
|
||||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="SavePersonalInfo" Disabled="_isPersonalSaving">
|
|
||||||
ذخیره تغییرات
|
|
||||||
</MudButton>
|
|
||||||
</MudStack>
|
|
||||||
</MudForm>
|
|
||||||
</div>
|
</div>
|
||||||
</MudTabPanel>
|
</MudStack>
|
||||||
|
</MudPaper>
|
||||||
|
</MudItem>
|
||||||
|
|
||||||
<!-- Password Change Tab -->
|
<!-- Profile Content -->
|
||||||
<MudTabPanel Text="تغییر رمز عبور" Icon="@Icons.Material.Filled.Lock">
|
<MudItem xs="12">
|
||||||
<div class="pa-4">
|
<MudPaper Elevation="4" Class="mud-elevation-4 rounded-2xl mud-theme-surface">
|
||||||
<MudText Typo="Typo.h6" Class="mb-4 mud-typography-subtitle1">تغییر رمز عبور</MudText>
|
<MudTabs Elevation="0" Rounded="true" ApplyEffectsToContainer="true" Class="px-4 pt-4">
|
||||||
|
<!-- Personal Information Tab -->
|
||||||
|
<MudTabPanel Text="اطلاعات شخصی" Icon="@Icons.Material.Filled.Person">
|
||||||
|
<div class="pa-4">
|
||||||
|
<MudText Typo="Typo.h6" Class="mb-4 mud-typography-subtitle1">اطلاعات شخصی</MudText>
|
||||||
|
|
||||||
<MudForm @ref="_passwordForm" Model="_passwordModel" Validation="@((Func<object, IEnumerable<FluentValidation.Results.ValidationFailure>>)((model) => _passwordValidator.Validate((PasswordChangeModel)model).Errors))">
|
<MudForm @ref="_personalForm" Model="_userProfile" Validation="@((Func<object, IEnumerable<FluentValidation.Results.ValidationFailure>>)((model) => _personalValidator.Validate((UserProfile)model).Errors))">
|
||||||
<MudGrid Spacing="3">
|
|
||||||
<MudItem xs="12">
|
|
||||||
<MudTextField @bind-Value="_passwordModel.CurrentPassword"
|
|
||||||
For="@(() => _passwordModel.CurrentPassword)"
|
|
||||||
Label="رمز عبور فعلی"
|
|
||||||
Variant="Variant.Outlined"
|
|
||||||
InputType="InputType.Password"
|
|
||||||
Required="true"
|
|
||||||
RequiredError="وارد کردن رمز عبور فعلی الزامی است." />
|
|
||||||
</MudItem>
|
|
||||||
|
|
||||||
<MudItem xs="12" md="6">
|
|
||||||
<MudTextField @bind-Value="_passwordModel.NewPassword"
|
|
||||||
For="@(() => _passwordModel.NewPassword)"
|
|
||||||
Label="رمز عبور جدید"
|
|
||||||
Variant="Variant.Outlined"
|
|
||||||
InputType="InputType.Password"
|
|
||||||
Required="true"
|
|
||||||
RequiredError="وارد کردن رمز عبور جدید الزامی است." />
|
|
||||||
</MudItem>
|
|
||||||
|
|
||||||
<MudItem xs="12" md="6">
|
|
||||||
<MudTextField @bind-Value="_passwordModel.ConfirmPassword"
|
|
||||||
For="@(() => _passwordModel.ConfirmPassword)"
|
|
||||||
Label="تکرار رمز عبور جدید"
|
|
||||||
Variant="Variant.Outlined"
|
|
||||||
InputType="InputType.Password"
|
|
||||||
Required="true"
|
|
||||||
RequiredError="تکرار رمز عبور جدید الزامی است." />
|
|
||||||
</MudItem>
|
|
||||||
</MudGrid>
|
|
||||||
|
|
||||||
<MudStack Row="true" Spacing="2" Justify="Justify.FlexEnd" Class="mt-4">
|
|
||||||
<MudButton Variant="Variant.Outlined" Color="Color.Secondary" OnClick="CancelPasswordChange">
|
|
||||||
لغو
|
|
||||||
</MudButton>
|
|
||||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="ChangePassword" Disabled="_isPasswordChanging">
|
|
||||||
تغییر رمز عبور
|
|
||||||
</MudButton>
|
|
||||||
</MudStack>
|
|
||||||
</MudForm>
|
|
||||||
</div>
|
|
||||||
</MudTabPanel>
|
|
||||||
|
|
||||||
<!-- Account Settings Tab -->
|
|
||||||
<MudTabPanel Text="تنظیمات حساب" Icon="@Icons.Material.Filled.Settings">
|
|
||||||
<div class="pa-4">
|
|
||||||
<MudText Typo="Typo.h6" Class="mb-4 mud-typography-subtitle1">تنظیمات حساب</MudText>
|
|
||||||
|
|
||||||
<MudStack Spacing="4">
|
|
||||||
<!-- Notification Settings -->
|
|
||||||
<MudPaper Outlined="true" Class="pa-4 rounded-lg">
|
|
||||||
<MudText Typo="Typo.subtitle1" Class="mb-3 fw-600">اعلانها</MudText>
|
|
||||||
<MudStack Spacing="2">
|
|
||||||
<MudSwitch T="bool" @bind-Checked="_settings.EmailNotifications" Label="اعلانهای ایمیلی" />
|
|
||||||
<MudSwitch T="bool" @bind-Checked="_settings.SmsNotifications" Label="اعلانهای پیامکی" />
|
|
||||||
<MudSwitch T="bool" @bind-Checked="_settings.PushNotifications" Label="اعلانهای پوش" />
|
|
||||||
</MudStack>
|
|
||||||
</MudPaper>
|
|
||||||
|
|
||||||
<!-- Privacy Settings -->
|
|
||||||
<MudPaper Outlined="true" Class="pa-4 rounded-lg">
|
|
||||||
<MudText Typo="Typo.subtitle1" Class="mb-3 fw-600">حریم خصوصی</MudText>
|
|
||||||
<MudStack Spacing="2">
|
|
||||||
<MudSwitch T="bool" @bind-Checked="_settings.ProfileVisibility" Label="نمایش پروفایل عمومی" />
|
|
||||||
<MudSwitch T="bool" @bind-Checked="_settings.ShowOnlineStatus" Label="نمایش وضعیت آنلاین" />
|
|
||||||
</MudStack>
|
|
||||||
</MudPaper>
|
|
||||||
|
|
||||||
<!-- Language & Theme -->
|
|
||||||
<MudPaper Outlined="true" Class="pa-4 rounded-lg">
|
|
||||||
<MudText Typo="Typo.subtitle1" Class="mb-3 fw-600">زبان و تم</MudText>
|
|
||||||
<MudGrid Spacing="3">
|
<MudGrid Spacing="3">
|
||||||
<MudItem xs="12" md="6">
|
<MudItem xs="12" md="6">
|
||||||
<MudSelect @bind-Value="_settings.Language" Label="زبان" Variant="Variant.Outlined">
|
<MudTextField @bind-Value="_userProfile.FirstName"
|
||||||
<MudSelectItem Value="@("fa")">فارسی</MudSelectItem>
|
For="@(() => _userProfile.FirstName)"
|
||||||
<MudSelectItem Value="@("en")">English</MudSelectItem>
|
Label="نام"
|
||||||
</MudSelect>
|
Variant="Variant.Outlined"
|
||||||
|
Required="true"
|
||||||
|
RequiredError="وارد کردن نام الزامی است." />
|
||||||
</MudItem>
|
</MudItem>
|
||||||
|
|
||||||
<MudItem xs="12" md="6">
|
<MudItem xs="12" md="6">
|
||||||
<MudSelect @bind-Value="_settings.Theme" Label="تم" Variant="Variant.Outlined">
|
<MudTextField @bind-Value="_userProfile.LastName"
|
||||||
<MudSelectItem Value="@("light")">روشن</MudSelectItem>
|
For="@(() => _userProfile.LastName)"
|
||||||
<MudSelectItem Value="@("dark")">تیره</MudSelectItem>
|
Label="نام خانوادگی"
|
||||||
<MudSelectItem Value="@("auto")">خودکار</MudSelectItem>
|
Variant="Variant.Outlined"
|
||||||
</MudSelect>
|
Required="true"
|
||||||
|
RequiredError="وارد کردن نام خانوادگی الزامی است." />
|
||||||
|
</MudItem>
|
||||||
|
|
||||||
|
<MudItem xs="12" md="6">
|
||||||
|
<MudTextField @bind-Value="_userProfile.Mobile"
|
||||||
|
For="@(() => _userProfile.Mobile)"
|
||||||
|
Label="شماره موبایل"
|
||||||
|
Variant="Variant.Outlined"
|
||||||
|
InputType="InputType.Text"
|
||||||
|
Required="true"
|
||||||
|
RequiredError="وارد کردن شماره موبایل الزامی است." />
|
||||||
|
</MudItem>
|
||||||
|
|
||||||
|
<MudItem xs="12" md="6">
|
||||||
|
<MudTextField @bind-Value="_userProfile.NationalCode"
|
||||||
|
For="@(() => _userProfile.NationalCode)"
|
||||||
|
Label="کد ملی"
|
||||||
|
Variant="Variant.Outlined"
|
||||||
|
InputType="InputType.Text" />
|
||||||
</MudItem>
|
</MudItem>
|
||||||
</MudGrid>
|
</MudGrid>
|
||||||
</MudPaper>
|
|
||||||
|
|
||||||
<MudStack Row="true" Spacing="2" Justify="Justify.FlexEnd">
|
<MudStack Row="true" Spacing="2" Justify="Justify.FlexEnd" Class="mt-4">
|
||||||
<MudButton Variant="Variant.Outlined" Color="Color.Secondary" OnClick="CancelSettingsChanges">
|
<MudButton Variant="Variant.Outlined" Color="Color.Secondary" OnClick="CancelPersonalChanges">
|
||||||
لغو
|
لغو
|
||||||
</MudButton>
|
</MudButton>
|
||||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="SaveSettings" Disabled="_isSettingsSaving">
|
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="SavePersonalInfo" Disabled="_isPersonalSaving">
|
||||||
ذخیره تنظیمات
|
ذخیره تغییرات
|
||||||
</MudButton>
|
</MudButton>
|
||||||
</MudStack>
|
|
||||||
</MudStack>
|
|
||||||
</div>
|
|
||||||
</MudTabPanel>
|
|
||||||
|
|
||||||
<!-- Statistics Tab -->
|
|
||||||
<MudTabPanel Text="آمار و اطلاعات" Icon="@Icons.Material.Filled.BarChart">
|
|
||||||
<div class="pa-4">
|
|
||||||
<MudText Typo="Typo.h6" Class="mb-4 mud-typography-subtitle1">آمار حساب کاربری</MudText>
|
|
||||||
|
|
||||||
<MudGrid Spacing="3">
|
|
||||||
<MudItem xs="12" md="6" lg="3">
|
|
||||||
<MudPaper Elevation="3" Class="mud-elevation-3 pa-4 text-center rounded-xl mud-theme-surface">
|
|
||||||
<MudIcon Icon="@Icons.Material.Filled.DateRange" Size="Size.Large" Color="Color.Primary" Class="mb-2" />
|
|
||||||
<MudText Typo="Typo.h4" Class="mud-typography-subtitle1">@_userProfile.JoinDate</MudText>
|
|
||||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">تاریخ عضویت</MudText>
|
|
||||||
</MudPaper>
|
|
||||||
</MudItem>
|
|
||||||
|
|
||||||
<MudItem xs="12" md="6" lg="3">
|
|
||||||
<MudPaper Elevation="3" Class="mud-elevation-3 pa-4 text-center rounded-xl mud-theme-surface">
|
|
||||||
<MudIcon Icon="@Icons.Material.Filled.Login" Size="Size.Large" Color="Color.Success" Class="mb-2" />
|
|
||||||
<MudText Typo="Typo.h4" Class="mud-typography-subtitle1">@_userProfile.LastLogin</MudText>
|
|
||||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">آخرین ورود</MudText>
|
|
||||||
</MudPaper>
|
|
||||||
</MudItem>
|
|
||||||
|
|
||||||
<MudItem xs="12" md="6" lg="3">
|
|
||||||
<MudPaper Elevation="3" Class="mud-elevation-3 pa-4 text-center rounded-xl mud-theme-surface">
|
|
||||||
<MudIcon Icon="@Icons.Material.Filled.Group" Size="Size.Large" Color="Color.Info" Class="mb-2" />
|
|
||||||
<MudText Typo="Typo.h4" Class="mud-typography-subtitle1">@_userProfile.TotalReferrals</MudText>
|
|
||||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">معرفها</MudText>
|
|
||||||
</MudPaper>
|
|
||||||
</MudItem>
|
|
||||||
|
|
||||||
<MudItem xs="12" md="6" lg="3">
|
|
||||||
<MudPaper Elevation="3" Class="mud-elevation-3 pa-4 text-center rounded-xl mud-theme-surface">
|
|
||||||
<MudIcon Icon="@Icons.Material.Filled.Star" Size="Size.Large" Color="Color.Warning" Class="mb-2" />
|
|
||||||
<MudText Typo="Typo.h4" Class="mud-typography-subtitle1">@_userProfile.Level</MudText>
|
|
||||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">سطح کاربری</MudText>
|
|
||||||
</MudPaper>
|
|
||||||
</MudItem>
|
|
||||||
</MudGrid>
|
|
||||||
|
|
||||||
<!-- Account Status -->
|
|
||||||
<MudPaper Elevation="2" Class="mud-elevation-2 pa-4 mt-4 rounded-xl mud-theme-surface">
|
|
||||||
<MudText Typo="Typo.subtitle1" Class="mb-3 mud-typography-subtitle1">وضعیت حساب</MudText>
|
|
||||||
<MudStack Spacing="2">
|
|
||||||
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
|
|
||||||
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" Size="Size.Small" Color="Color.Success" />
|
|
||||||
<MudText Typo="Typo.body2">حساب تأیید شده</MudText>
|
|
||||||
</MudStack>
|
</MudStack>
|
||||||
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
|
</MudForm>
|
||||||
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" Size="Size.Small" Color="Color.Success" />
|
</div>
|
||||||
<MudText Typo="Typo.body2">ایمیل تأیید شده</MudText>
|
</MudTabPanel>
|
||||||
|
|
||||||
|
<!-- Password Change Tab -->
|
||||||
|
<MudTabPanel Text="تغییر رمز عبور" Icon="@Icons.Material.Filled.Lock">
|
||||||
|
<div class="pa-4">
|
||||||
|
<MudText Typo="Typo.h6" Class="mb-4 mud-typography-subtitle1">تغییر رمز عبور</MudText>
|
||||||
|
|
||||||
|
<MudForm @ref="_passwordForm" Model="_passwordModel" Validation="@((Func<object, IEnumerable<FluentValidation.Results.ValidationFailure>>)((model) => _passwordValidator.Validate((PasswordChangeModel)model).Errors))">
|
||||||
|
<MudGrid Spacing="3">
|
||||||
|
<MudItem xs="12">
|
||||||
|
<MudTextField @bind-Value="_passwordModel.CurrentPassword"
|
||||||
|
For="@(() => _passwordModel.CurrentPassword)"
|
||||||
|
Label="رمز عبور فعلی"
|
||||||
|
Variant="Variant.Outlined"
|
||||||
|
InputType="InputType.Password"
|
||||||
|
Required="true"
|
||||||
|
RequiredError="وارد کردن رمز عبور فعلی الزامی است." />
|
||||||
|
</MudItem>
|
||||||
|
|
||||||
|
<MudItem xs="12" md="6">
|
||||||
|
<MudTextField @bind-Value="_passwordModel.NewPassword"
|
||||||
|
For="@(() => _passwordModel.NewPassword)"
|
||||||
|
Label="رمز عبور جدید"
|
||||||
|
Variant="Variant.Outlined"
|
||||||
|
InputType="InputType.Password"
|
||||||
|
Required="true"
|
||||||
|
RequiredError="وارد کردن رمز عبور جدید الزامی است." />
|
||||||
|
</MudItem>
|
||||||
|
|
||||||
|
<MudItem xs="12" md="6">
|
||||||
|
<MudTextField @bind-Value="_passwordModel.ConfirmPassword"
|
||||||
|
For="@(() => _passwordModel.ConfirmPassword)"
|
||||||
|
Label="تکرار رمز عبور جدید"
|
||||||
|
Variant="Variant.Outlined"
|
||||||
|
InputType="InputType.Password"
|
||||||
|
Required="true"
|
||||||
|
RequiredError="تکرار رمز عبور جدید الزامی است." />
|
||||||
|
</MudItem>
|
||||||
|
</MudGrid>
|
||||||
|
|
||||||
|
<MudStack Row="true" Spacing="2" Justify="Justify.FlexEnd" Class="mt-4">
|
||||||
|
<MudButton Variant="Variant.Outlined" Color="Color.Secondary" OnClick="CancelPasswordChange">
|
||||||
|
لغو
|
||||||
|
</MudButton>
|
||||||
|
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="ChangePassword" Disabled="_isPasswordChanging">
|
||||||
|
تغییر رمز عبور
|
||||||
|
</MudButton>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
|
</MudForm>
|
||||||
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" Size="Size.Small" Color="Color.Success" />
|
</div>
|
||||||
<MudText Typo="Typo.body2">شماره موبایل تأیید شده</MudText>
|
</MudTabPanel>
|
||||||
|
|
||||||
|
<!-- Account Settings Tab -->
|
||||||
|
<MudTabPanel Text="تنظیمات حساب" Icon="@Icons.Material.Filled.Settings">
|
||||||
|
<div class="pa-4">
|
||||||
|
<MudText Typo="Typo.h6" Class="mb-4 mud-typography-subtitle1">تنظیمات حساب</MudText>
|
||||||
|
|
||||||
|
<MudStack Spacing="4">
|
||||||
|
<!-- Notification Settings -->
|
||||||
|
<MudPaper Outlined="true" Class="pa-4 rounded-lg">
|
||||||
|
<MudText Typo="Typo.subtitle1" Class="mb-3 fw-600">اعلانها</MudText>
|
||||||
|
<MudStack Spacing="2">
|
||||||
|
<MudSwitch T="bool" @bind-Checked="_settings.EmailNotifications" Label="اعلانهای ایمیلی" />
|
||||||
|
<MudSwitch T="bool" @bind-Checked="_settings.SmsNotifications" Label="اعلانهای پیامکی" />
|
||||||
|
<MudSwitch T="bool" @bind-Checked="_settings.PushNotifications" Label="اعلانهای پوش" />
|
||||||
|
</MudStack>
|
||||||
|
</MudPaper>
|
||||||
|
|
||||||
|
<!-- Privacy Settings -->
|
||||||
|
<MudPaper Outlined="true" Class="pa-4 rounded-lg">
|
||||||
|
<MudText Typo="Typo.subtitle1" Class="mb-3 fw-600">حریم خصوصی</MudText>
|
||||||
|
<MudStack Spacing="2">
|
||||||
|
<MudSwitch T="bool" @bind-Checked="_settings.ProfileVisibility" Label="نمایش پروفایل عمومی" />
|
||||||
|
<MudSwitch T="bool" @bind-Checked="_settings.ShowOnlineStatus" Label="نمایش وضعیت آنلاین" />
|
||||||
|
</MudStack>
|
||||||
|
</MudPaper>
|
||||||
|
|
||||||
|
<!-- Language & Theme -->
|
||||||
|
<MudPaper Outlined="true" Class="pa-4 rounded-lg">
|
||||||
|
<MudText Typo="Typo.subtitle1" Class="mb-3 fw-600">زبان و تم</MudText>
|
||||||
|
<MudGrid Spacing="3">
|
||||||
|
<MudItem xs="12" md="6">
|
||||||
|
<MudSelect @bind-Value="_settings.Language" Label="زبان" Variant="Variant.Outlined">
|
||||||
|
<MudSelectItem Value="@("fa")">فارسی</MudSelectItem>
|
||||||
|
<MudSelectItem Value="@("en")">English</MudSelectItem>
|
||||||
|
</MudSelect>
|
||||||
|
</MudItem>
|
||||||
|
<MudItem xs="12" md="6">
|
||||||
|
<MudSelect @bind-Value="_settings.Theme" Label="تم" Variant="Variant.Outlined">
|
||||||
|
<MudSelectItem Value="@("light")">روشن</MudSelectItem>
|
||||||
|
<MudSelectItem Value="@("dark")">تیره</MudSelectItem>
|
||||||
|
<MudSelectItem Value="@("auto")">خودکار</MudSelectItem>
|
||||||
|
</MudSelect>
|
||||||
|
</MudItem>
|
||||||
|
</MudGrid>
|
||||||
|
</MudPaper>
|
||||||
|
|
||||||
|
<MudStack Row="true" Spacing="2" Justify="Justify.FlexEnd">
|
||||||
|
<MudButton Variant="Variant.Outlined" Color="Color.Secondary" OnClick="CancelSettingsChanges">
|
||||||
|
لغو
|
||||||
|
</MudButton>
|
||||||
|
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="SaveSettings" Disabled="_isSettingsSaving">
|
||||||
|
ذخیره تنظیمات
|
||||||
|
</MudButton>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
</MudPaper>
|
</div>
|
||||||
</div>
|
</MudTabPanel>
|
||||||
|
|
||||||
|
<!-- Statistics Tab -->
|
||||||
|
@* <MudTabPanel Text="آمار و اطلاعات" Icon="@Icons.Material.Filled.BarChart">
|
||||||
|
<div class="pa-4">
|
||||||
|
<MudText Typo="Typo.h6" Class="mb-4 mud-typography-subtitle1">آمار حساب کاربری</MudText>
|
||||||
|
|
||||||
|
<MudGrid Spacing="3">
|
||||||
|
<MudItem xs="12" md="6" lg="3">
|
||||||
|
<MudPaper Elevation="3" Class="mud-elevation-3 pa-4 text-center rounded-xl mud-theme-surface">
|
||||||
|
<MudIcon Icon="@Icons.Material.Filled.DateRange" Size="Size.Large" Color="Color.Primary" Class="mb-2" />
|
||||||
|
<MudText Typo="Typo.h4" Class="mud-typography-subtitle1">@_userProfile.JoinDate</MudText>
|
||||||
|
<MudText Typo="Typo.caption" Class="mud-text-secondary">تاریخ عضویت</MudText>
|
||||||
|
</MudPaper>
|
||||||
|
</MudItem>
|
||||||
|
|
||||||
|
<MudItem xs="12" md="6" lg="3">
|
||||||
|
<MudPaper Elevation="3" Class="mud-elevation-3 pa-4 text-center rounded-xl mud-theme-surface">
|
||||||
|
<MudIcon Icon="@Icons.Material.Filled.Login" Size="Size.Large" Color="Color.Success" Class="mb-2" />
|
||||||
|
<MudText Typo="Typo.h4" Class="mud-typography-subtitle1">@_userProfile.LastLogin</MudText>
|
||||||
|
<MudText Typo="Typo.caption" Class="mud-text-secondary">آخرین ورود</MudText>
|
||||||
|
</MudPaper>
|
||||||
|
</MudItem>
|
||||||
|
|
||||||
|
<MudItem xs="12" md="6" lg="3">
|
||||||
|
<MudPaper Elevation="3" Class="mud-elevation-3 pa-4 text-center rounded-xl mud-theme-surface">
|
||||||
|
<MudIcon Icon="@Icons.Material.Filled.Group" Size="Size.Large" Color="Color.Info" Class="mb-2" />
|
||||||
|
<MudText Typo="Typo.h4" Class="mud-typography-subtitle1">@_userProfile.TotalReferrals</MudText>
|
||||||
|
<MudText Typo="Typo.caption" Class="mud-text-secondary">معرفها</MudText>
|
||||||
|
</MudPaper>
|
||||||
|
</MudItem>
|
||||||
|
|
||||||
|
<MudItem xs="12" md="6" lg="3">
|
||||||
|
<MudPaper Elevation="3" Class="mud-elevation-3 pa-4 text-center rounded-xl mud-theme-surface">
|
||||||
|
<MudIcon Icon="@Icons.Material.Filled.Star" Size="Size.Large" Color="Color.Warning" Class="mb-2" />
|
||||||
|
<MudText Typo="Typo.h4" Class="mud-typography-subtitle1">@_userProfile.Level</MudText>
|
||||||
|
<MudText Typo="Typo.caption" Class="mud-text-secondary">سطح کاربری</MudText>
|
||||||
|
</MudPaper>
|
||||||
|
</MudItem>
|
||||||
|
</MudGrid>
|
||||||
|
|
||||||
|
<!-- Account Status -->
|
||||||
|
<MudPaper Elevation="2" Class="mud-elevation-2 pa-4 mt-4 rounded-xl mud-theme-surface">
|
||||||
|
<MudText Typo="Typo.subtitle1" Class="mb-3 mud-typography-subtitle1">وضعیت حساب</MudText>
|
||||||
|
<MudStack Spacing="2">
|
||||||
|
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
|
||||||
|
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" Size="Size.Small" Color="Color.Success" />
|
||||||
|
<MudText Typo="Typo.body2">حساب تأیید شده</MudText>
|
||||||
|
</MudStack>
|
||||||
|
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
|
||||||
|
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" Size="Size.Small" Color="Color.Success" />
|
||||||
|
<MudText Typo="Typo.body2">ایمیل تأیید شده</MudText>
|
||||||
|
</MudStack>
|
||||||
|
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
|
||||||
|
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" Size="Size.Small" Color="Color.Success" />
|
||||||
|
<MudText Typo="Typo.body2">شماره موبایل تأیید شده</MudText>
|
||||||
|
</MudStack>
|
||||||
|
</MudStack>
|
||||||
|
</MudPaper>
|
||||||
|
</div>
|
||||||
</MudTabPanel>
|
</MudTabPanel>
|
||||||
</MudTabs>
|
*@
|
||||||
</MudPaper>
|
</MudTabs>
|
||||||
</MudItem>
|
</MudPaper>
|
||||||
</MudGrid>
|
</MudItem>
|
||||||
</MudContainer>
|
</MudGrid>
|
||||||
|
</MudContainer>
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
|
using FrontOffice.BFF.Package.Protobuf.Protos.Package;
|
||||||
|
using FrontOffice.BFF.User.Protobuf.Protos.User;
|
||||||
using FrontOffice.Main.Utilities;
|
using FrontOffice.Main.Utilities;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using MudBlazor;
|
using MudBlazor;
|
||||||
@@ -9,7 +11,9 @@ namespace FrontOffice.Main.Pages.Profile;
|
|||||||
|
|
||||||
public partial class Index
|
public partial class Index
|
||||||
{
|
{
|
||||||
private UserProfile _userProfile = new();
|
[Inject] private UserContract.UserContractClient UserContract { get; set; } = default!;
|
||||||
|
|
||||||
|
private GetUserResponse _userProfile = new();
|
||||||
private PasswordChangeModel _passwordModel = new();
|
private PasswordChangeModel _passwordModel = new();
|
||||||
private AccountSettings _settings = new();
|
private AccountSettings _settings = new();
|
||||||
|
|
||||||
@@ -23,29 +27,20 @@ public partial class Index
|
|||||||
private readonly UserProfileValidator _personalValidator = new();
|
private readonly UserProfileValidator _personalValidator = new();
|
||||||
private readonly PasswordChangeValidator _passwordValidator = new();
|
private readonly PasswordChangeValidator _passwordValidator = new();
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
{
|
{
|
||||||
await LoadUserProfile();
|
await base.OnAfterRenderAsync(firstRender);
|
||||||
await LoadAccountSettings();
|
if(firstRender)
|
||||||
|
{
|
||||||
|
await LoadUserProfile();
|
||||||
|
await LoadAccountSettings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task LoadUserProfile()
|
private async Task LoadUserProfile()
|
||||||
{
|
{
|
||||||
// TODO: Load user profile from API
|
_userProfile = await UserContract.GetUserAsync(request: new());
|
||||||
_userProfile = new UserProfile
|
StateHasChanged();
|
||||||
{
|
|
||||||
FirstName = "علی",
|
|
||||||
LastName = "احمدی",
|
|
||||||
Email = "ali.ahmad@example.com",
|
|
||||||
PhoneNumber = "09123456789",
|
|
||||||
NationalCode = "0123456789",
|
|
||||||
BirthDate = "1370/01/01",
|
|
||||||
Address = "تهران، خیابان ولیعصر",
|
|
||||||
JoinDate = "۱۴۰۲/۰۱/۱۵",
|
|
||||||
LastLogin = "۱۴۰۲/۱۰/۰۶",
|
|
||||||
TotalReferrals = 25,
|
|
||||||
Level = "طلایی"
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task LoadAccountSettings()
|
private async Task LoadAccountSettings()
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
@using FrontOffice.Main.Shared
|
@using FrontOffice.Main.Shared
|
||||||
@using MudBlazor
|
@using MudBlazor
|
||||||
@using FrontOffice.Main.Utilities
|
@using FrontOffice.Main.Utilities
|
||||||
|
@using DateTimeConverterCL
|
||||||
|
|
||||||
@inject NavigationManager Navigation
|
@inject NavigationManager Navigation
|
||||||
@inject IDialogService DialogService
|
@inject IDialogService DialogService
|
||||||
|
|||||||
Reference in New Issue
Block a user