diff --git a/README.md b/README.md index 6301f5b19..888c71245 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fcommerce&project-name=commerce&repo-name=commerce&demo-title=Next.js%20Commerce&demo-url=https%3A%2F%2Fdemo.vercel.store&demo-image=https%3A%2F%2Fbigcommerce-demo-asset-ksvtgfvnd.vercel.app%2Fbigcommerce.png&env=COMPANY_NAME,SHOPIFY_REVALIDATION_SECRET,SHOPIFY_STORE_DOMAIN,SHOPIFY_STOREFRONT_ACCESS_TOKEN,SITE_NAME,TWITTER_CREATOR,TWITTER_SITE) +## IMPORTANT NOTES!! + +- Vercel's production instance is currently running on the `sol/narai` branch. For the latest stable version, please refer to that branch. +- If you're making changes to the site, please make sure to create a new branch and submit a PR to the `sol/preview` branch. This is to ensure that the production instance is always stable. +- The `sol/preview` branch should be reviewed and approved by the suginomori brewery team before merging to `sol/narai` and deploying to production. # Next.js Commerce diff --git a/app/[locale]/about/page.tsx b/app/[locale]/about/page.tsx index 936d6628d..1fcfbe8b1 100644 --- a/app/[locale]/about/page.tsx +++ b/app/[locale]/about/page.tsx @@ -9,6 +9,8 @@ import { Suspense } from 'react'; import AboutNaraiDetail from './about-narai-detail'; export const runtime = 'edge'; +export const revalidate = 43200; // 12 hours in seconds + const { SITE_NAME } = process.env; export const metadata = { diff --git a/app/[locale]/bar/sagyobar-detail.tsx b/app/[locale]/bar/sagyobar-detail.tsx index 83fde8e60..6073e4d81 100644 --- a/app/[locale]/bar/sagyobar-detail.tsx +++ b/app/[locale]/bar/sagyobar-detail.tsx @@ -26,7 +26,7 @@ export default function SagyobarDetail() {
diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index 13e6a7067..43ccc6d15 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -71,7 +71,7 @@ const noto = Noto_Serif_JP({ }); export function generateStaticParams() { - return [{ locale: 'en' }, { locale: 'ja' }]; + return [{ locale: 'ja' }, { locale: 'en' }]; } export default async function RootLayout({ diff --git a/app/[locale]/opengraph-image.tsx b/app/[locale]/opengraph-image.tsx index 23762cbdd..434a936b8 100644 --- a/app/[locale]/opengraph-image.tsx +++ b/app/[locale]/opengraph-image.tsx @@ -1,6 +1,7 @@ import OpengraphImage from 'components/opengraph-image'; export const runtime = 'edge'; +export const revalidate = 300; // 5 minutes in seconds export default async function Image() { return await OpengraphImage(); diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index 68e1736fb..d351d6034 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -27,6 +27,8 @@ import Image from 'next/image'; import { Suspense } from 'react'; export const runtime = 'edge'; +export const revalidate = 300; // 5 minutes in seconds + const { SITE_NAME } = process.env; export const metadata = { diff --git a/app/[locale]/product/[handle]/layout.tsx b/app/[locale]/product/[handle]/layout.tsx index a9aebb272..9d1928993 100644 --- a/app/[locale]/product/[handle]/layout.tsx +++ b/app/[locale]/product/[handle]/layout.tsx @@ -7,6 +7,8 @@ import { cookies } from 'next/headers'; import { ReactNode, Suspense } from 'react'; export const runtime = 'edge'; +export const revalidate = 300; // 5 minutes in seconds + const { SITE_NAME } = process.env; export const metadata = { diff --git a/app/[locale]/product/[handle]/page.tsx b/app/[locale]/product/[handle]/page.tsx index b137230a5..01b6330bb 100644 --- a/app/[locale]/product/[handle]/page.tsx +++ b/app/[locale]/product/[handle]/page.tsx @@ -2,6 +2,7 @@ import type { Metadata } from 'next'; import { notFound } from 'next/navigation'; import { Suspense } from 'react'; +import { ChevronDoubleRightIcon } from '@heroicons/react/24/outline'; import clsx from 'clsx'; import { AddManyToCart } from 'components/cart/add-many-to-cart'; import { GridTileImage } from 'components/grid/tile'; @@ -18,7 +19,7 @@ import Image from 'next/image'; import Link from 'next/link'; export const runtime = 'edge'; -export const revalidate = 43200; // 12 hours in seconds +export const revalidate = 300; // 5 minutes in seconds export async function generateMetadata({ params @@ -152,18 +153,18 @@ export default async function ProductPage({
{!!product?.notes && ( -
+
)} {!!product?.galleryIntro?.value && ( -
+
{product.galleryIntro.value}
)} -
+
{!!otherImages && otherImages?.length > 0 && otherImages.map((image, index) => { @@ -174,7 +175,7 @@ export default async function ProductPage({
@@ -191,7 +192,7 @@ export default async function ProductPage({
{!!product?.lower?.value && ( -
+
{product.lower.value}
)} @@ -211,7 +212,12 @@ async function RelatedProducts({ id }: { id: string }) { if (!relatedProducts.length) return null; return ( -
+
+ {relatedProducts.length > 1 && ( +
+ +
+ )}

other products

    {relatedProducts.map((product) => ( diff --git a/app/[locale]/products/page.tsx b/app/[locale]/products/page.tsx index e013e14c4..3993cfa35 100644 --- a/app/[locale]/products/page.tsx +++ b/app/[locale]/products/page.tsx @@ -9,7 +9,7 @@ import { cookies } from 'next/headers'; import { Suspense } from 'react'; export const runtime = 'edge'; -export const revalidate = 43200; // 12 hours in seconds +export const revalidate = 300; // 5 minutes in seconds const { SITE_NAME } = process.env; diff --git a/app/[locale]/shop-list/opengraph-image.tsx b/app/[locale]/shop-list/opengraph-image.tsx index 8f068a6f1..df924a4a3 100644 --- a/app/[locale]/shop-list/opengraph-image.tsx +++ b/app/[locale]/shop-list/opengraph-image.tsx @@ -2,6 +2,7 @@ import OpengraphImage from 'components/opengraph-image'; import { getPage } from 'lib/shopify'; export const runtime = 'edge'; +export const revalidate = 300; // 5 minutes in seconds export default async function Image({ params }: { params: { page: string } }) { const page = await getPage({ handle: params.page }); diff --git a/app/[locale]/shop-list/page.tsx b/app/[locale]/shop-list/page.tsx index 0f63e9b6c..0a14091bf 100644 --- a/app/[locale]/shop-list/page.tsx +++ b/app/[locale]/shop-list/page.tsx @@ -12,8 +12,7 @@ import { Suspense } from 'react'; import ShopsNav from './shops-nav'; export const runtime = 'edge'; - -export const revalidate = 43200; // 12 hours in seconds +export const revalidate = 300; // 5 minutes in seconds export async function generateMetadata({ params diff --git a/app/[locale]/stories/[handle]/layout.tsx b/app/[locale]/stories/[handle]/layout.tsx index 5916e25a2..747ed671a 100644 --- a/app/[locale]/stories/[handle]/layout.tsx +++ b/app/[locale]/stories/[handle]/layout.tsx @@ -8,6 +8,8 @@ import { cookies } from 'next/headers'; import { ReactNode, Suspense } from 'react'; export const runtime = 'edge'; +export const revalidate = 300; // 5 minutes in seconds + const { SITE_NAME } = process.env; export const metadata = { diff --git a/app/[locale]/stories/[handle]/page.tsx b/app/[locale]/stories/[handle]/page.tsx index d9a9c1730..0dc20e721 100644 --- a/app/[locale]/stories/[handle]/page.tsx +++ b/app/[locale]/stories/[handle]/page.tsx @@ -7,7 +7,9 @@ import { BLOG_HANDLE, HIDDEN_ARTICLE_TAG } from 'lib/constants'; import { getBlogArticle } from 'lib/shopify'; import { BlogArticle } from 'lib/shopify/types'; import Image from 'next/image'; + export const runtime = 'edge'; +export const revalidate = 300; // 5 minutes in seconds export async function generateMetadata({ params diff --git a/app/[locale]/stories/page.tsx b/app/[locale]/stories/page.tsx index bf8545d2b..316d20c0a 100644 --- a/app/[locale]/stories/page.tsx +++ b/app/[locale]/stories/page.tsx @@ -10,6 +10,8 @@ import { cookies } from 'next/headers'; import { Suspense } from 'react'; export const runtime = 'edge'; +export const revalidate = 300; // 5 minutes in seconds + const { SITE_NAME } = process.env; export const metadata = { diff --git a/app/[locale]/terms/page.tsx b/app/[locale]/terms/page.tsx index 04339f352..fcd3b8647 100644 --- a/app/[locale]/terms/page.tsx +++ b/app/[locale]/terms/page.tsx @@ -9,6 +9,8 @@ import { Suspense } from 'react'; import TermsOfUse from './terms-of-use'; export const runtime = 'edge'; +export const revalidate = 43200; // 12 hours in seconds + const { SITE_NAME } = process.env; export const metadata = { diff --git a/components/cart/add-many-to-cart.tsx b/components/cart/add-many-to-cart.tsx index 3693bf081..84b670365 100644 --- a/components/cart/add-many-to-cart.tsx +++ b/components/cart/add-many-to-cart.tsx @@ -41,7 +41,7 @@ export function AddManyToCart({ return (
    -
    {t('cart.quantity-label')}
    +
    {t('cart.quantity-label')}
    setCurrentQuantity(Number(e.target.value))} diff --git a/components/cart/index.tsx b/components/cart/index.tsx index f82c7a67f..d5e9103ef 100644 --- a/components/cart/index.tsx +++ b/components/cart/index.tsx @@ -14,7 +14,7 @@ export default async function Cart({ locale }: { locale?: SupportedLocale }) { const promotedItem: Product | undefined = await getProduct({ handle: 'gift-bag-and-postcard-set', - language: locale?.toUpperCase() || 'EN' + language: locale?.toUpperCase() || 'JA' }); return ; diff --git a/components/layout/navbar/language-control.tsx b/components/layout/navbar/language-control.tsx index 13457f763..993fbf32a 100644 --- a/components/layout/navbar/language-control.tsx +++ b/components/layout/navbar/language-control.tsx @@ -19,7 +19,7 @@ export const LanguageControl = ({ lang }: { lang?: SupportedLocale }) => { const basePathName = () => { const unjoined = pathName.split('/'); - const unjoinedWithoutLocale = removeItem(unjoined, 'ja'); + const unjoinedWithoutLocale = removeItem(unjoined, 'en'); return unjoinedWithoutLocale.join('/') || '/'; }; diff --git a/components/prose.tsx b/components/prose.tsx index 999da9d01..c326e6e06 100644 --- a/components/prose.tsx +++ b/components/prose.tsx @@ -10,8 +10,9 @@ const Prose: FunctionComponent = ({ html, className }) => { return (
    import('./en.json').then((module) => module.default), - ja: () => import('./ja.json').then((module) => module.default) + ja: () => import('./ja.json').then((module) => module.default), + en: () => import('./en.json').then((module) => module.default) }; export const getDictionary = async (locale: SupportedLocale) => diff --git a/messages/ja.json b/messages/ja.json index 0a1d26e3a..72c3671ee 100644 --- a/messages/ja.json +++ b/messages/ja.json @@ -549,11 +549,11 @@ }, "003": { "label": "酒類販売管理研修受講年月日", - "value": "令和2年9月11日" + "value": "令和5年9月6日" }, "004": { "label": "次回研修の受講期限", - "value": "令和5年8月31日" + "value": "令和8年9月5日" }, "005": { "label": "研修実施団体名", diff --git a/middleware.ts b/middleware.ts index b0a3d6402..f7520bddd 100644 --- a/middleware.ts +++ b/middleware.ts @@ -2,10 +2,10 @@ import createMiddleware from 'next-intl/middleware'; export default createMiddleware({ // A list of all locales that are supported - locales: ['en', 'ja'], + locales: ['ja', 'en'], // If this locale is matched, pathnames work without a prefix (e.g. `/about`) - defaultLocale: 'en' + defaultLocale: 'ja' }); export const config = {