diff --git a/components/orders/activate-warranty.tsx b/components/orders/activate-warranty.tsx
index 35a7b9b8f..42afa2989 100644
--- a/components/orders/activate-warranty.tsx
+++ b/components/orders/activate-warranty.tsx
@@ -5,6 +5,7 @@ import { isBeforeToday } from 'lib/utils';
import { useState } from 'react';
import ActivateWarrantyModal from './activate-warranty-modal';
import WarrantyActivatedBadge from './warranty-activated-badge';
+import { Button } from 'components/ui';
type ActivateWarrantyModalProps = {
order: Order;
@@ -12,7 +13,7 @@ type ActivateWarrantyModalProps = {
const ActivateWarranty = ({ order }: ActivateWarrantyModalProps) => {
const [isOpen, setIsOpen] = useState(false);
- const isWarrantyActivated = order?.warrantyStatus === WarrantyStatus.Activated;
+ const isWarrantyActivated = order?.warrantyStatus?.value === WarrantyStatus.Activated;
const isPassDeadline = isBeforeToday(order?.warrantyActivationDeadline?.value);
if (isWarrantyActivated) {
@@ -25,13 +26,8 @@ const ActivateWarranty = ({ order }: ActivateWarrantyModalProps) => {
return (
<>
-
-
setIsOpen(false)} orderId={order.id} />
+
+ setIsOpen(false)} order={order} />
>
);
};
diff --git a/components/orders/mobile-order-actions.tsx b/components/orders/mobile-order-actions.tsx
index 7ddfdb232..6df4f57c3 100644
--- a/components/orders/mobile-order-actions.tsx
+++ b/components/orders/mobile-order-actions.tsx
@@ -16,9 +16,9 @@ const MobileOrderActions = ({ order }: { order: Order }) => {
const [isWarrantyOpen, setIsWarrantyOpen] = useState(false);
const [isOrderConfirmaionOpen, setIsOrderConfirmationOpen] = useState(false);
- const isWarrantyActivated = order?.warrantyStatus === WarrantyStatus.Activated;
- const isPassDeadline = isBeforeToday(order?.warrantyActivationDeadline);
- const isOrderConfirmed = order?.orderConfirmation;
+ const isWarrantyActivated = order?.warrantyStatus?.value === WarrantyStatus.Activated;
+ const isPassDeadline = isBeforeToday(order?.warrantyActivationDeadline?.value);
+ const isOrderConfirmed = order?.orderConfirmation?.value;
return (
<>
@@ -84,7 +84,7 @@ const MobileOrderActions = ({ order }: { order: Order }) => {
setIsWarrantyOpen(false)}
- orderId={order.id}
+ order={order}
/>
{!isOrderConfirmed && (
= (event) => {
event.preventDefault();
+ setLoading(true);
const form = formRef.current;
if (!form) return;
const formData = new FormData(form);
@@ -276,11 +271,15 @@ export default function OrderConfirmationModal({
-