create-brainerce-store 1.68.0 → 1.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +22 -2
- package/messages/en.json +52 -2
- package/messages/he.json +52 -2
- package/package.json +1 -1
- package/templates/nextjs/base/src/app/checkout/page.tsx +1018 -1017
- package/templates/nextjs/base/src/app/products/[slug]/page.tsx +1 -1
- package/templates/nextjs/base/src/app/register/page.tsx +67 -64
- package/templates/nextjs/base/src/components/account/profile-section.tsx +303 -226
- package/templates/nextjs/base/src/components/auth/register-form.tsx +326 -245
- package/templates/nextjs/base/src/components/checkout/custom-fields-step.tsx +306 -294
- package/templates/nextjs/base/src/components/checkout/date-picker.tsx +13 -1
- package/templates/nextjs/base/src/components/checkout/datetime-picker.tsx +61 -21
- package/templates/nextjs/base/src/components/shared/birthday-picker.tsx +258 -0
- package/templates/nextjs/base/src/core/lib/auth.ts +162 -154
- package/templates/nextjs/base/src/core/lib/birthday.ts +74 -0
- package/templates/nextjs/base/src/core/lib/store-info.ts +10 -0
- package/templates/nextjs/base/src/ui/layout/newsletter-signup.tsx +143 -0
- package/templates/nextjs/base/src/ui/layout/site-footer.tsx.ejs +18 -2
- package/templates/nextjs/base/src/ui/product/back-in-stock-form.tsx +173 -0
- package/templates/nextjs/base/src/ui/product/product-client-section.tsx +484 -455
- package/templates/nextjs/base/src/ui/product/review-form.tsx +136 -12
- package/templates/nextjs/base/src/ui/product/reviews-section.tsx.ejs +139 -108
- package/templates/nextjs/designs/atelier/ui/layout/site-footer.tsx.ejs +155 -142
- package/templates/nextjs/designs/atelier/ui/product/product-client-section.tsx +500 -477
- package/templates/nextjs/designs/atelier/ui/product/review-form.tsx +135 -11
- package/templates/nextjs/designs/atelier/ui/product/reviews-section.tsx.ejs +179 -148
- package/templates/nextjs/ui-canvas/layout/newsletter-signup.tsx +122 -0
- package/templates/nextjs/ui-canvas/layout/site-footer.tsx.ejs +87 -83
- package/templates/nextjs/ui-canvas/product/back-in-stock-form.tsx +151 -0
- package/templates/nextjs/ui-canvas/product/product-client-section.tsx +373 -352
- package/templates/nextjs/ui-canvas/product/review-form.tsx +129 -11
- package/templates/nextjs/ui-canvas/product/reviews-section.tsx.ejs +127 -96
|
@@ -192,7 +192,7 @@ export default async function ProductDetailPage({ params }: Props) {
|
|
|
192
192
|
<div className="mx-auto max-w-7xl px-4 pt-6 sm:px-6 lg:px-8">
|
|
193
193
|
<Breadcrumbs items={breadcrumbItems} />
|
|
194
194
|
</div>
|
|
195
|
-
<ProductClientSection product={product} />
|
|
195
|
+
<ProductClientSection product={product} stockAlertsEnabled={storeInfo?.stockAlertsEnabled} />
|
|
196
196
|
{/* Visible Q&A + the FAQPage JSON-LD above read the same product.faq —
|
|
197
197
|
the extractable format AI answer engines cite. */}
|
|
198
198
|
<ProductFaqSection product={product} locale={locale} />
|
|
@@ -1,64 +1,67 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { useRouter, Link } from '@/core/lib/navigation';
|
|
5
|
-
import { useAuth } from '@/core/providers/store-provider';
|
|
6
|
-
import { proxyRegister } from '@/core/lib/auth';
|
|
7
|
-
import { RegisterForm } from '@/components/auth/register-form';
|
|
8
|
-
import { OAuthButtons } from '@/components/auth/oauth-buttons';
|
|
9
|
-
import { useTranslations } from '@/core/lib/translations';
|
|
10
|
-
|
|
11
|
-
export default function RegisterPage() {
|
|
12
|
-
const router = useRouter();
|
|
13
|
-
const auth = useAuth();
|
|
14
|
-
const t = useTranslations('auth');
|
|
15
|
-
const [error, setError] = useState<string | null>(null);
|
|
16
|
-
|
|
17
|
-
async function handleRegister(data: {
|
|
18
|
-
firstName: string;
|
|
19
|
-
lastName: string;
|
|
20
|
-
email: string;
|
|
21
|
-
password: string;
|
|
22
|
-
acceptsMarketing: boolean;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { useRouter, Link } from '@/core/lib/navigation';
|
|
5
|
+
import { useAuth } from '@/core/providers/store-provider';
|
|
6
|
+
import { proxyRegister } from '@/core/lib/auth';
|
|
7
|
+
import { RegisterForm } from '@/components/auth/register-form';
|
|
8
|
+
import { OAuthButtons } from '@/components/auth/oauth-buttons';
|
|
9
|
+
import { useTranslations } from '@/core/lib/translations';
|
|
10
|
+
|
|
11
|
+
export default function RegisterPage() {
|
|
12
|
+
const router = useRouter();
|
|
13
|
+
const auth = useAuth();
|
|
14
|
+
const t = useTranslations('auth');
|
|
15
|
+
const [error, setError] = useState<string | null>(null);
|
|
16
|
+
|
|
17
|
+
async function handleRegister(data: {
|
|
18
|
+
firstName: string;
|
|
19
|
+
lastName: string;
|
|
20
|
+
email: string;
|
|
21
|
+
password: string;
|
|
22
|
+
acceptsMarketing: boolean;
|
|
23
|
+
/** Month and day only, never a year. Present together or not at all. */
|
|
24
|
+
birthMonth?: number;
|
|
25
|
+
birthDay?: number;
|
|
26
|
+
}) {
|
|
27
|
+
try {
|
|
28
|
+
setError(null);
|
|
29
|
+
const result = await proxyRegister(data);
|
|
30
|
+
|
|
31
|
+
if (result.requiresVerification) {
|
|
32
|
+
// Cookie already set by proxy; verify-email uses it for auth
|
|
33
|
+
router.push('/verify-email');
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Cookie was set by the proxy; refresh auth state
|
|
38
|
+
await auth.login();
|
|
39
|
+
router.push('/');
|
|
40
|
+
} catch (err) {
|
|
41
|
+
const message = err instanceof Error ? err.message : 'Registration failed. Please try again.';
|
|
42
|
+
setError(message);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div className="flex min-h-[60vh] items-center justify-center px-4 py-12">
|
|
48
|
+
<div className="w-full max-w-md space-y-6">
|
|
49
|
+
<div className="text-center">
|
|
50
|
+
<h1 className="text-foreground text-2xl font-bold">{t('createAccountTitle')}</h1>
|
|
51
|
+
<p className="text-muted-foreground mt-1 text-sm">{t('joinSubtitle')}</p>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<RegisterForm onSubmit={handleRegister} error={error} />
|
|
55
|
+
|
|
56
|
+
<OAuthButtons />
|
|
57
|
+
|
|
58
|
+
<p className="text-muted-foreground text-center text-sm">
|
|
59
|
+
{t('alreadyHaveAccount')}{' '}
|
|
60
|
+
<Link href="/login" className="text-primary font-medium hover:underline">
|
|
61
|
+
{t('signIn')}
|
|
62
|
+
</Link>
|
|
63
|
+
</p>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
}
|