From cce8bd9e63e8571382f28265f47519c10661f05f Mon Sep 17 00:00:00 2001 From: oktay Date: Fri, 22 Jul 2022 23:31:48 +0300 Subject: [PATCH] Refactor serverSideProps --- pages/index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pages/index.js b/pages/index.js index 0729a9c..524c436 100644 --- a/pages/index.js +++ b/pages/index.js @@ -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() { @@ -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, }, }