update order details view, translations
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
import { redirect } from 'next/navigation';
|
||||||
|
|
||||||
import { ButtonTooltip } from '@kit/shared/components/ui/button-tooltip';
|
import { ButtonTooltip } from '@kit/shared/components/ui/button-tooltip';
|
||||||
import { pathsConfig } from '@kit/shared/config';
|
import { pathsConfig } from '@kit/shared/config';
|
||||||
@@ -30,7 +31,7 @@ export default async function AnalysisResultsPage({
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
if (!account?.id) {
|
if (!account?.id) {
|
||||||
return null;
|
return redirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
await createPageViewLog({
|
await createPageViewLog({
|
||||||
@@ -39,7 +40,16 @@ export default async function AnalysisResultsPage({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!analysisResponse) {
|
if (!analysisResponse) {
|
||||||
return null;
|
return (
|
||||||
|
<>
|
||||||
|
<PageHeader
|
||||||
|
title={<Trans i18nKey="analysis-results:pageTitle" />}
|
||||||
|
description={<Trans i18nKey="analysis-results:descriptionEmpty" />}
|
||||||
|
/>
|
||||||
|
<PageBody className="gap-4">
|
||||||
|
</PageBody>
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ export default function Cart({
|
|||||||
<div className="flex justify-end gap-x-4 px-6 pt-4">
|
<div className="flex justify-end gap-x-4 px-6 pt-4">
|
||||||
<div className="mr-[36px]">
|
<div className="mr-[36px]">
|
||||||
<p className="ml-0 font-bold text-sm text-muted-foreground">
|
<p className="ml-0 font-bold text-sm text-muted-foreground">
|
||||||
<Trans i18nKey="cart:subtotal" />
|
<Trans i18nKey="cart:order.subtotal" />
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mr-[116px]">
|
<div className="mr-[116px]">
|
||||||
@@ -97,7 +97,7 @@ export default function Cart({
|
|||||||
<div className="flex justify-end gap-x-4 px-6 py-2">
|
<div className="flex justify-end gap-x-4 px-6 py-2">
|
||||||
<div className="mr-[36px]">
|
<div className="mr-[36px]">
|
||||||
<p className="ml-0 font-bold text-sm text-muted-foreground">
|
<p className="ml-0 font-bold text-sm text-muted-foreground">
|
||||||
<Trans i18nKey="cart:promotionsTotal" />
|
<Trans i18nKey="cart:order.promotionsTotal" />
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mr-[116px]">
|
<div className="mr-[116px]">
|
||||||
@@ -113,7 +113,7 @@ export default function Cart({
|
|||||||
<div className="flex justify-end gap-x-4 px-6">
|
<div className="flex justify-end gap-x-4 px-6">
|
||||||
<div className="mr-[36px]">
|
<div className="mr-[36px]">
|
||||||
<p className="ml-0 font-bold text-sm">
|
<p className="ml-0 font-bold text-sm">
|
||||||
<Trans i18nKey="cart:total" />
|
<Trans i18nKey="cart:order.total" />
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mr-[116px]">
|
<div className="mr-[116px]">
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export default function OrderAnalysesCards({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="grid 2xs:grid-cols-3 gap-6 mt-4">
|
<div className="grid xs:grid-cols-3 gap-6 mt-4">
|
||||||
{analyses.map(({
|
{analyses.map(({
|
||||||
title,
|
title,
|
||||||
variant,
|
variant,
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default function CartTotals({ medusaOrder }: {
|
|||||||
<div className="flex flex-col gap-y-2 txt-medium text-ui-fg-subtle ">
|
<div className="flex flex-col gap-y-2 txt-medium text-ui-fg-subtle ">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<span className="flex gap-x-1 items-center">
|
<span className="flex gap-x-1 items-center">
|
||||||
<Trans i18nKey="cart:orderConfirmed.subtotal" />
|
<Trans i18nKey="cart:order.subtotal" />
|
||||||
</span>
|
</span>
|
||||||
<span data-testid="cart-subtotal" data-value={subtotal || 0}>
|
<span data-testid="cart-subtotal" data-value={subtotal || 0}>
|
||||||
{formatCurrency({ value: subtotal ?? 0, currencyCode: currency_code, locale: language })}
|
{formatCurrency({ value: subtotal ?? 0, currencyCode: currency_code, locale: language })}
|
||||||
@@ -32,7 +32,7 @@ export default function CartTotals({ medusaOrder }: {
|
|||||||
</div>
|
</div>
|
||||||
{!!discount_total && (
|
{!!discount_total && (
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<span><Trans i18nKey="cart:orderConfirmed.discount" /></span>
|
<span><Trans i18nKey="cart:order.promotionsTotal" /></span>
|
||||||
<span
|
<span
|
||||||
className="text-ui-fg-interactive"
|
className="text-ui-fg-interactive"
|
||||||
data-testid="cart-discount"
|
data-testid="cart-discount"
|
||||||
@@ -43,17 +43,17 @@ export default function CartTotals({ medusaOrder }: {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="flex justify-between">
|
{/* <div className="flex justify-between">
|
||||||
<span className="flex gap-x-1 items-center ">
|
<span className="flex gap-x-1 items-center ">
|
||||||
<Trans i18nKey="cart:orderConfirmed.taxes" />
|
<Trans i18nKey="cart:orderConfirmed.taxes" />
|
||||||
</span>
|
</span>
|
||||||
<span data-testid="cart-taxes" data-value={tax_total || 0}>
|
<span data-testid="cart-taxes" data-value={tax_total || 0}>
|
||||||
{formatCurrency({ value: tax_total ?? 0, currencyCode: currency_code, locale: language })}
|
{formatCurrency({ value: tax_total ?? 0, currencyCode: currency_code, locale: language })}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div> */}
|
||||||
{!!gift_card_total && (
|
{!!gift_card_total && (
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<span><Trans i18nKey="cart:orderConfirmed.giftCard" /></span>
|
<span><Trans i18nKey="cart:order.giftCard" /></span>
|
||||||
<span
|
<span
|
||||||
className="text-ui-fg-interactive"
|
className="text-ui-fg-interactive"
|
||||||
data-testid="cart-gift-card-amount"
|
data-testid="cart-gift-card-amount"
|
||||||
@@ -67,7 +67,7 @@ export default function CartTotals({ medusaOrder }: {
|
|||||||
</div>
|
</div>
|
||||||
<div className="h-px w-full border-b border-gray-200 my-4" />
|
<div className="h-px w-full border-b border-gray-200 my-4" />
|
||||||
<div className="flex items-center justify-between text-ui-fg-base mb-2 txt-medium ">
|
<div className="flex items-center justify-between text-ui-fg-base mb-2 txt-medium ">
|
||||||
<span className="font-bold"><Trans i18nKey="cart:orderConfirmed.total" /></span>
|
<span className="font-bold"><Trans i18nKey="cart:order.total" /></span>
|
||||||
<span
|
<span
|
||||||
className="txt-xlarge-plus"
|
className="txt-xlarge-plus"
|
||||||
data-testid="cart-total"
|
data-testid="cart-total"
|
||||||
|
|||||||
@@ -7,15 +7,23 @@ export default function OrderDetails({ order }: {
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-y-2">
|
<div className="flex flex-col gap-y-2">
|
||||||
|
<div>
|
||||||
|
<span className="font-bold">
|
||||||
|
<Trans i18nKey="cart:orderConfirmed.orderNumber" />:{" "}
|
||||||
|
</span>
|
||||||
<span>
|
<span>
|
||||||
|
{order.medusa_order_id}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<span className="font-bold">
|
||||||
<Trans i18nKey="cart:orderConfirmed.orderDate" />:{" "}
|
<Trans i18nKey="cart:orderConfirmed.orderDate" />:{" "}
|
||||||
|
</span>
|
||||||
<span>
|
<span>
|
||||||
{formatDate(order.created_at, 'dd.MM.yyyy HH:mm')}
|
{formatDate(order.created_at, 'dd.MM.yyyy HH:mm')}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</div>
|
||||||
<span className="text-ui-fg-interactive">
|
|
||||||
<Trans i18nKey="cart:orderConfirmed.orderNumber" />: <span data-testid="order-id">{order.medusa_order_id}</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ export interface AccountSubmitData {
|
|||||||
email: string;
|
email: string;
|
||||||
phone?: string;
|
phone?: string;
|
||||||
city?: string;
|
city?: string;
|
||||||
weight: number | null;
|
weight?: number | null | undefined;
|
||||||
height: number | null;
|
height?: number | null | undefined;
|
||||||
userConsent: boolean;
|
userConsent: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,8 +119,8 @@ export function PageNavigation(props: React.PropsWithChildren) {
|
|||||||
|
|
||||||
export function PageDescription(props: React.PropsWithChildren) {
|
export function PageDescription(props: React.PropsWithChildren) {
|
||||||
return (
|
return (
|
||||||
<div className={'flex h-6 items-center'}>
|
<div className={'flex items-center'}>
|
||||||
<div className={'text-muted-foreground text-sm leading-none font-normal'}>
|
<div className={'text-muted-foreground text-sm font-normal leading-6'}>
|
||||||
{props.children}
|
{props.children}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -168,7 +168,7 @@ export function PageHeader({
|
|||||||
</If>
|
</If>
|
||||||
|
|
||||||
<If condition={displaySidebarTrigger || description}>
|
<If condition={displaySidebarTrigger || description}>
|
||||||
<div className="flex items-center gap-x-2.5">
|
<div className="flex items-center gap-3">
|
||||||
{displaySidebarTrigger ? (
|
{displaySidebarTrigger ? (
|
||||||
<SidebarTrigger className="text-muted-foreground hover:text-secondary-foreground hidden h-4.5 w-4.5 cursor-pointer lg:inline-flex" />
|
<SidebarTrigger className="text-muted-foreground hover:text-secondary-foreground hidden h-4.5 w-4.5 cursor-pointer lg:inline-flex" />
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
"description": "View your cart",
|
"description": "View your cart",
|
||||||
"emptyCartMessage": "Your cart is empty",
|
"emptyCartMessage": "Your cart is empty",
|
||||||
"emptyCartMessageDescription": "Add items to your cart to continue.",
|
"emptyCartMessageDescription": "Add items to your cart to continue.",
|
||||||
"subtotal": "Subtotal",
|
|
||||||
"total": "Total",
|
|
||||||
"promotionsTotal": "Promotions total",
|
|
||||||
"table": {
|
"table": {
|
||||||
"item": "Item",
|
"item": "Item",
|
||||||
"quantity": "Quantity",
|
"quantity": "Quantity",
|
||||||
@@ -58,7 +55,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"order": {
|
"order": {
|
||||||
"title": "Order"
|
"title": "Order",
|
||||||
|
"promotionsTotal": "Promotions total",
|
||||||
|
"subtotal": "Subtotal",
|
||||||
|
"total": "Total",
|
||||||
|
"giftCard": "Gift card"
|
||||||
},
|
},
|
||||||
"orderConfirmed": {
|
"orderConfirmed": {
|
||||||
"title": "Order confirmed",
|
"title": "Order confirmed",
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
"description": "Vaata oma ostukorvi",
|
"description": "Vaata oma ostukorvi",
|
||||||
"emptyCartMessage": "Sinu ostukorv on tühi",
|
"emptyCartMessage": "Sinu ostukorv on tühi",
|
||||||
"emptyCartMessageDescription": "Lisa tooteid ostukorvi, et jätkata.",
|
"emptyCartMessageDescription": "Lisa tooteid ostukorvi, et jätkata.",
|
||||||
"subtotal": "Vahesumma",
|
|
||||||
"total": "Summa",
|
|
||||||
"promotionsTotal": "Soodustuse summa",
|
|
||||||
"table": {
|
"table": {
|
||||||
"item": "Toode",
|
"item": "Toode",
|
||||||
"quantity": "Kogus",
|
"quantity": "Kogus",
|
||||||
@@ -58,7 +55,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"order": {
|
"order": {
|
||||||
"title": "Tellimus"
|
"title": "Tellimus",
|
||||||
|
"promotionsTotal": "Soodustuse summa",
|
||||||
|
"subtotal": "Vahesumma",
|
||||||
|
"total": "Summa",
|
||||||
|
"giftCard": "Kinkekaart"
|
||||||
},
|
},
|
||||||
"orderConfirmed": {
|
"orderConfirmed": {
|
||||||
"title": "Tellimus on edukalt esitatud",
|
"title": "Tellimus on edukalt esitatud",
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
"description": "Просмотрите свою корзину",
|
"description": "Просмотрите свою корзину",
|
||||||
"emptyCartMessage": "Ваша корзина пуста",
|
"emptyCartMessage": "Ваша корзина пуста",
|
||||||
"emptyCartMessageDescription": "Добавьте товары в корзину, чтобы продолжить.",
|
"emptyCartMessageDescription": "Добавьте товары в корзину, чтобы продолжить.",
|
||||||
"subtotal": "Промежуточный итог",
|
|
||||||
"total": "Сумма",
|
|
||||||
"promotionsTotal": "Скидка",
|
|
||||||
"table": {
|
"table": {
|
||||||
"item": "Товар",
|
"item": "Товар",
|
||||||
"quantity": "Количество",
|
"quantity": "Количество",
|
||||||
@@ -58,7 +55,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"order": {
|
"order": {
|
||||||
"title": "Заказ"
|
"title": "Заказ",
|
||||||
|
"promotionsTotal": "Скидка",
|
||||||
|
"subtotal": "Промежуточный итог",
|
||||||
|
"total": "Сумма",
|
||||||
|
"giftCard": "Подарочная карта"
|
||||||
},
|
},
|
||||||
"orderConfirmed": {
|
"orderConfirmed": {
|
||||||
"title": "Заказ успешно оформлен",
|
"title": "Заказ успешно оформлен",
|
||||||
|
|||||||
Reference in New Issue
Block a user