File tree Expand file tree Collapse file tree 4 files changed +266
-46
lines changed
Expand file tree Collapse file tree 4 files changed +266
-46
lines changed Original file line number Diff line number Diff line change 4646 </p >
4747 </a >
4848 <div class ={myDivider }></div >
49+ <a href =" /app-explorer" >
50+ <p class ={isHighlighted (' /app-explorer' ) ? topBarHighlightedFont : topBarFont }>
51+ APP EXPLORER
52+ </p >
53+ </a >
54+ <div class ={myDivider }></div >
4955 <a href =" /blog" >
5056 <p class ={isHighlighted (' /blog' ) ? topBarHighlightedFont : topBarFont }>BLOG</p >
5157 </a >
Original file line number Diff line number Diff line change 111111 <div class =" mb-2" >
112112 <a href =" /about" class =" underline hover:text-primary-900-100" >About AppGoblin</a >
113113 |
114+ <a href =" /blog" class =" underline hover:text-primary-900-100" >Blog</a >
115+ |
116+ <a href =" /reports" class =" underline hover:text-primary-900-100" >Reports</a >
117+ |
114118 <a href =" /pricing" class =" underline hover:text-primary-900-100" >Pricing</a >
115119 |
116120 <a href =" /privacy_policy.html" class =" underline hover:text-primary-900-100"
Original file line number Diff line number Diff line change 11import type { PageServerLoad } from './$types' ;
22import { createApiClient } from '$lib/server/api' ;
3+ import { db } from '$lib/server/auth/db' ;
34
45interface CompanyRaw {
56 company_name : string | null ;
67 company_domain : string | null ;
78 total_apps : number ;
89}
910
10- export const load : PageServerLoad = async ( { fetch } ) => {
11+ export const load : PageServerLoad = async ( { fetch, locals } ) => {
12+ const user = locals . user ;
13+ let hasPaidAccess = false ;
14+
15+ if ( user ) {
16+ const row = await db . queryOne < { status : string } > (
17+ `SELECT status FROM subscriptions
18+ WHERE user_id = $1 AND status IN ('active', 'trialing')
19+ ORDER BY created_at DESC LIMIT 1` ,
20+ [ user . id ]
21+ ) ;
22+ hasPaidAccess = ! ! row ;
23+ }
24+
1125 const api = createApiClient ( fetch ) ;
1226
1327 // Load companies for the dropdown filters
@@ -30,7 +44,8 @@ export const load: PageServerLoad = async ({ fetch }) => {
3044
3145 return {
3246 companies,
33- categories
47+ categories,
48+ hasPaidAccess
3449 } ;
3550} ;
3651
You can’t perform that action at this time.
0 commit comments