Updates and architecture reorder

This commit is contained in:
Belen Curcio
2020-09-29 19:13:06 -03:00
parent 702f00933d
commit 7c890c7587
10 changed files with 51 additions and 36 deletions

View File

@@ -1,6 +1,5 @@
import { useRouter } from "next/router";
import { Featurebar, Button, Container } from "ui";
import { Navbar, Footer, ProductView } from "components";
import { ProductView, Layout } from "components";
import ErrorPage from "next/error";
export async function getStaticProps() {
@@ -18,33 +17,26 @@ export async function getStaticProps() {
props: {
productData,
},
revalidate: 200,
};
}
export async function getStaticPaths() {
return {
paths: [],
fallback: true,
fallback: "unstable_blocking",
};
}
export default function Home({ productData }) {
const router = useRouter();
return (
<>
<Featurebar
title="Free Standard Shipping on orders over $99.99"
description="Due to COVID-19, some orders may experience processing and delivery delays."
/>
<Navbar />
<Container className="h-screen">
{router.isFallback ? (
<h1>Loading...</h1>
) : (
<ProductView productData={productData} />
)}
</Container>
<Footer></Footer>
</>
<Layout>
{router.isFallback ? (
<h1>Loading...</h1>
) : (
<ProductView productData={productData} />
)}
</Layout>
);
}