diff --git a/.claude/launch.json b/.claude/launch.json new file mode 100644 index 0000000..53b551a --- /dev/null +++ b/.claude/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.0.1", + "configurations": [ + { + "name": "suman-hrvatska", + "runtimeExecutable": "sh", + "runtimeArgs": ["-c", "cd apps/suman-hrvatska && npx next dev -p 8020"], + "port": 8020 + } + ] +} diff --git a/apps/suman-bosna/public/hero/pergole-desktop.webp b/apps/suman-bosna/public/hero/pergole-desktop.webp new file mode 100644 index 0000000..73e85fb Binary files /dev/null and b/apps/suman-bosna/public/hero/pergole-desktop.webp differ diff --git a/apps/suman-bosna/public/logo-suman.svg b/apps/suman-bosna/public/logo-suman.svg new file mode 100644 index 0000000..8a1d0ae --- /dev/null +++ b/apps/suman-bosna/public/logo-suman.svg @@ -0,0 +1,55 @@ + + + + + + + + diff --git a/apps/suman-bosna/src/app/[countryCode]/(checkout)/checkout/page.tsx b/apps/suman-bosna/src/app/[countryCode]/(checkout)/checkout/page.tsx index 6244a1d..87667ff 100644 --- a/apps/suman-bosna/src/app/[countryCode]/(checkout)/checkout/page.tsx +++ b/apps/suman-bosna/src/app/[countryCode]/(checkout)/checkout/page.tsx @@ -7,7 +7,7 @@ import { Metadata } from "next" import { notFound } from "next/navigation" export const metadata: Metadata = { - title: "Checkout", + title: "Plaćanje", } export default async function Checkout() { @@ -20,7 +20,7 @@ export default async function Checkout() { const customer = await retrieveCustomer() return ( -
+
diff --git a/apps/suman-bosna/src/app/[countryCode]/(checkout)/layout.tsx b/apps/suman-bosna/src/app/[countryCode]/(checkout)/layout.tsx index 53793db..6ec0c22 100644 --- a/apps/suman-bosna/src/app/[countryCode]/(checkout)/layout.tsx +++ b/apps/suman-bosna/src/app/[countryCode]/(checkout)/layout.tsx @@ -1,42 +1,44 @@ import LocalizedClientLink from "@modules/common/components/localized-client-link" -import ChevronDown from "@modules/common/icons/chevron-down" -import MedusaCTA from "@modules/layout/components/medusa-cta" +import { Logo } from "@/components/ui/logo" +import { ArrowLeft, Lock } from "lucide-react" +/** Focused checkout shell: back to cart, logo, secure-payment note */ export default function CheckoutLayout({ children, }: { children: React.ReactNode }) { return ( -
-
- ) } diff --git a/apps/suman-bosna/src/modules/account/components/address-book/index.tsx b/apps/suman-bosna/src/modules/account/components/address-book/index.tsx index edd8ac8..5811d34 100644 --- a/apps/suman-bosna/src/modules/account/components/address-book/index.tsx +++ b/apps/suman-bosna/src/modules/account/components/address-book/index.tsx @@ -13,7 +13,7 @@ const AddressBook: React.FC = ({ customer, region }) => { const { addresses } = customer return (
-
+
{addresses.map((address) => { return ( diff --git a/apps/suman-bosna/src/modules/account/components/address-card/add-address.tsx b/apps/suman-bosna/src/modules/account/components/address-card/add-address.tsx index 4ef7545..e222329 100644 --- a/apps/suman-bosna/src/modules/account/components/address-card/add-address.tsx +++ b/apps/suman-bosna/src/modules/account/components/address-card/add-address.tsx @@ -47,31 +47,31 @@ const AddAddress = ({ return ( <> - Add address + Nova adresa
{formState.error && (
{formState.error} @@ -151,7 +151,7 @@ const AddAddress = ({ className="h-10" data-testid="cancel-button" > - Cancel + Odustani Save
diff --git a/apps/suman-bosna/src/modules/account/components/address-card/edit-address-modal.tsx b/apps/suman-bosna/src/modules/account/components/address-card/edit-address-modal.tsx index e386270..d58a512 100644 --- a/apps/suman-bosna/src/modules/account/components/address-card/edit-address-modal.tsx +++ b/apps/suman-bosna/src/modules/account/components/address-card/edit-address-modal.tsx @@ -63,29 +63,29 @@ const EditAddress: React.FC = ({ <>
{address.first_name} {address.last_name} {address.company && ( {address.company} )} - + {address.address_1} {address.address_2 && , {address.address_2}} @@ -99,29 +99,29 @@ const EditAddress: React.FC = ({
-
+
- Edit address + Izmjena adrese @@ -129,7 +129,7 @@ const EditAddress: React.FC = ({
= ({ data-testid="first-name-input" /> = ({ />
= ({ data-testid="address-1-input" /> = ({ />
= ({ data-testid="postal-code-input" /> = ({ />
= ({ data-testid="country-select" /> = ({ />
{formState.error && ( -
+
{formState.error}
)} @@ -223,7 +223,7 @@ const EditAddress: React.FC = ({ className="h-10" data-testid="cancel-button" > - Cancel + Odustani Save
diff --git a/apps/suman-bosna/src/modules/account/components/login/index.tsx b/apps/suman-bosna/src/modules/account/components/login/index.tsx index bd489e8..99ac2db 100644 --- a/apps/suman-bosna/src/modules/account/components/login/index.tsx +++ b/apps/suman-bosna/src/modules/account/components/login/index.tsx @@ -13,36 +13,37 @@ const Login = ({ setCurrentView }: Props) => { const [message, formAction] = useActionState(login, null) return ( -
-

Welcome back

-

- Sign in to access an enhanced shopping experience. -

+
+
+

Moj račun

+

Prijava

+

+ Pratite narudžbe, sačuvajte adrese i naručujte brže. +

+
+ {message?.state === "verification_required" && (
- We sent a verification link to {message.email}. - Please verify your email, then sign in. + Poslali smo link za potvrdu na {message.email}. Potvrdite email, pa se prijavite.
)} - -
+ + +
{ error={message?.state === "error" ? message.error : null} data-testid="login-error-message" /> - - Sign in + + Prijava - - Not a member?{" "} + +

+ Nemate račun?{" "} - . - +

) } diff --git a/apps/suman-bosna/src/modules/account/components/order-card/index.tsx b/apps/suman-bosna/src/modules/account/components/order-card/index.tsx index 843d92b..57acd0d 100644 --- a/apps/suman-bosna/src/modules/account/components/order-card/index.tsx +++ b/apps/suman-bosna/src/modules/account/components/order-card/index.tsx @@ -1,85 +1,71 @@ -import { Button } from "@modules/common/components/ui" +import Image from "next/image" import { useMemo } from "react" -import Thumbnail from "@modules/products/components/thumbnail" import LocalizedClientLink from "@modules/common/components/localized-client-link" import { convertToLocale } from "@lib/util/money" +import { getProductCardImage } from "@lib/util/sale-scenario" import { HttpTypes } from "@medusajs/types" +import { ArrowRight } from "lucide-react" type OrderCardProps = { order: HttpTypes.StoreOrder } const OrderCard = ({ order }: OrderCardProps) => { - const numberOfLines = useMemo(() => { - return ( - order.items?.reduce((acc, item) => { - return acc + item.quantity - }, 0) ?? 0 - ) - }, [order]) - - const numberOfProducts = useMemo(() => { - return order.items?.length ?? 0 - }, [order]) + const itemCount = useMemo( + () => order.items?.reduce((acc, item) => acc + item.quantity, 0) ?? 0, + [order] + ) + const extra = (order.items?.length ?? 0) - 4 return ( -
-
- #{order.display_id} +
+
+

+ #{order.display_id} +

+

+ + {new Date(order.created_at).toLocaleDateString("bs-BA", { + day: "numeric", + month: "long", + year: "numeric", + })} + + + {itemCount % 10 === 1 && itemCount % 100 !== 11 ? `${itemCount} artikal` : `${itemCount} artikala`} + + + {convertToLocale({ amount: order.total, currency_code: order.currency_code })} + +

-
- - {new Date(order.created_at).toDateString()} - - - {convertToLocale({ - amount: order.total, - currency_code: order.currency_code, - })} - - {`${numberOfLines} ${ - numberOfLines > 1 ? "items" : "item" - }`} -
-
- {order.items?.slice(0, 3).map((i) => { - return ( -
- -
- - {i.title} - - x - {i.quantity} -
+ +
    + {order.items?.slice(0, 4).map((i) => ( +
  • +
    +
    - ) - })} - {numberOfProducts > 4 && ( -
    - - + {numberOfLines - 4} - - more -
    - )} -
-
- - - -
+

+ {i.product_title ?? i.title} +

+

+ × {i.quantity} +

+ + ))} + + {extra > 0 &&

+ još {extra}

} + + + Pogledaj detalje + +
) } diff --git a/apps/suman-bosna/src/modules/account/components/order-overview/index.tsx b/apps/suman-bosna/src/modules/account/components/order-overview/index.tsx index 035a7ab..a02d8e9 100644 --- a/apps/suman-bosna/src/modules/account/components/order-overview/index.tsx +++ b/apps/suman-bosna/src/modules/account/components/order-overview/index.tsx @@ -9,32 +9,29 @@ import { HttpTypes } from "@medusajs/types" const OrderOverview = ({ orders }: { orders: HttpTypes.StoreOrder[] }) => { if (orders?.length) { return ( -
+
    {orders.map((o) => ( -
    +
  • -
  • + ))} -
+ ) } return (
-

Nothing to see here

-

- You don't have any orders yet, let us change that {":)"} +

Još nemate narudžbi

+

+ Kad naručite, ovdje ćete pratiti status i isporuku.

- -
diff --git a/apps/suman-bosna/src/modules/account/components/overview/index.tsx b/apps/suman-bosna/src/modules/account/components/overview/index.tsx index eb21f77..c8c714f 100644 --- a/apps/suman-bosna/src/modules/account/components/overview/index.tsx +++ b/apps/suman-bosna/src/modules/account/components/overview/index.tsx @@ -1,167 +1,96 @@ -import { Container } from "@modules/common/components/ui" - -import ChevronDown from "@modules/common/icons/chevron-down" import LocalizedClientLink from "@modules/common/components/localized-client-link" import { convertToLocale } from "@lib/util/money" import { HttpTypes } from "@medusajs/types" +import { ArrowRight } from "lucide-react" type OverviewProps = { customer: HttpTypes.StoreCustomer | null orders: HttpTypes.StoreOrder[] | null } +const formatDate = (value: string | Date) => + new Date(value).toLocaleDateString("bs-BA", { day: "numeric", month: "long", year: "numeric" }) + const Overview = ({ customer, orders }: OverviewProps) => { + const stats = [ + { value: `${getProfileCompletion(customer)}%`, label: "Profil popunjen", href: "/account/profile", testId: "customer-profile-completion" }, + { value: String(customer?.addresses?.length ?? 0), label: "Sačuvane adrese", href: "/account/addresses", testId: "addresses-count" }, + { value: String(orders?.length ?? 0), label: "Narudžbe", href: "/account/orders", testId: "orders-count" }, + ] + return (
-
-
- - Hello {customer?.first_name} - - - Signed in as:{" "} - - {customer?.email} - - -
-
-
-
-
-

Profile

-
- - {getProfileCompletion(customer)}% - - - Completed - -
-
+ + Pozdrav {customer?.first_name} + + + {customer?.email} + -
-

Addresses

-
- - {customer?.addresses?.length || 0} - - - Saved - -
-
-
- -
-
-

Recent orders

-
-
    - {orders && orders.length > 0 ? ( - orders.slice(0, 5).map((order) => { - return ( -
  • - - -
    - Date placed - - Order number - - - Total amount - - - {new Date(order.created_at).toDateString()} - - - #{order.display_id} - - - {convertToLocale({ - amount: order.total, - currency_code: order.currency_code, - })} - -
    - -
    -
    -
  • - ) - }) - ) : ( - No recent orders - )} -
-
-
-
+
+ {stats.map((s) => ( + +

+ {s.value} +

+

+ {s.label} + +

+
+ ))}
+ +
+
+

Nedavne narudžbe

+ + Sve narudžbe + +
+
    + {orders && orders.length > 0 ? ( + orders.slice(0, 5).map((order) => ( +
  • + + + #{order.display_id} + + + {formatDate(order.created_at)} + + + {convertToLocale({ amount: order.total, currency_code: order.currency_code })} + + + +
  • + )) + ) : ( +
  • + Još nemate narudžbi.{" "} + + Pogledajte katalog + +
  • + )} +
+
) } const getProfileCompletion = (customer: HttpTypes.StoreCustomer | null) => { + if (!customer) return 0 let count = 0 - - if (!customer) { - return 0 - } - - if (customer.email) { - count++ - } - - if (customer.first_name && customer.last_name) { - count++ - } - - if (customer.phone) { - count++ - } - - const billingAddress = customer.addresses?.find( - (addr) => addr.is_default_billing - ) - - if (billingAddress) { - count++ - } - + if (customer.email) count++ + if (customer.first_name && customer.last_name) count++ + if (customer.phone) count++ + if (customer.addresses?.find((addr) => addr.is_default_billing)) count++ return (count / 4) * 100 } diff --git a/apps/suman-bosna/src/modules/account/components/profile-billing-address/index.tsx b/apps/suman-bosna/src/modules/account/components/profile-billing-address/index.tsx index 9309bc7..9ab803f 100644 --- a/apps/suman-bosna/src/modules/account/components/profile-billing-address/index.tsx +++ b/apps/suman-bosna/src/modules/account/components/profile-billing-address/index.tsx @@ -63,7 +63,7 @@ const ProfileBillingAddress: React.FC = ({ const currentInfo = useMemo(() => { if (!billingAddress) { - return "No billing address" + return "Nema adrese za račun" } const country = @@ -93,7 +93,7 @@ const ProfileBillingAddress: React.FC = ({
clearState()} className="w-full"> = ({
= ({ />
= ({ data-testid="billing-phone-input" />
= ({ />
= ({ customer }) => { return ( = ({ customer }) => { >
= ({ customer: _customer }) // TODO: Add support for password updates const updatePassword = async () => { // TODO: Re-add toast notification when Toaster component is implemented - console.info("Password update is not implemented") + console.info("Promjena lozinke trenutno nije dostupna") } const clearState = () => { @@ -30,7 +30,7 @@ const ProfilePassword: React.FC = ({ customer: _customer }) className="w-full" > The password is not shown for security reasons } @@ -42,21 +42,21 @@ const ProfilePassword: React.FC = ({ customer: _customer }) >
= ({ customer }) => { return ( = ({ customer }) => { >
{ const [message, formAction] = useActionState(signup, null) return ( -
-

- Become a Medusa Store Member -

-

- Create your Medusa Store Member profile, and get access to an enhanced - shopping experience. -

+
+
+

Moj račun

+

Registracija

+

+ Napravite račun za brže naručivanje i praćenje isporuke. +

+
{message?.state === "verification_required" && (
- We sent a verification link to {message.email}. - Please check your inbox to verify your email, then sign in. + Poslali smo link za potvrdu na {message.email}. + Potvrdite email, pa se prijavite.
)} -
+
{ data-testid="email-input" /> { error={message?.state === "error" ? message.error : null} data-testid="register-error" /> - - By creating an account, you agree to Medusa Store's{" "} + + Registracijom prihvatate{" "} - Privacy Policy + Politikom privatnosti {" "} - and{" "} + i{" "} - Terms of Use + Uslovima korištenja . - - Join + + Registracija - - Already a member?{" "} +

+ Već imate račun?{" "} - . - +

) } diff --git a/apps/suman-bosna/src/modules/account/components/section-heading/index.tsx b/apps/suman-bosna/src/modules/account/components/section-heading/index.tsx new file mode 100644 index 0000000..90795f4 --- /dev/null +++ b/apps/suman-bosna/src/modules/account/components/section-heading/index.tsx @@ -0,0 +1,17 @@ +/** Title + short description at the top of each account screen */ +export default function SectionHeading({ + title, + description, +}: { + title: string + description?: string +}) { + return ( +
+

{title}

+ {description && ( +

{description}

+ )} +
+ ) +} diff --git a/apps/suman-bosna/src/modules/account/components/transfer-request-form/index.tsx b/apps/suman-bosna/src/modules/account/components/transfer-request-form/index.tsx index 0a0b6dd..d96b776 100644 --- a/apps/suman-bosna/src/modules/account/components/transfer-request-form/index.tsx +++ b/apps/suman-bosna/src/modules/account/components/transfer-request-form/index.tsx @@ -27,11 +27,11 @@ export default function TransferRequestForm() {
- Order transfers + Prijenos narudžbi -

- Can't find the order you are looking for? -
Connect an order to your account. +

+ Ne vidite narudžbu koju tražite? +
Povežite narudžbu sa svojim računom.

- + - Request transfer + Zatraži prijenos
{!state.success && state.error && ( - + {state.error} )} {showSuccess && ( -
+
Transfer for order {state.order?.id} requested - + Transfer request email sent to {state.order?.email}
diff --git a/apps/suman-bosna/src/modules/account/components/verify-account/index.tsx b/apps/suman-bosna/src/modules/account/components/verify-account/index.tsx index aefdcb6..58a5e4f 100644 --- a/apps/suman-bosna/src/modules/account/components/verify-account/index.tsx +++ b/apps/suman-bosna/src/modules/account/components/verify-account/index.tsx @@ -37,33 +37,33 @@ const VerifyAccount = () => { className="max-w-sm w-full flex flex-col items-center text-center gap-y-4" data-testid="verify-account-page" > -

Email verification

+

Email verification

{state === "verifying" && ( -

- Verifying your email... +

+ Potvrđujemo vašu email adresu…

)} {state === "success" && ( <> -

- Your email is verified. You can now sign in to your account. +

+ Email adresa je potvrđena. Sada se možete prijaviti na svoj račun.

- + )} {state === "error" && ( <> -

- This verification link is invalid or has expired. Sign in to receive - a new verification email. +

+ Link za potvrdu nije ispravan ili je istekao. Prijavite se da dobijete + novi email za potvrdu.

- + )} diff --git a/apps/suman-bosna/src/modules/account/templates/account-layout.tsx b/apps/suman-bosna/src/modules/account/templates/account-layout.tsx index 2d29490..01a2442 100644 --- a/apps/suman-bosna/src/modules/account/templates/account-layout.tsx +++ b/apps/suman-bosna/src/modules/account/templates/account-layout.tsx @@ -1,7 +1,6 @@ import React from "react" -import UnderlineLink from "@modules/common/components/interactive-link" - +import LocalizedClientLink from "@modules/common/components/localized-client-link" import AccountNav from "../components/account-nav" import { HttpTypes } from "@medusajs/types" @@ -10,31 +9,46 @@ interface AccountLayoutProps { children: React.ReactNode } -const AccountLayout: React.FC = ({ - customer, - children, -}) => { +/** + * Signed out: the login/register screen is centred on its own. + * Signed in: centred greeting, tab navigation, one readable content column. + */ +const AccountLayout: React.FC = ({ customer, children }) => { + if (!customer) { + return ( +
+ {children} +
+ ) + } + return ( -
-
-
-
{customer && }
-
{children}
-
-
-
-

Got questions?

- - You can find frequently asked questions and answers on our - customer service page. - -
-
- - Customer Service - -
+
+
+

Moj račun

+

+ Pozdrav, {customer.first_name || "dobro došli"} +

+

{customer.email}

+
+ + + +
{children}
+ +
+
+

Imate pitanja?

+

+ Pišite nam ili nas nazovite, odgovaramo u roku od jednog radnog dana. +

+ + Kontakt +
) diff --git a/apps/suman-bosna/src/modules/account/templates/login-template.tsx b/apps/suman-bosna/src/modules/account/templates/login-template.tsx index 5d68e64..28e2605 100644 --- a/apps/suman-bosna/src/modules/account/templates/login-template.tsx +++ b/apps/suman-bosna/src/modules/account/templates/login-template.tsx @@ -14,7 +14,7 @@ const LoginTemplate = () => { const [currentView, setCurrentView] = useState("sign-in") return ( -
+
{currentView === "sign-in" ? ( ) : ( diff --git a/apps/suman-bosna/src/modules/cart/components/cart-item-select/index.tsx b/apps/suman-bosna/src/modules/cart/components/cart-item-select/index.tsx index 2f77c0e..056d2bd 100644 --- a/apps/suman-bosna/src/modules/cart/components/cart-item-select/index.tsx +++ b/apps/suman-bosna/src/modules/cart/components/cart-item-select/index.tsx @@ -42,10 +42,10 @@ const CartItemSelect = forwardRef( onFocus={() => innerRef.current?.focus()} onBlur={() => innerRef.current?.blur()} className={clx( - "relative flex items-center txt-compact-small border text-ui-fg-base group", + "relative flex items-center text-sm border text-foreground group", className, { - "text-ui-fg-subtle": isPlaceholder, + "text-muted-foreground": isPlaceholder, } )} > diff --git a/apps/suman-bosna/src/modules/cart/components/empty-cart-message/index.tsx b/apps/suman-bosna/src/modules/cart/components/empty-cart-message/index.tsx index 8c1b41c..b3ac0e9 100644 --- a/apps/suman-bosna/src/modules/cart/components/empty-cart-message/index.tsx +++ b/apps/suman-bosna/src/modules/cart/components/empty-cart-message/index.tsx @@ -1,28 +1,30 @@ import LocalizedClientLink from "@modules/common/components/localized-client-link" -import { Button } from "@/components/ui/button" -import { ShoppingBag, ArrowRight } from "lucide-react" const EmptyCartMessage = () => { return (
-
- -
-

- Vaša korpa je prazna -

-

- Trenutno nemate dodanih proizvoda u korpi. Istražite našu ponudu profesionalnih suncobrana, pergola i opreme za zaštitu od sunca. +

Korpa

+

Korpa je prazna

+

+ Konfigurišite suncobran po svojoj mjeri ili pogledajte pergole i tende iz naše proizvodnje.

- - - +
+ + Konfiguriši suncobran + + + Pogledajte katalog + +
) } diff --git a/apps/suman-bosna/src/modules/cart/components/item/index.tsx b/apps/suman-bosna/src/modules/cart/components/item/index.tsx index f7a9436..6984dfd 100644 --- a/apps/suman-bosna/src/modules/cart/components/item/index.tsx +++ b/apps/suman-bosna/src/modules/cart/components/item/index.tsx @@ -1,139 +1,143 @@ "use client" -import { Table } from "@modules/common/components/ui" -import { updateLineItem } from "@lib/data/cart" +import Image from "next/image" +import { updateLineItem, deleteLineItem } from "@lib/data/cart" +import { notifyCartUpdated } from "@lib/util/cart-events" +import { convertToLocale } from "@lib/util/money" +import { getProductCardImage } from "@lib/util/sale-scenario" import { HttpTypes } from "@medusajs/types" -import CartItemSelect from "@modules/cart/components/cart-item-select" import ErrorMessage from "@modules/checkout/components/error-message" -import DeleteButton from "@modules/common/components/delete-button" import LineItemOptions from "@modules/common/components/line-item-options" -import LineItemPrice from "@modules/common/components/line-item-price" -import LineItemUnitPrice from "@modules/common/components/line-item-unit-price" import LocalizedClientLink from "@modules/common/components/localized-client-link" -import Thumbnail from "@modules/products/components/thumbnail" import { useState } from "react" -import { Loader2 } from "lucide-react" +import { Loader2, Minus, Plus } from "lucide-react" import { cn } from "@/lib/utils" type ItemProps = { item: HttpTypes.StoreCartLineItem + /** full: cart page with quantity controls; preview: checkout summary */ type?: "full" | "preview" currencyCode: string } +const MAX_QUANTITY = 99 + +/** Cart line as a list row (cart page and checkout summary) */ const Item = ({ item, type = "full", currencyCode }: ItemProps) => { const [updating, setUpdating] = useState(false) + const [removing, setRemoving] = useState(false) const [error, setError] = useState(null) + const isFull = type === "full" + const money = (amount?: number | null) => + convertToLocale({ amount: amount ?? 0, currency_code: currencyCode }) const changeQuantity = async (quantity: number) => { + if (quantity < 1 || quantity > MAX_QUANTITY) return setError(null) setUpdating(true) + await updateLineItem({ lineId: item.id, quantity }) + .then(() => notifyCartUpdated()) + .catch((err) => setError(err.message)) + .finally(() => setUpdating(false)) + } - await updateLineItem({ - lineId: item.id, - quantity, - }) + const remove = async () => { + setRemoving(true) + await deleteLineItem(item.id) + .then(() => notifyCartUpdated()) .catch((err) => { setError(err.message) - }) - .finally(() => { - setUpdating(false) + setRemoving(false) }) } - const maxQtyFromInventory = 10 - const maxQuantity = item.variant?.manage_inventory ? 10 : maxQtyFromInventory - return ( - - - - - - +
  • + + {item.product_title + - - - {item.product_title} - - - - - {type === "full" && ( - -
    - - changeQuantity(parseInt(value.target.value))} - className="h-9 rounded-md border border-input bg-background px-2 text-sm" - data-testid="product-select-button" - > - {Array.from( - { - length: Math.min(maxQuantity, 10), - }, - (_, i) => ( - - ) +
    +
    +
    + - {updating && } + data-testid="product-title" + > + {item.product_title} + +
    - - - )} +
    +

    + {money(item.total)} +

    + {(isFull ? item.quantity > 1 : true) && ( +

    + {item.quantity} × {money(item.unit_price)} +

    + )} +
    +
    - {type === "full" && ( - - - - )} - - - - {type === "preview" && ( - - {item.quantity}x - - - )} - - - - + {isFull && ( +
    +
    + + + {updating ? : item.quantity} + + +
    + +
    + )} + +
    +
  • ) } diff --git a/apps/suman-bosna/src/modules/cart/components/sign-in-prompt/index.tsx b/apps/suman-bosna/src/modules/cart/components/sign-in-prompt/index.tsx index 09a5571..4468b96 100644 --- a/apps/suman-bosna/src/modules/cart/components/sign-in-prompt/index.tsx +++ b/apps/suman-bosna/src/modules/cart/components/sign-in-prompt/index.tsx @@ -1,24 +1,21 @@ -import { Button } from "@/components/ui/button" import LocalizedClientLink from "@modules/common/components/localized-client-link" const SignInPrompt = () => { return ( -
    +
    -

    - Već imate nalog? -

    -

    - Prijavite se za brže naručivanje i praćenje statusa isporuke. +

    Već imate nalog?

    +

    + Prijavite se za brže naručivanje i praćenje isporuke.

    -
    - - - -
    + + Prijava +
    ) } diff --git a/apps/suman-bosna/src/modules/cart/templates/index.tsx b/apps/suman-bosna/src/modules/cart/templates/index.tsx index 570076a..65474e2 100644 --- a/apps/suman-bosna/src/modules/cart/templates/index.tsx +++ b/apps/suman-bosna/src/modules/cart/templates/index.tsx @@ -2,7 +2,6 @@ import ItemsTemplate from "./items" import Summary from "./summary" import EmptyCartMessage from "../components/empty-cart-message" import SignInPrompt from "../components/sign-in-prompt" -import { Separator } from "@/components/ui/separator" import { HttpTypes } from "@medusajs/types" const CartTemplate = ({ @@ -12,34 +11,34 @@ const CartTemplate = ({ cart: HttpTypes.StoreCart | null customer: HttpTypes.StoreCustomer | null }) => { + const count = cart?.items?.reduce((sum, i) => sum + i.quantity, 0) ?? 0 + return ( -
    -
    - {cart?.items?.length ? ( -
    -
    - {!customer && ( - <> - - - - )} +
    + {cart?.items?.length ? ( + <> +
    +

    Korpa

    +

    Vaša korpa

    +

    + {count % 10 === 1 && count % 100 !== 11 ? `${count} artikal` : `${count} artikala`} · Dostava za + 24–48h širom BiH ili preuzimanje u Gračanici +

    +
    + +
    +
    + {!customer && }
    -
    - {cart && cart.region && ( -
    - -
    - )} -
    +
    - ) : ( -
    - -
    - )} -
    + + ) : ( + + )}
    ) } diff --git a/apps/suman-bosna/src/modules/cart/templates/items.tsx b/apps/suman-bosna/src/modules/cart/templates/items.tsx index 24613a8..016814e 100644 --- a/apps/suman-bosna/src/modules/cart/templates/items.tsx +++ b/apps/suman-bosna/src/modules/cart/templates/items.tsx @@ -1,56 +1,21 @@ -import repeat from "@lib/util/repeat" import { HttpTypes } from "@medusajs/types" -import { Heading, Table } from "@modules/common/components/ui" - import Item from "@modules/cart/components/item" -import SkeletonLineItem from "@modules/skeletons/components/skeleton-line-item" type ItemsTemplateProps = { cart?: HttpTypes.StoreCart } const ItemsTemplate = ({ cart }: ItemsTemplateProps) => { - const items = cart?.items + const items = [...(cart?.items ?? [])].sort((a, b) => + (a.created_at ?? "") > (b.created_at ?? "") ? -1 : 1 + ) + return ( -
    -
    - Cart -
    - - - - Item - - Quantity - - Price - - - Total - - - - - {items - ? items - .sort((a, b) => { - return (a.created_at ?? "") > (b.created_at ?? "") ? -1 : 1 - }) - .map((item) => { - return ( - - ) - }) - : repeat(5).map((i) => { - return - })} - -
    -
    +
      + {items.map((item) => ( + + ))} +
    ) } diff --git a/apps/suman-bosna/src/modules/cart/templates/preview.tsx b/apps/suman-bosna/src/modules/cart/templates/preview.tsx index 5f38f1d..9e5c5b1 100644 --- a/apps/suman-bosna/src/modules/cart/templates/preview.tsx +++ b/apps/suman-bosna/src/modules/cart/templates/preview.tsx @@ -1,50 +1,32 @@ "use client" -import repeat from "@lib/util/repeat" import { HttpTypes } from "@medusajs/types" -import { Table, clx } from "@modules/common/components/ui" - +import { cn } from "@/lib/utils" import Item from "@modules/cart/components/item" -import SkeletonLineItem from "@modules/skeletons/components/skeleton-line-item" type ItemsTemplateProps = { cart: HttpTypes.StoreCart } +/** Compact item list for the checkout summary */ const ItemsPreviewTemplate = ({ cart }: ItemsTemplateProps) => { - const items = cart.items - const hasOverflow = items && items.length > 4 + const items = [...(cart.items ?? [])].sort((a, b) => + (a.created_at ?? "") > (b.created_at ?? "") ? -1 : 1 + ) + const hasOverflow = items.length > 4 return ( -
    - - - {items - ? items - .sort((a, b) => { - return (a.created_at ?? "") > (b.created_at ?? "") ? -1 : 1 - }) - .map((item) => { - return ( - - ) - }) - : repeat(5).map((i) => { - return - })} - -
    -
    + {items.map((item) => ( + + ))} + ) } diff --git a/apps/suman-bosna/src/modules/cart/templates/summary.tsx b/apps/suman-bosna/src/modules/cart/templates/summary.tsx index f662d5a..6dc18d0 100644 --- a/apps/suman-bosna/src/modules/cart/templates/summary.tsx +++ b/apps/suman-bosna/src/modules/cart/templates/summary.tsx @@ -1,11 +1,10 @@ "use client" -import { Button } from "@/components/ui/button" import CartTotals from "@modules/common/components/cart-totals" -import { Separator } from "@/components/ui/separator" import DiscountCode from "@modules/checkout/components/discount-code" import LocalizedClientLink from "@modules/common/components/localized-client-link" import { HttpTypes } from "@medusajs/types" +import { ArrowRight } from "lucide-react" type SummaryProps = { cart: HttpTypes.StoreCart @@ -25,22 +24,22 @@ const Summary = ({ cart }: SummaryProps) => { const step = getCheckoutStep(cart) return ( -
    -

    - Pregled Narudžbe -

    - - - +
    +

    Pregled narudžbe

    +
    + +
    - + Nastavite na plaćanje + +
    + +
    ) } diff --git a/apps/suman-bosna/src/modules/categories/components/category-toolbar/index.tsx b/apps/suman-bosna/src/modules/categories/components/category-toolbar/index.tsx new file mode 100644 index 0000000..1ab40d1 --- /dev/null +++ b/apps/suman-bosna/src/modules/categories/components/category-toolbar/index.tsx @@ -0,0 +1,64 @@ +"use client" + +import { Search } from "lucide-react" +import { useParams, usePathname, useRouter } from "next/navigation" +import { useState } from "react" +import { PRODUCT_INDEX_NAME } from "@lib/search-client" +import RefinementList from "@modules/store/components/refinement-list" +import { SortOptions } from "@modules/store/components/refinement-list/sort-products" +import CatalogToolbar from "@modules/store/components/catalog-toolbar" + +const SORT_LABELS: Record = { + created_at: "Najnovije", + price_asc: "Cijena: od najniže", + price_desc: "Cijena: od najviše", +} + +/** Category search hands the query to the full-catalog search on /store */ +function CategorySearch({ onClose }: { onClose: () => void }) { + const router = useRouter() + const { countryCode } = useParams<{ countryCode: string }>() + const [value, setValue] = useState("") + + return ( +
    { + event.preventDefault() + const query = value.trim() + if (!query) return + const params = new URLSearchParams({ [`${PRODUCT_INDEX_NAME}[query]`]: query }) + router.push(`/${countryCode}/store?${params.toString()}`) + }} + className="relative flex items-center" + > + + setValue(e.target.value)} + onKeyDown={(e) => e.key === "Escape" && onClose()} + placeholder="Pretražite sve proizvode i pritisnite Enter" + aria-label="Pretraži proizvode" + className="h-10 w-full bg-transparent pl-8 text-base sm:text-sm placeholder:text-muted-foreground focus-visible:outline-none [&::-webkit-search-cancel-button]:hidden" + /> + + ) +} + +export default function CategoryToolbar({ sortBy }: { sortBy: SortOptions }) { + const router = useRouter() + const pathname = usePathname() + const isDefaultSort = sortBy === "created_at" + + return ( + } + activeFilters={isDefaultSort ? 0 : 1} + onClearFilters={() => router.push(pathname)} + renderSearch={({ onClose }) => } + /> + ) +} diff --git a/apps/suman-bosna/src/modules/categories/templates/index.tsx b/apps/suman-bosna/src/modules/categories/templates/index.tsx index 21c420a..a18dde7 100644 --- a/apps/suman-bosna/src/modules/categories/templates/index.tsx +++ b/apps/suman-bosna/src/modules/categories/templates/index.tsx @@ -1,14 +1,12 @@ import { notFound } from "next/navigation" import { Suspense } from "react" import SkeletonProductGrid from "@modules/skeletons/templates/skeleton-product-grid" -import RefinementList from "@modules/store/components/refinement-list" +import CategoryToolbar from "@modules/categories/components/category-toolbar" import { SortOptions } from "@modules/store/components/refinement-list/sort-products" import PaginatedProducts from "@modules/store/templates/paginated-products" -import LocalizedClientLink from "@modules/common/components/localized-client-link" +import CatalogHeader from "@modules/store/components/catalog-header" import { HttpTypes } from "@medusajs/types" import { OptionValueIds } from "@lib/util/product-option-filters" -import { ChevronRight } from "lucide-react" -import { Badge } from "@/components/ui/badge" export default function CategoryTemplate({ category, @@ -28,101 +26,35 @@ export default function CategoryTemplate({ if (!category || !countryCode) notFound() - const parents = [] as HttpTypes.StoreProductCategory[] - - const getParents = (category: HttpTypes.StoreProductCategory) => { - if (category.parent_category) { - parents.push(category.parent_category) - getParents(category.parent_category) - } - } - - getParents(category) + const rootHandle = + category.parent_category?.handle ?? category.handle ?? null return ( -
    - {/* Breadcrumb Navigation */} - +
    + - {/* Category Header */} -
    -

    - {category.name} -

    - {category.description && ( -

    - {category.description} -

    - )} - {category.category_children && category.category_children.length > 0 && ( -
    - {category.category_children.map((c) => ( - - - {c.name} - - - ))} -
    - )} -
    - - {/* Main Grid: Sidebar + Products */} -
    -
    -
    - -
    -
    -
    - - } - > - - -
    -
    + + + } + > + +
    ) } diff --git a/apps/suman-bosna/src/modules/checkout/components/address-select/index.tsx b/apps/suman-bosna/src/modules/checkout/components/address-select/index.tsx index 14a5be7..f529690 100644 --- a/apps/suman-bosna/src/modules/checkout/components/address-select/index.tsx +++ b/apps/suman-bosna/src/modules/checkout/components/address-select/index.tsx @@ -36,7 +36,7 @@ const AddressSelect = ({
    {({ open }) => ( @@ -44,7 +44,7 @@ const AddressSelect = ({ {selectedAddress ? selectedAddress.address_1 - : "Choose an address"} + : "Odaberite adresu"} {addresses.map((address) => { @@ -78,15 +78,15 @@ const AddressSelect = ({ data-testid="shipping-address-radio" />
    - + {address.first_name} {address.last_name} {address.company && ( - + {address.company} )} -
    +
    {address.address_1} {address.address_2 && ( diff --git a/apps/suman-bosna/src/modules/checkout/components/addresses/index.tsx b/apps/suman-bosna/src/modules/checkout/components/addresses/index.tsx index 286db1d..e53c951 100644 --- a/apps/suman-bosna/src/modules/checkout/components/addresses/index.tsx +++ b/apps/suman-bosna/src/modules/checkout/components/addresses/index.tsx @@ -44,19 +44,19 @@ const Addresses = ({
    - Shipping Address + Adresa dostave {!isOpen && } {!isOpen && cart?.shipping_address && ( )} @@ -75,23 +75,23 @@ const Addresses = ({
    - Billing address + Adresa za račun
    )} - Continue to delivery + Nastavite na dostavu
    ) : (
    -
    +
    {cart && cart.shipping_address ? (
    @@ -99,22 +99,22 @@ const Addresses = ({ className="flex flex-col w-1/3" data-testid="shipping-address-summary" > - - Shipping Address + + Adresa dostave - + {cart.shipping_address.first_name}{" "} {cart.shipping_address.last_name} - + {cart.shipping_address.address_1}{" "} {cart.shipping_address.address_2} - + {cart.shipping_address.postal_code},{" "} {cart.shipping_address.city} - + {cart.shipping_address.country_code?.toUpperCase()}
    @@ -123,13 +123,13 @@ const Addresses = ({ className="flex flex-col w-1/3 " data-testid="shipping-contact-summary" > - - Contact + + Kontakt - + {cart.shipping_address.phone} - + {cart.email}
    @@ -138,29 +138,29 @@ const Addresses = ({ className="flex flex-col w-1/3" data-testid="billing-address-summary" > - - Billing Address + + Adresa za račun {sameAsBilling ? ( - - Billing and delivery address are the same. + + Adresa za račun ista je kao adresa dostave. ) : ( <> - + {cart.billing_address?.first_name}{" "} {cart.billing_address?.last_name} - + {cart.billing_address?.address_1}{" "} {cart.billing_address?.address_2} - + {cart.billing_address?.postal_code},{" "} {cart.billing_address?.city} - + {cart.billing_address?.country_code?.toUpperCase()} diff --git a/apps/suman-bosna/src/modules/checkout/components/billing_address/index.tsx b/apps/suman-bosna/src/modules/checkout/components/billing_address/index.tsx index 4417137..62e63d3 100644 --- a/apps/suman-bosna/src/modules/checkout/components/billing_address/index.tsx +++ b/apps/suman-bosna/src/modules/checkout/components/billing_address/index.tsx @@ -31,7 +31,7 @@ const BillingAddress = ({ cart }: { cart: HttpTypes.StoreCart | null }) => { <>
    { data-testid="billing-first-name-input" /> { data-testid="billing-last-name-input" /> { data-testid="billing-address-input" /> { data-testid="billing-company-input" /> { data-testid="billing-postal-input" /> { data-testid="billing-country-select" /> { data-testid="billing-province-input" /> (({ placeholder = "Country", region, defaultValue, ...props }, ref) => { +>(({ placeholder = "Država", region, defaultValue, ...props }, ref) => { const innerRef = useRef(null) useImperativeHandle( diff --git a/apps/suman-bosna/src/modules/checkout/components/payment-button/adyen-payment-button.tsx b/apps/suman-bosna/src/modules/checkout/components/payment-button/adyen-payment-button.tsx index cc4d1f2..10f9678 100644 --- a/apps/suman-bosna/src/modules/checkout/components/payment-button/adyen-payment-button.tsx +++ b/apps/suman-bosna/src/modules/checkout/components/payment-button/adyen-payment-button.tsx @@ -130,7 +130,7 @@ const AdyenPaymentButton = ({ } mount().catch(() => { - setErrorMessage("Could not load the payment methods.") + setErrorMessage("Načini plaćanja se nisu mogli učitati.") }) return () => { @@ -144,7 +144,7 @@ const AdyenPaymentButton = ({ if (notReady) { return ( ) } diff --git a/apps/suman-bosna/src/modules/checkout/components/payment-button/index.tsx b/apps/suman-bosna/src/modules/checkout/components/payment-button/index.tsx index 2acc0dc..767e390 100644 --- a/apps/suman-bosna/src/modules/checkout/components/payment-button/index.tsx +++ b/apps/suman-bosna/src/modules/checkout/components/payment-button/index.tsx @@ -51,7 +51,7 @@ const PaymentButton: React.FC = ({ ) default: - return + return } } @@ -160,7 +160,7 @@ const StripePaymentButton = ({ isLoading={submitting} data-testid={dataTestId} > - Place order + Potvrdi narudžbu { size="large" data-testid="submit-order-button" > - Place order + Potvrdi narudžbu = ({ value={paymentProviderId} disabled={disabled} className={clx( - "flex flex-col gap-y-2 text-small-regular cursor-pointer py-4 border rounded-rounded px-8 mb-2 hover:shadow-borders-interactive-with-active", + "flex flex-col gap-y-2 text-sm cursor-pointer py-4 border rounded-rounded px-8 mb-2 hover:border-primary", { - "border-ui-border-interactive": + "border-primary": selectedPaymentOptionId === paymentProviderId, } )} @@ -43,19 +43,19 @@ const PaymentContainer: React.FC = ({
    - + {paymentInfo?.title || paymentProviderId} {isManual(paymentProviderId) && isDevelopment && ( - + )}
    - + {paymentInfo?.icon}
    {isManual(paymentProviderId) && isDevelopment && ( - + )} {children} @@ -85,8 +85,8 @@ export const StripePaymentContainer = ({ {selectedPaymentOptionId === paymentProviderId && (stripeReady ? (
    - - Enter your payment details: + + Unesite podatke za plaćanje: diff --git a/apps/suman-bosna/src/modules/checkout/components/payment-test/index.tsx b/apps/suman-bosna/src/modules/checkout/components/payment-test/index.tsx index dd96ab6..b24d30b 100644 --- a/apps/suman-bosna/src/modules/checkout/components/payment-test/index.tsx +++ b/apps/suman-bosna/src/modules/checkout/components/payment-test/index.tsx @@ -3,7 +3,7 @@ import { Badge } from "@modules/common/components/ui" const PaymentTest = ({ className }: { className?: string }) => { return ( - Attention: For testing purposes + Pažnja: For testing purposes only. ) diff --git a/apps/suman-bosna/src/modules/checkout/components/payment/index.tsx b/apps/suman-bosna/src/modules/checkout/components/payment/index.tsx index 7252c67..cb915bf 100644 --- a/apps/suman-bosna/src/modules/checkout/components/payment/index.tsx +++ b/apps/suman-bosna/src/modules/checkout/components/payment/index.tsx @@ -116,24 +116,24 @@ const Payment = ({ - Payment + Plaćanje {!isOpen && paymentReady && } {!isOpen && paymentReady && ( )} @@ -169,14 +169,14 @@ const Payment = ({ {paidByGiftcard && (
    - - Payment method + + Način plaćanja - Gift card + Poklon kartica
    )} @@ -198,8 +198,8 @@ const Payment = ({ data-testid="submit-payment-button" > {!activeSession && isStripeLike(selectedPaymentMethod) - ? "Enter payment details" - : "Continue to review"} + ? "Unesite podatke za plaćanje" + : "Nastavite na pregled"}
    @@ -207,11 +207,11 @@ const Payment = ({ {cart && paymentReady && activeSession ? (
    - - Payment method + + Način plaćanja {getPaymentInfo(activeSession?.provider_id)?.title || @@ -219,14 +219,14 @@ const Payment = ({
    - - Payment details + + Podaci o plaćanju
    - + {getPaymentInfo(selectedPaymentMethod)?.icon || ( )} @@ -237,14 +237,14 @@ const Payment = ({
    ) : paidByGiftcard ? (
    - - Payment method + + Način plaćanja - Gift card + Poklon kartica
    ) : null} diff --git a/apps/suman-bosna/src/modules/checkout/components/review/index.tsx b/apps/suman-bosna/src/modules/checkout/components/review/index.tsx index 0d29def..a8a5604 100644 --- a/apps/suman-bosna/src/modules/checkout/components/review/index.tsx +++ b/apps/suman-bosna/src/modules/checkout/components/review/index.tsx @@ -26,24 +26,23 @@ const Review = ({ cart }: { cart: HttpTypes.StoreCart }) => { - Review + Pregled
    {isOpen && previousStepsCompleted && ( <>
    - - By clicking the Place Order button, you confirm that you have - read, understand and accept our Terms of Use, Terms of Sale and - Returns Policy and acknowledge that you have read Medusa - Store's Privacy Policy. + + Klikom na „Potvrdi narudžbu“ potvrđujete da ste pročitali i + prihvatate uslove poslovanja i pravila o povratu robe, te da ste + upoznati s politikom privatnosti Suman d.o.o.
    diff --git a/apps/suman-bosna/src/modules/checkout/components/shipping-address/index.tsx b/apps/suman-bosna/src/modules/checkout/components/shipping-address/index.tsx index 618ef33..d9c0132 100644 --- a/apps/suman-bosna/src/modules/checkout/components/shipping-address/index.tsx +++ b/apps/suman-bosna/src/modules/checkout/components/shipping-address/index.tsx @@ -108,7 +108,7 @@ const ShippingAddress = ({ <> {customer && (addressesInRegion?.length || 0) > 0 && ( -

    +

    {`Hi ${customer.first_name}, do you want to use one of your saved addresses?`}

    = ({ - Delivery + Dostava {!isOpen && (cart.shipping_methods?.length ?? 0) > 0 && ( )} @@ -176,10 +176,10 @@ const Shipping: React.FC = ({ )} @@ -188,11 +188,11 @@ const Shipping: React.FC = ({ <>
    - - Shipping method + + Način dostave - - How would you like you order delivered + + Kako želite da vam isporučimo narudžbu
    @@ -214,9 +214,9 @@ const Shipping: React.FC = ({ value={PICKUP_OPTION_ON} data-testid="delivery-option-radio" className={clx( - "flex items-center justify-between text-small-regular cursor-pointer py-4 border rounded-rounded px-8 mb-2 hover:shadow-borders-interactive-with-active", + "flex items-center justify-between text-sm cursor-pointer py-4 border rounded-rounded px-8 mb-2 hover:border-primary", { - "border-ui-border-interactive": + "border-primary": showPickupOptions === PICKUP_OPTION_ON, } )} @@ -225,11 +225,11 @@ const Shipping: React.FC = ({ - - Pick up your order + + Preuzmite narudžbu lično
    - + - @@ -256,9 +256,9 @@ const Shipping: React.FC = ({ data-testid="delivery-option-radio" disabled={isDisabled} className={clx( - "flex items-center justify-between text-small-regular cursor-pointer py-4 border rounded-rounded px-8 mb-2 hover:shadow-borders-interactive-with-active", + "flex items-center justify-between text-sm cursor-pointer py-4 border rounded-rounded px-8 mb-2 hover:border-primary", { - "border-ui-border-interactive": + "border-primary": option.id === shippingMethodId, "hover:shadow-brders-none cursor-not-allowed": isDisabled, @@ -269,11 +269,11 @@ const Shipping: React.FC = ({ - + {option.name}
    - + {option.price_type === "flat" ? ( convertToLocale({ amount: option.amount!, @@ -301,11 +301,11 @@ const Shipping: React.FC = ({ {showPickupOptions === PICKUP_OPTION_ON && (
    - - Store + + Prodajno mjesto - - Choose a store near you + + Odaberite najbliže prodajno mjesto
    @@ -326,9 +326,9 @@ const Shipping: React.FC = ({ disabled={option.insufficient_inventory} data-testid="delivery-option-radio" className={clx( - "flex items-center justify-between text-small-regular cursor-pointer py-4 border rounded-rounded px-8 mb-2 hover:shadow-borders-interactive-with-active", + "flex items-center justify-between text-sm cursor-pointer py-4 border rounded-rounded px-8 mb-2 hover:border-primary", { - "border-ui-border-interactive": + "border-primary": option.id === shippingMethodId, "hover:shadow-brders-none cursor-not-allowed": option.insufficient_inventory, @@ -340,10 +340,10 @@ const Shipping: React.FC = ({ checked={option.id === shippingMethodId} />
    - + {option.name} - + {formatAddress( (option as unknown as { service_zone?: { fulfillment_set?: { location?: { address: HttpTypes.StoreCartAddress } } } }).service_zone?.fulfillment_set?.location ?.address as HttpTypes.StoreCartAddress @@ -351,7 +351,7 @@ const Shipping: React.FC = ({
    - + {convertToLocale({ amount: option.amount!, currency_code: cart?.currency_code, @@ -379,19 +379,19 @@ const Shipping: React.FC = ({ disabled={!cart.shipping_methods?.[0]} data-testid="submit-delivery-option-button" > - Continue to payment + Nastavite na plaćanje
    ) : (
    -
    +
    {cart && (cart.shipping_methods?.length ?? 0) > 0 && (
    - - Method + + Način - + {cart.shipping_methods!.at(-1)!.name}{" "} {convertToLocale({ amount: cart.shipping_methods!.at(-1)!.amount!, diff --git a/apps/suman-bosna/src/modules/checkout/templates/checkout-summary/index.tsx b/apps/suman-bosna/src/modules/checkout/templates/checkout-summary/index.tsx index cf2f018..4b6d191 100644 --- a/apps/suman-bosna/src/modules/checkout/templates/checkout-summary/index.tsx +++ b/apps/suman-bosna/src/modules/checkout/templates/checkout-summary/index.tsx @@ -1,30 +1,24 @@ -import { Heading } from "@modules/common/components/ui" - import ItemsPreviewTemplate from "@modules/cart/templates/preview" import DiscountCode from "@modules/checkout/components/discount-code" import CartTotals from "@modules/common/components/cart-totals" -import Divider from "@modules/common/components/divider" import { HttpTypes } from "@medusajs/types" const CheckoutSummary = ({ cart }: { cart: HttpTypes.StoreCart }) => { return ( -
    -
    - - - In your Cart - - - - -
    +
    + ) } diff --git a/apps/suman-bosna/src/modules/collections/templates/index.tsx b/apps/suman-bosna/src/modules/collections/templates/index.tsx index ebbebd3..c3440a1 100644 --- a/apps/suman-bosna/src/modules/collections/templates/index.tsx +++ b/apps/suman-bosna/src/modules/collections/templates/index.tsx @@ -24,10 +24,10 @@ export default function CollectionTemplate({ const sort = sortBy || "created_at" return ( -
    +
    -
    +

    {collection.title}

    = ({ totals }) => {
    - + -
    - Ukupno za uplatu +
    + Ukupno za uplatu @@ -86,10 +86,10 @@ const CartTotals: React.FC = ({ totals }) => {
    -
    - - Fiskalni račun i R1 porezna faktura za firme sa JIB/PDV brojem -
    +

    + + Fiskalni račun i R1 faktura za firme s JIB/PDV brojem +

    ) } diff --git a/apps/suman-bosna/src/modules/common/components/checkbox/index.tsx b/apps/suman-bosna/src/modules/common/components/checkbox/index.tsx index 9f93f9a..acdc964 100644 --- a/apps/suman-bosna/src/modules/common/components/checkbox/index.tsx +++ b/apps/suman-bosna/src/modules/common/components/checkbox/index.tsx @@ -19,7 +19,7 @@ const CheckboxWithLabel: React.FC = ({ return (
    = ({ /> diff --git a/apps/suman-bosna/src/modules/common/components/filter-radio-group/index.tsx b/apps/suman-bosna/src/modules/common/components/filter-radio-group/index.tsx index 9a931a6..b78df41 100644 --- a/apps/suman-bosna/src/modules/common/components/filter-radio-group/index.tsx +++ b/apps/suman-bosna/src/modules/common/components/filter-radio-group/index.tsx @@ -1,6 +1,5 @@ "use client" -import { Label } from "@/components/ui/label" import { cn } from "@/lib/utils" type FilterRadioGroupProps = { @@ -22,39 +21,46 @@ const FilterRadioGroup = ({ "data-testid": dataTestId, }: FilterRadioGroupProps) => { return ( -
    - - {title} - -
    +
    + {title} +
    {items?.map((item) => { const isSelected = item.value === value return ( ) })}
    -
    + ) } diff --git a/apps/suman-bosna/src/modules/common/components/input/index.tsx b/apps/suman-bosna/src/modules/common/components/input/index.tsx index 827e64c..2135deb 100644 --- a/apps/suman-bosna/src/modules/common/components/input/index.tsx +++ b/apps/suman-bosna/src/modules/common/components/input/index.tsx @@ -36,22 +36,22 @@ const Input = React.forwardRef( return (
    {topLabel && ( - + )} -
    +