Skip to content

Commit

Permalink
[Remove] 거래량 설정 관련 일부 코드 삭제
Browse files Browse the repository at this point in the history
- 기존 : 거래양을 이미 최대 거래량으로 설정한 뒤, 지정가를 높일 경우 변경된 최대 거래량으로 거래량을 자동으로 변경
- 최대 거래량보다 거래량을 높게 설정하고 매수/매도 버튼을 클릭할 경우 예외처리로 거래 불가 안내창을 띄울 예정이기 때문에 굳이 필요하지 않은 기능이라고 생각되어 삭제함

Issues #17
  • Loading branch information
novice1993 committed Sep 9, 2023
1 parent 25517e5 commit 336df77
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions client/src/components/StockOrderSection/VolumeSetteing.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useEffect } from "react";
import { useSelector, useDispatch } from "react-redux";
import { styled } from "styled-components";
import { StateProps } from "../../models/stateProps";
Expand Down Expand Up @@ -27,19 +26,11 @@ const VolumeSetting = () => {
const maximumBuyingVolume = Math.trunc(dummyMoney / orderPrice);

const handlePlusOrderVolume = () => {
// 매수 -> 증가 버튼 클릭 시, 최대 구매수량 보다 낮으면 개수 1증가
if (!orderType) {
orderVolume < maximumBuyingVolume && dispatch(plusStockOrderVolume());
}
// 매도 -> 증가 버튼 클릭 시, 보유 주식수량 보다 낮으면 개수 1증가
if (orderType) {
orderVolume < dummyholdingStock && dispatch(plusStockOrderVolume());
}
dispatch(plusStockOrderVolume());
};

const handleMinusOrderVolume = () => {
if (0 < orderVolume) {
// setOrderVolume((previousState: number) => previousState - 1);
dispatch(minusStockOrderVolume());
}
};
Expand All @@ -58,13 +49,6 @@ const VolumeSetting = () => {
}
};

// 지정가 증가 -> (현재 주문수량 > 최대 주문가능 수량)일 경우 -> 현재 주문수량을 최대 주문수량으로 변경
useEffect(() => {
if (maximumBuyingVolume < orderVolume) {
dispatch(setStockOrderVolume(maximumBuyingVolume));
}
}, [maximumBuyingVolume]);

return (
<Container>
<TitleContainer orderType={orderType}>
Expand Down

0 comments on commit 336df77

Please sign in to comment.