From fbf42b7551734e878e91a6fdbde3f62fa92a3754 Mon Sep 17 00:00:00 2001 From: Jieren Chen Date: Mon, 23 Sep 2024 16:46:29 -0400 Subject: [PATCH] some more cleanup --- README.md | 2 +- app/api/revalidate/route.ts | 6 ----- app/page.tsx | 2 +- app/product/[handle]/page.tsx | 47 +++-------------------------------- app/sitemap.ts | 34 +++++++++---------------- components/layout/footer.tsx | 24 +++--------------- components/welcome-toast.tsx | 2 +- lib/constants.ts | 2 +- lib/fourthwall/index.ts | 37 +++++++++++++-------------- lib/fourthwall/reshape.ts | 13 ++++------ lib/fourthwall/types.ts | 15 +++++++++++ lib/type-guards.ts | 27 -------------------- lib/types.ts | 37 +-------------------------- lib/utils.ts | 13 ++-------- next.config.js | 5 ---- 15 files changed, 62 insertions(+), 204 deletions(-) delete mode 100644 app/api/revalidate/route.ts delete mode 100644 lib/type-guards.ts diff --git a/README.md b/README.md index 732990275..4bb78d68e 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Integrations enable upgraded or additional functionality for Next.js Commerce You will need to use the environment variables [defined in `.env.example`](.env.example) to run Next.js Commerce. It's recommended you use [Vercel Environment Variables](https://vercel.com/docs/concepts/projects/environment-variables) for this, but a `.env` file is all that is necessary. -> Note: You should not commit your `.env` file or it will expose secrets that will allow others to control your Shopify store. +> Note: You should not commit your `.env` file or it will expose secrets that will allow others to control your Fourthwall store. 1. Install Vercel CLI: `npm i -g vercel` 2. Link local instance with Vercel and GitHub accounts (creates `.vercel` directory): `vercel link` diff --git a/app/api/revalidate/route.ts b/app/api/revalidate/route.ts deleted file mode 100644 index 4ecc0b45d..000000000 --- a/app/api/revalidate/route.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { revalidate } from 'lib/shopify'; -import { NextRequest, NextResponse } from 'next/server'; - -export async function POST(req: NextRequest): Promise { - return revalidate(req); -} diff --git a/app/page.tsx b/app/page.tsx index 3e12b7af3..e63fea3e4 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -6,7 +6,7 @@ import { getCart } from 'lib/fourthwall'; import { cookies } from 'next/headers'; export const metadata = { - description: 'High-performance ecommerce store built with Next.js, Vercel, and Shopify.', + description: 'High-performance ecommerce store built with Next.js, Vercel, and Fourthwall.', openGraph: { type: 'website' } diff --git a/app/product/[handle]/page.tsx b/app/product/[handle]/page.tsx index 557ebb6e6..ebaac2b1e 100644 --- a/app/product/[handle]/page.tsx +++ b/app/product/[handle]/page.tsx @@ -1,16 +1,14 @@ import type { Metadata } from 'next'; import { notFound } from 'next/navigation'; -import { GridTileImage } from 'components/grid/tile'; import Footer from 'components/layout/footer'; import { Gallery } from 'components/product/gallery'; import { ProductProvider } from 'components/product/product-context'; import { ProductDescription } from 'components/product/product-description'; import { Wrapper } from 'components/wrapper'; import { HIDDEN_PRODUCT_TAG } from 'lib/constants'; -import { getCart, getProduct, getProductRecommendations } from 'lib/fourthwall'; +import { getCart, getProduct } from 'lib/fourthwall'; import { cookies } from 'next/headers'; -import Link from 'next/link'; import { Suspense } from 'react'; export async function generateMetadata({ @@ -26,8 +24,8 @@ export async function generateMetadata({ const indexable = !product.tags.includes(HIDDEN_PRODUCT_TAG); return { - title: product.seo.title || product.title, - description: product.seo.description || product.description, + title: product.title, + description: product.description, robots: { index: indexable, follow: indexable, @@ -110,48 +108,9 @@ export default async function ProductPage({ params, searchParams }: { params: { -