Skip to content

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh committed Oct 4, 2023
1 parent 6d0786e commit e2ea04e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/pages/TrueSightV2/components/WatchlistButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,7 @@ const CreateListInput = ({
value={value}
onChange={e => {
if (touchedRef.current) {
if (!checkExist(e.target.value)) {
setIsError(false)
} else {
setIsError(true)
}
setIsError(checkExist(e.target.value))
}
setValue(e.target.value)
}}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/TrueSightV2/components/chart/KyberScoreChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default function KyberScoreChart({
</defs>
<g transform="scale(1,-1) translate(0,-21)" clipPath="url(#cut-off-outline)">
{filledData?.map((item, index) => {
const v = item?.createdAt || 0
const v = item?.kyberScore || 0
const gap = 2
const rectWidth = (100 - (filledData.length - 1) * gap) / filledData.length
const rectHeight = !v ? 21 : Math.max((v * 21) / 100, 0.8)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/TrueSightV2/hooks/useRenderRankingList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ const renderByColumnType: Record<
<>
{['Binance', 'OKX', 'Bybit'].map((exname: string) => {
const exchange = token?.fundingRateExtra?.uMarginList?.find((item: any) => item.exchangeName === exname)
const rate = (exchange && exchange.rate) || 0
const rate = exchange?.rate || 0
return (
<td key={exname} style={{ textAlign: 'start' }}>
<Text color={colorFundingRateText(rate, theme)}>{rate.toFixed(4) + '%' || '--'}</Text>
Expand Down

0 comments on commit e2ea04e

Please sign in to comment.