forked from deriv-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: replace connect in Trader package v1.0 (#76)
- Loading branch information
1 parent
033c590
commit f9f0d0d
Showing
8 changed files
with
123 additions
and
185 deletions.
There are no files selected for viewing
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
42 changes: 21 additions & 21 deletions
42
packages/trader/src/Modules/SmartChart/Components/control-widgets.jsx
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 |
---|---|---|
@@ -1,27 +1,27 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import { observer, useStore } from '@deriv/stores'; | ||
import { DesktopWrapper } from '@deriv/components'; | ||
import { ChartMode, DrawTools, Share, StudyLegend, Views } from 'Modules/SmartChart'; | ||
|
||
const ControlWidgets = ({ updateChartType, updateGranularity }) => ( | ||
<React.Fragment> | ||
<DesktopWrapper> | ||
<ChartMode | ||
portalNodeId='modal_root' | ||
onChartType={type => updateChartType(type)} | ||
onGranularity={granularity => updateGranularity(granularity)} | ||
/> | ||
<StudyLegend portalNodeId='modal_root' searchInputClassName='data-hj-whitelist' /> | ||
<DrawTools portalNodeId='modal_root' /> | ||
<Views portalNodeId='modal_root' searchInputClassName='data-hj-whitelist' /> | ||
<Share portalNodeId='modal_root' /> | ||
</DesktopWrapper> | ||
</React.Fragment> | ||
); | ||
|
||
ControlWidgets.propTypes = { | ||
updateChartType: PropTypes.func, | ||
updateGranularity: PropTypes.func, | ||
}; | ||
const ControlWidgets = observer(() => { | ||
const { | ||
contract_trade: { updateChartType, updateGranularity }, | ||
} = useStore(); | ||
return ( | ||
<React.Fragment> | ||
<DesktopWrapper> | ||
<ChartMode | ||
portalNodeId='modal_root' | ||
onChartType={type => updateChartType(type)} | ||
onGranularity={granularity => updateGranularity(granularity)} | ||
/> | ||
<StudyLegend portalNodeId='modal_root' searchInputClassName='data-hj-whitelist' /> | ||
<DrawTools portalNodeId='modal_root' /> | ||
<Views portalNodeId='modal_root' searchInputClassName='data-hj-whitelist' /> | ||
<Share portalNodeId='modal_root' /> | ||
</DesktopWrapper> | ||
</React.Fragment> | ||
); | ||
}); | ||
|
||
export default ControlWidgets; |
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
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.