From f1eed0a24f3fbce5a37118b1a0876bccfcb08538 Mon Sep 17 00:00:00 2001 From: novice1993 Date: Tue, 26 Sep 2023 00:26:55 +0900 Subject: [PATCH] =?UTF-8?q?[Refactor]=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=ED=8C=8C=EC=9D=BC/=EC=A3=BC=EC=84=9D=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0=20=EB=B0=8F=20=EB=94=94=EB=A0=89=ED=86=A0=EB=A6=AC?= =?UTF-8?q?=EB=AA=85=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 불필요한 파일, 주석 등 제거 - 컴포넌트 내부 디렉토리명 통일 (앞글자 대문자로 통일) Issues #122 --- .../CentralChart/CompareChartBtn.tsx | 1 - .../CentralChartMenu/BookmarkBtn.tsx | 38 ------- .../CentralChartMenu/CompareChartBtn.tsx | 37 ------- .../CentralChartMenu/ExpandScreenBtn.tsx | 3 +- .../CentralChartMenu/StockOverview.tsx | 2 +- .../CompareChartSection/CompareList.tsx | 32 ------ .../components/CompareChartSection/Index.tsx | 62 ----------- .../CompareChartSection/SearchBox.tsx | 38 ------- client/src/components/Headers/LoginHeader.tsx | 4 +- .../src/components/Headers/LogoutHeader.tsx | 6 +- .../LeftStockListSection/Header.tsx | 100 ------------------ .../components/LeftStockListSection/Index.tsx | 18 ---- .../{CancleConfirm.tsx => CancelConfirm.tsx} | 87 +++++---------- .../components/StockOrderSection/Index.tsx | 99 ++++++----------- .../StockOrderSection/OrderedStock.tsx | 4 +- .../StockOrderSection/PriceSetting.tsx | 3 - .../StockOrderSection/StockOrder.tsx | 52 +-------- .../StockOrderSection/StockPriceList.tsx | 5 +- .../StockOrderSection/WaitOrderIndicator.tsx | 25 +---- client/src/components/watchlist/WatchList.tsx | 2 +- client/src/page/MainPage.tsx | 9 +- client/src/page/TabPages/TabContainerPage.tsx | 39 ++----- client/src/page/TabPages/communityPage.tsx | 2 +- client/src/utils/setAutoLogoutAlarm.ts | 4 +- 24 files changed, 84 insertions(+), 588 deletions(-) delete mode 100644 client/src/components/CentralChartMenu/BookmarkBtn.tsx delete mode 100644 client/src/components/CentralChartMenu/CompareChartBtn.tsx delete mode 100644 client/src/components/CompareChartSection/CompareList.tsx delete mode 100644 client/src/components/CompareChartSection/Index.tsx delete mode 100644 client/src/components/CompareChartSection/SearchBox.tsx delete mode 100644 client/src/components/LeftStockListSection/Header.tsx delete mode 100644 client/src/components/LeftStockListSection/Index.tsx rename client/src/components/StockOrderSection/{CancleConfirm.tsx => CancelConfirm.tsx} (78%) diff --git a/client/src/components/CentralChart/CompareChartBtn.tsx b/client/src/components/CentralChart/CompareChartBtn.tsx index e6381216..f88e2a3f 100644 --- a/client/src/components/CentralChart/CompareChartBtn.tsx +++ b/client/src/components/CentralChart/CompareChartBtn.tsx @@ -1,7 +1,6 @@ import { useState } from "react"; import { styled } from "styled-components"; import useCompanyData from "../../hooks/useCompanyData"; - import CompareList from "./CompareList"; import IconImg from "../../asset/CentralSectionMenu-compareChart.png"; diff --git a/client/src/components/CentralChartMenu/BookmarkBtn.tsx b/client/src/components/CentralChartMenu/BookmarkBtn.tsx deleted file mode 100644 index 9ed3852e..00000000 --- a/client/src/components/CentralChartMenu/BookmarkBtn.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { styled } from "styled-components"; - -import bookmarkOffImg from "../../asset/CentralSectionMenu-BookmarkOff.png"; -// import bookmarkOnImg from "../../asset/CentralSectionMenu-BookmarkOn.png.png"; - -const buttonText: string = "관심"; - -const BookmarkBtn = () => { - return ( - - - @@ -178,7 +141,7 @@ const CancelConfirm = (props: CancelConfirmProps) => { {totalPrice} {priceUnit} -
+
@@ -218,7 +181,7 @@ const Container = styled.div<{ orderType: string }>` justify-content: center; align-items: center; - .Container { + .container { display: flex; flex-direction: column; justify-content: center; @@ -233,13 +196,13 @@ const Container = styled.div<{ orderType: string }>` padding-left: 20px; padding-right: 20px; - .CorpLogo { + .corpLogo { width: 40px; height: 40px; border-radius: 50%; } - .OrderOverview { + .orderOverview { display: flex; flex-direction: row; justify-content: center; @@ -250,12 +213,12 @@ const Container = styled.div<{ orderType: string }>` padding-top: 18px; padding-bottom: 28px; - .OrderType { + .orderType { color: ${(props) => (props.orderType === "매도" ? "#4479c2" : "#cc3c3a")}; } } - .OrderContent { + .orderContent { width: 100%; font-size: 15px; @@ -303,7 +266,7 @@ const Container = styled.div<{ orderType: string }>` } } - .ButtonContainer { + .buttonContainer { width: 100%; display: flex; flex-direction: row; @@ -336,7 +299,7 @@ const VolumeSettingBox = styled.div` display: flex; flex-direction: row; - .DirectionContainer { + .directionContainer { display: flex; flex-direction: column; @@ -350,12 +313,12 @@ const VolumeSettingBox = styled.div` border: 1px solid darkgray; border-radius: 0%; - &.VolumeUp { + &.volumeUp { border-bottom: none; border-radius: 0 0.2rem 0 0; } - &.VolumeDown { + &.volumeDown { border-radius: 0 0 0.2rem 0; } } diff --git a/client/src/components/StockOrderSection/Index.tsx b/client/src/components/StockOrderSection/Index.tsx index eb42854a..09dbed81 100644 --- a/client/src/components/StockOrderSection/Index.tsx +++ b/client/src/components/StockOrderSection/Index.tsx @@ -8,6 +8,7 @@ import useGetHoldingStock from "../../hooks/useGetHoldingStock"; import useGetCompanyList from "../../hooks/useGetCompanyList"; import { stockOrderClose } from "../../reducer/StockOrderSet-Reducer"; import { StateProps } from "../../models/stateProps"; +import { dummyLogo } from "../../dummy/dummyLogo"; import StockOrder from "./StockOrder"; import OrderResult from "./OrderResult"; import WaitOrderIndicator from "./WaitOrderIndicator"; @@ -21,25 +22,6 @@ const moenyRequireBtnText: string = "현금 충전하러 가기"; const upperbarTitle: string = "주식주문"; const marketType: string = "코스피"; -// dummyData -import dummyLogo from "../../asset/CentralSectionMenu-dummyImg.png"; - -//import company logo -import kia from "../../asset/logos/기아.svg"; -import dy from "../../asset/logos/디와이.jpeg"; -import logosamsung from "../../asset/logos/삼성전자.svg"; -import celltrion from "../../asset/logos/셀트리온.svg"; -import ecopro from "../../asset/logos/에코프로.jpeg"; -import ecoproBM from "../../asset/logos/에코프로비엠.svg"; -import kakaoBank from "../../asset/logos/카카오뱅크.svg"; -import kuckoo from "../../asset/logos/쿠쿠홀딩스.jpeg"; -import hanse from "../../asset/logos/한세엠케이.jpeg"; -import hyundai from "../../asset/logos/현대차.svg"; -import KG from "../../asset/logos/KG케미칼.png"; -import LGelec from "../../asset/logos/LG전자.svg"; -import LGchem from "../../asset/logos/LG화학.svg"; -import posco from "../../asset/logos/POSCO홀딩스.svg"; - const StockOrderSection: React.FC = (props) => { const dispatch = useDispatch(); const isLogin = useSelector((state: StateProps) => state.login); @@ -72,14 +54,14 @@ const StockOrderSection: React.FC = (props) => { return ( -

{upperbarTitle}

-
-
-
{errorMessage}
-
@@ -91,8 +73,8 @@ const StockOrderSection: React.FC = (props) => { return ( -

{upperbarTitle}

-
@@ -104,42 +86,23 @@ const StockOrderSection: React.FC = (props) => { // 3) 데이터 받아오기 성공 const corpName = stockInfo.korName; const stockCode = stockInfo.code; - - // 이미 import된 로고들을 바탕으로 logos 객체 생성 - const logos: { [key: string]: string } = { - 삼성전자: logosamsung, - POSCO홀딩스: posco, - 셀트리온: celltrion, - 에코프로: ecopro, - 에코프로비엠: ecoproBM, - 디와이: dy, - 쿠쿠홀딩스: kuckoo, - 카카오뱅크: kakaoBank, - 한세엠케이: hanse, - KG케미칼: KG, - LG화학: LGchem, - 현대차: hyundai, - LG전자: LGelec, - 기아: kia, - }; - // 그리고 나서, 이 `logos` 객체를 사용하여 기업명에 따라 적절한 로고를 선택할 수 있습니다. - const companyLogo = logos[corpName] || dummyLogo; // 기본 로고를 대체로 사용 + const companyLogo = dummyLogo[companyId - 1]; return ( -

{upperbarTitle}

-
{isLogin === 1 ? (
- stock logo -
-
{corpName}
-
+ stock logo +
+
{corpName}
+
{stockCode} {marketType}
@@ -163,12 +126,11 @@ interface StockOrderSectionProps { } // 미로그인 시 -> 로그인 요청 화면 -//props 전달 const LoginRequestIndicator: React.FC = ({ openOAuthModal }) => { return ( -
{loginRequiredText}
-
@@ -179,12 +141,11 @@ interface LoginRequestIndicatorProps { } // 현금 충전요청 화면 -//props 전달 const MoneyReqireIndicator: React.FC = ({ openProfileModal }) => { return ( -
{moneyRequireText}
-
@@ -213,7 +174,7 @@ const Container = styled.aside<{ orderSet: boolean }>` height: 100%; } - .ErrorContainer { + .errorContainer { width: 100%; height: 80%; display: flex; @@ -222,12 +183,12 @@ const Container = styled.aside<{ orderSet: boolean }>` align-items: center; gap: 12px; - .ErrorMessage { + .errorMessage { font-size: 20px; color: #999999; } - .ErrorCloseButton { + .errorCloseButton { width: 35%; height: 32px; color: white; @@ -248,13 +209,13 @@ const UpperBar = styled.div` min-height: 44px; border-bottom: 1px solid black; - .Title { + .title { font-size: 17px; font-weight: 450; color: #1c1c1c; } - .CloseButton { + .closeButton { position: absolute; right: 10px; width: 28px; @@ -275,11 +236,11 @@ const LoginRequestContainer = styled.div` align-items: center; gap: 8px; - .Notification { + .notification { color: #999999; } - .LoginButton { + .loginButton { width: 170px; height: 32px; font-size: 15px; @@ -305,25 +266,25 @@ const StockName = styled.section` padding-left: 16px; gap: 9px; - .CorpLogo { + .corpLogo { width: 28px; height: 28px; border-radius: 50%; } - .NameContainer { + .nameContainer { height: 40px; display: flex; flex-direction: column; } - .CorpName { + .corpName { font-size: 16px; font-weight: 500; color: #1c1c1c; } - .StockCode { + .stockCode { font-size: 14px; color: #999999; } diff --git a/client/src/components/StockOrderSection/OrderedStock.tsx b/client/src/components/StockOrderSection/OrderedStock.tsx index 370845be..32b3fb93 100644 --- a/client/src/components/StockOrderSection/OrderedStock.tsx +++ b/client/src/components/StockOrderSection/OrderedStock.tsx @@ -1,7 +1,7 @@ import { useState, useEffect, useRef } from "react"; import { styled } from "styled-components"; import useGetCompanyList from "../../hooks/useGetCompanyList"; -import CancelConfirm from "./CancleConfirm"; +import CancelConfirm from "./CancelConfirm"; import { dummyLogo } from "../../dummy/dummyLogo"; const priceUnit: string = "원"; @@ -21,7 +21,7 @@ const OrderedStock = (props: OrderdStockProps) => { const corp = companyList.filter((corp: CompanyProps) => corp.companyId === companyId); const corpName = corp[0].korName; - const companyLogo = dummyLogo[companyId]; + const companyLogo = dummyLogo[companyId - 1]; const handleSetOrderCancle = () => { setOrderCancle(!orderCancle); diff --git a/client/src/components/StockOrderSection/PriceSetting.tsx b/client/src/components/StockOrderSection/PriceSetting.tsx index d4e6c712..fe9a3f1e 100644 --- a/client/src/components/StockOrderSection/PriceSetting.tsx +++ b/client/src/components/StockOrderSection/PriceSetting.tsx @@ -28,7 +28,6 @@ const PriceSetting = (props: OwnProps) => { const defaultPrice = existSellingPrice[0]; const priceInterval = existSellingPrice[1] - existSellingPrice[0]; - // 🔴 [TestCode] 거래가능 안내 메세지 테스트 -> 🟢 구현 성공하여 코드 정리할 예정 const orderType = useSelector((state: StateProps) => state.stockOrderType); const [orderPossibility, setOrderPossibility] = useState(true); @@ -60,8 +59,6 @@ const PriceSetting = (props: OwnProps) => { handleCheckTradePossibility(); }, [orderPrice, orderType]); - // 🔴 [TestCode] 거래가능 안내 메세지 테스트 -> 🟢 구현 성공하여 코드 정리할 예정 - // 거래가 증가/감소 const handlePlusOrderPrice = () => { dispatch(plusStockOrderPrice(priceInterval)); diff --git a/client/src/components/StockOrderSection/StockOrder.tsx b/client/src/components/StockOrderSection/StockOrder.tsx index f6012e36..86765034 100644 --- a/client/src/components/StockOrderSection/StockOrder.tsx +++ b/client/src/components/StockOrderSection/StockOrder.tsx @@ -6,29 +6,11 @@ import { styled } from "styled-components"; import { toast } from "react-toastify"; import { StateProps } from "../../models/stateProps"; import useTradeStock from "../../hooks/useTradeStock"; +import { dummyLogo } from "../../dummy/dummyLogo"; import StockPriceList from "./StockPriceList"; import StockOrderSetting from "./StockOrderSetting"; -// dummyData -import dummyImg from "../../asset/CentralSectionMenu-dummyImg.png"; - -//import company logos -import kia from "../../asset/logos/기아.svg"; -import dy from "../../asset/logos/디와이.jpeg"; -import logosamsung from "../../asset/logos/삼성전자.svg"; -import celltrion from "../../asset/logos/셀트리온.svg"; -import ecopro from "../../asset/logos/에코프로.jpeg"; -import ecoproBM from "../../asset/logos/에코프로비엠.svg"; -import kakaoBank from "../../asset/logos/카카오뱅크.svg"; -import kuckoo from "../../asset/logos/쿠쿠홀딩스.jpeg"; -import hanse from "../../asset/logos/한세엠케이.jpeg"; -import hyundai from "../../asset/logos/현대차.svg"; -import KG from "../../asset/logos/KG케미칼.png"; -import LGelec from "../../asset/logos/LG전자.svg"; -import LGchem from "../../asset/logos/LG화학.svg"; -import posco from "../../asset/logos/POSCO홀딩스.svg"; - const orderFailureMessage01: string = "주문 실패"; const orderFailureMessage02: string = "주문 수량이 없습니다"; const orderFailureMessage03: string = "입력하신 가격이 올바르지 않습니다"; @@ -48,6 +30,7 @@ const toastText: string = " 요청이 완료되었습니다"; const StockOrder = ({ corpName }: { corpName: string }) => { const dispatch = useDispatch(); + const companyId = useSelector((state: StateProps) => state.companyId); const orderType = useSelector((state: StateProps) => state.stockOrderType); const orderVolume = useSelector((state: StateProps) => state.stockOrderVolume); const orderPrice = useSelector((state: StateProps) => state.stockOrderPrice); @@ -58,31 +41,12 @@ const StockOrder = ({ corpName }: { corpName: string }) => { const volume = orderVolume.toLocaleString(); const totalPrice = (orderPrice * orderVolume).toLocaleString(); - // 이미 import된 로고들을 바탕으로 logos 객체 생성 - const logos: { [key: string]: string } = { - 삼성전자: logosamsung, - POSCO홀딩스: posco, - 셀트리온: celltrion, - 에코프로: ecopro, - 에코프로비엠: ecoproBM, - 디와이: dy, - 쿠쿠홀딩스: kuckoo, - 카카오뱅크: kakaoBank, - 한세엠케이: hanse, - KG케미칼: KG, - LG화학: LGchem, - 현대차: hyundai, - LG전자: LGelec, - 기아: kia, - }; - // 그리고 나서, 이 `logos` 객체를 사용하여 기업명에 따라 적절한 로고를 선택할 수 있습니다. - const companyLogo = logos[corpName] || dummyImg; // 기본 로고를 대체로 사용 + const companyLogo = dummyLogo[companyId - 1]; const handleCloseDecisionWindow = () => { dispatch(closeDecisionWindow()); }; - //🔴 주문 관련 테스트 const orderRequest = useTradeStock(); const handleOrderConfirm = () => { @@ -113,7 +77,6 @@ const StockOrder = ({ corpName }: { corpName: string }) => { , { position: toast.POSITION.BOTTOM_LEFT, - // autoClose: 2000, hideProgressBar: true, } ); @@ -126,30 +89,23 @@ const StockOrder = ({ corpName }: { corpName: string }) => { const today = new Date(); const nonBusinessDay = isHoliday(today, { include: { saturday: true, sunday: true } }); // 토요일, 일요일, 공휴일 (임시 공휴일 포함) - // 🟢 2) 개장시간 여부 체크 + // 2) 개장시간 여부 체크 const currentHour = today.getHours(); const currentMinute = today.getMinutes(); const isBefore9AM = currentHour < 9; const isAfter330PM = currentHour > 15 || (currentHour === 15 && currentMinute >= 30); const closingTime = isBefore9AM || isAfter330PM; - // 주문 실패 케이스 1) 개장시간 2) 가격/거래량 설정 - // 🔴 3시 30분 이후 작업 위해 closingTime 조건 해제 + 주말 요건도 해제 - // const orderFailureCase01 = false; - - // 🟢 기존로직 const orderFailureCase01 = nonBusinessDay || closingTime; const orderFailureCase02 = orderPrice === 0 || orderVolume === 0; return ( <> - {/* 주문 버튼 클릭 안했을 때 */} - {/* 주문 버튼 클릭 했을 때 */} {decisionWindow ? ( orderFailureCase01 || orderFailureCase02 ? ( diff --git a/client/src/components/StockOrderSection/StockPriceList.tsx b/client/src/components/StockOrderSection/StockPriceList.tsx index 96a14fd8..318dbd2e 100644 --- a/client/src/components/StockOrderSection/StockPriceList.tsx +++ b/client/src/components/StockOrderSection/StockPriceList.tsx @@ -46,10 +46,7 @@ const StockPriceList = () => { const existSellingPrice = sellingPrice.filter((selling) => selling.price !== 0); const existBuyingPrice = buyingPrice.filter((buyingPrice) => buyingPrice.price !== 0); - /* 🔴 더미 데이터 추가 로직 - [문제점] 주가 리스트 개수가 너무 적음 (매도호가 5개 + 매수호가 5개 = 총 10개) → 더미데이터를 추가하여 가격 리스트 확장 (매도 10개 + 매수 10개 = 총 20개) - [해결방안] 1) fetching 해온 데이터 중 가격 0인 데이터 제외 (한국투자증권 API에서 간혹 보내는 경우 있음) → 호가 간격 계산 후, 더미 데이터 추가 (거래량은 0으로 설정) - */ + // 매수/매도호가 관련 더미데이터 추가 로직 const priceInterval: number = existSellingPrice[existSellingPrice.length - 1].price - existBuyingPrice[0].price; for (let i = 0; existSellingPrice.length < 10; i++) { diff --git a/client/src/components/StockOrderSection/WaitOrderIndicator.tsx b/client/src/components/StockOrderSection/WaitOrderIndicator.tsx index 47936f43..74e7daf2 100644 --- a/client/src/components/StockOrderSection/WaitOrderIndicator.tsx +++ b/client/src/components/StockOrderSection/WaitOrderIndicator.tsx @@ -3,26 +3,9 @@ import { toast } from "react-toastify"; import { useState, useEffect } from "react"; import useGetMemberId from "../../hooks/useGetMemberId"; import * as Webstomp from "webstomp-client"; +import { dummyLogo } from "../../dummy/dummyLogo"; const url = "ws://ec2-13-125-246-160.ap-northeast-2.compute.amazonaws.com:8080/ws"; - -//기업로고 import -import kia from "../../asset/logos/기아.svg"; -import dy from "../../asset/logos/디와이.jpeg"; -import logosamsung from "../../asset/logos/삼성전자.svg"; -import celltrion from "../../asset/logos/셀트리온.svg"; -import ecopro from "../../asset/logos/에코프로.jpeg"; -import ecoproBM from "../../asset/logos/에코프로비엠.svg"; -import kakaoBank from "../../asset/logos/카카오뱅크.svg"; -import kuckoo from "../../asset/logos/쿠쿠홀딩스.jpeg"; -import hanse from "../../asset/logos/한세엠케이.jpeg"; -import hyundai from "../../asset/logos/현대차.svg"; -import KG from "../../asset/logos/KG케미칼.png"; -import LGelec from "../../asset/logos/LG전자.svg"; -import LGchem from "../../asset/logos/LG화학.svg"; -import posco from "../../asset/logos/POSCO홀딩스.svg"; - -const corpLogo = [logosamsung, posco, celltrion, ecopro, ecoproBM, dy, kuckoo, kakaoBank, hanse, KG, LGchem, hyundai, LGelec, kia]; const corpName = ["삼성전자", "POSCO홀딩스", "셀트리온", "에코프로", "에코프로비엠", "디와이", "쿠쿠홀딩스", "카카오뱅크", "한세엠케이", "KG케마칼", "LG화학", "현대차", "LG전자", "기아"]; const volumeUnit = "주"; @@ -43,9 +26,6 @@ const WaitOrderIndicator = () => { }; stompClient.connect(headers, () => { - // console.log("Connected with headers:", headers); - // console.log("Connected to the WebSocket server"); - stompClient.subscribe(`/sub/${memberId}`, async (data) => { const responseData = JSON.parse(data.body); const orderType = responseData.orderTypes === "BUY" ? "매수" : "매도"; @@ -62,7 +42,7 @@ const WaitOrderIndicator = () => { if (waitOrder !== null) { const companyId = waitOrder.companyId; const type = waitOrder.orderType; - const logo = corpLogo[companyId - 1]; + const logo = dummyLogo[companyId - 1]; const name = corpName[companyId - 1]; const volume = waitOrder.orderVolume; @@ -84,7 +64,6 @@ const WaitOrderIndicator = () => { , { position: toast.POSITION.BOTTOM_LEFT, - // autoClose: 2000, hideProgressBar: true, } ); diff --git a/client/src/components/watchlist/WatchList.tsx b/client/src/components/watchlist/WatchList.tsx index 1ae886a0..916f64eb 100644 --- a/client/src/components/watchlist/WatchList.tsx +++ b/client/src/components/watchlist/WatchList.tsx @@ -3,7 +3,7 @@ import styled from "styled-components"; import StockSearchComponent from "./StockSearchComponent.tsx"; import Header from "./Header.tsx"; import StockItem from "./StockItem.tsx"; -import useCompanyData from "../../hooks/useCompanyData"; +import useCompanyData from "../../hooks/useCompanyData.ts"; import useGetStars from "../../hooks/stars/useGetstars.ts"; // useGetStars 훅의 경로를 지정해주세요. import { useSelector } from "react-redux"; import { RootState } from "../../store/config.ts"; diff --git a/client/src/page/MainPage.tsx b/client/src/page/MainPage.tsx index 93d61d77..696a06ed 100644 --- a/client/src/page/MainPage.tsx +++ b/client/src/page/MainPage.tsx @@ -1,6 +1,5 @@ import { useState, useEffect, useCallback } from "react"; import { useSelector, useDispatch } from "react-redux"; -// import { BrowserRouter as Router, Route, Routes } from "react-router-dom"; import styled from "styled-components"; import LogoutHeader from "../components/Headers/LogoutHeader"; @@ -20,17 +19,14 @@ import CentralChart from "../components/CentralChart/Index"; import EntireList from "../components/EntireList/EntireList"; import HoldingList from "../components/HoldingList/HoldingList"; -import WatchList from "../components/watchlist/WatchList"; // Assuming you have a Holdings component -import CompareChartSection from "../components/CompareChartSection/Index"; +import WatchList from "../components/Watchlist/WatchList"; import StockOrderSection from "../components/StockOrderSection/Index"; -import ProfileModal from "../components/Profile/profileModal"; -// import CashModal from "../components/Profile/cashModal"; +import ProfileModal from "../components/Profile/ProfileModal"; import { StateProps } from "../models/stateProps"; import { TabContainerPage } from "./TabPages/TabContainerPage"; import { RootState } from "../store/config"; -// 🔴 로그아웃 관련 action 함수 import { setLoginState } from "../reducer/member/loginSlice"; import setAutoLogoutAlarm from "../utils/setAutoLogoutAlarm"; import { secondAlarmTime, lastAlarmTime } from "../utils/setAutoLogoutAlarm"; @@ -208,7 +204,6 @@ const MainPage = () => { {isLogin == 1 ? : }
- {selectedMenu === "전체종목" ? ( diff --git a/client/src/page/TabPages/TabContainerPage.tsx b/client/src/page/TabPages/TabContainerPage.tsx index f30656ac..e7bfbeed 100644 --- a/client/src/page/TabPages/TabContainerPage.tsx +++ b/client/src/page/TabPages/TabContainerPage.tsx @@ -3,14 +3,10 @@ import { StateProps } from "../../models/stateProps"; import MarketInfo from "./MarketInfoPage"; import { Routes, Route, Link } from "react-router-dom"; import styled from "styled-components"; -import DetailStockInformation from "../../components/stockinfoComponents/index"; -import { Community } from "./communityPage"; +import DetailStockInformation from "../../components/StockinfoComponents/Index"; +import { Community } from "./CommunityPage"; import { useState } from "react"; -import { - MarketImages, - InfoImages, - CommunityImages, -} from "../../components/communityComponents/IconComponent/Icon"; +import { MarketImages, InfoImages, CommunityImages } from "../../components/CommunityComponents/IconComponent/Icon"; import { useLocation } from "react-router-dom"; export const TabContainerPage = () => { const location = useLocation(); @@ -19,7 +15,7 @@ export const TabContainerPage = () => { const [activeTab, setActiveTab] = useState(initialTab); // 초기 탭 번호를 반환하는 함수 - function getInitialTab(pathname:string) { + function getInitialTab(pathname: string) { switch (pathname) { case "/stockitems": return 2; @@ -38,34 +34,19 @@ export const TabContainerPage = () => { return ( - +
-