-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
179 additions
and
6 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
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,42 @@ | ||
import { CoinTrade } from "../../../types/common/common.type"; | ||
import ValuePoint from "../../common/valuePoint/ValuePoint"; | ||
import { | ||
CoinDetailTradeInfoWrap, | ||
CoinDetailTradeItem, | ||
CoinDetailTradeTitle, | ||
CoinDetailTradeValueWrap, | ||
CoinDetailTradeWrap, | ||
} from "./style"; | ||
|
||
type Props = { | ||
coinTradesData: CoinTrade[] | null; | ||
}; | ||
|
||
const CoinDetailTrade = ({ coinTradesData }: Props) => { | ||
return ( | ||
<CoinDetailTradeWrap> | ||
<CoinDetailTradeTitle>최근 체결 내역</CoinDetailTradeTitle> | ||
{coinTradesData?.map((trade) => ( | ||
<CoinDetailTradeItem | ||
key={`${trade.trade_date_utc} ${trade.trade_time_utc} trade`} | ||
> | ||
<CoinDetailTradeInfoWrap> | ||
<h1>{trade.market}</h1> | ||
<span> | ||
{trade.trade_date_utc} {trade.trade_time_utc} | ||
</span> | ||
</CoinDetailTradeInfoWrap> | ||
<CoinDetailTradeValueWrap change={trade.change_price}> | ||
<p>{trade.trade_price}</p> | ||
<span> | ||
<ValuePoint change_price={trade.change_price} /> | ||
{trade.change_price} | ||
</span> | ||
</CoinDetailTradeValueWrap> | ||
</CoinDetailTradeItem> | ||
))} | ||
</CoinDetailTradeWrap> | ||
); | ||
}; | ||
|
||
export default CoinDetailTrade; |
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,78 @@ | ||
import styled, { css } from "styled-components"; | ||
import { palette } from "../../../styles/palette"; | ||
|
||
export const CoinDetailTradeWrap = styled.div` | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
border: 1px solid ${palette.gray[200]}; | ||
border-radius: 4px; | ||
background-color: ${({ theme }) => theme.subBackgroundColor}; | ||
padding-bottom: 14px; | ||
`; | ||
|
||
export const CoinDetailTradeTitle = styled.div` | ||
font-size: 13px; | ||
margin: 15px 13px; | ||
color: ${({ theme }) => theme.contrast}; | ||
font-weight: bold; | ||
`; | ||
|
||
export const CoinDetailTradeItem = styled.div` | ||
padding: 4px 16px 5px; | ||
display: flex; | ||
justify-content: space-between; | ||
`; | ||
|
||
export const CoinDetailTradeInfoWrap = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
h1 { | ||
font-size: 13px; | ||
color: ${({ theme }) => theme.contrast}; | ||
line-height: 17px; | ||
} | ||
span { | ||
font-size: 12px; | ||
margin-top: 2px; | ||
color: ${({ theme }) => theme.subText}; | ||
line-height: 16px; | ||
} | ||
`; | ||
|
||
export const CoinDetailTradeValueWrap = styled.div<{ change: number }>` | ||
display: flex; | ||
flex-direction: column; | ||
font-size: 12px; | ||
text-align: end; | ||
${({ change }) => | ||
change! > 0 && | ||
css` | ||
color: ${palette.red[500]}; | ||
`}; | ||
${({ change }) => | ||
change! < 0 && | ||
css` | ||
color: ${palette.blue[700]}; | ||
`} | ||
${({ change }) => | ||
change! === 0 && | ||
css` | ||
color: ${({ theme }) => theme.contrast}; | ||
`} | ||
p { | ||
line-height: 16px; | ||
} | ||
span { | ||
display: flex; | ||
align-items: center; | ||
justify-content: end; | ||
margin-top: 1px; | ||
line-height: 16px; | ||
} | ||
`; |
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,37 @@ | ||
import styled, { css } from "styled-components"; | ||
import { palette } from "../../../styles/palette"; | ||
|
||
type Props = { | ||
change_price: number; | ||
}; | ||
|
||
const ValuePoint = ({ change_price }: Props) => { | ||
return <ValuePointItem change={change_price} />; | ||
}; | ||
|
||
export default ValuePoint; | ||
|
||
export const ValuePointItem = styled.span<{ change: number }>` | ||
border-style: solid; | ||
border-width: 7px 4.5px 0 4.5px; | ||
margin-right: 5px; | ||
${({ change }) => | ||
change! > 0 && | ||
css` | ||
transform: rotate(180deg); | ||
border-color: ${palette.red[500]} transparent transparent transparent; | ||
`}; | ||
${({ change }) => | ||
change! === 0 && | ||
css` | ||
border-color: ${palette.gray[200]} transparent transparent transparent; | ||
`}; | ||
${({ change }) => | ||
change! < 0 && | ||
css` | ||
border-color: ${palette.blue[700]} transparent transparent transparent; | ||
`}; | ||
`; |
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