Skip to content

Commit

Permalink
[Fix]빌드시 발생하는 에러수정
Browse files Browse the repository at this point in the history
-타입 에러 수정
-경로에러 수정 Issues #84
  • Loading branch information
sinjw committed Sep 12, 2023
1 parent 22a1141 commit e5e4925
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 31 deletions.
40 changes: 21 additions & 19 deletions client/src/components/MarketComponents/MarketKospiChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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: {
Expand Down
5 changes: 0 additions & 5 deletions client/src/components/communityComponents/Comments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ const Comments = ({ postId }: { postId: number }) => {
setVisibleComments(close ? 1 : commentData.length);
};

const CommentText = {
write: "작성",
replyCount: `댓글${commentData.length}개 모두보기`,
};

return (
<CommentContainer>
<div>
Expand Down
38 changes: 31 additions & 7 deletions client/src/page/TabPages/TabContainerPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -14,23 +19,42 @@ export const TabContainerPage = () => {

return (
<TabContainerStyle>
<style>@import url('https://fonts.googleapis.com/css2?family=Jua&family=Noto+Sans+KR:wght@500&display=swap');</style>
<style>
@import
url('https://fonts.googleapis.com/css2?family=Jua&family=Noto+Sans+KR:wght@500&display=swap');
</style>

<div>
<TabNavArea>
<Nav to="/" onClick={() => handleClickActiveTab(1)} className={`tab ${activeTab === 1 ? "active-tab" : "inactive-tab"}`}>
<Nav
to="/"
onClick={() => handleClickActiveTab(1)}
className={`tab ${activeTab === 1 ? "active-tab" : "inactive-tab"}`}
>
<MarketImages />
{TabContainerText.marketInfo}
</Nav>
<Nav to="/stockitems" onClick={() => handleClickActiveTab(2)} className={`tab ${activeTab === 2 ? "active-tab" : "inactive-tab"}`}>
<Nav
to="/stockitems"
onClick={() => handleClickActiveTab(2)}
className={`tab ${activeTab === 2 ? "active-tab" : "inactive-tab"}`}
>
<InfoImages />
{TabContainerText.StockInfo}
</Nav>
<Nav to="/community" onClick={() => handleClickActiveTab(3)} className={`tab ${activeTab === 3 ? "active-tab" : "inactive-tab"}`}>
<Nav
to="/community"
onClick={() => handleClickActiveTab(3)}
className={`tab ${activeTab === 3 ? "active-tab" : "inactive-tab"}`}
>
<CommunityImages />
{TabContainerText.community}
</Nav>
<Nav to="/status" onClick={() => handleClickActiveTab(4)} className={`tab ${activeTab === 4 ? "active-tab" : "inactive-tab"}`}>
<Nav
to="/status"
onClick={() => handleClickActiveTab(4)}
className={`tab ${activeTab === 4 ? "active-tab" : "inactive-tab"}`}
>
<InvestImage />
{TabContainerText.myPortfolio}
</Nav>
Expand Down

0 comments on commit e5e4925

Please sign in to comment.