feat(index): add TwentyCard credit promo section and integrate portal link
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 9m23s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 9m23s
- Introduced a new promotional section for TwentyCard credit on the landing page, featuring details about the service and a button to access the TwentyCard portal. - Updated the Index.razor.cs file to retrieve the portal URL from configuration and implemented the logic to open the portal in a new tab. - Enhanced site.css with styling specific to the TwentyCard promo box. These changes enhance user engagement by promoting the TwentyCard credit option and providing easy access to its portal.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.JSInterop;
|
||||
using MudBlazor;
|
||||
|
||||
@@ -16,8 +17,10 @@ public partial class Index : IDisposable
|
||||
[Inject] private DiscountCartService DiscountCart { get; set; } = default!;
|
||||
[Inject] private GuestActionGate GuestGate { get; set; } = default!;
|
||||
[Inject] private VATService VAT { get; set; } = default!;
|
||||
[Inject] private IConfiguration Configuration { get; set; } = default!;
|
||||
|
||||
private bool _isAuthenticated;
|
||||
private string _twentyCardPortalUrl = string.Empty;
|
||||
|
||||
// ── CMS page data ──
|
||||
private PageSettingsDto? _pageData;
|
||||
@@ -49,6 +52,7 @@ public partial class Index : IDisposable
|
||||
{
|
||||
MainService.OnChangeHandler += OnStateChanged;
|
||||
_isAuthenticated = await AuthService.IsAuthenticatedAsync();
|
||||
_twentyCardPortalUrl = Configuration["TwentyCard:CreditPortalUrl"] ?? string.Empty;
|
||||
|
||||
// Load landing page settings from CMS
|
||||
try
|
||||
@@ -298,6 +302,12 @@ public partial class Index : IDisposable
|
||||
Navigation.NavigateTo(RouteConstants.Registration.Wizard);
|
||||
}
|
||||
|
||||
private async Task OpenTwentyCardPortal()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(_twentyCardPortalUrl)) return;
|
||||
await JS.InvokeVoidAsync("open", _twentyCardPortalUrl, "_blank");
|
||||
}
|
||||
|
||||
private void NavigateToPost(string slug)
|
||||
{
|
||||
Navigation.NavigateTo($"/blog/{slug}");
|
||||
|
||||
Reference in New Issue
Block a user