File tree Expand file tree Collapse file tree 1 file changed +9
-37
lines changed Expand file tree Collapse file tree 1 file changed +9
-37
lines changed Original file line number Diff line number Diff line change 1- import CardContainer from "@/components/CardContainer" ;
2- import FAQSection from "@/components/FAQSection" ;
3- import FeatureArticles from "@/components/FeaturedArticles" ;
4- import Hero from "@/components/Hero" ;
5- import Wrapper from "@/components/Wrapper" ;
6- import { postQuery } from "@/lib/queries" ;
7- import { client , isSanityConfigured } from "@/lib/sanityClient" ;
8-
9- export default function HomePage ( { articles } ) {
10-
11- return (
12- < Wrapper >
13- < Hero />
14- < CardContainer />
15- < FAQSection />
16- { isSanityConfigured && < FeatureArticles articles = { articles } /> }
17- </ Wrapper >
18- ) ;
19- }
20-
21- export async function getStaticProps ( ) {
22- let articles = null ;
23-
24- if ( isSanityConfigured && client ) {
25- try {
26- articles = await client . fetch ( postQuery ) ;
27- } catch ( error ) {
28- console . error ( "Error fetching articles from Sanity:" , error ) ;
29- articles = null ;
30- }
31- }
32-
33- return {
34- props : {
35- articles,
36- } ,
37- } ;
1+ import { useEffect } from "react" ;
2+ import { useRouter } from "next/router" ;
3+
4+ export default function Home ( ) {
5+ const router = useRouter ( ) ;
6+ useEffect ( ( ) => {
7+ router . replace ( "/docs" ) ;
8+ } , [ router ] ) ;
9+ return null ;
3810}
You can’t perform that action at this time.
0 commit comments