diff --git a/ui/Featurebar/Featurebar.module.css b/components/Featurebar/Featurebar.module.css similarity index 100% rename from ui/Featurebar/Featurebar.module.css rename to components/Featurebar/Featurebar.module.css diff --git a/ui/Featurebar/Featurebar.tsx b/components/Featurebar/Featurebar.tsx similarity index 100% rename from ui/Featurebar/Featurebar.tsx rename to components/Featurebar/Featurebar.tsx diff --git a/ui/Featurebar/index.ts b/components/Featurebar/index.ts similarity index 100% rename from ui/Featurebar/index.ts rename to components/Featurebar/index.ts diff --git a/components/Layout/Layout.module.css b/components/Layout/Layout.module.css new file mode 100644 index 000000000..984ca54c8 --- /dev/null +++ b/components/Layout/Layout.module.css @@ -0,0 +1,3 @@ +.root { + @apply h-full border-indigo-900; +} diff --git a/components/Layout/Layout.tsx b/components/Layout/Layout.tsx new file mode 100644 index 000000000..c3c2b07ab --- /dev/null +++ b/components/Layout/Layout.tsx @@ -0,0 +1,26 @@ +import cn from "classnames"; +import React, { FunctionComponent } from "react"; +import s from "./Layout.module.css"; +import { Navbar, Featurebar } from "components"; +import { Container } from "ui"; + +interface Props { + className?: string; + children?: any; +} + +const Layout: FunctionComponent = ({ className, children }) => { + const rootClassName = cn(s.root, className); + return ( + + + +
{children}
+
+ ); +}; + +export default Layout; diff --git a/components/Layout/index.ts b/components/Layout/index.ts new file mode 100644 index 000000000..d4dca0dc6 --- /dev/null +++ b/components/Layout/index.ts @@ -0,0 +1 @@ +export { default } from "./Layout"; diff --git a/components/index.ts b/components/index.ts index 2d5c171b0..1c60119cd 100644 --- a/components/index.ts +++ b/components/index.ts @@ -3,3 +3,5 @@ export { default as Footer } from "./Footer"; export { default as Navbar } from "./Navbar"; export { default as Searchbar } from "./Searchbar"; export { default as ProductView } from "./ProductView"; +export { default as Layout } from "./Layout"; +export { default as Featurebar } from "./Featurebar"; diff --git a/pages/index.tsx b/pages/index.tsx index 2c292173f..86c2a09c8 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,22 +1,13 @@ -import { Featurebar, Button, Container } from "ui"; -import { Navbar, Footer } from "components"; +import { Layout } from "components"; export default function Home() { return ( - <> - - - -
-
-
-
-
-
-
- + +
+
+
+
+
+
); } diff --git a/pages/product/[id].tsx b/pages/product/[id].tsx index 05ec07c95..fdf872787 100644 --- a/pages/product/[id].tsx +++ b/pages/product/[id].tsx @@ -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 ( - <> - - - - {router.isFallback ? ( -

Loading...

- ) : ( - - )} -
-
- + + {router.isFallback ? ( +

Loading...

+ ) : ( + + )} +
); } diff --git a/ui/index.ts b/ui/index.ts index 4af714c6d..e643270a1 100644 --- a/ui/index.ts +++ b/ui/index.ts @@ -1,4 +1,4 @@ export { default as Button } from "./Button"; export { default as Container } from "./Container"; -export { default as Featurebar } from "./Featurebar"; + export { default as Logo } from "./Logo";