Fix: Route photo requests to design canvas instead of approval upload
When admin clicks 'Start a design for this' on a photo request, now routes
to the design canvas at /made-to-order/{productSlug} with the custom photo
passed as a query parameter. The DesignCanvas component now accepts and
displays the custom photo as the background for designing.
Changes:
- Updated photo request link to go to design canvas page
- Added customPhoto query parameter to pass custom image URL
- Updated DesignCanvas to accept and use customPhoto prop
- Modified renderPhoto() to display custom photo when provided
- Updated getPhotoInfo() to use custom photo for compositing
This commit is contained in:
@@ -7,7 +7,13 @@ import ProductCard from '@/components/ProductCard';
|
||||
|
||||
const DesignCanvas = dynamic(() => import('@/components/DesignCanvas'), { ssr: false });
|
||||
|
||||
export default async function ProductDetailPage({ params }: { params: { slug: string } }) {
|
||||
export default async function ProductDetailPage({
|
||||
params,
|
||||
searchParams,
|
||||
}: {
|
||||
params: { slug: string };
|
||||
searchParams: { customPhoto?: string };
|
||||
}) {
|
||||
const activePromotions = await fetchActivePromotions();
|
||||
|
||||
const row = await prisma.product.findUnique({ where: { slug: params.slug } });
|
||||
@@ -23,7 +29,7 @@ export default async function ProductDetailPage({ params }: { params: { slug: st
|
||||
|
||||
return (
|
||||
<div className="mx-auto max-w-6xl px-6 py-12">
|
||||
<DesignCanvas product={product} />
|
||||
<DesignCanvas product={product} customPhoto={searchParams.customPhoto} />
|
||||
|
||||
{related.length > 0 && (
|
||||
<section className="mt-20 border-t border-line pt-12">
|
||||
|
||||
Reference in New Issue
Block a user