diff --git a/src/app/components/LandingCTA.tsx b/src/app/components/LandingCTA.tsx index 18233a6ca..6f8097b0a 100644 --- a/src/app/components/LandingCTA.tsx +++ b/src/app/components/LandingCTA.tsx @@ -1,11 +1,11 @@ import clx from 'classnames' - import { LoginButtonClient } from './LoginButton' import { ShowEmailJS } from './ShowEmailJS' +import { ReactNode } from 'react' export const LandingCTA: React.FC = () => { return ( -
+
@@ -20,7 +20,12 @@ const Card4Coders: React.FC = () => { return ( +
  • ☑️ Fix a bug.
  • +
  • ☑️ Use OpenBeta API & data in your projects.
  • + + } action={ <> Dev onboarding @@ -35,7 +40,12 @@ const Card4All: React.FC = () => { return ( +
  • ☑️ Add missing climbs
  • +
  • ☑️ Help us make your local climbing's area page even better!
  • + + } action={} /> ) @@ -63,7 +73,7 @@ const Donate: React.FC = () => { interface CTACardProps { title: string - body: string + body: string | ReactNode action: React.ReactNode className?: string } @@ -74,7 +84,7 @@ const Card: React.FC = ({ title, body, action, className }) => {

    {title}

    -

    {body}

    +
    {body}
    {action}
    diff --git a/src/app/components/LandingHero.tsx b/src/app/components/LandingHero.tsx index 4387cbedb..d535cdb2f 100644 --- a/src/app/components/LandingHero.tsx +++ b/src/app/components/LandingHero.tsx @@ -1,13 +1,8 @@ -import Heart from '@/assets/icons/heart-hero' - export const LandingHero: React.FC = () => { return ( -
    -
    - Knowledge - + - You = -
    +
    +

    Share your climbing route knowledge!

    +

    Join OpenBeta and help build a community resource for climbers

    ) } diff --git a/src/app/components/RecentEdits.tsx b/src/app/components/RecentEdits.tsx index bdc0dfef8..3dc33f8c4 100644 --- a/src/app/components/RecentEdits.tsx +++ b/src/app/components/RecentEdits.tsx @@ -1,9 +1,17 @@ +import Link from 'next/link' import { ArrowRightIcon } from '@heroicons/react/24/outline' import { getChangeHistoryServerSide } from '@/js/graphql/contribAPI' import { ChangesetRow } from '@/components/edit/RecentChangeHistory' -import Link from 'next/link' +/** + * Cache time in seconds + */ +export const revalidate = 300 + +/** + * Show most recent edits + */ export const RecentEdits: React.FC = async () => { const history = await getChangeHistoryServerSide() return ( @@ -15,7 +23,9 @@ export const RecentEdits: React.FC = async () => {
    {history.splice(0, 10).map(changetset => - )} + + )} +
    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 (
    -
    +

    Our website is undergoing a facelift. Visit the old home.
    Questions or comments? hello@openbeta.io

    - + }> + +