parent
b44105f586
commit
feaf36e92d
|
@ -29,6 +29,7 @@ const Tooltip = ({
|
||||||
appendTo={() => document.body}
|
appendTo={() => document.body}
|
||||||
maxWidth={maxWidth}
|
maxWidth={maxWidth}
|
||||||
interactive
|
interactive
|
||||||
|
inlinePositioning
|
||||||
delay={delay}
|
delay={delay}
|
||||||
content={
|
content={
|
||||||
content ? (
|
content ? (
|
||||||
|
|
|
@ -32,7 +32,7 @@ export interface ChartContainerProps {
|
||||||
const TradingViewChart = () => {
|
const TradingViewChart = () => {
|
||||||
const { theme } = useTheme()
|
const { theme } = useTheme()
|
||||||
const { width } = useViewport()
|
const { width } = useViewport()
|
||||||
const { publicKey } = useWallet()
|
|
||||||
const [chartReady, setChartReady] = useState(false)
|
const [chartReady, setChartReady] = useState(false)
|
||||||
const selectedMarketName = mangoStore((s) => s.selectedMarket.current?.name)
|
const selectedMarketName = mangoStore((s) => s.selectedMarket.current?.name)
|
||||||
const isMobile = width ? width < breakpoints.sm : false
|
const isMobile = width ? width < breakpoints.sm : false
|
||||||
|
@ -45,10 +45,6 @@ const TradingViewChart = () => {
|
||||||
theme: 'Dark',
|
theme: 'Dark',
|
||||||
container: 'tv_chart_container',
|
container: 'tv_chart_container',
|
||||||
datafeedUrl: CHART_DATA_FEED,
|
datafeedUrl: CHART_DATA_FEED,
|
||||||
chartsStorageUrl: 'https://trading-view-backend.herokuapp.com',
|
|
||||||
chartsStorageApiVersion: '1.1',
|
|
||||||
clientId: 'mango.markets',
|
|
||||||
userId: '',
|
|
||||||
libraryPath: '/charting_library/',
|
libraryPath: '/charting_library/',
|
||||||
fullscreen: false,
|
fullscreen: false,
|
||||||
autosize: true,
|
autosize: true,
|
||||||
|
@ -129,10 +125,7 @@ const TradingViewChart = () => {
|
||||||
defaultProps.container as ChartingLibraryWidgetOptions['container'],
|
defaultProps.container as ChartingLibraryWidgetOptions['container'],
|
||||||
library_path: defaultProps.libraryPath as string,
|
library_path: defaultProps.libraryPath as string,
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
enabled_features: [
|
enabled_features: ['hide_left_toolbar_by_default'],
|
||||||
'hide_left_toolbar_by_default',
|
|
||||||
publicKey ? 'study_templates' : '',
|
|
||||||
],
|
|
||||||
disabled_features: [
|
disabled_features: [
|
||||||
'use_localstorage_for_settings',
|
'use_localstorage_for_settings',
|
||||||
'timeframes_toolbar',
|
'timeframes_toolbar',
|
||||||
|
@ -146,16 +139,12 @@ const TradingViewChart = () => {
|
||||||
'header_screenshot',
|
'header_screenshot',
|
||||||
// 'header_widget_dom_node',
|
// 'header_widget_dom_node',
|
||||||
// 'header_widget',
|
// 'header_widget',
|
||||||
!publicKey ? 'header_saveload' : '',
|
'header_saveload',
|
||||||
'header_undo_redo',
|
'header_undo_redo',
|
||||||
'header_interval_dialog_button',
|
'header_interval_dialog_button',
|
||||||
'show_interval_dialog_on_key_press',
|
'show_interval_dialog_on_key_press',
|
||||||
'header_symbol_search',
|
'header_symbol_search',
|
||||||
],
|
],
|
||||||
charts_storage_url: defaultProps.chartsStorageUrl,
|
|
||||||
charts_storage_api_version: defaultProps.chartsStorageApiVersion,
|
|
||||||
client_id: defaultProps.clientId,
|
|
||||||
user_id: publicKey ? publicKey.toString() : defaultProps.userId,
|
|
||||||
fullscreen: defaultProps.fullscreen,
|
fullscreen: defaultProps.fullscreen,
|
||||||
autosize: defaultProps.autosize,
|
autosize: defaultProps.autosize,
|
||||||
studies_overrides: defaultProps.studiesOverrides,
|
studies_overrides: defaultProps.studiesOverrides,
|
||||||
|
@ -184,7 +173,7 @@ const TradingViewChart = () => {
|
||||||
})
|
})
|
||||||
//eslint-disable-next-line
|
//eslint-disable-next-line
|
||||||
}
|
}
|
||||||
}, [theme, isMobile, defaultProps, publicKey])
|
}, [theme, isMobile, defaultProps])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id={defaultProps.container as string} className="tradingview-chart" />
|
<div id={defaultProps.container as string} className="tradingview-chart" />
|
||||||
|
|
Loading…
Reference in New Issue