See more
@@ -23,3 +33,22 @@ export const RecentEdits: React.FC = async () => {
)
}
+
+/**
+ * Loading skelton.
+ * Todo: somehow reuse the structure and css from the real component
+ */
+export const RecentEditsSkeleton: React.FC = () => {
+ return (
+
+
+
Recent edits
+ See more
+
+
+
+ {[1, 2, 3, 4, 5].map(item =>
)}
+
+
+ )
+}
diff --git a/src/app/components/RecentTags.tsx b/src/app/components/RecentTags.tsx
index bbce08bc0..3267334ad 100644
--- a/src/app/components/RecentTags.tsx
+++ b/src/app/components/RecentTags.tsx
@@ -1,6 +1,11 @@
import { RecentImageCard } from '@/components/home/RecentMediaCard'
import { getMediaForFeed } from '@/js/graphql/api'
+/**
+ * Cache time in seconds
+ */
+export const revalidate = 300
+
/**
* Horizontal gallery of recent images with tags
*/
diff --git a/src/app/page.tsx b/src/app/page.tsx
index a8711eb83..313cf6f79 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -1,6 +1,7 @@
+import { Suspense } from 'react'
import { LandingCTA } from './components/LandingCTA'
import { LandingHero } from './components/LandingHero'
-import { RecentEdits } from './components/RecentEdits'
+import { RecentEdits, RecentEditsSkeleton } from './components/RecentEdits'
import { RecentTags } from './components/RecentTags'
import { USAToC } from './components/USAToC'
@@ -8,13 +9,15 @@ export default async function Home (): Promise
{
return (