-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 좌/우측 컴포넌트 및 중앙 차트 컴포넌트 관련 가독성 떨어지는 코드 리팩토링 - 기능 구현 후 추가적인 리팩토링 예정 Issues #43
- Loading branch information
1 parent
377a3c7
commit deb6d40
Showing
29 changed files
with
503 additions
and
595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
client/src/components/CentralChartMenu/ChangeChartCycleBtn.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { styled } from "styled-components"; | ||
|
||
const chartCylceText01: string = "30분"; | ||
const chartCylceText02: string = "일"; | ||
const chartCylceText03: string = "주"; | ||
const chartCylceText04: string = "월"; | ||
const chartCylceText05: string = "년"; | ||
|
||
const ChangeChartCycleBtn = () => { | ||
return ( | ||
<Container> | ||
<Button>{chartCylceText01}</Button> | ||
<Button>{chartCylceText02}</Button> | ||
<Button>{chartCylceText03}</Button> | ||
<Button>{chartCylceText04}</Button> | ||
<Button>{chartCylceText05}</Button> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default ChangeChartCycleBtn; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
gap: 4px; | ||
`; | ||
|
||
const Button = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
padding-right: 14px; | ||
color: #999999; | ||
`; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { styled } from "styled-components"; | ||
|
||
import ExpandScreenBtn from "./ExpandScreenBtn"; | ||
import StockOverview from "./StockOverview"; | ||
import BookmarkBtn from "./BookmarkBtn"; | ||
import StockOrderBtn from "./StockOrderBtn"; | ||
import CompareChartBtn from "./CompareChartBtn"; | ||
import ChangeChartCycleBtn from "./ChangeChartCycleBtn"; | ||
|
||
const UpperMenuBar = () => { | ||
return ( | ||
<Container> | ||
<div className="FirstLine"> | ||
<ExpandScreenBtn direction="left" /> | ||
<StockOverview /> | ||
<BookmarkBtn /> | ||
<StockOrderBtn type="buying" /> | ||
<StockOrderBtn type="selling" /> | ||
<ExpandScreenBtn direction="right" /> | ||
</div> | ||
<div className="SecondLine"> | ||
<CompareChartBtn /> | ||
<ChangeChartCycleBtn /> | ||
</div> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default UpperMenuBar; | ||
|
||
const Container = styled.div` | ||
width: 100%; | ||
text-align: center; | ||
.FirstLine { | ||
width: 100%; | ||
height: 44px; | ||
display: flex; | ||
flex-direction: row; | ||
border-bottom: 1px solid darkgray; | ||
} | ||
.SecondLine { | ||
width: 100%; | ||
height: 40px; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: center; | ||
border-bottom: 1px solid darkgray; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import { styled } from "styled-components"; | ||
|
||
// dummyData | ||
import { dummyData } from "./dummyData"; | ||
|
||
const marketType: string = "코스피"; | ||
const volumeText: string = "거래량"; | ||
const valueText: string = "거래대금"; | ||
|
||
// styled-component 수정 및 미디어 쿼리 적용 | ||
const StockOverview = () => { | ||
return ( | ||
<Container> | ||
<img className="CorpLogo" src={dummyData.corpLogo} /> | ||
<div className="CorpName">{dummyData.corpName}</div> | ||
<div className="StockCode"> | ||
{dummyData.stockCode} <span>{marketType}</span> | ||
</div> | ||
<div className="StockPrice">{dummyData.stockPrice}</div> | ||
<div className="PriceChangeRate">{dummyData.changeRate}</div> | ||
<div className="PriceChangeAmount">{dummyData.changeAmount}</div> | ||
<TransactionVolume> | ||
<span>{volumeText}</span> | ||
{dummyData.totalVolume} | ||
</TransactionVolume> | ||
<TransactionValue> | ||
<span>{valueText}</span> | ||
{dummyData.totalValue} | ||
</TransactionValue> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default StockOverview; | ||
|
||
const Container = styled.div` | ||
flex: 7 0 0; | ||
overflow-x: scroll; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
padding-left: 12px; | ||
padding-right: 12px; | ||
gap: 8px; | ||
&::-webkit-scrollbar { | ||
display: none; | ||
} | ||
.CorpLogo { | ||
width: 24px; | ||
height: 24px; | ||
border-radius: 50%; | ||
} | ||
.CorpName { | ||
white-space: nowrap; | ||
min-width: min-content; | ||
font-size: 18px; | ||
font-weight: 530; | ||
} | ||
.StockCode { | ||
white-space: nowrap; | ||
min-width: min-content; | ||
font-size: 14px; | ||
color: #999999; | ||
} | ||
.StockPrice { | ||
font-size: 18px; | ||
color: #ed2926; | ||
font-weight: 530; | ||
} | ||
.PriceChangeRate, | ||
.PriceChangeAmount { | ||
font-size: 14px; | ||
color: #ed2926; | ||
} | ||
`; | ||
|
||
const TransactionVolume = styled.div` | ||
white-space: nowrap; | ||
min-width: min-content; | ||
font-size: 14px; | ||
color: #525252; | ||
& span { | ||
color: #999999; | ||
padding-right: 5px; | ||
} | ||
`; | ||
|
||
const TransactionValue = styled(TransactionVolume)``; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import dummyImg from "../../asset/CentralSectionMenu-dummyImg.png"; | ||
|
||
export const dummyData: dummyProps = { | ||
corpLogo: dummyImg, | ||
corpName: "카카오", | ||
stockCode: "035720", | ||
stockPrice: "48,600", | ||
changeRate: "+1.25%", | ||
changeAmount: "▲600", | ||
totalVolume: "864,728", | ||
totalValue: "419억 1,468만", | ||
}; | ||
|
||
interface dummyProps { | ||
corpLogo: string; | ||
corpName: string; | ||
stockCode: string; | ||
stockPrice: string; | ||
changeRate: string; | ||
changeAmount: string; | ||
totalVolume: string; | ||
totalValue: string; | ||
} |
15 changes: 0 additions & 15 deletions
15
client/src/components/CentralChartSection/TransactionVolumeChart.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.