@akinon/projectzero 2.0.0-beta.12 → 2.0.0-beta.13
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/CHANGELOG.md +100 -23
- package/app-template/.env.example +1 -0
- package/app-template/.github/instructions/account.instructions.md +749 -0
- package/app-template/.github/instructions/checkout.instructions.md +678 -0
- package/app-template/.github/instructions/default.instructions.md +279 -0
- package/app-template/.github/instructions/edge-cases.instructions.md +73 -0
- package/app-template/.github/instructions/routing.instructions.md +603 -0
- package/app-template/.github/instructions/settings.instructions.md +338 -0
- package/app-template/.gitignore +3 -0
- package/app-template/AGENTS.md +7 -0
- package/app-template/CHANGELOG.md +1348 -310
- package/app-template/Procfile +1 -1
- package/app-template/akinon.json +0 -3
- package/app-template/build.sh +10 -0
- package/app-template/docs/advanced-usage.md +101 -0
- package/app-template/docs/sentry-usage.md +35 -0
- package/app-template/next-env.d.ts +1 -0
- package/app-template/{next.config.ts → next.config.mjs} +6 -6
- package/app-template/package.json +58 -51
- package/app-template/postcss.config.mjs +1 -4
- package/app-template/public/locales/en/checkout.json +6 -0
- package/app-template/public/locales/en/common.json +50 -1
- package/app-template/public/locales/en/product.json +62 -1
- package/app-template/public/locales/tr/checkout.json +6 -0
- package/app-template/public/locales/tr/common.json +50 -1
- package/app-template/public/locales/tr/product.json +63 -0
- package/app-template/public/masterpass-javascript-sdk-web.min.js +1 -0
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/[...prettyurl]/page.tsx +9 -9
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/layout.tsx +2 -2
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/cancellation/page.tsx +6 -6
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/page.tsx +6 -6
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/page.tsx +1 -1
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/profile/page.tsx +2 -2
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/address/stores/page.tsx +2 -2
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/auth/page.tsx +1 -1
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/basket/page.tsx +2 -2
- package/app-template/src/app/[pz]/category/[pk]/page.tsx +27 -0
- package/app-template/src/app/[pz]/flat-page/[pk]/page.tsx +23 -0
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/forms/[pk]/generate/page.tsx +2 -3
- package/app-template/src/app/[pz]/group-product/[pk]/page.tsx +93 -0
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/landing-page/[pk]/page.tsx +2 -4
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/layout.tsx +3 -10
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/list/page.tsx +2 -4
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/not-found.tsx +5 -7
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/completed/[token]/page.tsx +6 -4
- package/app-template/src/app/[pz]/product/[pk]/page.tsx +102 -0
- package/app-template/src/app/[pz]/special-page/[pk]/page.tsx +35 -0
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/email-set-primary/[[...id]]/page.tsx +3 -4
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/registration/account-confirm-email/[[...id]]/page.tsx +3 -3
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/reset/[[...id]]/page.tsx +6 -12
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/xml-sitemap/[node]/route.ts +2 -2
- package/app-template/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/app-template/src/app/api/form/[...id]/route.ts +1 -7
- package/app-template/src/app/api/image-proxy/route.ts +1 -0
- package/app-template/src/app/api/product-categories/route.ts +1 -0
- package/app-template/src/app/api/similar-product-list/route.ts +1 -0
- package/app-template/src/app/api/similar-products/route.ts +1 -0
- package/app-template/src/app/api/virtual-try-on/limited-categories/route.ts +1 -0
- package/app-template/src/app/api/virtual-try-on/route.ts +1 -0
- package/app-template/src/assets/globals.scss +4 -133
- package/app-template/src/auth.ts +3 -0
- package/app-template/src/components/__tests__/badge.test.tsx +2 -2
- package/app-template/src/components/__tests__/link.test.tsx +2 -0
- package/app-template/src/components/accordion.tsx +23 -20
- package/app-template/src/components/button.tsx +1 -1
- package/app-template/src/components/carousel-core.tsx +4 -11
- package/app-template/src/components/checkbox.tsx +1 -1
- package/app-template/src/components/currency-select.tsx +1 -0
- package/app-template/src/components/file-input.tsx +27 -7
- package/app-template/src/components/generate-form-fields.tsx +49 -10
- package/app-template/src/components/input.tsx +11 -5
- package/app-template/src/components/modal.tsx +32 -16
- package/app-template/src/components/pagination.tsx +1 -0
- package/app-template/src/components/price.tsx +1 -1
- package/app-template/src/components/pwa-tags.tsx +1 -0
- package/app-template/src/components/select.tsx +39 -27
- package/app-template/src/components/shimmer.tsx +1 -1
- package/app-template/src/components/types/index.ts +25 -1
- package/app-template/src/hooks/use-fav-button.tsx +4 -8
- package/app-template/src/hooks/use-product-cart.ts +77 -0
- package/app-template/src/hooks/use-stock-alert.ts +74 -0
- package/app-template/src/plugins.js +12 -2
- package/app-template/src/redux/middlewares/category.ts +5 -4
- package/app-template/src/redux/store.ts +21 -1
- package/app-template/src/routes/index.ts +2 -1
- package/app-template/src/settings.js +3 -1
- package/app-template/src/types/index.ts +74 -3
- package/app-template/src/types/next-auth.d.ts +2 -2
- package/app-template/src/utils/variant-validation.ts +41 -0
- package/app-template/src/views/account/address-form.tsx +8 -4
- package/app-template/src/views/account/contact-form.tsx +2 -2
- package/app-template/src/views/account/content-header.tsx +4 -3
- package/app-template/src/views/account/faq/faq-tabs.tsx +8 -2
- package/app-template/src/views/account/order.tsx +1 -1
- package/app-template/src/views/account/orders/order-cancellation-item.tsx +1 -1
- package/app-template/src/views/anonymous-tracking/order-detail/index.tsx +1 -1
- package/app-template/src/views/basket/basket-item.tsx +6 -1
- package/app-template/src/views/basket/summary.tsx +16 -0
- package/app-template/src/views/breadcrumb.tsx +2 -2
- package/app-template/src/views/category/category-info.tsx +2 -1
- package/app-template/src/views/category/filters/index.tsx +1 -1
- package/app-template/src/views/checkout/auth.tsx +1 -1
- package/app-template/src/views/checkout/layout/header.tsx +1 -1
- package/app-template/src/views/checkout/steps/payment/options/credit-card/index.tsx +1 -1
- package/app-template/src/views/checkout/steps/payment/options/store-credit.tsx +121 -0
- package/app-template/src/views/checkout/steps/payment/payment-option-buttons.tsx +4 -4
- package/app-template/src/views/checkout/steps/shipping/address-box.tsx +3 -3
- package/app-template/src/views/checkout/steps/shipping/addresses.tsx +1 -1
- package/app-template/src/views/checkout/summary.tsx +12 -2
- package/app-template/src/views/find-in-store/index.tsx +2 -2
- package/app-template/src/views/header/action-menu.tsx +2 -6
- package/app-template/src/views/header/band.tsx +2 -2
- package/app-template/src/views/header/index.tsx +1 -1
- package/app-template/src/views/header/mini-basket.tsx +2 -2
- package/app-template/src/views/header/mobile-menu.tsx +6 -6
- package/app-template/src/views/header/navbar.tsx +1 -1
- package/app-template/src/views/header/pwa-back-button.tsx +1 -1
- package/app-template/src/views/header/search/index.tsx +13 -3
- package/app-template/src/views/header/search/results.tsx +1 -1
- package/app-template/src/views/header/user-menu.tsx +1 -3
- package/app-template/src/views/login/index.tsx +14 -13
- package/app-template/src/views/otp-login/index.tsx +11 -6
- package/app-template/src/views/product/layout.tsx +15 -1
- package/app-template/src/views/product/product-actions.tsx +165 -0
- package/app-template/src/views/product/product-info.tsx +69 -261
- package/app-template/src/views/product/product-share.tsx +56 -0
- package/app-template/src/views/product/product-variants.tsx +26 -0
- package/app-template/src/views/product/slider.tsx +22 -1
- package/app-template/src/views/product-pointer-banner-item.tsx +1 -1
- package/app-template/src/views/register/index.tsx +17 -21
- package/app-template/src/views/sales-contract-modal/index.tsx +17 -17
- package/app-template/src/widgets/footer-info.tsx +1 -1
- package/app-template/src/widgets/footer-menu.tsx +7 -3
- package/app-template/src/widgets/footer-subscription/index.tsx +1 -1
- package/app-template/src/widgets/home-stories-eng.tsx +43 -35
- package/app-template/tailwind.config.js +129 -1
- package/app-template/tsconfig.json +29 -11
- package/codemods/migrate-segments/index.js +591 -0
- package/commands/plugins.ts +62 -14
- package/dist/commands/plugins.js +62 -14
- package/package.json +1 -1
- package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/page.tsx +0 -22
- package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/page.tsx +0 -20
- package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/page.tsx +0 -74
- package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/page.tsx +0 -84
- package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/page.tsx +0 -27
- package/app-template/src/pages/api/auth/[...nextauth].ts +0 -3
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/address/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/change-email/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/change-password/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/contact/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/coupons/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/email-verification/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/faq/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/favourite-products/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/my-quotations/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/layout.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/anonymous-tracking/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/auth/oauth-login/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/basket-b2b/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/category/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/client-root.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/contact-us/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/error.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/flat-page/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/group-product/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/landing-page/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/list/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/checkout/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/completed/[token]/layout.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/special-page/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/template.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/password/reset/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/xml-sitemap/route.ts +0 -0
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { signIn
|
|
5
|
+
import { signIn } from 'next-auth/react';
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
import { SubmitHandler, useForm } from 'react-hook-form';
|
|
8
8
|
import { useAppDispatch, useAppSelector } from '@akinon/next/redux/hooks';
|
|
9
|
-
import { RegisterFormType } from '@theme/types';
|
|
9
|
+
import { RegisterFormType, FormType, PzSignInOptions } from '@theme/types';
|
|
10
10
|
import { Button, Checkbox, Icon, Input, Modal } from '@theme/components';
|
|
11
11
|
import * as yup from 'yup';
|
|
12
12
|
import { useCaptcha, useLocalization, useRouter } from '@akinon/next/hooks';
|
|
@@ -120,29 +120,21 @@ export const Register = () => {
|
|
|
120
120
|
const [showPassword, setShowPassword] = useState(false);
|
|
121
121
|
const { user_phone_format } = useAppSelector((state) => state.config);
|
|
122
122
|
|
|
123
|
-
const registerHandler
|
|
123
|
+
const registerHandler = async (data: RegisterFormType) => {
|
|
124
124
|
return await signIn('default', {
|
|
125
125
|
redirect: false,
|
|
126
126
|
callbackUrl: '/',
|
|
127
127
|
captchaValidated,
|
|
128
|
-
...data
|
|
129
|
-
|
|
128
|
+
...data,
|
|
129
|
+
formType: FormType.register
|
|
130
|
+
} as PzSignInOptions & { redirect: false });
|
|
130
131
|
};
|
|
131
132
|
|
|
132
133
|
const onSubmit: SubmitHandler<RegisterFormType> = async (data) => {
|
|
133
134
|
const registerResponse = await registerHandler(data);
|
|
134
135
|
|
|
135
|
-
if (registerResponse.error === 'Captcha') {
|
|
136
|
-
if (await validateCaptcha()) {
|
|
137
|
-
onSubmit(data);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
136
|
if (registerResponse.error) {
|
|
144
|
-
const errors: AuthError[] = JSON.parse(registerResponse.
|
|
145
|
-
|
|
137
|
+
const errors: AuthError[] = JSON.parse(registerResponse.code);
|
|
146
138
|
|
|
147
139
|
if (errors.find((error) => error.type === 'captcha')) {
|
|
148
140
|
if (await validateCaptcha()) {
|
|
@@ -171,25 +163,25 @@ export const Register = () => {
|
|
|
171
163
|
try {
|
|
172
164
|
parsedValue = JSON.parse(item.value);
|
|
173
165
|
} catch {
|
|
174
|
-
parsedValue = [item.value];
|
|
166
|
+
parsedValue = [item.value];
|
|
175
167
|
}
|
|
176
168
|
} else {
|
|
177
|
-
parsedValue = item.value;
|
|
169
|
+
parsedValue = item.value;
|
|
178
170
|
}
|
|
179
171
|
|
|
180
172
|
if (Array.isArray(parsedValue)) {
|
|
181
173
|
setError(item.name as keyof RegisterFormType, {
|
|
182
174
|
type: 'custom',
|
|
183
|
-
message: parsedValue.join(', ')
|
|
175
|
+
message: parsedValue.join(', ')
|
|
184
176
|
});
|
|
185
177
|
} else {
|
|
186
178
|
Object.keys(parsedValue).forEach((key) => {
|
|
187
179
|
const fieldName = key as keyof RegisterFormType;
|
|
188
180
|
const errorMessages = parsedValue[key] as string[];
|
|
189
|
-
|
|
181
|
+
|
|
190
182
|
setError(fieldName, {
|
|
191
183
|
type: 'custom',
|
|
192
|
-
message: errorMessages.join(', ')
|
|
184
|
+
message: errorMessages.join(', ')
|
|
193
185
|
});
|
|
194
186
|
});
|
|
195
187
|
}
|
|
@@ -247,7 +239,11 @@ export const Register = () => {
|
|
|
247
239
|
</p>
|
|
248
240
|
|
|
249
241
|
<form onSubmit={handleSubmit(onSubmit)} className="flex flex-col gap-4">
|
|
250
|
-
<input
|
|
242
|
+
<input
|
|
243
|
+
type="hidden"
|
|
244
|
+
value={FormType.register}
|
|
245
|
+
{...register('formType')}
|
|
246
|
+
/>
|
|
251
247
|
<input type="hidden" value={locale} {...register('locale')} />
|
|
252
248
|
|
|
253
249
|
<div className={clsx({ 'mb-4': errors.email })}>
|
|
@@ -169,19 +169,19 @@ export const SalesContractModal = ({ data }: Props) => {
|
|
|
169
169
|
</div>
|
|
170
170
|
</div>
|
|
171
171
|
|
|
172
|
-
<table className="w-full border
|
|
172
|
+
<table className="w-full border">
|
|
173
173
|
<thead className="text-sm">
|
|
174
174
|
<tr>
|
|
175
|
-
<th className="border
|
|
175
|
+
<th className="border font-normal text-left py-2 px-3">
|
|
176
176
|
{t('account.sales_contract.product')}
|
|
177
177
|
</th>
|
|
178
|
-
<th className="border
|
|
178
|
+
<th className="border font-normal py-2 px-3">
|
|
179
179
|
{t('account.sales_contract.quantity')}
|
|
180
180
|
</th>
|
|
181
|
-
<th className="border
|
|
181
|
+
<th className="border font-normal text-left py-2 px-3">
|
|
182
182
|
{t('account.sales_contract.product_price')}
|
|
183
183
|
</th>
|
|
184
|
-
<th className="border
|
|
184
|
+
<th className="border font-normal text-left py-2 px-3">
|
|
185
185
|
{t('account.sales_contract.total_price')}
|
|
186
186
|
</th>
|
|
187
187
|
</tr>
|
|
@@ -191,20 +191,20 @@ export const SalesContractModal = ({ data }: Props) => {
|
|
|
191
191
|
{data.orderitem_set.map((value, index) => {
|
|
192
192
|
return (
|
|
193
193
|
<tr key={index.toString()}>
|
|
194
|
-
<td className="border
|
|
194
|
+
<td className="border font-light text-left py-2 px-3">
|
|
195
195
|
{value.product.name}
|
|
196
196
|
</td>
|
|
197
|
-
<td className="border
|
|
197
|
+
<td className="border font-light text-center py-2 px-3">
|
|
198
198
|
{value.quantity ? value.quantity : '1'}
|
|
199
199
|
</td>
|
|
200
|
-
<td className="border
|
|
200
|
+
<td className="border font-light text-center py-2 px-3">
|
|
201
201
|
<Price
|
|
202
202
|
value={
|
|
203
203
|
value.unit_price ? value.unit_price : value.price
|
|
204
204
|
}
|
|
205
205
|
/>
|
|
206
206
|
</td>
|
|
207
|
-
<td className="border
|
|
207
|
+
<td className="border font-light text-right py-2 px-3">
|
|
208
208
|
<Price
|
|
209
209
|
value={
|
|
210
210
|
value.total_amount
|
|
@@ -222,12 +222,12 @@ export const SalesContractModal = ({ data }: Props) => {
|
|
|
222
222
|
<tr>
|
|
223
223
|
<th
|
|
224
224
|
colSpan={3}
|
|
225
|
-
className="border
|
|
225
|
+
className="border text-left py-2 px-3 font-normal"
|
|
226
226
|
>
|
|
227
227
|
{t('account.sales_contract.products_total')}
|
|
228
228
|
</th>
|
|
229
229
|
<td
|
|
230
|
-
className="border
|
|
230
|
+
className="border text-right py-2 px-3 font-light"
|
|
231
231
|
colSpan={1}
|
|
232
232
|
>
|
|
233
233
|
<Price value={data.discount_amount} />
|
|
@@ -237,12 +237,12 @@ export const SalesContractModal = ({ data }: Props) => {
|
|
|
237
237
|
<tr>
|
|
238
238
|
<th
|
|
239
239
|
colSpan={3}
|
|
240
|
-
className="border
|
|
240
|
+
className="border text-left py-2 px-3 font-normal"
|
|
241
241
|
>
|
|
242
242
|
{t('account.sales_contract.shipping_price')}
|
|
243
243
|
</th>
|
|
244
244
|
<td
|
|
245
|
-
className="border
|
|
245
|
+
className="border text-right py-2 px-3 font-light"
|
|
246
246
|
colSpan={1}
|
|
247
247
|
>
|
|
248
248
|
<Price value={data.shipping_amount} />
|
|
@@ -252,12 +252,12 @@ export const SalesContractModal = ({ data }: Props) => {
|
|
|
252
252
|
<tr>
|
|
253
253
|
<th
|
|
254
254
|
colSpan={3}
|
|
255
|
-
className="border
|
|
255
|
+
className="border text-left py-2 px-3 font-normal"
|
|
256
256
|
>
|
|
257
257
|
{t('account.sales_contract.payment_type')}
|
|
258
258
|
</th>
|
|
259
259
|
<td
|
|
260
|
-
className="border
|
|
260
|
+
className="border text-right py-2 px-3 font-light"
|
|
261
261
|
colSpan={1}
|
|
262
262
|
>
|
|
263
263
|
{data.payment_option_slug}
|
|
@@ -267,12 +267,12 @@ export const SalesContractModal = ({ data }: Props) => {
|
|
|
267
267
|
<tr>
|
|
268
268
|
<th
|
|
269
269
|
colSpan={3}
|
|
270
|
-
className="border
|
|
270
|
+
className="border text-left py-2 px-3 font-normal"
|
|
271
271
|
>
|
|
272
272
|
{t('account.sales_contract.order_total')}
|
|
273
273
|
</th>
|
|
274
274
|
<td
|
|
275
|
-
className="border
|
|
275
|
+
className="border text-right py-2 px-3 font-light"
|
|
276
276
|
colSpan={1}
|
|
277
277
|
>
|
|
278
278
|
<Price value={data.amount} />
|
|
@@ -19,7 +19,7 @@ export default async function FooterInfo() {
|
|
|
19
19
|
const data = await getWidgetData<FooterInfoType>({ slug: 'footer-info' });
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
|
-
<div className="flex flex-col w-full mb-4 pb-4 text-xs border-b
|
|
22
|
+
<div className="flex flex-col w-full mb-4 pb-4 text-xs border-b md:border-b-0 md:pb-0 md:mb-0 md:w-3/12 lg:w-1/6 md:pr-7">
|
|
23
23
|
<div className="flex items-center mb-8">
|
|
24
24
|
<div className="mr-3">
|
|
25
25
|
<svg
|
|
@@ -2,6 +2,7 @@ import 'server-only';
|
|
|
2
2
|
|
|
3
3
|
import { Link, Accordion } from '@theme/components';
|
|
4
4
|
import { getWidgetData } from '@akinon/next/data/server';
|
|
5
|
+
import { ServerVariables } from '@akinon/next/utils/server-variables';
|
|
5
6
|
|
|
6
7
|
type SideItem = {
|
|
7
8
|
value: string;
|
|
@@ -47,10 +48,11 @@ type FooterMenuType = {
|
|
|
47
48
|
|
|
48
49
|
export default async function FooterMenu() {
|
|
49
50
|
const data = await getWidgetData<FooterMenuType>({ slug: 'footer-menu' });
|
|
51
|
+
const { locale } = ServerVariables;
|
|
50
52
|
|
|
51
53
|
return (
|
|
52
54
|
<div className="flex-1">
|
|
53
|
-
<div className="hidden justify-between text-xs md:flex md:px-6 md:py-4 md:border-r md:border-l
|
|
55
|
+
<div className="hidden justify-between text-xs md:flex md:px-6 md:py-4 md:border-r md:border-l">
|
|
54
56
|
<div>
|
|
55
57
|
<div className="mb-4 font-medium" data-testid="footer-categories">
|
|
56
58
|
{data?.attributes?.first_column_title?.value}
|
|
@@ -72,7 +74,7 @@ export default async function FooterMenu() {
|
|
|
72
74
|
: '_self'
|
|
73
75
|
}
|
|
74
76
|
data-testid={`footer-categories-${item?.value?.name
|
|
75
|
-
?.toLocaleLowerCase()
|
|
77
|
+
?.toLocaleLowerCase(locale)
|
|
76
78
|
.split(' ')
|
|
77
79
|
.join('')}`}
|
|
78
80
|
>
|
|
@@ -96,7 +98,9 @@ export default async function FooterMenu() {
|
|
|
96
98
|
? '_blank'
|
|
97
99
|
: '_self'
|
|
98
100
|
}
|
|
99
|
-
data-testid={`footer-categories-${item?.value?.name?.toLocaleLowerCase(
|
|
101
|
+
data-testid={`footer-categories-${item?.value?.name?.toLocaleLowerCase(
|
|
102
|
+
locale
|
|
103
|
+
)}`}
|
|
100
104
|
>
|
|
101
105
|
{item?.value?.name}
|
|
102
106
|
</Link>
|
|
@@ -19,7 +19,7 @@ export default async function FooterSubscription() {
|
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
|
-
<div className="py-4 border-t
|
|
22
|
+
<div className="py-4 border-t md:border-t-0 lg:pl-7">
|
|
23
23
|
<h3 className="mb-1 text-xs font-medium">
|
|
24
24
|
{data?.attributes?.title?.value}
|
|
25
25
|
</h3>
|
|
@@ -6,6 +6,41 @@ import { getWidgetData } from '@akinon/next/data/server';
|
|
|
6
6
|
import { Link } from '@theme/components';
|
|
7
7
|
import { Image } from '@akinon/next/components/image';
|
|
8
8
|
|
|
9
|
+
function TitleSection({
|
|
10
|
+
mobileTitle,
|
|
11
|
+
mobileSubtitle
|
|
12
|
+
}: {
|
|
13
|
+
mobileTitle?: { value: string };
|
|
14
|
+
mobileSubtitle?: { value: string };
|
|
15
|
+
}) {
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
{mobileTitle ? (
|
|
19
|
+
<h2 className="text-5xl text-center font-light px-11 mb-2 lg:hidden">
|
|
20
|
+
{mobileTitle.value}
|
|
21
|
+
</h2>
|
|
22
|
+
) : null}
|
|
23
|
+
{mobileSubtitle ? (
|
|
24
|
+
<p className="text-sm text-center mb-2 lg:hidden">
|
|
25
|
+
{mobileSubtitle.value}
|
|
26
|
+
</p>
|
|
27
|
+
) : null}
|
|
28
|
+
</>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function MobileLinks({ mobileLinks }: { mobileLinks?: MobileLink[] }) {
|
|
33
|
+
return (
|
|
34
|
+
<ul className="flex justify-center text-sm font-medium underline mb-4 lg:hidden">
|
|
35
|
+
{mobileLinks?.map((item, index) => (
|
|
36
|
+
<li className="mr-4 first:ml-4" key={`${item?.value?.text}__${index}`}>
|
|
37
|
+
<Link href={item?.value?.url}>{item?.value?.text}</Link>
|
|
38
|
+
</li>
|
|
39
|
+
))}
|
|
40
|
+
</ul>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
9
44
|
type StoryData = {
|
|
10
45
|
value: {
|
|
11
46
|
url: string;
|
|
@@ -20,7 +55,7 @@ type StoryData = {
|
|
|
20
55
|
};
|
|
21
56
|
};
|
|
22
57
|
|
|
23
|
-
type
|
|
58
|
+
type MobileLink = {
|
|
24
59
|
value: {
|
|
25
60
|
url: string;
|
|
26
61
|
text: string;
|
|
@@ -35,7 +70,7 @@ type HomeStoriesEngType = {
|
|
|
35
70
|
value: string;
|
|
36
71
|
};
|
|
37
72
|
stories: StoryData[];
|
|
38
|
-
mobileLinks:
|
|
73
|
+
mobileLinks: MobileLink[];
|
|
39
74
|
};
|
|
40
75
|
|
|
41
76
|
export default async function HomeStoriesEng() {
|
|
@@ -43,46 +78,19 @@ export default async function HomeStoriesEng() {
|
|
|
43
78
|
slug: 'home-storieseng'
|
|
44
79
|
});
|
|
45
80
|
|
|
46
|
-
const TitleSection = () => (
|
|
47
|
-
<>
|
|
48
|
-
{data?.attributes?.mobileTitle ? (
|
|
49
|
-
<h2 className="text-5xl text-center font-light px-11 mb-2 lg:hidden">
|
|
50
|
-
{data?.attributes?.mobileTitle?.value}
|
|
51
|
-
</h2>
|
|
52
|
-
) : null}
|
|
53
|
-
{data?.attributes?.mobileSubtitle ? (
|
|
54
|
-
<p className="text-sm text-center mb-2 lg:hidden">
|
|
55
|
-
{data?.attributes?.mobileSubtitle?.value}
|
|
56
|
-
</p>
|
|
57
|
-
) : null}
|
|
58
|
-
</>
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
const MobileLinks = () => (
|
|
62
|
-
<ul className="flex justify-center text-sm font-medium underline mb-4 lg:hidden">
|
|
63
|
-
{data?.attributes?.mobileLinks?.map((item, index) => {
|
|
64
|
-
return (
|
|
65
|
-
<li
|
|
66
|
-
className="mr-4 first:ml-4"
|
|
67
|
-
key={`${item?.value?.text}__${index}`}
|
|
68
|
-
>
|
|
69
|
-
<Link href={item?.value?.url}>{item?.value?.text}</Link>
|
|
70
|
-
</li>
|
|
71
|
-
);
|
|
72
|
-
})}
|
|
73
|
-
</ul>
|
|
74
|
-
);
|
|
75
|
-
|
|
76
81
|
return (
|
|
77
82
|
<section className="my-8">
|
|
78
|
-
<TitleSection
|
|
79
|
-
|
|
83
|
+
<TitleSection
|
|
84
|
+
mobileTitle={data?.attributes?.mobileTitle}
|
|
85
|
+
mobileSubtitle={data?.attributes?.mobileSubtitle}
|
|
86
|
+
/>
|
|
87
|
+
<MobileLinks mobileLinks={data?.attributes?.mobileLinks} />
|
|
80
88
|
|
|
81
89
|
<div className="flex items-center overflow-x-auto pb-4 md:justify-center">
|
|
82
90
|
{data?.attributes?.stories?.map((story, index) => {
|
|
83
91
|
return (
|
|
84
92
|
<div
|
|
85
|
-
className="mr-4 shrink-0 first:ms-4 w-32 md:w-32"
|
|
93
|
+
className="mr-4 flex-shrink-0 first:ms-4 w-32 md:w-32"
|
|
86
94
|
key={`story__${index}`}
|
|
87
95
|
>
|
|
88
96
|
<Link href={story?.value?.url} aria-label={story?.value?.alt}>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
const getAkinonNextContent = require(
|
|
1
|
+
const getAkinonNextContent = require("@akinon/next/tailwind/content");
|
|
2
2
|
const deepMerge = require('@akinon/next/utils/deep-merge');
|
|
3
|
+
const defaultTheme = require('tailwindcss/defaultTheme');
|
|
3
4
|
const plugins = require('./src/plugins');
|
|
4
5
|
const fs = require('fs');
|
|
5
6
|
const path = require('path');
|
|
@@ -28,6 +29,133 @@ const defaultConfig = {
|
|
|
28
29
|
'./src/utils/**/*.{js,ts,jsx,tsx}',
|
|
29
30
|
...getAkinonNextContent(plugins)
|
|
30
31
|
],
|
|
32
|
+
theme: {
|
|
33
|
+
extend: {
|
|
34
|
+
fontSize: {
|
|
35
|
+
'2xs': '0.5rem'
|
|
36
|
+
},
|
|
37
|
+
outline: {
|
|
38
|
+
off: 'none'
|
|
39
|
+
},
|
|
40
|
+
width: {
|
|
41
|
+
'1/10': '10%',
|
|
42
|
+
'2/10': '20%',
|
|
43
|
+
'3/10': '30%',
|
|
44
|
+
'4/10': '40%',
|
|
45
|
+
'5/10': '50%',
|
|
46
|
+
'6/10': '60%',
|
|
47
|
+
'7/10': '70%',
|
|
48
|
+
'8/10': '80%',
|
|
49
|
+
'9/10': '90%'
|
|
50
|
+
},
|
|
51
|
+
transitionProperty: {
|
|
52
|
+
'max-width': 'max-width'
|
|
53
|
+
},
|
|
54
|
+
backgroundImage: {
|
|
55
|
+
'skeleton-shimmer':
|
|
56
|
+
'linear-gradient(90deg, #d7d7d7 0%, #ebebeb 40%, #eeeeee 60%, #d7d7d7)'
|
|
57
|
+
},
|
|
58
|
+
keyframes: {
|
|
59
|
+
'skeleton-shimmer': {
|
|
60
|
+
'100%': {
|
|
61
|
+
transform: 'translateX(100%)'
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
animation: {
|
|
66
|
+
'skeleton-shimmer': 'skeleton-shimmer 2s linear infinite'
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
colors: {
|
|
70
|
+
transparent: 'transparent',
|
|
71
|
+
white: '#ffffff',
|
|
72
|
+
primary: {
|
|
73
|
+
DEFAULT: '#000000',
|
|
74
|
+
hover: '#181818',
|
|
75
|
+
foreground: '#ffffff',
|
|
76
|
+
100: '#525252',
|
|
77
|
+
200: '#404040',
|
|
78
|
+
300: '#3d3d3d',
|
|
79
|
+
400: '#333333',
|
|
80
|
+
500: '#2d2d2d',
|
|
81
|
+
600: '#292929',
|
|
82
|
+
700: '#2b2b2b',
|
|
83
|
+
800: '#181818',
|
|
84
|
+
900: '#000000'
|
|
85
|
+
},
|
|
86
|
+
secondary: {
|
|
87
|
+
DEFAULT: '#e95151',
|
|
88
|
+
hover: '#d03838',
|
|
89
|
+
foreground: '#ffffff',
|
|
90
|
+
100: '#ffb7b7',
|
|
91
|
+
200: '#ff9e9e',
|
|
92
|
+
300: '#ff8484',
|
|
93
|
+
400: '#ff6b6b',
|
|
94
|
+
500: '#e95151',
|
|
95
|
+
600: '#d72b01',
|
|
96
|
+
700: '#b61e1e',
|
|
97
|
+
800: '#9d0505',
|
|
98
|
+
900: '#830000'
|
|
99
|
+
},
|
|
100
|
+
black: {
|
|
101
|
+
DEFAULT: '#000000',
|
|
102
|
+
100: '#525252',
|
|
103
|
+
200: '#404040',
|
|
104
|
+
300: '#3d3d3d',
|
|
105
|
+
400: '#333333',
|
|
106
|
+
500: '#2d2d2d',
|
|
107
|
+
600: '#292929',
|
|
108
|
+
700: '#2b2b2b',
|
|
109
|
+
800: '#181818',
|
|
110
|
+
900: '#000000'
|
|
111
|
+
},
|
|
112
|
+
gray: {
|
|
113
|
+
DEFAULT: '#ebebeb',
|
|
114
|
+
25: '#fdfdfd',
|
|
115
|
+
50: '#f7f7f7',
|
|
116
|
+
100: '#f5f5f5',
|
|
117
|
+
150: '#f4f4f4',
|
|
118
|
+
200: '#eeeeee',
|
|
119
|
+
300: '#ebebeb',
|
|
120
|
+
400: '#d7d7d7',
|
|
121
|
+
450: '#d4d4d4',
|
|
122
|
+
500: '#c9c9c9',
|
|
123
|
+
600: '#9d9d9d',
|
|
124
|
+
700: '#686868',
|
|
125
|
+
800: '#615f62',
|
|
126
|
+
850: '#58585a',
|
|
127
|
+
900: '#4a4f54',
|
|
128
|
+
950: '#424242'
|
|
129
|
+
},
|
|
130
|
+
error: {
|
|
131
|
+
DEFAULT: '#d72b01',
|
|
132
|
+
100: '#e20008'
|
|
133
|
+
},
|
|
134
|
+
success: {
|
|
135
|
+
DEFAULT: '#7b9d76',
|
|
136
|
+
100: '#7b9d76'
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
container: {
|
|
140
|
+
center: true,
|
|
141
|
+
padding: {
|
|
142
|
+
DEFAULT: '0rem',
|
|
143
|
+
sm: '2rem',
|
|
144
|
+
'2xl': '0rem'
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
fontFamily: {
|
|
148
|
+
sans: ['Jost'].concat(defaultTheme.fontFamily.sans)
|
|
149
|
+
},
|
|
150
|
+
screens: {
|
|
151
|
+
xs: '575px',
|
|
152
|
+
sm: '640px',
|
|
153
|
+
md: '768px',
|
|
154
|
+
lg: '1024px',
|
|
155
|
+
xl: '1170px',
|
|
156
|
+
'2xl': '1370px'
|
|
157
|
+
}
|
|
158
|
+
},
|
|
31
159
|
plugins: [require('@tailwindcss/typography')]
|
|
32
160
|
};
|
|
33
161
|
|
|
@@ -4,17 +4,27 @@
|
|
|
4
4
|
"compilerOptions": {
|
|
5
5
|
"baseUrl": "./src",
|
|
6
6
|
"paths": {
|
|
7
|
-
"@theme/*": [
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
"@theme/*": [
|
|
8
|
+
"./*"
|
|
9
|
+
],
|
|
10
|
+
"@root/*": [
|
|
11
|
+
"./app/[pz]/*"
|
|
12
|
+
],
|
|
13
|
+
"@product/*": [
|
|
14
|
+
"./app/[pz]/product/*"
|
|
15
|
+
],
|
|
10
16
|
"@group-product/*": [
|
|
11
|
-
"./app/[
|
|
17
|
+
"./app/[pz]/group-product/*"
|
|
18
|
+
],
|
|
19
|
+
"@category/*": [
|
|
20
|
+
"./app/[pz]/category/*"
|
|
12
21
|
],
|
|
13
|
-
"@category/*": ["./app/[commerce]/[locale]/[currency]/category/*"],
|
|
14
22
|
"@special-page/*": [
|
|
15
|
-
"./app/[
|
|
23
|
+
"./app/[pz]/special-page/*"
|
|
16
24
|
],
|
|
17
|
-
"@flat-page/*": [
|
|
25
|
+
"@flat-page/*": [
|
|
26
|
+
"./app/[pz]/flat-page/*"
|
|
27
|
+
]
|
|
18
28
|
},
|
|
19
29
|
"allowSyntheticDefaultImports": true,
|
|
20
30
|
"composite": false,
|
|
@@ -26,7 +36,11 @@
|
|
|
26
36
|
"noUnusedParameters": false,
|
|
27
37
|
"preserveWatchOutput": true,
|
|
28
38
|
"target": "es5",
|
|
29
|
-
"lib": [
|
|
39
|
+
"lib": [
|
|
40
|
+
"dom",
|
|
41
|
+
"dom.iterable",
|
|
42
|
+
"esnext"
|
|
43
|
+
],
|
|
30
44
|
"allowJs": true,
|
|
31
45
|
"skipLibCheck": true,
|
|
32
46
|
"strict": false,
|
|
@@ -37,7 +51,7 @@
|
|
|
37
51
|
"module": "esnext",
|
|
38
52
|
"resolveJsonModule": true,
|
|
39
53
|
"isolatedModules": true,
|
|
40
|
-
"jsx": "
|
|
54
|
+
"jsx": "react-jsx",
|
|
41
55
|
"plugins": [
|
|
42
56
|
{
|
|
43
57
|
"name": "next"
|
|
@@ -50,7 +64,11 @@
|
|
|
50
64
|
"**/*.ts",
|
|
51
65
|
"**/*.tsx",
|
|
52
66
|
".next/types/**/*.ts",
|
|
53
|
-
"../../packages/**/*"
|
|
67
|
+
"../../packages/**/*",
|
|
68
|
+
".next/dev/types/**/*.ts"
|
|
54
69
|
],
|
|
55
|
-
"exclude": [
|
|
70
|
+
"exclude": [
|
|
71
|
+
"node_modules",
|
|
72
|
+
"../../packages/projectzero/app-template"
|
|
73
|
+
]
|
|
56
74
|
}
|