Skip to content

Commit 4571aa8

Browse files
committed
chore: 버튼 비활성화 추가
1 parent 2a88f48 commit 4571aa8

File tree

1 file changed

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

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,16 @@ const OrderProductRelationItem: React.FC<OrderProductRelationItemProps> = ({
9090
? "옵션 수정 중 문제가 발생했습니다,\n잠시 후 다시 시도해주세요."
9191
: "An error occurred while modifying the options,\nplease try again later.";
9292

93-
const scanCodeBtnText = language === "ko" ? "등록 QR 코드" : "Registeration QR Code";
9493
const refundBtnDisabled = isPending || !R.isNullish(prodRel.not_refundable_reason);
9594
const refundBtnText = R.isNullish(prodRel.not_refundable_reason)
9695
? refundOneProductStr
9796
: prodRel.status === "refunded"
9897
? refundedStr
9998
: prodRel.not_refundable_reason;
10099

100+
const scanCodeDisabled = isPending || prodRel.status === "refunded";
101+
const scanCodeBtnText = language === "ko" ? "등록 QR 코드" : "Registeration QR Code";
102+
101103
const refundOneItem = () =>
102104
oneItemRefundMutation.mutate(
103105
{ order_id: order.id, order_product_relation_id: prodRel.id },
@@ -138,7 +140,7 @@ const OrderProductRelationItem: React.FC<OrderProductRelationItemProps> = ({
138140
<Stack direction="column" flexGrow={1} spacing={2}>
139141
{prodRel.scancode_url && (
140142
<a href={prodRel.scancode_url} target="_blank" rel="noopener noreferrer">
141-
<Button variant="contained" fullWidth children={scanCodeBtnText} />
143+
<Button variant="contained" fullWidth children={scanCodeBtnText} disabled={scanCodeDisabled} />
142144
</a>
143145
)}
144146
<Stack direction="row" flexGrow={1} spacing={2}>

0 commit comments

Comments
 (0)