design upgrade
This commit is contained in:
@@ -36,7 +36,7 @@ const AddressSelect = ({
|
||||
<Listbox onChange={handleSelect} value={selectedAddress?.id}>
|
||||
<div className="relative">
|
||||
<Listbox.Button
|
||||
className="relative w-full flex justify-between items-center px-4 py-[10px] text-left bg-white cursor-default focus:outline-none border rounded-rounded focus-visible:ring-2 focus-visible:ring-opacity-75 focus-visible:ring-white focus-visible:ring-offset-gray-300 focus-visible:ring-offset-2 focus-visible:border-gray-300 text-base-regular"
|
||||
className="relative w-full flex justify-between items-center px-4 py-[10px] text-left bg-white cursor-default focus:outline-none border rounded-rounded focus-visible:ring-2 focus-visible:ring-opacity-75 focus-visible:ring-white focus-visible:ring-offset-gray-300 focus-visible:ring-offset-2 focus-visible:border-gray-300 text-base"
|
||||
data-testid="shipping-address-select"
|
||||
>
|
||||
{({ open }) => (
|
||||
@@ -44,7 +44,7 @@ const AddressSelect = ({
|
||||
<span className="block truncate">
|
||||
{selectedAddress
|
||||
? selectedAddress.address_1
|
||||
: "Choose an address"}
|
||||
: "Odaberite adresu"}
|
||||
</span>
|
||||
<ChevronsUpDown
|
||||
className={clx("h-4 w-4 transition-transform duration-200", {
|
||||
@@ -61,7 +61,7 @@ const AddressSelect = ({
|
||||
leaveTo="opacity-0"
|
||||
>
|
||||
<Listbox.Options
|
||||
className="absolute z-20 w-full overflow-auto text-small-regular bg-white border border-top-0 max-h-60 focus:outline-none sm:text-sm"
|
||||
className="absolute z-20 w-full overflow-auto text-sm bg-white border border-top-0 max-h-60 focus:outline-none sm:text-sm"
|
||||
data-testid="shipping-address-options"
|
||||
>
|
||||
{addresses.map((address) => {
|
||||
@@ -78,15 +78,15 @@ const AddressSelect = ({
|
||||
data-testid="shipping-address-radio"
|
||||
/>
|
||||
<div className="flex flex-col">
|
||||
<span className="text-left text-base-semi">
|
||||
<span className="text-left text-base font-semibold">
|
||||
{address.first_name} {address.last_name}
|
||||
</span>
|
||||
{address.company && (
|
||||
<span className="text-small-regular text-ui-fg-base">
|
||||
<span className="text-sm text-foreground">
|
||||
{address.company}
|
||||
</span>
|
||||
)}
|
||||
<div className="flex flex-col text-left text-base-regular mt-2">
|
||||
<div className="flex flex-col text-left text-base mt-2">
|
||||
<span>
|
||||
{address.address_1}
|
||||
{address.address_2 && (
|
||||
|
||||
@@ -44,19 +44,19 @@ const Addresses = ({
|
||||
<div className="flex flex-row items-center justify-between mb-6">
|
||||
<Heading
|
||||
level="h2"
|
||||
className="flex flex-row text-3xl-regular gap-x-2 items-baseline"
|
||||
className="flex flex-row font-display text-3xl gap-x-2 items-baseline"
|
||||
>
|
||||
Shipping Address
|
||||
Adresa dostave
|
||||
{!isOpen && <CheckCircleSolid />}
|
||||
</Heading>
|
||||
{!isOpen && cart?.shipping_address && (
|
||||
<Text>
|
||||
<button
|
||||
onClick={handleEdit}
|
||||
className="text-ui-fg-interactive hover:text-ui-fg-interactive-hover"
|
||||
className="text-primary hover:text-primary/80"
|
||||
data-testid="edit-address-button"
|
||||
>
|
||||
Edit
|
||||
Izmijeni
|
||||
</button>
|
||||
</Text>
|
||||
)}
|
||||
@@ -75,23 +75,23 @@ const Addresses = ({
|
||||
<div>
|
||||
<Heading
|
||||
level="h2"
|
||||
className="text-3xl-regular gap-x-4 pb-6 pt-8"
|
||||
className="font-display text-3xl gap-x-4 pb-6 pt-8"
|
||||
>
|
||||
Billing address
|
||||
Adresa za račun
|
||||
</Heading>
|
||||
|
||||
<BillingAddress cart={cart} />
|
||||
</div>
|
||||
)}
|
||||
<SubmitButton className="mt-6" data-testid="submit-address-button">
|
||||
Continue to delivery
|
||||
Nastavite na dostavu
|
||||
</SubmitButton>
|
||||
<ErrorMessage error={message} data-testid="address-error-message" />
|
||||
</div>
|
||||
</form>
|
||||
) : (
|
||||
<div>
|
||||
<div className="text-small-regular">
|
||||
<div className="text-sm">
|
||||
{cart && cart.shipping_address ? (
|
||||
<div className="flex items-start gap-x-8">
|
||||
<div className="flex items-start gap-x-1 w-full">
|
||||
@@ -99,22 +99,22 @@ const Addresses = ({
|
||||
className="flex flex-col w-1/3"
|
||||
data-testid="shipping-address-summary"
|
||||
>
|
||||
<Text className="txt-medium-plus text-ui-fg-base mb-1">
|
||||
Shipping Address
|
||||
<Text className="text-sm font-medium text-foreground mb-1">
|
||||
Adresa dostave
|
||||
</Text>
|
||||
<Text className="txt-medium text-ui-fg-subtle">
|
||||
<Text className="text-sm text-muted-foreground">
|
||||
{cart.shipping_address.first_name}{" "}
|
||||
{cart.shipping_address.last_name}
|
||||
</Text>
|
||||
<Text className="txt-medium text-ui-fg-subtle">
|
||||
<Text className="text-sm text-muted-foreground">
|
||||
{cart.shipping_address.address_1}{" "}
|
||||
{cart.shipping_address.address_2}
|
||||
</Text>
|
||||
<Text className="txt-medium text-ui-fg-subtle">
|
||||
<Text className="text-sm text-muted-foreground">
|
||||
{cart.shipping_address.postal_code},{" "}
|
||||
{cart.shipping_address.city}
|
||||
</Text>
|
||||
<Text className="txt-medium text-ui-fg-subtle">
|
||||
<Text className="text-sm text-muted-foreground">
|
||||
{cart.shipping_address.country_code?.toUpperCase()}
|
||||
</Text>
|
||||
</div>
|
||||
@@ -123,13 +123,13 @@ const Addresses = ({
|
||||
className="flex flex-col w-1/3 "
|
||||
data-testid="shipping-contact-summary"
|
||||
>
|
||||
<Text className="txt-medium-plus text-ui-fg-base mb-1">
|
||||
Contact
|
||||
<Text className="text-sm font-medium text-foreground mb-1">
|
||||
Kontakt
|
||||
</Text>
|
||||
<Text className="txt-medium text-ui-fg-subtle">
|
||||
<Text className="text-sm text-muted-foreground">
|
||||
{cart.shipping_address.phone}
|
||||
</Text>
|
||||
<Text className="txt-medium text-ui-fg-subtle">
|
||||
<Text className="text-sm text-muted-foreground">
|
||||
{cart.email}
|
||||
</Text>
|
||||
</div>
|
||||
@@ -138,29 +138,29 @@ const Addresses = ({
|
||||
className="flex flex-col w-1/3"
|
||||
data-testid="billing-address-summary"
|
||||
>
|
||||
<Text className="txt-medium-plus text-ui-fg-base mb-1">
|
||||
Billing Address
|
||||
<Text className="text-sm font-medium text-foreground mb-1">
|
||||
Adresa za račun
|
||||
</Text>
|
||||
|
||||
{sameAsBilling ? (
|
||||
<Text className="txt-medium text-ui-fg-subtle">
|
||||
Billing and delivery address are the same.
|
||||
<Text className="text-sm text-muted-foreground">
|
||||
Adresa za račun ista je kao adresa dostave.
|
||||
</Text>
|
||||
) : (
|
||||
<>
|
||||
<Text className="txt-medium text-ui-fg-subtle">
|
||||
<Text className="text-sm text-muted-foreground">
|
||||
{cart.billing_address?.first_name}{" "}
|
||||
{cart.billing_address?.last_name}
|
||||
</Text>
|
||||
<Text className="txt-medium text-ui-fg-subtle">
|
||||
<Text className="text-sm text-muted-foreground">
|
||||
{cart.billing_address?.address_1}{" "}
|
||||
{cart.billing_address?.address_2}
|
||||
</Text>
|
||||
<Text className="txt-medium text-ui-fg-subtle">
|
||||
<Text className="text-sm text-muted-foreground">
|
||||
{cart.billing_address?.postal_code},{" "}
|
||||
{cart.billing_address?.city}
|
||||
</Text>
|
||||
<Text className="txt-medium text-ui-fg-subtle">
|
||||
<Text className="text-sm text-muted-foreground">
|
||||
{cart.billing_address?.country_code?.toUpperCase()}
|
||||
</Text>
|
||||
</>
|
||||
|
||||
@@ -31,7 +31,7 @@ const BillingAddress = ({ cart }: { cart: HttpTypes.StoreCart | null }) => {
|
||||
<>
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<Input
|
||||
label="First name"
|
||||
label="Ime"
|
||||
name="billing_address.first_name"
|
||||
autoComplete="given-name"
|
||||
value={formData["billing_address.first_name"]}
|
||||
@@ -40,7 +40,7 @@ const BillingAddress = ({ cart }: { cart: HttpTypes.StoreCart | null }) => {
|
||||
data-testid="billing-first-name-input"
|
||||
/>
|
||||
<Input
|
||||
label="Last name"
|
||||
label="Prezime"
|
||||
name="billing_address.last_name"
|
||||
autoComplete="family-name"
|
||||
value={formData["billing_address.last_name"]}
|
||||
@@ -49,7 +49,7 @@ const BillingAddress = ({ cart }: { cart: HttpTypes.StoreCart | null }) => {
|
||||
data-testid="billing-last-name-input"
|
||||
/>
|
||||
<Input
|
||||
label="Address"
|
||||
label="Adresa"
|
||||
name="billing_address.address_1"
|
||||
autoComplete="address-line1"
|
||||
value={formData["billing_address.address_1"]}
|
||||
@@ -58,7 +58,7 @@ const BillingAddress = ({ cart }: { cart: HttpTypes.StoreCart | null }) => {
|
||||
data-testid="billing-address-input"
|
||||
/>
|
||||
<Input
|
||||
label="Company"
|
||||
label="Firma"
|
||||
name="billing_address.company"
|
||||
value={formData["billing_address.company"]}
|
||||
onChange={handleChange}
|
||||
@@ -66,7 +66,7 @@ const BillingAddress = ({ cart }: { cart: HttpTypes.StoreCart | null }) => {
|
||||
data-testid="billing-company-input"
|
||||
/>
|
||||
<Input
|
||||
label="Postal code"
|
||||
label="Poštanski broj"
|
||||
name="billing_address.postal_code"
|
||||
autoComplete="postal-code"
|
||||
value={formData["billing_address.postal_code"]}
|
||||
@@ -75,7 +75,7 @@ const BillingAddress = ({ cart }: { cart: HttpTypes.StoreCart | null }) => {
|
||||
data-testid="billing-postal-input"
|
||||
/>
|
||||
<Input
|
||||
label="City"
|
||||
label="Grad"
|
||||
name="billing_address.city"
|
||||
autoComplete="address-level2"
|
||||
value={formData["billing_address.city"]}
|
||||
@@ -91,7 +91,7 @@ const BillingAddress = ({ cart }: { cart: HttpTypes.StoreCart | null }) => {
|
||||
data-testid="billing-country-select"
|
||||
/>
|
||||
<Input
|
||||
label="State / Province"
|
||||
label="Kanton / entitet"
|
||||
name="billing_address.province"
|
||||
autoComplete="address-level1"
|
||||
value={formData["billing_address.province"]}
|
||||
@@ -99,7 +99,7 @@ const BillingAddress = ({ cart }: { cart: HttpTypes.StoreCart | null }) => {
|
||||
data-testid="billing-province-input"
|
||||
/>
|
||||
<Input
|
||||
label="Phone"
|
||||
label="Telefon"
|
||||
name="billing_address.phone"
|
||||
autoComplete="tel"
|
||||
value={formData["billing_address.phone"]}
|
||||
|
||||
@@ -10,7 +10,7 @@ const CountrySelect = forwardRef<
|
||||
NativeSelectProps & {
|
||||
region?: HttpTypes.StoreRegion
|
||||
}
|
||||
>(({ placeholder = "Country", region, defaultValue, ...props }, ref) => {
|
||||
>(({ placeholder = "Država", region, defaultValue, ...props }, ref) => {
|
||||
const innerRef = useRef<HTMLSelectElement>(null)
|
||||
|
||||
useImperativeHandle<HTMLSelectElement | null, HTMLSelectElement | null>(
|
||||
|
||||
@@ -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 (
|
||||
<Button disabled size="large" data-testid={dataTestId}>
|
||||
Place order
|
||||
Potvrdi narudžbu
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ const PaymentButton: React.FC<PaymentButtonProps> = ({
|
||||
<ManualTestPaymentButton notReady={notReady} data-testid={dataTestId} />
|
||||
)
|
||||
default:
|
||||
return <Button disabled>Select a payment method</Button>
|
||||
return <Button disabled>Odaberite način plaćanja</Button>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ const StripePaymentButton = ({
|
||||
isLoading={submitting}
|
||||
data-testid={dataTestId}
|
||||
>
|
||||
Place order
|
||||
Potvrdi narudžbu
|
||||
</Button>
|
||||
<ErrorMessage
|
||||
error={errorMessage}
|
||||
@@ -199,7 +199,7 @@ const ManualTestPaymentButton = ({ notReady }: { notReady: boolean }) => {
|
||||
size="large"
|
||||
data-testid="submit-order-button"
|
||||
>
|
||||
Place order
|
||||
Potvrdi narudžbu
|
||||
</Button>
|
||||
<ErrorMessage
|
||||
error={errorMessage}
|
||||
|
||||
@@ -33,9 +33,9 @@ const PaymentContainer: React.FC<PaymentContainerProps> = ({
|
||||
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<PaymentContainerProps> = ({
|
||||
<div className="flex items-center justify-between ">
|
||||
<div className="flex items-center gap-x-4">
|
||||
<Radio checked={selectedPaymentOptionId === paymentProviderId} />
|
||||
<Text className="text-base-regular">
|
||||
<Text className="text-base">
|
||||
{paymentInfo?.title || paymentProviderId}
|
||||
</Text>
|
||||
{isManual(paymentProviderId) && isDevelopment && (
|
||||
<PaymentTest className="hidden small:block" />
|
||||
<PaymentTest className="hidden lg:block" />
|
||||
)}
|
||||
</div>
|
||||
<span className="justify-self-end text-ui-fg-base">
|
||||
<span className="justify-self-end text-foreground">
|
||||
{paymentInfo?.icon}
|
||||
</span>
|
||||
</div>
|
||||
{isManual(paymentProviderId) && isDevelopment && (
|
||||
<PaymentTest className="small:hidden text-[10px]" />
|
||||
<PaymentTest className="lg:hidden text-[10px]" />
|
||||
)}
|
||||
{children}
|
||||
</RadioGroupOption>
|
||||
@@ -85,8 +85,8 @@ export const StripePaymentContainer = ({
|
||||
{selectedPaymentOptionId === paymentProviderId &&
|
||||
(stripeReady ? (
|
||||
<div className="my-4 transition-all duration-150 ease-in-out">
|
||||
<Text className="txt-medium-plus text-ui-fg-base mb-1">
|
||||
Enter your payment details:
|
||||
<Text className="text-sm font-medium text-foreground mb-1">
|
||||
Unesite podatke za plaćanje:
|
||||
</Text>
|
||||
<PaymentElement
|
||||
options={{ layout: "accordion" }}
|
||||
@@ -102,7 +102,7 @@ export const StripePaymentContainer = ({
|
||||
setPaymentComplete(false)
|
||||
setError(
|
||||
getPaymentErrorMessage(e.error) ??
|
||||
"Could not load the payment methods."
|
||||
"Načini plaćanja se nisu mogli učitati."
|
||||
)
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Badge } from "@modules/common/components/ui"
|
||||
const PaymentTest = ({ className }: { className?: string }) => {
|
||||
return (
|
||||
<Badge color="orange" className={className}>
|
||||
<span className="font-semibold">Attention:</span> For testing purposes
|
||||
<span className="font-semibold">Pažnja:</span> For testing purposes
|
||||
only.
|
||||
</Badge>
|
||||
)
|
||||
|
||||
@@ -116,24 +116,24 @@ const Payment = ({
|
||||
<Heading
|
||||
level="h2"
|
||||
className={clx(
|
||||
"flex flex-row text-3xl-regular gap-x-2 items-baseline",
|
||||
"flex flex-row font-display text-3xl gap-x-2 items-baseline",
|
||||
{
|
||||
"opacity-50 pointer-events-none select-none":
|
||||
!isOpen && !paymentReady,
|
||||
}
|
||||
)}
|
||||
>
|
||||
Payment
|
||||
Plaćanje
|
||||
{!isOpen && paymentReady && <CheckCircleSolid />}
|
||||
</Heading>
|
||||
{!isOpen && paymentReady && (
|
||||
<Text>
|
||||
<button
|
||||
onClick={handleEdit}
|
||||
className="text-ui-fg-interactive hover:text-ui-fg-interactive-hover"
|
||||
className="text-primary hover:text-primary/80"
|
||||
data-testid="edit-payment-button"
|
||||
>
|
||||
Edit
|
||||
Izmijeni
|
||||
</button>
|
||||
</Text>
|
||||
)}
|
||||
@@ -169,14 +169,14 @@ const Payment = ({
|
||||
|
||||
{paidByGiftcard && (
|
||||
<div className="flex flex-col w-1/3">
|
||||
<Text className="txt-medium-plus text-ui-fg-base mb-1">
|
||||
Payment method
|
||||
<Text className="text-sm font-medium text-foreground mb-1">
|
||||
Način plaćanja
|
||||
</Text>
|
||||
<Text
|
||||
className="txt-medium text-ui-fg-subtle"
|
||||
className="text-sm text-muted-foreground"
|
||||
data-testid="payment-method-summary"
|
||||
>
|
||||
Gift card
|
||||
Poklon kartica
|
||||
</Text>
|
||||
</div>
|
||||
)}
|
||||
@@ -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"}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -207,11 +207,11 @@ const Payment = ({
|
||||
{cart && paymentReady && activeSession ? (
|
||||
<div className="flex items-start gap-x-1 w-full">
|
||||
<div className="flex flex-col w-1/3">
|
||||
<Text className="txt-medium-plus text-ui-fg-base mb-1">
|
||||
Payment method
|
||||
<Text className="text-sm font-medium text-foreground mb-1">
|
||||
Način plaćanja
|
||||
</Text>
|
||||
<Text
|
||||
className="txt-medium text-ui-fg-subtle"
|
||||
className="text-sm text-muted-foreground"
|
||||
data-testid="payment-method-summary"
|
||||
>
|
||||
{getPaymentInfo(activeSession?.provider_id)?.title ||
|
||||
@@ -219,14 +219,14 @@ const Payment = ({
|
||||
</Text>
|
||||
</div>
|
||||
<div className="flex flex-col w-1/3">
|
||||
<Text className="txt-medium-plus text-ui-fg-base mb-1">
|
||||
Payment details
|
||||
<Text className="text-sm font-medium text-foreground mb-1">
|
||||
Podaci o plaćanju
|
||||
</Text>
|
||||
<div
|
||||
className="flex gap-2 txt-medium text-ui-fg-subtle items-center"
|
||||
className="flex gap-2 text-sm text-muted-foreground items-center"
|
||||
data-testid="payment-details-summary"
|
||||
>
|
||||
<Container className="flex items-center h-7 w-fit p-2 bg-ui-button-neutral-hover">
|
||||
<Container className="flex items-center h-7 w-fit p-2 bg-muted">
|
||||
{getPaymentInfo(selectedPaymentMethod)?.icon || (
|
||||
<CreditCard />
|
||||
)}
|
||||
@@ -237,14 +237,14 @@ const Payment = ({
|
||||
</div>
|
||||
) : paidByGiftcard ? (
|
||||
<div className="flex flex-col w-1/3">
|
||||
<Text className="txt-medium-plus text-ui-fg-base mb-1">
|
||||
Payment method
|
||||
<Text className="text-sm font-medium text-foreground mb-1">
|
||||
Način plaćanja
|
||||
</Text>
|
||||
<Text
|
||||
className="txt-medium text-ui-fg-subtle"
|
||||
className="text-sm text-muted-foreground"
|
||||
data-testid="payment-method-summary"
|
||||
>
|
||||
Gift card
|
||||
Poklon kartica
|
||||
</Text>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
@@ -26,24 +26,23 @@ const Review = ({ cart }: { cart: HttpTypes.StoreCart }) => {
|
||||
<Heading
|
||||
level="h2"
|
||||
className={clx(
|
||||
"flex flex-row text-3xl-regular gap-x-2 items-baseline",
|
||||
"flex flex-row font-display text-3xl gap-x-2 items-baseline",
|
||||
{
|
||||
"opacity-50 pointer-events-none select-none": !isOpen,
|
||||
}
|
||||
)}
|
||||
>
|
||||
Review
|
||||
Pregled
|
||||
</Heading>
|
||||
</div>
|
||||
{isOpen && previousStepsCompleted && (
|
||||
<>
|
||||
<div className="flex items-start gap-x-1 w-full mb-6">
|
||||
<div className="w-full">
|
||||
<Text className="txt-medium-plus text-ui-fg-base mb-1">
|
||||
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.
|
||||
<Text className="text-sm font-medium text-foreground mb-1">
|
||||
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.
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -108,7 +108,7 @@ const ShippingAddress = ({
|
||||
<>
|
||||
{customer && (addressesInRegion?.length || 0) > 0 && (
|
||||
<Container className="mb-6 flex flex-col gap-y-4 p-5">
|
||||
<p className="text-small-regular">
|
||||
<p className="text-sm">
|
||||
{`Hi ${customer.first_name}, do you want to use one of your saved addresses?`}
|
||||
</p>
|
||||
<AddressSelect
|
||||
@@ -124,7 +124,7 @@ const ShippingAddress = ({
|
||||
)}
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<Input
|
||||
label="First name"
|
||||
label="Ime"
|
||||
name="shipping_address.first_name"
|
||||
autoComplete="given-name"
|
||||
value={formData["shipping_address.first_name"]}
|
||||
@@ -133,7 +133,7 @@ const ShippingAddress = ({
|
||||
data-testid="shipping-first-name-input"
|
||||
/>
|
||||
<Input
|
||||
label="Last name"
|
||||
label="Prezime"
|
||||
name="shipping_address.last_name"
|
||||
autoComplete="family-name"
|
||||
value={formData["shipping_address.last_name"]}
|
||||
@@ -142,7 +142,7 @@ const ShippingAddress = ({
|
||||
data-testid="shipping-last-name-input"
|
||||
/>
|
||||
<Input
|
||||
label="Address"
|
||||
label="Adresa"
|
||||
name="shipping_address.address_1"
|
||||
autoComplete="address-line1"
|
||||
value={formData["shipping_address.address_1"]}
|
||||
@@ -151,7 +151,7 @@ const ShippingAddress = ({
|
||||
data-testid="shipping-address-input"
|
||||
/>
|
||||
<Input
|
||||
label="Company"
|
||||
label="Firma"
|
||||
name="shipping_address.company"
|
||||
value={formData["shipping_address.company"]}
|
||||
onChange={handleChange}
|
||||
@@ -186,7 +186,7 @@ const ShippingAddress = ({
|
||||
)}
|
||||
</div>
|
||||
<Input
|
||||
label="Postal code"
|
||||
label="Poštanski broj"
|
||||
name="shipping_address.postal_code"
|
||||
autoComplete="postal-code"
|
||||
value={formData["shipping_address.postal_code"]}
|
||||
@@ -195,7 +195,7 @@ const ShippingAddress = ({
|
||||
data-testid="shipping-postal-code-input"
|
||||
/>
|
||||
<Input
|
||||
label="City"
|
||||
label="Grad"
|
||||
name="shipping_address.city"
|
||||
autoComplete="address-level2"
|
||||
value={formData["shipping_address.city"]}
|
||||
@@ -213,7 +213,7 @@ const ShippingAddress = ({
|
||||
data-testid="shipping-country-select"
|
||||
/>
|
||||
<Input
|
||||
label="State / Province"
|
||||
label="Kanton / entitet"
|
||||
name="shipping_address.province"
|
||||
autoComplete="address-level1"
|
||||
value={formData["shipping_address.province"]}
|
||||
@@ -223,7 +223,7 @@ const ShippingAddress = ({
|
||||
</div>
|
||||
<div className="my-8">
|
||||
<Checkbox
|
||||
label="Billing address same as shipping address"
|
||||
label="Adresa za račun ista je kao adresa dostave"
|
||||
name="same_as_billing"
|
||||
checked={checked}
|
||||
onChange={onChange}
|
||||
@@ -235,7 +235,7 @@ const ShippingAddress = ({
|
||||
label="Email"
|
||||
name="email"
|
||||
type="email"
|
||||
title="Enter a valid email address."
|
||||
title="Unesite ispravnu email adresu."
|
||||
autoComplete="email"
|
||||
value={formData.email}
|
||||
onChange={handleChange}
|
||||
@@ -243,7 +243,7 @@ const ShippingAddress = ({
|
||||
data-testid="shipping-email-input"
|
||||
/>
|
||||
<Input
|
||||
label="Phone"
|
||||
label="Telefon"
|
||||
name="shipping_address.phone"
|
||||
autoComplete="tel"
|
||||
value={formData["shipping_address.phone"]}
|
||||
|
||||
@@ -157,14 +157,14 @@ const Shipping: React.FC<ShippingProps> = ({
|
||||
<Heading
|
||||
level="h2"
|
||||
className={clx(
|
||||
"flex flex-row text-3xl-regular gap-x-2 items-baseline",
|
||||
"flex flex-row font-display text-3xl gap-x-2 items-baseline",
|
||||
{
|
||||
"opacity-50 pointer-events-none select-none":
|
||||
!isOpen && cart.shipping_methods?.length === 0,
|
||||
}
|
||||
)}
|
||||
>
|
||||
Delivery
|
||||
Dostava
|
||||
{!isOpen && (cart.shipping_methods?.length ?? 0) > 0 && (
|
||||
<CheckCircleSolid />
|
||||
)}
|
||||
@@ -176,10 +176,10 @@ const Shipping: React.FC<ShippingProps> = ({
|
||||
<Text>
|
||||
<button
|
||||
onClick={handleEdit}
|
||||
className="text-ui-fg-interactive hover:text-ui-fg-interactive-hover"
|
||||
className="text-primary hover:text-primary/80"
|
||||
data-testid="edit-delivery-button"
|
||||
>
|
||||
Edit
|
||||
Izmijeni
|
||||
</button>
|
||||
</Text>
|
||||
)}
|
||||
@@ -188,11 +188,11 @@ const Shipping: React.FC<ShippingProps> = ({
|
||||
<>
|
||||
<div className="grid">
|
||||
<div className="flex flex-col">
|
||||
<span className="font-medium txt-medium text-ui-fg-base">
|
||||
Shipping method
|
||||
<span className="font-medium text-sm text-foreground">
|
||||
Način dostave
|
||||
</span>
|
||||
<span className="mb-4 text-ui-fg-muted txt-medium">
|
||||
How would you like you order delivered
|
||||
<span className="mb-4 text-muted-foreground text-sm">
|
||||
Kako želite da vam isporučimo narudžbu
|
||||
</span>
|
||||
</div>
|
||||
<div data-testid="delivery-options-container">
|
||||
@@ -214,9 +214,9 @@ const Shipping: React.FC<ShippingProps> = ({
|
||||
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<ShippingProps> = ({
|
||||
<MedusaRadio
|
||||
checked={showPickupOptions === PICKUP_OPTION_ON}
|
||||
/>
|
||||
<span className="text-base-regular">
|
||||
Pick up your order
|
||||
<span className="text-base">
|
||||
Preuzmite narudžbu lično
|
||||
</span>
|
||||
</div>
|
||||
<span className="justify-self-end text-ui-fg-base">
|
||||
<span className="justify-self-end text-foreground">
|
||||
-
|
||||
</span>
|
||||
</Radio>
|
||||
@@ -256,9 +256,9 @@ const Shipping: React.FC<ShippingProps> = ({
|
||||
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<ShippingProps> = ({
|
||||
<MedusaRadio
|
||||
checked={option.id === shippingMethodId}
|
||||
/>
|
||||
<span className="text-base-regular">
|
||||
<span className="text-base">
|
||||
{option.name}
|
||||
</span>
|
||||
</div>
|
||||
<span className="justify-self-end text-ui-fg-base">
|
||||
<span className="justify-self-end text-foreground">
|
||||
{option.price_type === "flat" ? (
|
||||
convertToLocale({
|
||||
amount: option.amount!,
|
||||
@@ -301,11 +301,11 @@ const Shipping: React.FC<ShippingProps> = ({
|
||||
{showPickupOptions === PICKUP_OPTION_ON && (
|
||||
<div className="grid">
|
||||
<div className="flex flex-col">
|
||||
<span className="font-medium txt-medium text-ui-fg-base">
|
||||
Store
|
||||
<span className="font-medium text-sm text-foreground">
|
||||
Prodajno mjesto
|
||||
</span>
|
||||
<span className="mb-4 text-ui-fg-muted txt-medium">
|
||||
Choose a store near you
|
||||
<span className="mb-4 text-muted-foreground text-sm">
|
||||
Odaberite najbliže prodajno mjesto
|
||||
</span>
|
||||
</div>
|
||||
<div data-testid="delivery-options-container">
|
||||
@@ -326,9 +326,9 @@ const Shipping: React.FC<ShippingProps> = ({
|
||||
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<ShippingProps> = ({
|
||||
checked={option.id === shippingMethodId}
|
||||
/>
|
||||
<div className="flex flex-col">
|
||||
<span className="text-base-regular">
|
||||
<span className="text-base">
|
||||
{option.name}
|
||||
</span>
|
||||
<span className="text-base-regular text-ui-fg-muted">
|
||||
<span className="text-base text-muted-foreground">
|
||||
{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<ShippingProps> = ({
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<span className="justify-self-end text-ui-fg-base">
|
||||
<span className="justify-self-end text-foreground">
|
||||
{convertToLocale({
|
||||
amount: option.amount!,
|
||||
currency_code: cart?.currency_code,
|
||||
@@ -379,19 +379,19 @@ const Shipping: React.FC<ShippingProps> = ({
|
||||
disabled={!cart.shipping_methods?.[0]}
|
||||
data-testid="submit-delivery-option-button"
|
||||
>
|
||||
Continue to payment
|
||||
Nastavite na plaćanje
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<div>
|
||||
<div className="text-small-regular">
|
||||
<div className="text-sm">
|
||||
{cart && (cart.shipping_methods?.length ?? 0) > 0 && (
|
||||
<div className="flex flex-col w-1/3">
|
||||
<Text className="txt-medium-plus text-ui-fg-base mb-1">
|
||||
Method
|
||||
<Text className="text-sm font-medium text-foreground mb-1">
|
||||
Način
|
||||
</Text>
|
||||
<Text className="txt-medium text-ui-fg-subtle">
|
||||
<Text className="text-sm text-muted-foreground">
|
||||
{cart.shipping_methods!.at(-1)!.name}{" "}
|
||||
{convertToLocale({
|
||||
amount: cart.shipping_methods!.at(-1)!.amount!,
|
||||
|
||||
Reference in New Issue
Block a user