From bb789e443ee7857ae15a9069e3049c8cfac3f8dc Mon Sep 17 00:00:00 2001 From: masoodafar-web Date: Sun, 4 Oct 2026 23:34:22 +0330 Subject: [PATCH 1/2] feat(index): enable conditional rendering for steps and features sections - Added support for conditional rendering of the steps and features sections on the landing page, controlled by the new `StepsEnabled` and `FeaturesEnabled` properties in the Index.razor.cs file. - This enhancement allows for more dynamic content presentation based on user settings, improving the overall user experience. --- src/FrontOffice.Main/Pages/Index.razor | 8 ++++++++ src/FrontOffice.Main/Pages/Index.razor.cs | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/FrontOffice.Main/Pages/Index.razor b/src/FrontOffice.Main/Pages/Index.razor index a652f1b..64741df 100644 --- a/src/FrontOffice.Main/Pages/Index.razor +++ b/src/FrontOffice.Main/Pages/Index.razor @@ -131,7 +131,10 @@ @* ═══════════════════════════════════════════════ 2. HOW IT WORKS — 3 numbered steps + (controlled by LandingSettings.StepsEnabled; default off) ═══════════════════════════════════════════════ *@ +@if (_settings?.StepsEnabled == true) +{
@@ -157,10 +160,14 @@
+} @* ═══════════════════════════════════════════════ 3. FEATURES — 6 cards with icons + (controlled by LandingSettings.FeaturesEnabled; default off) ═══════════════════════════════════════════════ *@ +@if (_settings?.FeaturesEnabled == true) +{
@@ -188,6 +195,7 @@
+} @* ═══════════════════════════════════════════════ 4. STATS — Counter cards diff --git a/src/FrontOffice.Main/Pages/Index.razor.cs b/src/FrontOffice.Main/Pages/Index.razor.cs index 4062577..56f6c17 100644 --- a/src/FrontOffice.Main/Pages/Index.razor.cs +++ b/src/FrontOffice.Main/Pages/Index.razor.cs @@ -344,8 +344,10 @@ public partial class Index : IDisposable public string? HeroButtonPrimaryText { get; set; } public string? HeroButtonSecondaryText { get; set; } public List? TrustBadges { get; set; } + public bool? StepsEnabled { get; set; } public string? StepsTitle { get; set; } public List? Steps { get; set; } + public bool? FeaturesEnabled { get; set; } public string? FeaturesTitle { get; set; } public List? Features { get; set; } public string? StatsTitle { get; set; } From 016b259da075a6b3b9d72425d1c7522cadac23db Mon Sep 17 00:00:00 2001 From: masoodafar-web Date: Sun, 4 Oct 2026 23:54:42 +0330 Subject: [PATCH 2/2] feat(index): add configuration options for landing page sections - Introduced new settings in appsettings files to control the visibility of the steps and features sections on the landing page, allowing for dynamic content presentation. - Updated Index.razor and Index.razor.cs to utilize these settings, enhancing user experience by enabling or disabling sections based on configuration. --- src/FrontOffice.Main/Pages/Index.razor | 8 ++++---- src/FrontOffice.Main/Pages/Index.razor.cs | 5 +++++ src/FrontOffice.Main/appsettings.Production.json | 4 ++++ src/FrontOffice.Main/appsettings.Staging.json | 4 ++++ src/FrontOffice.Main/appsettings.json | 4 ++++ 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/FrontOffice.Main/Pages/Index.razor b/src/FrontOffice.Main/Pages/Index.razor index 64741df..d0626ae 100644 --- a/src/FrontOffice.Main/Pages/Index.razor +++ b/src/FrontOffice.Main/Pages/Index.razor @@ -131,9 +131,9 @@ @* ═══════════════════════════════════════════════ 2. HOW IT WORKS — 3 numbered steps - (controlled by LandingSettings.StepsEnabled; default off) + (appsettings Landing:ShowStepsSection; default false) ═══════════════════════════════════════════════ *@ -@if (_settings?.StepsEnabled == true) +@if (_showStepsSection) {
@@ -164,9 +164,9 @@ @* ═══════════════════════════════════════════════ 3. FEATURES — 6 cards with icons - (controlled by LandingSettings.FeaturesEnabled; default off) + (appsettings Landing:ShowFeaturesSection; default false) ═══════════════════════════════════════════════ *@ -@if (_settings?.FeaturesEnabled == true) +@if (_showFeaturesSection) {
diff --git a/src/FrontOffice.Main/Pages/Index.razor.cs b/src/FrontOffice.Main/Pages/Index.razor.cs index 56f6c17..7b0a525 100644 --- a/src/FrontOffice.Main/Pages/Index.razor.cs +++ b/src/FrontOffice.Main/Pages/Index.razor.cs @@ -21,6 +21,8 @@ public partial class Index : IDisposable private bool _isAuthenticated; private string _twentyCardPortalUrl = string.Empty; + private bool _showStepsSection; + private bool _showFeaturesSection; // ── CMS page data ── private PageSettingsDto? _pageData; @@ -53,6 +55,9 @@ public partial class Index : IDisposable MainService.OnChangeHandler += OnStateChanged; _isAuthenticated = await AuthService.IsAuthenticatedAsync(); _twentyCardPortalUrl = Configuration["TwentyCard:CreditPortalUrl"] ?? string.Empty; + // appsettings Landing:* — default false (hidden). Set true to restore sections. + _showStepsSection = Configuration.GetValue("Landing:ShowStepsSection", false); + _showFeaturesSection = Configuration.GetValue("Landing:ShowFeaturesSection", false); // Load landing page settings from CMS try diff --git a/src/FrontOffice.Main/appsettings.Production.json b/src/FrontOffice.Main/appsettings.Production.json index 9b93861..fa99ff6 100644 --- a/src/FrontOffice.Main/appsettings.Production.json +++ b/src/FrontOffice.Main/appsettings.Production.json @@ -4,6 +4,10 @@ "TwentyCard": { "CreditPortalUrl": "https://userpanel.20card.ir/" }, + "Landing": { + "ShowStepsSection": false, + "ShowFeaturesSection": false + }, "EncryptionSettings": { "Key": "kmcQ3XTmH4mrdh8VHziuscyf8LLYjG//Kyni81nH/0E=", "IV": "1wyF3Tt142MOkCpIyCxh/g==" diff --git a/src/FrontOffice.Main/appsettings.Staging.json b/src/FrontOffice.Main/appsettings.Staging.json index 9eeec81..e5ab841 100644 --- a/src/FrontOffice.Main/appsettings.Staging.json +++ b/src/FrontOffice.Main/appsettings.Staging.json @@ -9,6 +9,10 @@ "TwentyCard": { "CreditPortalUrl": "https://userpanel.20card.ir/" }, + "Landing": { + "ShowStepsSection": false, + "ShowFeaturesSection": false + }, "EncryptionSettings": { "Key": "kmcQ3XTmH4mrdh8VHziuscyf8LLYjG//Kyni81nH/0E=", "IV": "1wyF3Tt142MOkCpIyCxh/g==" diff --git a/src/FrontOffice.Main/appsettings.json b/src/FrontOffice.Main/appsettings.json index 33d9fbb..1876c38 100644 --- a/src/FrontOffice.Main/appsettings.json +++ b/src/FrontOffice.Main/appsettings.json @@ -9,6 +9,10 @@ "TwentyCard": { "CreditPortalUrl": "https://userpanel.20card.ir/" }, + "Landing": { + "ShowStepsSection": false, + "ShowFeaturesSection": false + }, "EncryptionSettings": { "Key": "kmcQ3XTmH4mrdh8VHziuscyf8LLYjG//Kyni81nH/0E=", "IV": "1wyF3Tt142MOkCpIyCxh/g=="