1- @page " /subscribedusers-only"
1+ @page " /subscribedusers-only"
22@using CodeBlock .DevKit .Contracts .Services
33@inject ISubscriptionAccessorService SubscriptionService
44
88 @AdminPanelLocalizer [AdminPanelResource.SubscribedUsersOnly]
99</h1 >
1010
11+ <p class =" mb-4 text-muted" >
12+ This demo page shows how to check whether the currently logged-in user has an active subscription.
13+ You can use this logic to control access to your features, grant access to subscribed users and prompt others to subscribe first.
14+ For more details, see the
15+ <a href =" https://docs.codeblock.dev/" target =" _blank" rel =" noopener noreferrer" >documentation</a >.
16+ </p >
17+
1118@if (UserHasAnyActiveSubscription )
1219{
13- <div class =" alert text -success" >
14- You already have an active subscription and that 's why you can see this alert : )
20+ <div class =" alert alert -success" >
21+ ✅ You have an active subscription , which is why you ' re seeing this message .
1522 </div >
1623}
1724else
1825{
19- <div class =" alert text-danger" >
20- You already don 't have any active subscription and that' s why you see this alert : )
26+ <div class =" alert alert-danger" >
27+ ❌ You don 't have an active subscription, which is why you' re seeing this message .
28+ <div class =" mt-3" >
29+ <a class =" btn btn-success" href =" /pricing/demo" >View Available Plans </a >
30+ </div >
2131 </div >
2232}
2333
24-
2534@code {
2635 private bool UserHasAnyActiveSubscription = false ;
2736
2837 protected override async Task OnInitializedAsync ()
2938 {
3039 UserHasAnyActiveSubscription = await SubscriptionService .UserHasAnyActiveSubscription (CurrentUser .GetUserId ());
3140 }
32- }
41+ }
0 commit comments