Skip to content

Commit

Permalink
chore: revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gitstart-sourcegraph committed Nov 8, 2023
1 parent 39c192c commit 2a69a86
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { FunctionComponent, useRef, useState } from 'react'
import classNames from 'classnames'
import ChevronRightIcon from 'mdi-react/ChevronRightIcon'
import PlusIcon from 'mdi-react/PlusIcon'
// import { GetStaticProps } from 'next'
import { GetStaticProps } from 'next'
import Link from 'next/link'
// import { EmbeddedTweet, TweetSkeleton } from 'react-tweet'
import { EmbeddedTweet, TweetSkeleton } from 'react-tweet'
import { Tweet } from 'react-tweet/api'

import {
Expand All @@ -21,12 +21,12 @@ import {
} from '../components'
import { breakpoints } from '../data/breakpoints'
// eslint-disable-next-line import/extensions
// import Tweets from '../data/tweets.json'
import Tweets from '../data/tweets.json'
import { EventName, getEventLogger } from '../hooks/eventLogger'
import { useInView } from '../hooks/useInView'
import { useWindowWidth } from '../hooks/windowWidth'

// import { HOME_PAGE_TWEET_IDS } from './constants'
import { HOME_PAGE_TWEET_IDS } from './constants'

interface HomeProps {
tweets: (Tweet | undefined)[]
Expand Down Expand Up @@ -70,7 +70,7 @@ const carouselVideos = [
},
]

const Home: FunctionComponent<HomeProps> = () => {
const Home: FunctionComponent<HomeProps> = ({ tweets }) => {
const windowWidth = useWindowWidth()
const isMobile = windowWidth < breakpoints.lg

Expand Down Expand Up @@ -134,7 +134,7 @@ const Home: FunctionComponent<HomeProps> = () => {
<Heading size="h3" className="mb-16 text-center !text-4xl font-semibold text-white md:mb-16">
See what devs are saying about Cody (beta)
</Heading>
{/* <div className="relative -mt-[25px] grid w-full grid-cols-1 gap-x-6 md:grid-cols-2">
<div className="relative -mt-[25px] grid w-full grid-cols-1 gap-x-6 md:grid-cols-2">
<div className="relative grid auto-rows-min grid-cols-1">
<div className="mb-1 -mt-[30px] flex justify-center md:mt-0 xl:-mr-[80px]">
{tweets[0] ? <EmbeddedTweet key={tweets[0].id_str} tweet={tweets[0]} /> : <TweetSkeleton />}
Expand All @@ -152,7 +152,7 @@ const Home: FunctionComponent<HomeProps> = () => {
{tweets[3] ? <EmbeddedTweet key={tweets[3].id_str} tweet={tweets[3]} /> : <TweetSkeleton />}
</div>
</div>
</div> */}
</div>
</ContentSection>

<CallToActionWithCody className="-mt-[10px] md:mt-32" />
Expand Down Expand Up @@ -484,15 +484,15 @@ const AvailabilityIcon: React.FC<AvailabilityIconProps> = ({
)
}

// export const getStaticProps: GetStaticProps<HomeProps> = () => {
// try {
// const tweets = HOME_PAGE_TWEET_IDS.map(tweetId => Tweets[tweetId] as any)
export const getStaticProps: GetStaticProps<HomeProps> = () => {
try {
const tweets = HOME_PAGE_TWEET_IDS.map(tweetId => Tweets[tweetId] as any)

// return { props: { tweets } }
// } catch (error) {
// console.error('Error fetching tweets:', error)
// return { props: { tweets: [] } }
// }
// }
return { props: { tweets } }
} catch (error) {
console.error('Error fetching tweets:', error)
return { props: { tweets: [] } }
}
}

export default Home

0 comments on commit 2a69a86

Please sign in to comment.