Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { withContentlayer } from "next-contentlayer"
import plugin from 'next-intl/plugin'

/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
Expand All @@ -23,4 +24,7 @@ const nextConfig = {
// ignoreBuildErrors: true,
// },
}
export default withContentlayer(nextConfig)

const withNextIntl = plugin("./src/i18n.ts");

export default withNextIntl(withContentlayer(nextConfig));
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache"
},
"dependencies": {
"@clerk/localizations": "^1.23.1",
"@clerk/nextjs": "^4.21.13",
"@clerk/themes": "^1.7.5",
"@clerk/types": "^3.46.1",
Expand Down Expand Up @@ -63,6 +64,7 @@
"lucide-react": "^0.258.0",
"next": "^13.4.8",
"next-contentlayer": "^0.3.4",
"next-intl": "3.0.0-beta.9",
"next-themes": "^0.2.1",
"react": "18.2.0",
"react-cropper": "^2.3.3",
Expand Down
132 changes: 126 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { Label } from "@/components/ui/label"
import { LoadingButton } from "@/components/ui/loading-button"
import { Textarea } from "@/components/ui/textarea"
import { ConnectStoreToStripeButton } from "@/components/connect-store-to-stripe-button"
import { checkStripeConnectionAction } from "@/app/_actions/stripe"
import { checkStripeConnectionAction } from "@/app/[locale]/_actions/stripe"

export const metadata: Metadata = {
metadataBase: new URL(env.NEXT_PUBLIC_APP_URL),
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { BoardBuilder } from "@/components/board-builder"
import { Header } from "@/components/header"
import { Icons } from "@/components/icons"
import { Shell } from "@/components/shells/shell"
import { getCartItemsAction } from "@/app/_actions/cart"
import { getProductsAction } from "@/app/_actions/product"
import { getCartItemsAction } from "@/app/[locale]/_actions/cart"
import { getProductsAction } from "@/app/[locale]/_actions/product"

export const metadata: Metadata = {
metadataBase: new URL(env.NEXT_PUBLIC_APP_URL),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { toTitleCase, unslugify } from "@/lib/utils"
import { Header } from "@/components/header"
import { Products } from "@/components/products"
import { Shell } from "@/components/shells/shell"
import { getProductsAction } from "@/app/_actions/product"
import { getStoresAction } from "@/app/_actions/store"
import { getProductsAction } from "@/app/[locale]/_actions/product"
import { getStoresAction } from "@/app/[locale]/_actions/store"

// Running out of edge function execution units on vercel free plan
// export const runtime = "edge"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ProductsLoading from "@/app/(lobby)/products/loading"
import ProductsLoading from "@/app/[locale]/(lobby)/products/loading"

export default function CategoryLoading() {
return <ProductsLoading />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { toTitleCase } from "@/lib/utils"
import { Header } from "@/components/header"
import { Products } from "@/components/products"
import { Shell } from "@/components/shells/shell"
import { getProductsAction } from "@/app/_actions/product"
import { getStoresAction } from "@/app/_actions/store"
import { getProductsAction } from "@/app/[locale]/_actions/product"
import { getStoresAction } from "@/app/[locale]/_actions/store"

// Running out of edge function execution units on vercel free plan
// export const runtime = "edge"
Expand Down
File renamed without changes.
10 changes: 6 additions & 4 deletions src/app/(lobby)/page.tsx → src/app/[locale]/(lobby)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
import { Icons } from "@/components/icons"
import { ProductCard } from "@/components/product-card"
import { Shell } from "@/components/shells/shell"
import { getTranslator } from "next-intl/server"

// Running out of edge function execution units on vercel free plan
// export const runtime = "edge"
Expand All @@ -29,7 +30,7 @@ import { Shell } from "@/components/shells/shell"
// Read more: https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
export const dynamic = "force-dynamic"

export default async function IndexPage() {
export default async function IndexPage({params: {locale}}) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

locale is string type{params: {locale: string}}

const allProducts = await db
.select()
.from(products)
Expand Down Expand Up @@ -77,6 +78,8 @@ export default async function IndexPage() {

const githubStars = await getGithubStars()

const t = await getTranslator(locale, 'Index');

return (
<Shell as="div" className="gap-12">
<section
Expand All @@ -94,11 +97,10 @@ export default async function IndexPage() {
</Link>
) : null}
<h1 className="text-3xl font-bold leading-tight tracking-tighter md:text-5xl lg:text-6xl lg:leading-[1.1]">
An e-commerce skateshop built with everything new in Next.js 13
{t("title")}
</h1>
<Balance className="max-w-[46rem] text-lg text-muted-foreground sm:text-xl">
Buy and sell skateboarding products from independent brands and stores
around the world
{t("subtitle")}
</Balance>
<div className="flex flex-wrap items-center justify-center gap-4">
<Link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { env } from "@/env.mjs"
import { Header } from "@/components/header"
import { Products } from "@/components/products"
import { Shell } from "@/components/shells/shell"
import { getProductsAction } from "@/app/_actions/product"
import { getStoresAction } from "@/app/_actions/store"
import { getProductsAction } from "@/app/[locale]/_actions/product"
import { getStoresAction } from "@/app/[locale]/_actions/store"

// Running out of edge function execution units on vercel free plan
// export const runtime = "edge"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading