Skip to content

Commit 46305f9

Browse files
committed
fix: 영수증 조회가 가능한 상황에서도 영수증 버튼이 비활성회되어 있던 문제 수정
1 parent 5d57f08 commit 46305f9

File tree

1 file changed

+4
-4
lines changed
  • packages/shop/src/components/features

1 file changed

+4
-4
lines changed

packages/shop/src/components/features/order.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ const OrderItem: React.FC<{ order: ShopSchemas.Order; disabled?: boolean }> = ({
4545
orderRefundMutation.isPending ||
4646
oneItemRefundMutation.isPending ||
4747
optionsOfOneItemInOrderPatchMutation.isPending;
48-
const btnDisabled =
49-
isPending || !R.isNullish(order.not_fully_refundable_reason);
48+
const refundBtnDisabled = isPending || !R.isNullish(order.not_fully_refundable_reason);
49+
const receipyBtnDisabled = isPending || order.current_status === "pending";
5050
const btnText = R.isNullish(order.not_fully_refundable_reason)
5151
? "주문 전체 환불"
5252
: order.current_status === "refunded"
@@ -187,15 +187,15 @@ const OrderItem: React.FC<{ order: ShopSchemas.Order; disabled?: boolean }> = ({
187187
variant="contained"
188188
sx={{ width: "100%" }}
189189
onClick={openReceipt}
190-
disabled={btnDisabled}
190+
disabled={receipyBtnDisabled}
191191
>
192192
영수증
193193
</Button>
194194
<Button
195195
variant="contained"
196196
sx={{ width: "100%" }}
197197
onClick={refundOrder}
198-
disabled={btnDisabled}
198+
disabled={refundBtnDisabled}
199199
>
200200
{btnText}
201201
</Button>

0 commit comments

Comments
 (0)