From b8a8eab87c7f5df025523209dccc3a028192a042 Mon Sep 17 00:00:00 2001 From: Karli Date: Wed, 10 Sep 2025 06:34:18 +0300 Subject: [PATCH] update order details view, translations --- .../analysis-results/[id]/page.tsx | 14 +++++++++++-- app/home/(user)/_components/cart/index.tsx | 6 +++--- .../_components/order-analyses-cards.tsx | 2 +- .../(user)/_components/order/cart-totals.tsx | 12 +++++------ .../_components/order/order-details.tsx | 20 +++++++++++++------ packages/features/auth/src/server/api.ts | 4 ++-- packages/ui/src/makerkit/page.tsx | 6 +++--- public/locales/en/cart.json | 9 +++++---- public/locales/et/cart.json | 9 +++++---- public/locales/ru/cart.json | 9 +++++---- 10 files changed, 56 insertions(+), 35 deletions(-) diff --git a/app/home/(user)/(dashboard)/analysis-results/[id]/page.tsx b/app/home/(user)/(dashboard)/analysis-results/[id]/page.tsx index 7422d32..c69d0b6 100644 --- a/app/home/(user)/(dashboard)/analysis-results/[id]/page.tsx +++ b/app/home/(user)/(dashboard)/analysis-results/[id]/page.tsx @@ -1,4 +1,5 @@ import Link from 'next/link'; +import { redirect } from 'next/navigation'; import { ButtonTooltip } from '@kit/shared/components/ui/button-tooltip'; import { pathsConfig } from '@kit/shared/config'; @@ -30,7 +31,7 @@ export default async function AnalysisResultsPage({ ]); if (!account?.id) { - return null; + return redirect("/"); } await createPageViewLog({ @@ -39,7 +40,16 @@ export default async function AnalysisResultsPage({ }); if (!analysisResponse) { - return null; + return ( + <> + } + description={} + /> + + + + ); } return ( diff --git a/app/home/(user)/_components/cart/index.tsx b/app/home/(user)/_components/cart/index.tsx index 4ab083e..afd4639 100644 --- a/app/home/(user)/_components/cart/index.tsx +++ b/app/home/(user)/_components/cart/index.tsx @@ -81,7 +81,7 @@ export default function Cart({

- +

@@ -97,7 +97,7 @@ export default function Cart({

- +

@@ -113,7 +113,7 @@ export default function Cart({

- +

diff --git a/app/home/(user)/_components/order-analyses-cards.tsx b/app/home/(user)/_components/order-analyses-cards.tsx index 2e1064d..bd7f8a7 100644 --- a/app/home/(user)/_components/order-analyses-cards.tsx +++ b/app/home/(user)/_components/order-analyses-cards.tsx @@ -57,7 +57,7 @@ export default function OrderAnalysesCards({ } return ( -
+
{analyses.map(({ title, variant, diff --git a/app/home/(user)/_components/order/cart-totals.tsx b/app/home/(user)/_components/order/cart-totals.tsx index 2df2237..fb7b030 100644 --- a/app/home/(user)/_components/order/cart-totals.tsx +++ b/app/home/(user)/_components/order/cart-totals.tsx @@ -24,7 +24,7 @@ export default function CartTotals({ medusaOrder }: {
- + {formatCurrency({ value: subtotal ?? 0, currencyCode: currency_code, locale: language })} @@ -32,7 +32,7 @@ export default function CartTotals({ medusaOrder }: {
{!!discount_total && (
- +
)} -
+ {/*
{formatCurrency({ value: tax_total ?? 0, currencyCode: currency_code, locale: language })} -
+
*/} {!!gift_card_total && (
- +
- + - - :{" "} +
+ + :{" "} + + + {order.medusa_order_id} + +
+ +
+ + :{" "} + {formatDate(order.created_at, 'dd.MM.yyyy HH:mm')} - - - : {order.medusa_order_id} - +
) } diff --git a/packages/features/auth/src/server/api.ts b/packages/features/auth/src/server/api.ts index 223e82c..8462006 100644 --- a/packages/features/auth/src/server/api.ts +++ b/packages/features/auth/src/server/api.ts @@ -9,8 +9,8 @@ export interface AccountSubmitData { email: string; phone?: string; city?: string; - weight: number | null; - height: number | null; + weight?: number | null | undefined; + height?: number | null | undefined; userConsent: boolean; } diff --git a/packages/ui/src/makerkit/page.tsx b/packages/ui/src/makerkit/page.tsx index 7a4ee42..6ca7573 100644 --- a/packages/ui/src/makerkit/page.tsx +++ b/packages/ui/src/makerkit/page.tsx @@ -119,8 +119,8 @@ export function PageNavigation(props: React.PropsWithChildren) { export function PageDescription(props: React.PropsWithChildren) { return ( -
-
+
+
{props.children}
@@ -168,7 +168,7 @@ export function PageHeader({ -
+
{displaySidebarTrigger ? ( ) : null} diff --git a/public/locales/en/cart.json b/public/locales/en/cart.json index a78a8cb..223d3f1 100644 --- a/public/locales/en/cart.json +++ b/public/locales/en/cart.json @@ -3,9 +3,6 @@ "description": "View your cart", "emptyCartMessage": "Your cart is empty", "emptyCartMessageDescription": "Add items to your cart to continue.", - "subtotal": "Subtotal", - "total": "Total", - "promotionsTotal": "Promotions total", "table": { "item": "Item", "quantity": "Quantity", @@ -58,7 +55,11 @@ } }, "order": { - "title": "Order" + "title": "Order", + "promotionsTotal": "Promotions total", + "subtotal": "Subtotal", + "total": "Total", + "giftCard": "Gift card" }, "orderConfirmed": { "title": "Order confirmed", diff --git a/public/locales/et/cart.json b/public/locales/et/cart.json index e5e7376..36b69d0 100644 --- a/public/locales/et/cart.json +++ b/public/locales/et/cart.json @@ -3,9 +3,6 @@ "description": "Vaata oma ostukorvi", "emptyCartMessage": "Sinu ostukorv on tühi", "emptyCartMessageDescription": "Lisa tooteid ostukorvi, et jätkata.", - "subtotal": "Vahesumma", - "total": "Summa", - "promotionsTotal": "Soodustuse summa", "table": { "item": "Toode", "quantity": "Kogus", @@ -58,7 +55,11 @@ } }, "order": { - "title": "Tellimus" + "title": "Tellimus", + "promotionsTotal": "Soodustuse summa", + "subtotal": "Vahesumma", + "total": "Summa", + "giftCard": "Kinkekaart" }, "orderConfirmed": { "title": "Tellimus on edukalt esitatud", diff --git a/public/locales/ru/cart.json b/public/locales/ru/cart.json index bac0c63..289ff31 100644 --- a/public/locales/ru/cart.json +++ b/public/locales/ru/cart.json @@ -3,9 +3,6 @@ "description": "Просмотрите свою корзину", "emptyCartMessage": "Ваша корзина пуста", "emptyCartMessageDescription": "Добавьте товары в корзину, чтобы продолжить.", - "subtotal": "Промежуточный итог", - "total": "Сумма", - "promotionsTotal": "Скидка", "table": { "item": "Товар", "quantity": "Количество", @@ -58,7 +55,11 @@ } }, "order": { - "title": "Заказ" + "title": "Заказ", + "promotionsTotal": "Скидка", + "subtotal": "Промежуточный итог", + "total": "Сумма", + "giftCard": "Подарочная карта" }, "orderConfirmed": { "title": "Заказ успешно оформлен",