mango-v4-ui/components/trade/TradingChartContainer.tsx

27 lines
667 B
TypeScript
Raw Normal View History

2022-12-06 09:35:15 -08:00
import useLocalStorageState from 'hooks/useLocalStorageState'
import dynamic from 'next/dynamic'
import { TRADE_CHART_UI_KEY } from 'utils/constants'
const TradingViewChart = dynamic(() => import('./TradingViewChart'), {
ssr: false,
})
const TradingViewChartKlineContainer = dynamic(
() => import('./TradingViewChartKlineContainer'),
{
ssr: false,
}
)
const TradingChartContainer = () => {
const [tradingChart] = useLocalStorageState(TRADE_CHART_UI_KEY)
2022-12-22 02:04:38 -08:00
const isTradingChart = tradingChart === 'custom'
2022-12-21 09:48:39 -08:00
return !isTradingChart ? (
2023-01-18 18:42:29 -08:00
<TradingViewChart />
2022-12-06 09:35:15 -08:00
) : (
2023-01-18 18:42:29 -08:00
<TradingViewChartKlineContainer />
2022-12-06 09:35:15 -08:00
)
}
export default TradingChartContainer