fix(trading): avoid funding LineChart recreate instance on FundingContainer re-render (#5454)
This commit is contained in:
parent
3cd393dac0
commit
41cd6b1455
@ -40,6 +40,9 @@ const DateRange = {
|
|||||||
RANGE_ALL: 'All',
|
RANGE_ALL: 'All',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const priceFormat = (fundingRate: number) =>
|
||||||
|
`${(fundingRate * 100).toFixed(4)}%`;
|
||||||
|
|
||||||
export const FundingContainer = ({ marketId }: { marketId: string }) => {
|
export const FundingContainer = ({ marketId }: { marketId: string }) => {
|
||||||
const t = useT();
|
const t = useT();
|
||||||
const { theme } = useThemeSwitcher();
|
const { theme } = useThemeSwitcher();
|
||||||
@ -82,7 +85,7 @@ export const FundingContainer = ({ marketId }: { marketId: string }) => {
|
|||||||
<LineChart
|
<LineChart
|
||||||
data={values}
|
data={values}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
priceFormat={(fundingRate) => `${(fundingRate * 100).toFixed(4)}%`}
|
priceFormat={priceFormat}
|
||||||
yAxisTickFormat="%"
|
yAxisTickFormat="%"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user