Skip to content

Commit

Permalink
Fix: 로직추가 및 금액상태 초기화
Browse files Browse the repository at this point in the history
  • Loading branch information
furaha707 committed Feb 2, 2024
1 parent 79fb708 commit 5efa137
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/components/priceArea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ const PriceArea = ({
};

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

Please sign in to comment.