Skip to content

Commit

Permalink
Refactor serverSideProps
Browse files Browse the repository at this point in the history
  • Loading branch information
oktay committed Jul 22, 2022
1 parent 60261c3 commit cce8bd9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import { FiArrowUpRight, FiMail } from 'react-icons/fi'
import { BsCode, BsDribbble, BsGithub } from 'react-icons/bs'
import { useTranslations } from 'next-intl'

export default function Home({ repos, shots, projects, homepage, seo }) {
export default function Home({ repos, shots, projects, homepage, site }) {
const seo = site.globalSeo
const t = useTranslations('Global')

function onEmailClick() {
Expand Down Expand Up @@ -238,15 +239,11 @@ export async function getServerSideProps({ locale }) {
}),
])

const { homepage, site, projects } = data

return {
props: {
...data,
repos,
shots,
projects,
homepage,
seo: site.globalSeo,
messages: (await import(`../locales/${locale}.json`)).default,
},
}
Expand Down

1 comment on commit cce8bd9

@vercel
Copy link

@vercel vercel bot commented on cce8bd9 Jul 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.