Skip to content

Commit

Permalink
Merge pull request Yanabada#252 from Yanabada/fix/Yanabada#251
Browse files Browse the repository at this point in the history
Fix: 로직&문구수정 및 금액상태 초기화
  • Loading branch information
furaha707 authored Feb 3, 2024
2 parents 49e250d + 27fdcd4 commit 6188802
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
16 changes: 12 additions & 4 deletions src/components/priceArea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,20 @@ const PriceArea = ({
};

const getErrorMessage = () => {
if (purchasePrice && cancelFee) {
if (0 < price && price > purchasePrice) {
return <S.ErrorMessage>실구매가보다 낮은 금액으로만 판매 가능해요.</S.ErrorMessage>;
if (policyNumber === "YNBD_1" || policyNumber === "YNBD_2") {
if (0 < price && price <= purchasePrice - cancelFee) {
return (
<S.ErrorMessage>지금 야놀자에서 취소하는 것보다 손해보는 가격이에요!</S.ErrorMessage>
);
}
return;
} else if (policyNumber === "YNBD_3") {
if (0 < price && price < purchasePrice) {
return (
<S.ErrorMessage>지금 야놀자에서 취소하는 것보다 손해보는 가격이에요!</S.ErrorMessage>
);
}
}
return;
};

const getCommandMessage = () => {
Expand Down
6 changes: 5 additions & 1 deletion src/pages/charge/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as S from "./styles/styles";

import { useState } from "react";
import { useEffect, useState } from "react";
import { IoMdArrowDropup } from "react-icons/io";
import { IoMdArrowDropdown } from "react-icons/io";
import { GoCheck } from "react-icons/go";
Expand Down Expand Up @@ -46,6 +46,10 @@ const Charge = () => {

const typeText = typeParam == "charging" ? "충전" : "인출";

useEffect(() => {
setAmount(0);
}, [setAmount]);

return (
<>
<UpperNavBar title={typeText} type="back" />
Expand Down

0 comments on commit 6188802

Please sign in to comment.