forked from deriv-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "[DTRA] Ahmad/FEQ-857/Worldwide launch smartchart2 (deriv-com#…
…11195)" (deriv-com#12053) * Revert "[DTRA] Ahmad/FEQ-857/Worldwide launch smartchart2 (deriv-com#11195)" This reverts commit cd5c2e1. * fix: test case
- Loading branch information
1 parent
eeea94b
commit 2c67343
Showing
44 changed files
with
1,663 additions
and
180 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
49 changes: 38 additions & 11 deletions
49
packages/bot-web-ui/src/components/chart/toolbar-widgets.tsx
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 React from 'react'; | ||
import { getUrlBase, moduleLoader } from '@deriv/shared'; | ||
|
||
let module: Promise<any> | undefined; | ||
|
||
const init = () => { | ||
module = moduleLoader(() => { | ||
// TODO: Proper fix for types in smartcharts | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
return import(/* webpackChunkName: "smart_chart_beta" */ '@deriv/deriv-charts-beta'); | ||
}); | ||
|
||
module.then(({ setSmartChartsPublicPath }: { setSmartChartsPublicPath: (path: string) => void }) => { | ||
setSmartChartsPublicPath(getUrlBase('/js/smartchartsbeta/')); | ||
}); | ||
}; | ||
|
||
// React.Lazy expects a default export for the component | ||
// SmartChart library exports many components | ||
const load = (component_name: string) => () => { | ||
if (!module) { | ||
init(); | ||
} | ||
return module!.then(module => { | ||
return { default: module[component_name] }; | ||
}); | ||
}; | ||
|
||
export const SmartChartBeta = React.lazy(load('SmartChart')); | ||
export const ChartTitleBeta = React.lazy(load('ChartTitle')); | ||
|
||
export const ChartSizeBeta = React.lazy(load('ChartSize')); | ||
export const ChartModeBeta = React.lazy(load('ChartMode')); | ||
export const DrawToolsBeta = React.lazy(load('DrawTools')); | ||
export const ShareBeta = React.lazy(load('Share')); | ||
export const StudyLegendBeta = React.lazy(load('StudyLegend')); | ||
export const ViewsBeta = React.lazy(load('Views')); | ||
export const ToolbarWidgetBeta = React.lazy(load('ToolbarWidget')); | ||
|
||
export const FastMarkerBeta = React.lazy(load('FastMarker')); | ||
export const RawMarkerBeta = React.lazy(load('RawMarker')); |
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
Oops, something went wrong.