Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: 로직&문구수정 및 금액상태 초기화 #252

Merged
merged 2 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading