From 133cc620eaad3f3e9e61117b0486d64d6fa38750 Mon Sep 17 00:00:00 2001 From: Nathan Kluth Date: Tue, 12 Dec 2023 11:28:09 -0700 Subject: [PATCH] categories --- packages/nextjs/app/about/page.tsx | 2 +- packages/nextjs/app/categories/page.tsx | 17 ++++++++-- packages/nextjs/{ => app}/components/Card.tsx | 4 +-- packages/nextjs/app/migration/categories.tsx | 31 ------------------- .../nextjs/app/migration/products/[slug].tsx | 6 +--- packages/nextjs/components/CategoryList.tsx | 2 +- packages/nextjs/components/FeaturedList.tsx | 2 +- packages/nextjs/components/Image.tsx | 2 ++ 8 files changed, 23 insertions(+), 43 deletions(-) rename packages/nextjs/{ => app}/components/Card.tsx (91%) delete mode 100644 packages/nextjs/app/migration/categories.tsx diff --git a/packages/nextjs/app/about/page.tsx b/packages/nextjs/app/about/page.tsx index 02b0fdf..d4fc9f7 100644 --- a/packages/nextjs/app/about/page.tsx +++ b/packages/nextjs/app/about/page.tsx @@ -12,7 +12,7 @@ const DIAGRAM_HEIGHT = DIAGRAM_WIDTH / 1.86; const FASTLY_WIDTH = 700.0; const FASTLY_HEIGHT = FASTLY_WIDTH / 2.93; -export const metaData: Metadata = { +export const metadata: Metadata = { title: "About", description: "About the Formidable Boulangerie project.", }; diff --git a/packages/nextjs/app/categories/page.tsx b/packages/nextjs/app/categories/page.tsx index 1dc5519..3a59d4a 100644 --- a/packages/nextjs/app/categories/page.tsx +++ b/packages/nextjs/app/categories/page.tsx @@ -1,5 +1,7 @@ -import CategoriesPage from "app/migration/categories"; +import { Breadcrumbs } from "components/Breadcrumbs"; +import { CategoryList } from "components/CategoryList"; import { Metadata } from "next"; +import { WeDontSellBreadBanner } from "../ui/shared-ui"; import { getAllCategories } from "utils/getAllCategoriesQuery"; import { isString, pluralize } from "utils/pluralize"; @@ -25,5 +27,16 @@ export async function generateMetadata(): Promise { export default async function Page() { const data = await getData(); - return ; + return ( +
+ +
+

Categories

+
+ +
+ +
+
+ ); } diff --git a/packages/nextjs/components/Card.tsx b/packages/nextjs/app/components/Card.tsx similarity index 91% rename from packages/nextjs/components/Card.tsx rename to packages/nextjs/app/components/Card.tsx index 6fc27c3..bcbd150 100644 --- a/packages/nextjs/components/Card.tsx +++ b/packages/nextjs/app/components/Card.tsx @@ -1,8 +1,8 @@ import * as React from "react"; import { SanityImageSource } from "@sanity/image-url/lib/types/types"; import Link, { LinkProps } from "next/link"; -import { Image } from "./Image"; -import { Card as BaseCard } from "shared-ui"; +import { Image } from "../../components/Image"; +import { Card as BaseCard } from "../ui/shared-ui"; export interface CardProps { title: string; diff --git a/packages/nextjs/app/migration/categories.tsx b/packages/nextjs/app/migration/categories.tsx deleted file mode 100644 index f85eb15..0000000 --- a/packages/nextjs/app/migration/categories.tsx +++ /dev/null @@ -1,31 +0,0 @@ -"use client"; - -import { NextPage } from "next"; - -import { WeDontSellBreadBanner } from "shared-ui"; - -import { CategoryList } from "components/CategoryList"; -import { Breadcrumbs } from "components/Breadcrumbs"; -import { Category } from "utils/groqTypes/ProductList"; - -interface PageProps { - categories: Category[]; - categoryNames: string; -} - -const CategoriesPage: NextPage = ({ categories }) => { - return ( -
- -
-

Categories

-
- -
- -
-
- ); -}; - -export default CategoriesPage; diff --git a/packages/nextjs/app/migration/products/[slug].tsx b/packages/nextjs/app/migration/products/[slug].tsx index fcaffd0..228f9b4 100644 --- a/packages/nextjs/app/migration/products/[slug].tsx +++ b/packages/nextjs/app/migration/products/[slug].tsx @@ -9,7 +9,6 @@ import { H6, FadeInOut, BlockContent, Price, QuantityInput, useCart } from "shar import { getRecommendations } from "utils/getRecommendationsQuery"; import { ImageCarousel } from "components/ImageCarousel"; -import { PageHead } from "components/PageHead"; import { StyleOptions } from "components/ProductPage/StyleOptions"; import { ProductVariantSelector } from "components/ProductPage/ProductVariantSelector"; import { Product } from "components/Product"; @@ -34,7 +33,6 @@ const ProductPage: NextPage = ({ data }) => { return ( -
@@ -110,9 +108,7 @@ const PageBody = ({ variant, product }: { product?: ProductDetail; variant?: Pro
- {variant?.images && ( - - )} + {variant?.images && }

{product?.name}

diff --git a/packages/nextjs/components/CategoryList.tsx b/packages/nextjs/components/CategoryList.tsx index a86c4ad..eaf717b 100644 --- a/packages/nextjs/components/CategoryList.tsx +++ b/packages/nextjs/components/CategoryList.tsx @@ -1,5 +1,5 @@ import type { GetCategoriesQuery, GetProductsAndCategoriesQuery } from "utils/groqTypes/ProductList"; -import { Card } from "components/Card"; +import { Card } from "app/components/Card"; type CategoryListProps = { items?: GetCategoriesQuery["categories"] | GetProductsAndCategoriesQuery["categories"]; diff --git a/packages/nextjs/components/FeaturedList.tsx b/packages/nextjs/components/FeaturedList.tsx index 7ad8853..c5d2fd2 100644 --- a/packages/nextjs/components/FeaturedList.tsx +++ b/packages/nextjs/components/FeaturedList.tsx @@ -1,7 +1,7 @@ import type { Categories, Products } from "utils/groqTypes/ProductList"; import * as React from "react"; import classNames from "classnames"; -import { Card, CardProps } from "components/Card"; +import { Card, CardProps } from "app/components/Card"; type Props = { items?: Products | Categories; diff --git a/packages/nextjs/components/Image.tsx b/packages/nextjs/components/Image.tsx index 0fcb1b4..034ab10 100644 --- a/packages/nextjs/components/Image.tsx +++ b/packages/nextjs/components/Image.tsx @@ -1,3 +1,5 @@ +"use client"; + import type { ImageProps, ImageLoaderProps } from "next/image"; import * as React from "react"; import { SanityImageSource } from "@sanity/image-url/lib/types/types";