From e5e4925babc0a44047c19cf0c58a1331ead22ff2 Mon Sep 17 00:00:00 2001 From: sinjw Date: Tue, 12 Sep 2023 13:15:03 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=EB=B9=8C=EB=93=9C=EC=8B=9C=20=EB=B0=9C?= =?UTF-8?q?=EC=83=9D=ED=95=98=EB=8A=94=20=EC=97=90=EB=9F=AC=EC=88=98?= =?UTF-8?q?=EC=A0=95=20-=ED=83=80=EC=9E=85=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20-=EA=B2=BD=EB=A1=9C=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20Issues=20#84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MarketComponents/MarketKospiChart.tsx | 40 ++++++++++--------- .../communityComponents/Comments.tsx | 5 --- client/src/page/TabPages/TabContainerPage.tsx | 38 ++++++++++++++---- 3 files changed, 52 insertions(+), 31 deletions(-) diff --git a/client/src/components/MarketComponents/MarketKospiChart.tsx b/client/src/components/MarketComponents/MarketKospiChart.tsx index c49103db..5cd7e341 100644 --- a/client/src/components/MarketComponents/MarketKospiChart.tsx +++ b/client/src/components/MarketComponents/MarketKospiChart.tsx @@ -77,7 +77,7 @@ const MarketkospiChart = () => { symbol: "none", sampling: "lttb", itemStyle: { - color: function (params) { + color: function (params: any) { // 주식 상승이면 빨간색, 하락이면 파란색 반환 return params.data[1] >= params.data[0] ? "rgb(255, 0, 0)" @@ -97,26 +97,28 @@ const MarketkospiChart = () => { ]), }, - data: kospiData.map((item, index, array) => { - const currentPrice = parseFloat(item.bstp_nmix_oprc); - const previousPrice = - index > 0 - ? parseFloat(array[index - 1].bstp_nmix_oprc) - : currentPrice; + data: kospiData.map( + (item: KospiProps, index: number, array: KospiProps[]) => { + const currentPrice = parseFloat(item.bstp_nmix_oprc); + const previousPrice = + index > 0 + ? parseFloat(array[index - 1].bstp_nmix_oprc) + : currentPrice; - // 현재 가격과 이전 가격을 비교하여 색상 설정 - const color = - currentPrice > previousPrice - ? "rgb(255, 0, 0)" - : "rgb(0, 0, 255)"; + // 현재 가격과 이전 가격을 비교하여 색상 설정 + const color = + currentPrice > previousPrice + ? "rgb(255, 0, 0)" + : "rgb(0, 0, 255)"; - return { - value: currentPrice, - itemStyle: { - color: color, - }, - }; - }), + return { + value: currentPrice, + itemStyle: { + color: color, + }, + }; + } + ), }, ], grid: { diff --git a/client/src/components/communityComponents/Comments.tsx b/client/src/components/communityComponents/Comments.tsx index c980e439..1e290ba1 100644 --- a/client/src/components/communityComponents/Comments.tsx +++ b/client/src/components/communityComponents/Comments.tsx @@ -48,11 +48,6 @@ const Comments = ({ postId }: { postId: number }) => { setVisibleComments(close ? 1 : commentData.length); }; - const CommentText = { - write: "작성", - replyCount: `댓글${commentData.length}개 모두보기`, - }; - return (
diff --git a/client/src/page/TabPages/TabContainerPage.tsx b/client/src/page/TabPages/TabContainerPage.tsx index f44fcddc..cbcb8d5d 100644 --- a/client/src/page/TabPages/TabContainerPage.tsx +++ b/client/src/page/TabPages/TabContainerPage.tsx @@ -2,10 +2,15 @@ import MarketInfo from "./MarketInfoPage"; import { Routes, Route, Link } from "react-router-dom"; import styled from "styled-components"; import { DetailStockInformation } from "../../components/stockListComponents/DetailStockInformation"; -import { Community } from "./CommunityPage"; +import { Community } from "./communityPage"; import { Status } from "../../components/statusComponents"; import { useState } from "react"; -import { MarketImages, InfoImages, CommunityImages, InvestImage } from "../../components/communityComponents/IconComponent/Icon"; +import { + MarketImages, + InfoImages, + CommunityImages, + InvestImage, +} from "../../components/communityComponents/IconComponent/Icon"; export const TabContainerPage = () => { const [activeTab, setActiveTab] = useState(1); const handleClickActiveTab = (number: number) => { @@ -14,23 +19,42 @@ export const TabContainerPage = () => { return ( - +
-