From da90428ed9ad46c4b280a56aec6a9fdc7a1185ed Mon Sep 17 00:00:00 2001 From: Tororoi Date: Tue, 4 May 2021 12:16:40 -0400 Subject: [PATCH] changed nav and footer --- assets/{base.css => base.scss} | 0 assets/{chrome-bug.css => chrome-bug.scss} | 0 assets/{components.css => components.scss} | 0 assets/{main.css => main.scss} | 4 +- components/common/Footer/Footer.tsx | 35 ++++--- components/common/Navbar/Navbar.tsx | 15 +-- components/common/UserNav/UserNav.tsx | 22 ++-- pages/_app.tsx | 6 +- pages/index.tsx | 47 ++------- pages/index2.tsx | 114 +++++++++++++++++++++ 10 files changed, 169 insertions(+), 74 deletions(-) rename assets/{base.css => base.scss} (100%) rename assets/{chrome-bug.css => chrome-bug.scss} (100%) rename assets/{components.css => components.scss} (100%) rename assets/{main.css => main.scss} (53%) create mode 100644 pages/index2.tsx diff --git a/assets/base.css b/assets/base.scss similarity index 100% rename from assets/base.css rename to assets/base.scss diff --git a/assets/chrome-bug.css b/assets/chrome-bug.scss similarity index 100% rename from assets/chrome-bug.css rename to assets/chrome-bug.scss diff --git a/assets/components.css b/assets/components.scss similarity index 100% rename from assets/components.css rename to assets/components.scss diff --git a/assets/main.css b/assets/main.scss similarity index 53% rename from assets/main.css rename to assets/main.scss index 54dd1e50f..789e81d86 100644 --- a/assets/main.css +++ b/assets/main.scss @@ -1,7 +1,7 @@ @tailwind base; -@import './base.css'; +@import './base.scss'; @tailwind components; -@import './components.css'; +@import './components.scss'; @tailwind utilities; diff --git a/components/common/Footer/Footer.tsx b/components/common/Footer/Footer.tsx index 75b2806ef..57be0873c 100644 --- a/components/common/Footer/Footer.tsx +++ b/components/common/Footer/Footer.tsx @@ -25,40 +25,47 @@ const Footer: FC = ({ className, pages }) => { ) diff --git a/components/common/Navbar/Navbar.tsx b/components/common/Navbar/Navbar.tsx index fcf9f1e10..a0a3476c7 100644 --- a/components/common/Navbar/Navbar.tsx +++ b/components/common/Navbar/Navbar.tsx @@ -12,10 +12,11 @@ const Navbar: FC = () => (
- + {/* */} +
BetterBrand
- */}
-
+ {/*
-
+
*/}
-
+ {/*
-
+
*/} ) diff --git a/components/common/UserNav/UserNav.tsx b/components/common/UserNav/UserNav.tsx index 4d00970a9..6641492ae 100644 --- a/components/common/UserNav/UserNav.tsx +++ b/components/common/UserNav/UserNav.tsx @@ -26,11 +26,19 @@ const UserNav: FC = ({ className }) => { diff --git a/pages/_app.tsx b/pages/_app.tsx index dae0311b4..4de4040a7 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,6 +1,6 @@ -import '@assets/main.css' -import '@assets/chrome-bug.css' -import 'keen-slider/keen-slider.min.css' +import '@assets/main.scss' +import '@assets/chrome-bug.scss' +// import 'keen-slider/keen-slider.min.css' import { FC, useEffect } from 'react' import type { AppProps } from 'next/app' diff --git a/pages/index.tsx b/pages/index.tsx index a77e2d515..51965bb56 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -13,7 +13,6 @@ export async function getStaticProps({ preview, locale, }: GetStaticPropsContext) { - console.log('getStaticProps') const config = getConfig({ locale }) const { products } = await getAllProducts({ @@ -44,6 +43,7 @@ export default function Home({ return ( <> + {/* main product */} {products.slice(0, 3).map((product, i) => ( ))} + {/* Featured In */} + {/* Banana Comparison */} + {/* */} + {/* */} + {/* instagram */} {products.slice(0, 3).map((product, i) => ( ))} - - - {products.slice(0, 3).map((product, i) => ( - - ))} - - - {products.slice(0, 3).map((product, i) => ( - - ))} - - {/* */} ) } diff --git a/pages/index2.tsx b/pages/index2.tsx new file mode 100644 index 000000000..3a84112e5 --- /dev/null +++ b/pages/index2.tsx @@ -0,0 +1,114 @@ +import { Layout } from '@components/common' +import { Grid, Marquee, Hero } from '@components/ui' +import { ProductCard } from '@components/product' +// import HomeAllProductsGrid from '@components/common/HomeAllProductsGrid' +import type { GetStaticPropsContext, InferGetStaticPropsType } from 'next' + +import { getConfig } from '@framework/api' +import getAllProducts from '@framework/product/get-all-products' +import getSiteInfo from '@framework/common/get-site-info' +import getAllPages from '@framework/common/get-all-pages' + +export async function getStaticProps({ + preview, + locale, +}: GetStaticPropsContext) { + const config = getConfig({ locale }) + + const { products } = await getAllProducts({ + variables: { first: 12 }, + config, + preview, + }) + + const { categories, brands } = await getSiteInfo({ config, preview }) + const { pages } = await getAllPages({ config, preview }) + + return { + props: { + products, + categories, + brands, + pages, + }, + revalidate: 14400, + } +} + +export default function Home({ + products, + brands, + categories, +}: InferGetStaticPropsType) { + return ( + <> + + {products.slice(0, 3).map((product, i) => ( + + ))} + + + {products.slice(0, 3).map((product, i) => ( + + ))} + + + + {products.slice(0, 3).map((product, i) => ( + + ))} + + + {products.slice(0, 3).map((product, i) => ( + + ))} + + {/* */} + + ) +} + +Home.Layout = Layout