@@ -160,6 +160,7 @@ export class FileNode extends React.Component {
160160 type = "text"
161161 className = "sidebar__file-item-input"
162162 value = { this . props . name }
163+ maxLength = "128"
163164 onChange = { this . handleFileNameChange }
164165 ref = { ( element ) => { this . fileNameInput = element ; } }
165166 onBlur = { ( ) => {
@@ -184,40 +185,50 @@ export class FileNode extends React.Component {
184185 { ( ( ) => { // eslint-disable-line
185186 if ( this . props . fileType === 'folder' ) {
186187 return (
187- < li >
188- < button
189- aria-label = "add file"
190- onClick = { ( ) => {
191- this . props . newFile ( this . props . id ) ;
192- setTimeout ( ( ) => this . hideFileOptions ( ) , 0 ) ;
193- } }
194- onBlur = { this . onBlurComponent }
195- onFocus = { this . onFocusComponent }
196- className = "sidebar__file-item-option"
197- >
198- Add File
199- </ button >
200- </ li >
201- ) ;
202- }
203- } ) ( ) }
204- { ( ( ) => { // eslint-disable-line
205- if ( this . props . fileType === 'folder' ) {
206- return (
207- < li >
208- < button
209- aria-label = "add folder"
210- onClick = { ( ) => {
211- this . props . newFolder ( this . props . id ) ;
212- setTimeout ( ( ) => this . hideFileOptions ( ) , 0 ) ;
213- } }
214- onBlur = { this . onBlurComponent }
215- onFocus = { this . onFocusComponent }
216- className = "sidebar__file-item-option"
217- >
218- Add Folder
219- </ button >
220- </ li >
188+ < React . Fragment >
189+ < li >
190+ < button
191+ aria-label = "add folder"
192+ onClick = { ( ) => {
193+ this . props . newFolder ( this . props . id ) ;
194+ setTimeout ( this . hideFileOptions , 0 ) ;
195+ } }
196+ onBlur = { this . onBlurComponent }
197+ onFocus = { this . onFocusComponent }
198+ className = "sidebar__file-item-option"
199+ >
200+ Create folder
201+ </ button >
202+ </ li >
203+ < li >
204+ < button
205+ aria-label = "add file"
206+ onClick = { ( ) => {
207+ this . props . newFile ( this . props . id ) ;
208+ setTimeout ( this . hideFileOptions , 0 ) ;
209+ } }
210+ onBlur = { this . onBlurComponent }
211+ onFocus = { this . onFocusComponent }
212+ className = "sidebar__file-item-option"
213+ >
214+ Create file
215+ </ button >
216+ </ li >
217+ < li >
218+ < button
219+ aria-label = "upload file"
220+ onClick = { ( ) => {
221+ this . props . openUploadFileModal ( this . props . id ) ;
222+ setTimeout ( this . hideFileOptions , 0 ) ;
223+ } }
224+ onBlur = { this . onBlurComponent }
225+ onFocus = { this . onFocusComponent }
226+ >
227+ Upload file
228+ </ button >
229+ </ li >
230+
231+ </ React . Fragment >
221232 ) ;
222233 }
223234 } ) ( ) }
@@ -288,7 +299,8 @@ FileNode.propTypes = {
288299 newFolder : PropTypes . func . isRequired ,
289300 showFolderChildren : PropTypes . func . isRequired ,
290301 hideFolderChildren : PropTypes . func . isRequired ,
291- canEdit : PropTypes . bool . isRequired
302+ canEdit : PropTypes . bool . isRequired ,
303+ openUploadFileModal : PropTypes . func . isRequired
292304} ;
293305
294306FileNode . defaultProps = {
0 commit comments