@shoppexio/storefront-react 0.2.0 → 0.3.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/CHANGELOG.md +106 -0
- package/dist/account.js +1170 -196
- package/dist/account.js.map +1 -1
- package/dist/{chunk-ZEFZPUAW.js → chunk-NBOIS53R.js} +2 -1
- package/dist/chunk-NBOIS53R.js.map +1 -0
- package/dist/index.d.ts +151 -21
- package/dist/index.js +206 -61
- package/dist/index.js.map +1 -1
- package/eject/account/account-availability.ts +4 -1
- package/eject/account/account-page.tsx +26 -6
- package/eject/account/account-referrals.ts +179 -6
- package/eject/account/dashboard.tsx +1 -0
- package/eject/account/messages/ar.json +40 -3
- package/eject/account/messages/de.json +40 -3
- package/eject/account/messages/en.json +40 -3
- package/eject/account/messages/es.json +40 -3
- package/eject/account/messages/fi.json +40 -3
- package/eject/account/messages/fr.json +40 -3
- package/eject/account/messages/hi.json +40 -3
- package/eject/account/messages/it.json +40 -3
- package/eject/account/messages/lt.json +40 -3
- package/eject/account/messages/nl.json +40 -3
- package/eject/account/messages/pl.json +40 -3
- package/eject/account/messages/pt.json +40 -3
- package/eject/account/messages/ru.json +40 -3
- package/eject/account/messages/tr.json +40 -3
- package/eject/account/messages/uk.json +40 -3
- package/eject/account/messages/zh.json +40 -3
- package/eject/account/orders.tsx +53 -0
- package/eject/account/referrals.tsx +399 -153
- package/eject/account/rewards.tsx +38 -6
- package/eject/account/settings.tsx +98 -2
- package/eject/account/shared.tsx +3 -2
- package/package.json +4 -1
- package/dist/chunk-ZEFZPUAW.js.map +0 -1
|
@@ -159,7 +159,10 @@
|
|
|
159
159
|
"warrantyClaimSending": "Надсилаємо…",
|
|
160
160
|
"warrantyClaimDone": "Магазин отримав ваше звернення. Відповідь надійде на пошту.",
|
|
161
161
|
"warrantyClaimFailed": "Не вдалося надіслати звернення.",
|
|
162
|
-
"warrantyClaimTooLong": "Звернення не має перевищувати {max} символів."
|
|
162
|
+
"warrantyClaimTooLong": "Звернення не має перевищувати {max} символів.",
|
|
163
|
+
"invoicePdf": "Завантажити рахунок (PDF)",
|
|
164
|
+
"invoicePdfLoading": "Готуємо…",
|
|
165
|
+
"invoicePdfFailed": "Не вдалося завантажити цей рахунок. Спробуйте ще раз."
|
|
163
166
|
},
|
|
164
167
|
"downloads": {
|
|
165
168
|
"loading": "Завантажуємо ваші файли",
|
|
@@ -316,6 +319,16 @@
|
|
|
316
319
|
"commissionsEmptyTitle": "Комісій поки немає",
|
|
317
320
|
"commissionsEmptyBody": "Схвалені реферальні продажі з’являться тут.",
|
|
318
321
|
"commissionFor": "Замовлення {id}",
|
|
322
|
+
"ledgerWaitingPayment": "В обробці",
|
|
323
|
+
"ledgerEarned": "Зароблено",
|
|
324
|
+
"ledgerInPayoutRequest": "У запиті на виплату",
|
|
325
|
+
"ledgerPaidOut": "Виплачено",
|
|
326
|
+
"ledgerStoreCredit": "Баланс магазину",
|
|
327
|
+
"ledgerSplit": "Розподілено",
|
|
328
|
+
"ledgerVoided": "Анульовано",
|
|
329
|
+
"paidOutPart": "Виплачено {amount}",
|
|
330
|
+
"storeCreditPart": "{amount} на баланс магазину",
|
|
331
|
+
"ofTotal": "з {total}",
|
|
319
332
|
"balanceTitle": "Рух коштів",
|
|
320
333
|
"balanceEmptyTitle": "Рухів коштів поки немає",
|
|
321
334
|
"balanceEmptyBody": "Конвертації та виплати з’являться тут.",
|
|
@@ -324,7 +337,23 @@
|
|
|
324
337
|
"claimAdjustment": "Коригування",
|
|
325
338
|
"differentCurrency": "Ваш реферальний баланс ведеться у валюті {currency}.",
|
|
326
339
|
"convertedLabel": "Переведено в баланс магазину",
|
|
327
|
-
"paidLabel": "Виплачено"
|
|
340
|
+
"paidLabel": "Виплачено",
|
|
341
|
+
"newLink": "Нове посилання",
|
|
342
|
+
"linkLabel": "Назва",
|
|
343
|
+
"linkLabelPlaceholder": "Кампанія на YouTube",
|
|
344
|
+
"linkCode": "Код",
|
|
345
|
+
"linkCommission": "Бажана комісія (%)",
|
|
346
|
+
"linkDiscount": "Бажана знижка для покупців (%)",
|
|
347
|
+
"linkRatePlaceholder": "Як у магазині",
|
|
348
|
+
"linkRatesHint": "Залиште обидві ставки порожніми, щоб використати ставки магазину. Посилання з власними ставками очікує на схвалення магазину.",
|
|
349
|
+
"createLink": "Створити посилання",
|
|
350
|
+
"creatingLink": "Створюємо…",
|
|
351
|
+
"linkCreated": "Ваше посилання готове — можна ділитися.",
|
|
352
|
+
"linkRequested": "Ваше посилання очікує на схвалення магазину.",
|
|
353
|
+
"linkFailed": "Не вдалося створити посилання. Спробуйте ще раз.",
|
|
354
|
+
"linkRequired": "Вкажіть назву й код посилання.",
|
|
355
|
+
"linkRateInvalid": "Введіть кожну ставку у відсотках від 0 до 100, не більше двох знаків після коми, наприклад 12,5.",
|
|
356
|
+
"linksEmptyCanCreate": "Створіть посилання з власним кодом."
|
|
328
357
|
},
|
|
329
358
|
"support": {
|
|
330
359
|
"loading": "Завантажуємо ваші звернення",
|
|
@@ -393,7 +422,15 @@
|
|
|
393
422
|
"signOutOthersDone": "Вихід виконано на всіх інших пристроях.",
|
|
394
423
|
"devicesFailed": "Не вдалося завантажити ваші пристрої.",
|
|
395
424
|
"signOutDeviceFailed": "Не вдалося вийти на цьому пристрої. Спробуйте ще раз.",
|
|
396
|
-
"deviceOn": "{browser} на {os}"
|
|
425
|
+
"deviceOn": "{browser} на {os}",
|
|
426
|
+
"orderEmailsTitle": "Листи про замовлення",
|
|
427
|
+
"orderEmailsLoading": "Завантажуємо налаштування листів про замовлення",
|
|
428
|
+
"orderCreated": "Підтвердження замовлень",
|
|
429
|
+
"orderCreatedNote": "Лист, коли ви оформлюєте замовлення.",
|
|
430
|
+
"orderCompleted": "Квитанції за замовленнями",
|
|
431
|
+
"orderCompletedNote": "Квитанції та сповіщення про виконання. Лист із вашими товарами надсилається завжди.",
|
|
432
|
+
"paymentIssue": "Проблеми з оплатою",
|
|
433
|
+
"paymentIssueNote": "Лист, коли платіж потребує вашої уваги."
|
|
397
434
|
},
|
|
398
435
|
"walletTopup": {
|
|
399
436
|
"title": "Поповнити баланс",
|
|
@@ -159,7 +159,10 @@
|
|
|
159
159
|
"warrantyClaimSending": "提交中…",
|
|
160
160
|
"warrantyClaimDone": "商店已收到你的申请,他们会通过邮件回复。",
|
|
161
161
|
"warrantyClaimFailed": "申请提交失败。",
|
|
162
|
-
"warrantyClaimTooLong": "申请内容不能超过 {max} 个字符。"
|
|
162
|
+
"warrantyClaimTooLong": "申请内容不能超过 {max} 个字符。",
|
|
163
|
+
"invoicePdf": "下载发票 (PDF)",
|
|
164
|
+
"invoicePdfLoading": "正在准备…",
|
|
165
|
+
"invoicePdfFailed": "无法下载此发票,请重试。"
|
|
163
166
|
},
|
|
164
167
|
"downloads": {
|
|
165
168
|
"loading": "正在加载你的下载内容",
|
|
@@ -316,6 +319,16 @@
|
|
|
316
319
|
"commissionsEmptyTitle": "还没有佣金",
|
|
317
320
|
"commissionsEmptyBody": "审核通过的推荐订单会显示在这里。",
|
|
318
321
|
"commissionFor": "订单 {id}",
|
|
322
|
+
"ledgerWaitingPayment": "处理中",
|
|
323
|
+
"ledgerEarned": "已赚取",
|
|
324
|
+
"ledgerInPayoutRequest": "提现申请中",
|
|
325
|
+
"ledgerPaidOut": "已打款",
|
|
326
|
+
"ledgerStoreCredit": "商店余额",
|
|
327
|
+
"ledgerSplit": "拆分结算",
|
|
328
|
+
"ledgerVoided": "已作废",
|
|
329
|
+
"paidOutPart": "已打款 {amount}",
|
|
330
|
+
"storeCreditPart": "商店余额 {amount}",
|
|
331
|
+
"ofTotal": "共 {total}",
|
|
319
332
|
"balanceTitle": "余额动态",
|
|
320
333
|
"balanceEmptyTitle": "还没有余额动态",
|
|
321
334
|
"balanceEmptyBody": "转换和打款记录会显示在这里。",
|
|
@@ -324,7 +337,23 @@
|
|
|
324
337
|
"claimAdjustment": "调整",
|
|
325
338
|
"differentCurrency": "你的推荐余额以 {currency} 结算。",
|
|
326
339
|
"convertedLabel": "已转为商店余额",
|
|
327
|
-
"paidLabel": "已打款"
|
|
340
|
+
"paidLabel": "已打款",
|
|
341
|
+
"newLink": "新建链接",
|
|
342
|
+
"linkLabel": "名称",
|
|
343
|
+
"linkLabelPlaceholder": "YouTube 推广",
|
|
344
|
+
"linkCode": "代码",
|
|
345
|
+
"linkCommission": "申请的佣金比例 (%)",
|
|
346
|
+
"linkDiscount": "申请的买家折扣 (%)",
|
|
347
|
+
"linkRatePlaceholder": "使用商店默认值",
|
|
348
|
+
"linkRatesHint": "两项比例留空即使用商店的默认比例。申请自定义比例的链接需等待商店审核。",
|
|
349
|
+
"createLink": "创建链接",
|
|
350
|
+
"creatingLink": "正在创建…",
|
|
351
|
+
"linkCreated": "您的链接已可分享。",
|
|
352
|
+
"linkRequested": "您的链接正在等待商店审核。",
|
|
353
|
+
"linkFailed": "无法创建您的链接,请重试。",
|
|
354
|
+
"linkRequired": "请填写链接的名称和代码。",
|
|
355
|
+
"linkRateInvalid": "请将每个比例填写为 0 到 100 之间的百分比,最多两位小数,例如 12.5。",
|
|
356
|
+
"linksEmptyCanCreate": "用您自己的代码创建一个。"
|
|
328
357
|
},
|
|
329
358
|
"support": {
|
|
330
359
|
"loading": "正在加载你的工单",
|
|
@@ -393,7 +422,15 @@
|
|
|
393
422
|
"signOutOthersDone": "其他所有设备已退出登录。",
|
|
394
423
|
"devicesFailed": "无法加载你的设备。",
|
|
395
424
|
"signOutDeviceFailed": "该设备退出登录失败,请重试。",
|
|
396
|
-
"deviceOn": "{os} 上的 {browser}"
|
|
425
|
+
"deviceOn": "{os} 上的 {browser}",
|
|
426
|
+
"orderEmailsTitle": "订单邮件",
|
|
427
|
+
"orderEmailsLoading": "正在加载订单邮件设置",
|
|
428
|
+
"orderCreated": "订单确认",
|
|
429
|
+
"orderCreatedNote": "下单时发送的邮件。",
|
|
430
|
+
"orderCompleted": "订单收据",
|
|
431
|
+
"orderCompletedNote": "收据和订单完成通知。用于交付商品的邮件始终会发送。",
|
|
432
|
+
"paymentIssue": "付款问题",
|
|
433
|
+
"paymentIssueNote": "付款需要您处理时发送的邮件。"
|
|
397
434
|
},
|
|
398
435
|
"walletTopup": {
|
|
399
436
|
"title": "添加商店余额",
|
package/eject/account/orders.tsx
CHANGED
|
@@ -356,6 +356,8 @@ export function AccountOrderDetail({ orderId }: { orderId: string }) {
|
|
|
356
356
|
<p className="sxa:mt-3 sxa:text-small sxa:leading-relaxed sxa:text-muted">{order.statusDetails}</p>
|
|
357
357
|
) : null}
|
|
358
358
|
|
|
359
|
+
<InvoicePdfButton orderUniqid={order.uniqid} />
|
|
360
|
+
|
|
359
361
|
<ul className="sxa:mt-6 sxa:space-y-3">
|
|
360
362
|
{order.lineItems.map((item) => (
|
|
361
363
|
<li key={item.id}>
|
|
@@ -447,6 +449,57 @@ export function AccountOrderDetail({ orderId }: { orderId: string }) {
|
|
|
447
449
|
);
|
|
448
450
|
}
|
|
449
451
|
|
|
452
|
+
/**
|
|
453
|
+
* The invoice as a PDF.
|
|
454
|
+
*
|
|
455
|
+
* Fetched, not linked: a file that could not be made answers with JSON, and a
|
|
456
|
+
* link would open that in a new tab. Here the failure is a sentence beside the
|
|
457
|
+
* button, and the button is still there to press again. The save goes through
|
|
458
|
+
* a temporary object URL on an anchor the buyer never sees; the name is the
|
|
459
|
+
* producer's, and when it sent none the browser picks one.
|
|
460
|
+
*/
|
|
461
|
+
function InvoicePdfButton({ orderUniqid }: { orderUniqid: string }) {
|
|
462
|
+
const [busy, setBusy] = useState(false);
|
|
463
|
+
const [error, setError] = useState<string | null>(null);
|
|
464
|
+
|
|
465
|
+
const download = async () => {
|
|
466
|
+
setBusy(true);
|
|
467
|
+
setError(null);
|
|
468
|
+
const response = await callCustomerApi((sdk) => sdk.invoicePdf(orderUniqid));
|
|
469
|
+
setBusy(false);
|
|
470
|
+
|
|
471
|
+
if (!response.success || response.data === undefined) {
|
|
472
|
+
setError(response.message?.trim() || t('orders.invoicePdfFailed'));
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
const url = URL.createObjectURL(response.data.blob);
|
|
477
|
+
const anchor = document.createElement('a');
|
|
478
|
+
anchor.href = url;
|
|
479
|
+
anchor.download = response.data.filename ?? '';
|
|
480
|
+
anchor.click();
|
|
481
|
+
URL.revokeObjectURL(url);
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
return (
|
|
485
|
+
<div className="sxa:mt-4">
|
|
486
|
+
<button
|
|
487
|
+
type="button"
|
|
488
|
+
disabled={busy}
|
|
489
|
+
aria-busy={busy || undefined}
|
|
490
|
+
className="sx-account-button sxa:card-button sxa:card-button--add sxa:disabled:cursor-not-allowed sxa:disabled:opacity-50"
|
|
491
|
+
onClick={() => void download()}
|
|
492
|
+
>
|
|
493
|
+
{busy
|
|
494
|
+
? <BusySpinner className="sxa:mr-1.5 sxa:h-3.5 sxa:w-3.5" />
|
|
495
|
+
: <ReceiptIcon className="sxa:mr-1.5 sxa:h-3.5 sxa:w-3.5" />}
|
|
496
|
+
{busy ? t('orders.invoicePdfLoading') : t('orders.invoicePdf')}
|
|
497
|
+
</button>
|
|
498
|
+
{error ? <AccountFieldError message={error} /> : null}
|
|
499
|
+
</div>
|
|
500
|
+
);
|
|
501
|
+
}
|
|
502
|
+
|
|
450
503
|
/**
|
|
451
504
|
* What the shop still covers on this order.
|
|
452
505
|
*
|