Files
FrontOffice/src/FrontOffice.Main/Pages/About.razor.cs
T
masoodafar-web 997ab80fa4
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 6m58s
refactor: migrate About & Contact pages to SitePageSettings system
- About.razor: use SitePageSettingsService + GetSettings<AboutSettings>()
- About.razor.cs: read values/team from ImageGroups instead of SitePage sections
- Contact.razor: use SitePageSettingsService + GetSettings<ContactSettings>()
- Contact.razor.cs: read address/phone/email/social from SettingsJson
2026-02-17 23:02:58 +03:30

47 lines
1.3 KiB
C#

using FrontOffice.Main.Utilities;
namespace FrontOffice.Main.Pages;
public partial class About
{
private bool _loading = true;
private PageSettingsDto? _page;
private AboutSettings? _settings;
private List<PageSettingsImageDto> _valueImages = new();
private List<PageSettingsImageDto> _teamImages = new();
protected override async Task OnInitializedAsync()
{
try
{
_page = await PageSettingsService.GetPageAsync("about");
if (_page != null)
{
_settings = _page.GetSettings<AboutSettings>();
_valueImages = _page.GetImages("values");
_teamImages = _page.GetImages("team");
}
}
catch
{
// Fallback: page remains null → hardcoded content will render
}
finally
{
_loading = false;
}
}
private class AboutSettings
{
public string? VisionTitle { get; set; }
public string? VisionText { get; set; }
public string? VisionIcon { get; set; }
public string? MissionTitle { get; set; }
public string? MissionText { get; set; }
public string? MissionIcon { get; set; }
public string? ValuesTitle { get; set; }
public string? TeamTitle { get; set; }
}
}