design upgrade

This commit is contained in:
Nermin Karic
2026-11-23 00:59:47 +01:00
parent 9e84140474
commit ada6fd857c
198 changed files with 6626 additions and 2539 deletions

View File

@@ -1,3 +1,4 @@
import SectionHeading from "@modules/account/components/section-heading"
import { Metadata } from "next"
import { notFound } from "next/navigation"
@@ -8,7 +9,7 @@ import { retrieveCustomer } from "@lib/data/customer"
export const metadata: Metadata = {
title: "Addresses",
description: "View your addresses",
description: "Pregled vaših adresa.",
}
export default async function Addresses(props: {
@@ -25,13 +26,10 @@ export default async function Addresses(props: {
return (
<div className="w-full" data-testid="addresses-page-wrapper">
<div className="mb-8 flex flex-col gap-y-4">
<h1 className="text-2xl-semi">Shipping Addresses</h1>
<p className="text-base-regular">
View and update your shipping addresses, you can add as many as you
like. Saving your addresses will make them available during checkout.
</p>
</div>
<SectionHeading
title="Adrese za dostavu"
description="Sačuvane adrese nude se automatski pri plaćanju, pa naručujete brže."
/>
<AddressBook customer={customer} region={region} />
</div>
)

View File

@@ -2,7 +2,7 @@ import Spinner from "@modules/common/icons/spinner"
export default function Loading() {
return (
<div className="flex items-center justify-center w-full h-full text-ui-fg-base">
<div className="flex items-center justify-center w-full h-full text-foreground">
<Spinner size={36} />
</div>
)

View File

@@ -1,14 +1,14 @@
import SectionHeading from "@modules/account/components/section-heading"
import { Metadata } from "next"
import OrderOverview from "@modules/account/components/order-overview"
import { notFound } from "next/navigation"
import { listOrders } from "@lib/data/orders"
import Divider from "@modules/common/components/divider"
import TransferRequestForm from "@modules/account/components/transfer-request-form"
export const metadata: Metadata = {
title: "Orders",
description: "Overview of your previous orders.",
title: "Narudžbe",
description: "Pregled vaših prethodnih narudžbi.",
}
export default async function Orders() {
@@ -20,16 +20,12 @@ export default async function Orders() {
return (
<div className="w-full" data-testid="orders-page-wrapper">
<div className="mb-8 flex flex-col gap-y-4">
<h1 className="text-2xl-semi">Orders</h1>
<p className="text-base-regular">
View your previous orders and their status. You can also create
returns or exchanges for your orders if needed.
</p>
</div>
<div>
<OrderOverview orders={orders} />
<Divider className="mb-8 mt-8" />
<SectionHeading
title="Narudžbe"
description="Pregled vaših narudžbi, statusa i isporuka."
/>
<OrderOverview orders={orders} />
<div className="mt-14 rounded-2xl bg-muted p-6 sm:p-8">
<TransferRequestForm />
</div>
</div>

View File

@@ -6,8 +6,8 @@ import { retrieveCustomer } from "@lib/data/customer"
import { listOrders } from "@lib/data/orders"
export const metadata: Metadata = {
title: "Account",
description: "Overview of your account activity.",
title: "Moj račun",
description: "Pregled aktivnosti na vašem računu.",
}
export default async function OverviewTemplate() {

View File

@@ -1,3 +1,4 @@
import SectionHeading from "@modules/account/components/section-heading"
import { Metadata } from "next"
import ProfilePhone from "@modules/account//components/profile-phone"
@@ -10,7 +11,7 @@ import { retrieveCustomer } from "@lib/data/customer"
export const metadata: Metadata = {
title: "Profile",
description: "View and edit your Medusa Store profile.",
description: "Pregled i izmjena vašeg profila.",
}
export default async function Profile() {
@@ -23,29 +24,19 @@ export default async function Profile() {
return (
<div className="w-full" data-testid="profile-page-wrapper">
<div className="mb-8 flex flex-col gap-y-4">
<h1 className="text-2xl-semi">Profile</h1>
<p className="text-base-regular">
View and update your profile information, including your name, email,
and phone number. You can also update your billing address, or change
your password.
</p>
</div>
<div className="flex flex-col gap-y-8 w-full">
<SectionHeading
title="Profil"
description="Ime, email, telefon i adresa za račun koje koristimo za vaše narudžbe."
/>
<div className="flex w-full flex-col divide-y divide-border/70 border-y border-border/70">
<ProfileName customer={customer} />
<Divider />
<ProfileEmail customer={customer} />
<Divider />
<ProfilePhone customer={customer} />
<Divider />
{/* <ProfilePassword customer={customer} />
<Divider /> */}
{/* <ProfilePassword customer={customer} /> */}
<ProfileBillingAddress customer={customer} regions={regions} />
</div>
</div>
)
}
const Divider = () => {
return <div className="w-full h-px bg-gray-200" />
}

View File

@@ -3,8 +3,8 @@ import { Metadata } from "next"
import LoginTemplate from "@modules/account/templates/login-template"
export const metadata: Metadata = {
title: "Sign in",
description: "Sign in to your Medusa Store account.",
title: "Prijava",
description: "Prijavite se na svoj Suman račun.",
}
export default function Login() {

View File

@@ -2,7 +2,7 @@ import Spinner from "@modules/common/icons/spinner"
export default function Loading() {
return (
<div className="flex items-center justify-center w-full h-full text-ui-fg-base">
<div className="flex items-center justify-center w-full h-full text-foreground">
<Spinner size={36} />
</div>
)

View File

@@ -4,14 +4,14 @@ import InteractiveLink from "@modules/common/components/interactive-link"
export const metadata: Metadata = {
title: "404",
description: "Something went wrong",
description: "Nešto nije u redu.",
}
export default function NotFound() {
return (
<div className="flex flex-col items-center justify-center min-h-[calc(100vh-64px)]">
<h1 className="text-2xl-semi text-ui-fg-base">Page not found</h1>
<p className="text-small-regular text-ui-fg-base">
<h1 className="font-display text-2xl text-foreground">Page not found</h1>
<p className="text-sm text-foreground">
The cart you tried to access does not exist. Clear your cookies and try
again.
</p>

View File

@@ -5,8 +5,8 @@ import { Metadata } from "next"
import { notFound } from "next/navigation"
export const metadata: Metadata = {
title: "Cart",
description: "View your cart",
title: "Korpa",
description: "Pregled vaše korpe.",
}
export default async function Cart() {

View File

@@ -22,12 +22,12 @@ export async function generateMetadata(props: Props): Promise<Metadata> {
try {
const productCategory = await getCategoryByHandle(params.category)
const title = productCategory.name + " | Medusa Store"
const title = productCategory.name
const description = productCategory.description ?? `${title} category.`
return {
title: `${title} | Medusa Store`,
title: `${title} | Suman d.o.o.`,
description,
alternates: {
canonical: `${params.category.join("/")}`,

View File

@@ -26,7 +26,7 @@ export async function generateMetadata(props: Props): Promise<Metadata> {
}
const metadata = {
title: `${collection.title} | Medusa Store`,
title: `${collection.title} | Suman d.o.o.`,
description: `${collection.title} collection`,
} as Metadata

View File

@@ -1,24 +1,79 @@
import { Metadata } from "next"
import { STORE_NAME } from "@lib/util/site"
import { PlaceholderNotice, PolicyPage } from "@modules/policies/templates"
import LocalizedClientLink from "@modules/common/components/localized-client-link"
import footerConfig from "@/config/footer.json"
export const dynamic = "force-static"
export const revalidate = 60
export const metadata: Metadata = {
title: "Contact",
description: `How to contact ${STORE_NAME}.`,
title: "Kontakt",
description: `Kontakt i upiti za ${STORE_NAME}: telefon, email i adresa u Gračanici.`,
}
export default function ContactPage() {
const { phone, email, address } = footerConfig.contact
const channels = [
{ label: "Telefon", value: phone, href: `tel:${phone.replace(/[^\d+]/g, "")}`, note: "Radnim danima" },
{ label: "Email", value: email, href: `mailto:${email}`, note: "Odgovor u roku od jednog radnog dana" },
{ label: "Proizvodnja i lager", value: address, href: null, note: "Lično preuzimanje narudžbi" },
]
return (
<PolicyPage title="Contact">
<PlaceholderNotice />
<p>
Questions about an order, shipping or returns? Contact {STORE_NAME}{" "}
customer service and include your order number.
</p>
</PolicyPage>
<div className="content-container pb-24 sm:pb-32" data-testid="policy-page">
<header className="pt-14 sm:pt-20 pb-12 sm:pb-16 text-center">
<p className="eyebrow">Kontakt</p>
<h1 className="display-heading mt-5 text-4xl sm:text-6xl text-foreground">Razgovarajmo</h1>
<p className="mx-auto mt-5 max-w-xl text-sm sm:text-base text-muted-foreground leading-relaxed">
Pitanje o narudžbi, dostavi ili opremanju terase? Javite se direktno proizvođaču.
</p>
</header>
<div className="grid grid-cols-1 md:grid-cols-3 rounded-2xl border border-border/80 divide-y md:divide-y-0 md:divide-x divide-border/80">
{channels.map((c) => (
<div key={c.label} className="flex flex-col justify-between gap-10 p-7 sm:p-9">
<p className="eyebrow text-muted-foreground">{c.label}</p>
<div>
{c.href ? (
<a href={c.href} className="font-display text-2xl text-foreground transition-colors hover:text-primary">
{c.value}
</a>
) : (
<p className="font-display text-2xl text-foreground">{c.value}</p>
)}
<p className="mt-2 text-sm text-muted-foreground">{c.note}</p>
</div>
</div>
))}
</div>
<section className="mt-16 sm:mt-24 grid grid-cols-1 lg:grid-cols-12 gap-8 border-t border-border/70 pt-12">
<p className="lg:col-span-4 eyebrow text-muted-foreground">Upiti za ponudu</p>
<div className="lg:col-span-8">
<h2 className="display-heading text-3xl sm:text-4xl text-foreground">
Pergole i tende izrađujemo po mjeri
</h2>
<p className="mt-4 max-w-xl text-sm sm:text-base text-muted-foreground leading-relaxed">
Na stranici svakog proizvoda možete poslati upit s odabranim opcijama. Naš tim dolazi na mjerenje i
priprema preciznu ponudu.
</p>
<div className="mt-7 flex flex-col sm:flex-row gap-3">
<LocalizedClientLink
href="/categories/pergole-i-bioklimatske-tende"
className="inline-flex h-11 items-center justify-center rounded-md bg-primary px-6 text-sm text-primary-foreground transition-colors hover:bg-primary/90"
>
Pergole
</LocalizedClientLink>
<LocalizedClientLink
href="/categories/tende"
className="inline-flex h-11 items-center justify-center rounded-md border border-border px-6 text-sm text-foreground transition-colors hover:bg-muted"
>
Tende
</LocalizedClientLink>
</div>
</div>
</section>
</div>
)
}

View File

@@ -1,20 +1,34 @@
import { Metadata } from "next"
import InteractiveLink from "@modules/common/components/interactive-link"
import LocalizedClientLink from "@modules/common/components/localized-client-link"
export const metadata: Metadata = {
title: "404",
description: "Something went wrong",
description: "Stranica nije pronađena.",
}
export default function NotFound() {
return (
<div className="flex flex-col gap-4 items-center justify-center min-h-[calc(100vh-64px)]">
<h1 className="text-2xl-semi text-ui-fg-base">Page not found</h1>
<p className="text-small-regular text-ui-fg-base">
The page you tried to access does not exist.
<div className="content-container flex min-h-[calc(100vh-64px)] flex-col items-center justify-center py-24 text-center">
<p className="eyebrow">Greška 404</p>
<h1 className="display-heading mt-5 text-4xl sm:text-6xl text-foreground">Stranica nije pronađena</h1>
<p className="mt-5 max-w-md text-sm text-muted-foreground leading-relaxed">
Stranica koju tražite ne postoji ili je premještena.
</p>
<InteractiveLink href="/">Go to frontpage</InteractiveLink>
<div className="mt-8 flex flex-col sm:flex-row gap-3">
<LocalizedClientLink
href="/"
className="inline-flex h-11 items-center justify-center rounded-md bg-primary px-6 text-sm text-primary-foreground transition-colors hover:bg-primary/90"
>
Na početnu
</LocalizedClientLink>
<LocalizedClientLink
href="/store"
className="inline-flex h-11 items-center justify-center rounded-md border border-border px-6 text-sm text-foreground transition-colors hover:bg-muted"
>
Katalog proizvoda
</LocalizedClientLink>
</div>
</div>
)
}

View File

@@ -7,8 +7,8 @@ type Props = {
params: Promise<{ id: string }>
}
export const metadata: Metadata = {
title: "Order Confirmed",
description: "You purchase was successful",
title: "Narudžba potvrđena",
description: "Vaša narudžba je uspješno zaprimljena.",
}
export default async function OrderConfirmedPage(props: Props) {

View File

@@ -1,12 +1,12 @@
import { Metadata } from "next"
import Hero from "@modules/home/components/hero"
import PartnersTicker from "@modules/home/components/partners-ticker"
import ProductShowcase from "@modules/home/components/product-showcase"
import MissionSection from "@modules/home/components/mission-section"
import CtaBanner from "@modules/home/components/cta-banner"
import LatestNews from "@modules/home/components/latest-news"
import FaqSection from "@modules/home/components/faq-section"
import LandingHero from "@modules/home/components/landing/hero"
import LandingMission from "@modules/home/components/landing/mission"
import LandingMethod from "@modules/home/components/landing/method"
import LandingProducts from "@modules/home/components/landing/products"
import LandingStats from "@modules/home/components/landing/stats"
import LandingImpact from "@modules/home/components/landing/impact"
import LandingFaq from "@modules/home/components/landing/faq"
import { listCollections } from "@lib/data/collections"
import { getRegion, listRegions } from "@lib/data/regions"
import { toJsonLd } from "@lib/util/product-structured-data"
@@ -94,13 +94,13 @@ export default async function Home(props: {
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: toJsonLd(structuredData) }}
/>
<Hero />
<PartnersTicker />
<ProductShowcase />
<MissionSection />
<CtaBanner />
<LatestNews />
<FaqSection />
<LandingHero />
<LandingMission />
<LandingMethod />
<LandingProducts />
<LandingStats />
<LandingImpact />
<LandingFaq />
</>
)
}

View File

@@ -7,22 +7,22 @@ export const dynamic = "force-static"
export const revalidate = 60
export const metadata: Metadata = {
title: "Privacy policy",
description: `How ${STORE_NAME} collects and uses personal data.`,
title: "Politika privatnosti",
description: `Kako ${STORE_NAME} prikuplja i koristi lične podatke.`,
}
export default function PrivacyPage() {
return (
<PolicyPage title="Privacy policy">
<PolicyPage title="Politika privatnosti">
<PlaceholderNotice />
<p>
{STORE_NAME} collects the information you provide at checkout, such as
your name, email address and shipping address, to process and deliver
your order.
{STORE_NAME} prikuplja podatke koje unesete prilikom narudžbe, poput
imena, email adrese i adrese dostave, kako bi obradio i isporučio vašu
narudžbu.
</p>
<p>
Payment details are handled by our payment provider and are not stored
by the store. Cookies are used to keep your cart and sign-in session.
Podatke o plaćanju obrađuje naš procesor plaćanja i trgovina ih ne
čuva. Kolačići se koriste za čuvanje korpe i prijave na račun.
</p>
</PolicyPage>
)

View File

@@ -7,8 +7,8 @@ export const dynamic = "force-static"
export const revalidate = 60
export const metadata: Metadata = {
title: "Return policy",
description: "How to return items and get a refund.",
title: "Povrat robe",
description: "Kako vratiti proizvod i dobiti povrat novca.",
}
export default async function ReturnsPage(props: {
@@ -18,17 +18,17 @@ export default async function ReturnsPage(props: {
const { current } = await getStorePolicies(countryCode)
return (
<PolicyPage title="Return policy">
<PolicyPage title="Povrat robe">
{current ? (
<>
<p>
You can return items within {current.returnWindowDays} days of
delivery. Items are returned by mail.
Proizvode možete vratiti u roku od {current.returnWindowDays} dana od
isporuke. Povrat se šalje poštom.
</p>
<p>
{current.freeReturns
? "Return shipping is free."
: "Return shipping costs are paid by the customer."}
? "Troškove povrata snosimo mi."
: "Troškove povrata snosi kupac."}
</p>
</>
) : (

View File

@@ -42,22 +42,22 @@ export default async function SearchPage(props: Props) {
return (
<div className="content-container py-6" data-testid="search-container">
<h1 className="text-2xl-semi mb-6">
<h1 className="font-display text-2xl mb-6">
{query ? `Search results for "${query}"` : "Search"}
</h1>
<SearchForm countryCode={countryCode} defaultValue={query} className="mb-8 max-w-xl" />
{query && (
<p className="text-small-regular text-ui-fg-subtle mb-6">
<p className="text-sm text-muted-foreground mb-6">
{response.count} {response.count === 1 ? "product" : "products"} found
</p>
)}
{query && response.products.length === 0 ? (
<p className="text-ui-fg-subtle">
<p className="text-muted-foreground">
No products match your search. Try a different keyword.
</p>
) : (
<ul
className="grid grid-cols-2 w-full small:grid-cols-3 medium:grid-cols-4 gap-x-6 gap-y-8"
className="grid grid-cols-2 w-full lg:grid-cols-3 xl:grid-cols-4 gap-x-6 gap-y-8"
data-testid="search-results"
>
{response.products.map((product) => (

View File

@@ -11,8 +11,8 @@ export const dynamic = "force-static"
export const revalidate = 60
export const metadata: Metadata = {
title: "Shipping information",
description: "Shipping rates and delivery times.",
title: "Dostava",
description: "Cijene i rokovi dostave.",
}
export default async function ShippingPage(props: {
@@ -22,16 +22,16 @@ export default async function ShippingPage(props: {
const { current, currencyCode } = await getStorePolicies(countryCode)
return (
<PolicyPage title="Shipping information">
<PolicyPage title="Dostava">
{current ? (
<>
<p>
Orders to {countryCode.toUpperCase()} ship with the following rates
and delivery times.
Za narudžbe u {countryCode.toUpperCase()} važe sljedeće cijene i rokovi
dostave.
</p>
<ShippingSummary policies={current} currencyCode={currencyCode} />
<p className="text-ui-fg-subtle">
Available shipping methods and final costs are shown at checkout.
<p className="text-muted-foreground">
Dostupni načini dostave i konačna cijena prikazuju se u koraku plaćanja.
</p>
</>
) : (

View File

@@ -1,12 +1,16 @@
import { Metadata } from "next"
import { notFound } from "next/navigation"
import { listProducts } from "@lib/data/products"
import { getRegion } from "@lib/data/regions"
import { getSaleInfo, SaleInfo } from "@lib/util/sale-scenario"
import CatalogHeader from "@modules/store/components/catalog-header"
import StoreTemplate from "@modules/store/templates"
export const metadata: Metadata = {
title: "Store",
description: "Explore all of our products.",
title: "Katalog proizvoda",
description:
"Profesionalni suncobrani, bioklimatske pergole i tende iz vlastite proizvodnje.",
}
export default async function StorePage(props: {
@@ -19,5 +23,29 @@ export default async function StorePage(props: {
notFound()
}
return <StoreTemplate currencyCode={region.currency_code} />
// Search hits carry no metadata, so resolve each product's sale scenario here
const {
response: { products },
} = await listProducts({
countryCode,
queryParams: { limit: 100, fields: "handle,+metadata" },
})
const saleByHandle: Record<string, SaleInfo> = Object.fromEntries(
products
.filter((p) => p.handle)
.map((p) => [p.handle as string, getSaleInfo(p.metadata)])
)
return (
<div className="content-container pb-20 sm:pb-28" data-testid="category-container">
<CatalogHeader
kicker="Katalog"
title="Sistemi za zaštitu od sunca"
description="Suncobrani koje možete konfigurisati i naručiti online, te pergole i tende po mjeri vašeg prostora."
activeHandle={null}
titleTestId="store-page-title"
/>
<StoreTemplate currencyCode={region.currency_code} saleByHandle={saleByHandle} />
</div>
)
}

View File

@@ -7,22 +7,22 @@ export const dynamic = "force-static"
export const revalidate = 60
export const metadata: Metadata = {
title: "Terms of service",
description: `Terms that apply to purchases from ${STORE_NAME}.`,
title: "Uslovi poslovanja",
description: `Uslovi koji važe za kupovinu kod ${STORE_NAME}.`,
}
export default function TermsPage() {
return (
<PolicyPage title="Terms of service">
<PolicyPage title="Uslovi poslovanja">
<PlaceholderNotice />
<p>
By placing an order with {STORE_NAME} you agree to these terms. Prices,
product availability and shipping options are shown on the product
pages and at checkout, and may change without notice.
Narudžbom kod {STORE_NAME} prihvatate ove uslove. Cijene, dostupnost
proizvoda i opcije dostave prikazane su na stranicama proizvoda i u
koraku plaćanja, i mogu se mijenjati bez prethodne najave.
</p>
<p>
Orders are confirmed by email once payment is received. Returns and
refunds are handled according to our return policy.
Narudžbe potvrđujemo emailom nakon prijema uplate. Povrat robe i novca
rješavamo prema pravilima o povratu.
</p>
</PolicyPage>
)

View File

@@ -4,8 +4,8 @@ import { Suspense } from "react"
import VerifyAccount from "@modules/account/components/verify-account"
export const metadata: Metadata = {
title: "Verify your email",
description: "Verify your email address to complete your registration.",
title: "Potvrda email adrese",
description: "Potvrdite email adresu da završite registraciju.",
}
export default function VerifyAccountPage() {
@@ -13,7 +13,7 @@ export default function VerifyAccountPage() {
<div className="w-full flex justify-center px-8 py-12">
<Suspense
fallback={
<p className="text-base-regular text-ui-fg-base">
<p className="text-base text-foreground">
Verifying your email...
</p>
}