diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-10 03:15:32 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-10 03:15:32 +0800 |
commit | daa011f7cbbc6719d99eef251d07f552e23c21fb (patch) | |
tree | da1af3c83e7ed8677228714a18d67ea97147119a /packages/instant/src/containers/current_standard_sliding_panel.ts | |
parent | 239eada7d92e27ab5aa81d3364ffe5d83d0680a7 (diff) | |
download | dexon-sol-tools-daa011f7cbbc6719d99eef251d07f552e23c21fb.tar dexon-sol-tools-daa011f7cbbc6719d99eef251d07f552e23c21fb.tar.gz dexon-sol-tools-daa011f7cbbc6719d99eef251d07f552e23c21fb.tar.bz2 dexon-sol-tools-daa011f7cbbc6719d99eef251d07f552e23c21fb.tar.lz dexon-sol-tools-daa011f7cbbc6719d99eef251d07f552e23c21fb.tar.xz dexon-sol-tools-daa011f7cbbc6719d99eef251d07f552e23c21fb.tar.zst dexon-sol-tools-daa011f7cbbc6719d99eef251d07f552e23c21fb.zip |
feat: implement CurrentStandardSlidingPanel and put it in the main container
Diffstat (limited to 'packages/instant/src/containers/current_standard_sliding_panel.ts')
-rw-r--r-- | packages/instant/src/containers/current_standard_sliding_panel.ts | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/packages/instant/src/containers/current_standard_sliding_panel.ts b/packages/instant/src/containers/current_standard_sliding_panel.ts new file mode 100644 index 000000000..82ac7fa1b --- /dev/null +++ b/packages/instant/src/containers/current_standard_sliding_panel.ts @@ -0,0 +1,31 @@ +import * as React from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'redux'; + +import { StandardSlidingPanel } from '../components/standard_sliding_panel'; +import { Action, actions } from '../redux/actions'; +import { State } from '../redux/reducer'; +import { StandardSlidingPanelSettings } from '../types'; + +export interface CurrentStandardSlidingPanelProps {} + +interface ConnectedState extends StandardSlidingPanelSettings {} + +interface ConnectedDispatch { + onClose: () => void; +} + +const mapStateToProps = (state: State, _ownProps: CurrentStandardSlidingPanelProps): ConnectedState => + state.standardSlidingPanelSettings; + +const mapDispatchToProps = ( + dispatch: Dispatch<Action>, + ownProps: CurrentStandardSlidingPanelProps, +): ConnectedDispatch => ({ + onClose: () => dispatch(actions.closeStandardSlidingPanel()), +}); + +export const CurrentStandardSlidingPanel: React.ComponentClass<CurrentStandardSlidingPanelProps> = connect( + mapStateToProps, + mapDispatchToProps, +)(StandardSlidingPanel); |