@@ -4,7 +4,11 @@ import { JsonLd } from "~/components/json-ld";
44import { PageLayout } from "~/components/layout/page-layout" ;
55import { SearchBar } from "~/components/search-bar" ;
66import { SITE_URL } from "~/lib/constants" ;
7- import { fetchCategoriesWithApps , fetchRecentApps } from "~/lib/server-fns" ;
7+ import {
8+ fetchCategoriesWithApps ,
9+ fetchPopularApps ,
10+ fetchRecentApps ,
11+ } from "~/lib/server-fns" ;
812
913const popularAlternatives = [
1014 { name : "WhatsApp" , slug : "whatsapp" } ,
@@ -21,11 +25,12 @@ const popularAlternatives = [
2125
2226export const Route = createFileRoute ( "/" ) ( {
2327 loader : async ( ) => {
24- const [ recentApps , categories ] = await Promise . all ( [
28+ const [ recentApps , popularApps , categories ] = await Promise . all ( [
2529 fetchRecentApps ( ) ,
30+ fetchPopularApps ( ) ,
2631 fetchCategoriesWithApps ( ) ,
2732 ] ) ;
28- return { recentApps, categories } ;
33+ return { recentApps, popularApps , categories } ;
2934 } ,
3035 head : ( ) => ( {
3136 meta : [
@@ -53,7 +58,7 @@ export const Route = createFileRoute("/")({
5358} ) ;
5459
5560function HomePage ( ) {
56- const { recentApps, categories } = Route . useLoaderData ( ) ;
61+ const { recentApps, popularApps , categories } = Route . useLoaderData ( ) ;
5762
5863 const jsonLd = {
5964 "@context" : "https://schema.org" ,
@@ -104,6 +109,28 @@ function HomePage() {
104109 </ div >
105110 </ section >
106111
112+ { /* Popular Apps */ }
113+ { popularApps . length > 0 && (
114+ < section >
115+ < h2 className = "mb-3 font-sans text-base font-bold text-foreground" >
116+ Popular Apps
117+ </ h2 >
118+ < div className = "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3" >
119+ { popularApps . map ( ( app : any ) => (
120+ < AppCard
121+ key = { app . slug }
122+ name = { app . name }
123+ slug = { app . slug }
124+ description = { app . description }
125+ iconUrl = { app . iconUrl }
126+ sources = { app . sources }
127+ tags = { app . tags }
128+ />
129+ ) ) }
130+ </ div >
131+ </ section >
132+ ) }
133+
107134 { /* Recently Added */ }
108135 { recentApps . length > 0 && (
109136 < section >
0 commit comments