diff --git a/src/components/home/HomeApplicationStarter.tsx b/src/components/home/HomeApplicationStarter.tsx index e10eb9a11..3616a1112 100644 --- a/src/components/home/HomeApplicationStarter.tsx +++ b/src/components/home/HomeApplicationStarter.tsx @@ -1,9 +1,6 @@ import * as React from 'react' -import { Hydrate } from '@tanstack/react-start' -import { visible } from '@tanstack/react-start/hydration' import { ApplicationStarter } from '~/components/ApplicationStarter' -import { HomeApplicationStarterFallback } from './HomeSectionFallbacks' const headlineStorageKey = 'tanstack-home-starter-headline-index' const headlines = [ @@ -15,17 +12,6 @@ const headlines = [ ] as const export function HomeApplicationStarter() { - return ( - } - > - - - ) -} - -function RotatingHomeApplicationStarter() { const [headlineIndex, setHeadlineIndex] = React.useState(0) React.useEffect(() => { @@ -45,14 +31,6 @@ function RotatingHomeApplicationStarter() { headlineStorageKey, String((currentIndex + 1) % headlines.length), ) - - const section = document.getElementById('start-with-a-prompt') - if (section?.dataset.focusPrompt === 'true') { - const field = section.querySelector('textarea') - field?.focus() - field?.select() - delete section.dataset.focusPrompt - } }, []) return ( diff --git a/src/components/home/HomeCommunitySection.tsx b/src/components/home/HomeCommunitySection.tsx index d1ae913c0..ecb3cdace 100644 --- a/src/components/home/HomeCommunitySection.tsx +++ b/src/components/home/HomeCommunitySection.tsx @@ -1,7 +1,5 @@ import { lazy, Suspense } from 'react' import { ClientOnly, createLink } from '@tanstack/react-router' -import { Hydrate } from '@tanstack/react-start' -import { visible } from '@tanstack/react-start/hydration' import { ArrowRightIcon } from '@phosphor-icons/react' import { Button } from '~/components/ds/ui' import { allMaintainers } from '~/libraries/maintainers' @@ -14,28 +12,19 @@ const MaintainersMap = lazy(() => })), ) +// Reserve the map, its help text line, and the gap between them. const globeFallback = ( - + ) export function HomeCommunitySection() { - return ( - - {globeFallback}} - > - - - - ) -} - -function HomeCommunityContent() { return ( - - {title} - - - ) -} - -function SectionBlock({ className }: { className?: string }) { - return ( - - - - ) -} - -export function HomeSocialProofFallback() { - return ( - - - - - - - - - - - - - - - - - - - - - - ) -} - -export function HomeNewsletterFallback() { - return ( - - - - - - - - - - - - ) -} - -export function HomeApplicationStarterFallback() { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - ) -} - -export function HomeStatsFallback() { - return ( - - {Array.from({ length: 3 }).map((_, index) => ( - - - - - - - - - - ))} - - ) -} diff --git a/src/components/home/HomeSocialProofSection.tsx b/src/components/home/HomeSocialProofSection.tsx index 59cd2d76d..e04681ae3 100644 --- a/src/components/home/HomeSocialProofSection.tsx +++ b/src/components/home/HomeSocialProofSection.tsx @@ -1,6 +1,4 @@ import { Link } from '@tanstack/react-router' -import { Hydrate } from '@tanstack/react-start' -import { visible } from '@tanstack/react-start/hydration' import { ArrowRightIcon } from '@phosphor-icons/react' import { BlogPostCard } from '~/components/ds/ui/BlogPostCard' import { Button } from '~/components/ds/ui' @@ -14,68 +12,6 @@ type HomeSocialProofSectionProps = { export function HomeSocialProofSection({ recentPosts, }: HomeSocialProofSectionProps) { - return ( - } - > - - - ) -} - -function SocialProofSkeleton() { - return ( - - - - - {[2, 3].map((cols, band) => ( - - - - {Array.from({ length: cols * 2 }).map((_, index) => ( - - ))} - - - ))} - - - - - - {Array.from({ length: 3 }).map((_, index) => ( - - - - - - - - - - - - ))} - - - - ) -} - -function HomeSocialProofContent({ recentPosts }: HomeSocialProofSectionProps) { return ( ('textarea') - if (field) { - field.focus() - field.select() - } else if (section) { - section.dataset.focusPrompt = 'true' - } + field?.focus({ preventScroll: true }) + field?.select() } return ( @@ -152,12 +145,7 @@ function Index() { - } - > - - + - - - + ))}