feat(F-173): completed feature
This commit is contained in:
@@ -140,6 +140,13 @@ export default function CheckoutClient() {
|
||||
if (addr) setForm((f) => ({ ...f, ...addressToForm(addr) }));
|
||||
};
|
||||
|
||||
const selectedShippingMethod = useMemo(
|
||||
() => shippingMethods.find((m) => m.id === shippingMethodId) ?? null,
|
||||
[shippingMethods, shippingMethodId],
|
||||
);
|
||||
const shippingCost = selectedShippingMethod?.baseCostCents ?? 0;
|
||||
const totalCents = subtotalCents + shippingCost;
|
||||
|
||||
if (authLoading) {
|
||||
return (
|
||||
<div className="max-w-7xl mx-auto px-4 py-16 flex items-center justify-center">
|
||||
@@ -161,13 +168,6 @@ export default function CheckoutClient() {
|
||||
);
|
||||
}
|
||||
|
||||
const selectedShippingMethod = useMemo(
|
||||
() => shippingMethods.find((m) => m.id === shippingMethodId) ?? null,
|
||||
[shippingMethods, shippingMethodId],
|
||||
);
|
||||
const shippingCost = selectedShippingMethod?.baseCostCents ?? 0;
|
||||
const totalCents = subtotalCents + shippingCost;
|
||||
|
||||
const handlePlaceOrder = async () => {
|
||||
setSubmitting(true);
|
||||
setError('');
|
||||
|
||||
Reference in New Issue
Block a user