|
1 | 1 | import PropTypes from 'prop-types'; |
2 | 2 | import classNames from 'classnames'; |
3 | 3 | import React, { useState, useRef } from 'react'; |
4 | | -import { connect } from 'react-redux'; |
| 4 | +import { connect, useDispatch } from 'react-redux'; |
5 | 5 | import { useTranslation } from 'react-i18next'; |
6 | 6 |
|
7 | 7 | import * as IDEActions from '../actions/ide'; |
@@ -87,6 +87,7 @@ const FileNode = ({ |
87 | 87 | const [isEditingName, setIsEditingName] = useState(false); |
88 | 88 | const [isDeleting, setIsDeleting] = useState(false); |
89 | 89 | const [updatedName, setUpdatedName] = useState(name); |
| 90 | + const dispatch = useDispatch(); |
90 | 91 |
|
91 | 92 | const { t } = useTranslation(); |
92 | 93 | const fileNameInput = useRef(null); |
@@ -122,17 +123,17 @@ const FileNode = ({ |
122 | 123 | }; |
123 | 124 |
|
124 | 125 | const handleClickAddFile = () => { |
125 | | - newFile(id); |
| 126 | + dispatch(newFile(id)); |
126 | 127 | setTimeout(() => hideFileOptions(), 0); |
127 | 128 | }; |
128 | 129 |
|
129 | 130 | const handleClickAddFolder = () => { |
130 | | - newFolder(id); |
| 131 | + dispatch(newFolder(id)); |
131 | 132 | setTimeout(() => hideFileOptions(), 0); |
132 | 133 | }; |
133 | 134 |
|
134 | 135 | const handleClickUploadFile = () => { |
135 | | - openUploadFileModal(id); |
| 136 | + dispatch(openUploadFileModal(id)); |
136 | 137 | setTimeout(hideFileOptions, 0); |
137 | 138 | }; |
138 | 139 |
|
|
0 commit comments