@@ -2,8 +2,8 @@ import PropTypes from 'prop-types';
2
2
import classNames from 'classnames' ;
3
3
import React , { useState , useRef } from 'react' ;
4
4
import { connect } from 'react-redux' ;
5
- import { bindActionCreators } from 'redux' ;
6
5
import { useTranslation } from 'react-i18next' ;
6
+
7
7
import * as IDEActions from '../actions/ide' ;
8
8
import * as FileActions from '../actions/files' ;
9
9
import DownArrowIcon from '../../../images/down-filled-triangle.svg' ;
@@ -353,7 +353,12 @@ const FileNode = ({
353
353
< ul className = "file-item__children" >
354
354
{ children . map ( ( childId ) => (
355
355
< li key = { childId } >
356
- < ConnectedFileNode id = { childId } parentId = { id } />
356
+ < ConnectedFileNode
357
+ id = { childId }
358
+ parentId = { id }
359
+ canEdit = { canEdit }
360
+ onClickFile = { onClickFile }
361
+ />
357
362
</ li >
358
363
) ) }
359
364
</ ul >
@@ -402,13 +407,12 @@ function mapStateToProps(state, ownProps) {
402
407
} ) ;
403
408
}
404
409
405
- function mapDispatchToProps ( dispatch ) {
406
- return bindActionCreators ( Object . assign ( FileActions , IDEActions ) , dispatch ) ;
407
- }
410
+ const mapDispatchToProps = { ...FileActions , ...IDEActions } ;
408
411
409
412
const ConnectedFileNode = connect (
410
413
mapStateToProps ,
411
414
mapDispatchToProps
412
415
) ( FileNode ) ;
413
416
414
- export { FileNode , ConnectedFileNode as default } ;
417
+ export { FileNode } ;
418
+ export default ConnectedFileNode ;
0 commit comments