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 8, 2023
1 parent b94256a commit bfc6901
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 71 deletions.
49 changes: 0 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 Down
8 changes: 4 additions & 4 deletions client/src/components/StockOrderSection/StockOrderBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const StockOrderBtn = () => {

return (
<Container>
<AvailableMoney>
<AvailableMoney orderType={stockOrderType}>
<span>{availableMoneyText01}</span>
<span className="availableMoney">{dummyMoney}</span>
<span>{availableMoneyText02}</span>
Expand All @@ -38,19 +38,19 @@ export default StockOrderBtn;

const Container = styled.div``;

const AvailableMoney = styled.div`
const AvailableMoney = styled.div<{ orderType: boolean }>`
display: flex;
flex-direction: row;
justify-content: flex-end;
gap: 4px;
& span {
font-size: 14px;
color: #999999;
color: ${(props) => (props.orderType ? "white" : "#999999")};
}
.availableMoney {
color: #ed2926;
color: ${(props) => (props.orderType ? "white" : "#ed2926")};
}
`;

Expand Down
15 changes: 0 additions & 15 deletions client/src/reducer/StockPriceType-Reducer.ts

This file was deleted.

4 changes: 1 addition & 3 deletions client/src/store/config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { configureStore } from "@reduxjs/toolkit";
import { stockOrderTypeReducer } from "../reducer/StockOrderType-Reducer";
import { stockPriceTypeReducer } from "../reducer/StockPriceType-Reducer";
import { stockOrderPriceReducer } from "../reducer/StockOrderPrice-Reducer";
import { expandScreenReducer } from "../reducer/ExpandScreen-Reducer";
import { stockOrderSetReducer } from "../reducer/StockOrderSet-Reducer";
import { companyIdReducer } from "../reducer/CompanyId-Reducer";
import memberInfoReducer from '../reducer/member/memberInfoSlice';
import memberInfoReducer from "../reducer/member/memberInfoSlice";

const store = configureStore({
reducer: {
stockOrderType: stockOrderTypeReducer,
stockPriceType: stockPriceTypeReducer,
stockOrderPrice: stockOrderPriceReducer,
expandScreen: expandScreenReducer,
stockOrderSet: stockOrderSetReducer,
Expand Down

0 comments on commit bfc6901

Please sign in to comment.