Skip to content

Commit

Permalink
[Remove] 사용하지 않는 코드 주석처리
Browse files Browse the repository at this point in the history
- 지정가/시장가 관련 기능 활용하지 않는 것으로 계획이 수정되어 관련된 코드 주석처리
- 진행 상황 고려하여 재사용 하거나, 사용하지 않기로 확정될 경우 주석 처리한 부분 및 기타 코드 (ex. redux-toolkit 관련 reducer 등) 삭제 예정

Issues #17
  • Loading branch information
novice1993 committed Sep 7, 2023
1 parent 07853bf commit 87e77c8
Showing 1 changed file with 54 additions and 49 deletions.
103 changes: 54 additions & 49 deletions client/src/components/StockOrderSection/PriceSetting.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
import { useSelector, useDispatch } from "react-redux";
import { styled } from "styled-components";
import { setSpecifiedPrice, setMarketPrice } from "../../reducer/StockPriceType-Reducer";
import { plusStockOrderPrice, minusStockOrderPrice } from "../../reducer/StockOrderPrice-Reducer";
import { StateProps } from "../../models/stateProps";

const priceSettingTitle: string = "가격";
const specifiedPriceBtnText: string = "지정가";
const marketPriceBtnText: string = "시장가";
const unitText: string = "원";

const PriceSetting = () => {
const priceType = useSelector((state: StateProps) => state.stockPriceType);
const orderPrice = useSelector((state: StateProps) => state.stockOrderPrice);
const dispatch = useDispatch();

// 시장가, 지정가 변경
const handleSetSepcifiedPrice = () => {
dispatch(setSpecifiedPrice());
};

const handleSetMarketPrice = () => {
dispatch(setMarketPrice());
};

// 거래가 증가/감소
const handlePlusOrderPrice = () => {
dispatch(plusStockOrderPrice(10));
Expand All @@ -36,14 +23,6 @@ const PriceSetting = () => {
<Container>
<div className="PriceCategoryBox">
<div className="Title">{priceSettingTitle}</div>
<div className="ButtonContainer">
<SepcifiedPriceBtn onClick={handleSetSepcifiedPrice} priceType={priceType}>
{specifiedPriceBtnText}
</SepcifiedPriceBtn>
<MarketPriceBtn onClick={handleSetMarketPrice} priceType={priceType}>
{marketPriceBtnText}
</MarketPriceBtn>
</div>
</div>
<div className="PriceSettingBox">
<PriceController defaultValue={orderPrice} value={orderPrice} />
Expand All @@ -63,11 +42,6 @@ const PriceSetting = () => {

export default PriceSetting;

// type 정의
interface PriceTypeProps {
priceType: boolean;
}

// component 생성
const Container = styled.div`
width: 100%;
Expand Down Expand Up @@ -131,29 +105,6 @@ const Container = styled.div`
}
`;

const SepcifiedPriceBtn = styled.button<PriceTypeProps>`
width: 46px;
height: 21px;
border: none;
box-shadow: ${(props) => !props.priceType && "0.7px 0.7px 3px rgba(0, 0, 0, 0.4);"};
border-radius: 0.3rem;
background-color: ${(props) => (props.priceType ? "f2f2f2" : "white")};
color: ${(props) => (props.priceType ? "#999999" : "black")};
font-size: 13px;
`;

const MarketPriceBtn = styled.button<PriceTypeProps>`
width: 46px;
height: 21px;
border: none;
border-radius: 0.3rem;
box-shadow: ${(props) => props.priceType && "0.7px 0.7px 3px rgba(0, 0, 0, 0.4);"};
background-color: ${(props) => (props.priceType ? "white" : "f2f2f2")};
color: ${(props) => (props.priceType ? "black" : "#999999")};
font-size: 13px;
`;

const PriceController = styled.input`
flex: 1 0 0;
height: 30px;
Expand All @@ -179,3 +130,57 @@ const UnitContent = styled.div`
border-bottom: 1px solid darkgray;
background-color: #ffffff;
`;

// 지정가, 시장가 관련된 코드

// const specifiedPriceBtnText: string = "지정가";
// const marketPriceBtnText: string = "시장가";
// const priceType = useSelector((state: StateProps) => state.stockPriceType);

// 시장가, 지정가 변경
// const handleSetSepcifiedPrice = () => {
// dispatch(setSpecifiedPrice());
// };

// const handleSetMarketPrice = () => {
// dispatch(setMarketPrice());
// };

{
/* <div className="ButtonContainer">
<SepcifiedPriceBtn onClick={handleSetSepcifiedPrice} priceType={priceType}>
{specifiedPriceBtnText}
</SepcifiedPriceBtn>
<MarketPriceBtn onClick={handleSetMarketPrice} priceType={priceType}>
{marketPriceBtnText}
</MarketPriceBtn>
</div> */
}

// // type 정의
// interface PriceTypeProps {
// priceType: boolean;
// }

// const SepcifiedPriceBtn = styled.button<PriceTypeProps>`
// width: 46px;
// height: 21px;
// border: none;
// box-shadow: ${(props) => !props.priceType && "0.7px 0.7px 3px rgba(0, 0, 0, 0.4);"};
// border-radius: 0.3rem;
// background-color: ${(props) => (props.priceType ? "f2f2f2" : "white")};
// color: ${(props) => (props.priceType ? "#999999" : "black")};

// font-size: 13px;
// `;

// const MarketPriceBtn = styled.button<PriceTypeProps>`
// width: 46px;
// height: 21px;
// border: none;
// border-radius: 0.3rem;
// box-shadow: ${(props) => props.priceType && "0.7px 0.7px 3px rgba(0, 0, 0, 0.4);"};
// background-color: ${(props) => (props.priceType ? "white" : "f2f2f2")};
// color: ${(props) => (props.priceType ? "black" : "#999999")};
// font-size: 13px;
// `;

0 comments on commit 87e77c8

Please sign in to comment.