Skip to content

Commit 34d1829

Browse files
committed
fix: 상품 상세에서 로그아웃 상태일 시 버튼이 감춰지지 않던 문제 수정
1 parent 0e206ac commit 34d1829

File tree

1 file changed

+32
-30
lines changed

1 file changed

+32
-30
lines changed

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

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -136,45 +136,47 @@ const ProductItem: React.FC<ProductItemPropType> = ({
136136
});
137137
const onOrderOneItemButtonClick = () => startPurchaseProcess(getCartAppendRequestPayload(product, optionFormRef));
138138
const actionButton = R.isNullish(notPurchasableReason) && (
139-
<>
139+
<CommonComponents.SignInGuard fallback={<NotPurchasable>{requiresSignInStr}</NotPurchasable>}>
140140
<Button {...actionButtonProps} onClick={addItemToCart} children={addToCartStr} />
141141
<Button {...actionButtonProps} onClick={onOrderOneItemButtonClick} children={orderOneItemStr} />
142-
</>
142+
</CommonComponents.SignInGuard>
143143
);
144144

145145
return (
146146
<Common.Components.MDX.PrimaryStyledDetails {...props} summary={product.name} actions={actionButton}>
147147
<Common.Components.MDXRenderer text={product.description || ""} />
148148
<br />
149149
<Divider />
150-
<CommonComponents.SignInGuard fallback={<NotPurchasable>{requiresSignInStr}</NotPurchasable>}>
151-
{R.isNullish(notPurchasableReason) ? (
152-
<>
153-
<br />
154-
<form ref={optionFormRef} onSubmit={formOnSubmit}>
155-
<Stack spacing={2}>
156-
{product.option_groups.map((group) => (
157-
<CommonComponents.OptionGroupInput
158-
key={group.id}
159-
optionGroup={group}
160-
options={group.options}
161-
defaultValue={group.options[0]?.id || ""}
162-
disabled={disabled}
163-
/>
164-
))}
165-
</Stack>
166-
</form>
167-
<br />
168-
<Divider />
169-
<br />
170-
<Typography variant="h6" sx={{ textAlign: "right" }}>
171-
{orderPriceStr}: <CommonComponents.PriceDisplay price={product.price} />
172-
</Typography>
173-
</>
174-
) : (
175-
<NotPurchasable>{notPurchasableReason}</NotPurchasable>
176-
)}
177-
</CommonComponents.SignInGuard>
150+
{R.isNullish(notPurchasableReason) ? (
151+
<>
152+
<br />
153+
<form ref={optionFormRef} onSubmit={formOnSubmit}>
154+
<Stack spacing={2}>
155+
{product.option_groups.map((group) => (
156+
<CommonComponents.OptionGroupInput
157+
key={group.id}
158+
optionGroup={group}
159+
options={group.options}
160+
defaultValue={group.options[0]?.id || ""}
161+
disabled={disabled}
162+
/>
163+
))}
164+
</Stack>
165+
</form>
166+
<br />
167+
{product.option_groups.length > 0 && (
168+
<>
169+
<Divider />
170+
<br />
171+
</>
172+
)}
173+
<Typography variant="h6" sx={{ textAlign: "right" }}>
174+
{orderPriceStr}: <CommonComponents.PriceDisplay price={product.price} />
175+
</Typography>
176+
</>
177+
) : (
178+
<NotPurchasable>{notPurchasableReason}</NotPurchasable>
179+
)}
178180
</Common.Components.MDX.PrimaryStyledDetails>
179181
);
180182
};

0 commit comments

Comments
 (0)