diff --git a/src/components/index/indexConsole/commands/fetchCommands/Album/Create.js b/src/components/index/indexConsole/commands/fetchCommands/Album/Create.js index 48aeaf0..fc659b0 100644 --- a/src/components/index/indexConsole/commands/fetchCommands/Album/Create.js +++ b/src/components/index/indexConsole/commands/fetchCommands/Album/Create.js @@ -22,6 +22,11 @@ const AlbumCreate = ({ const titleInput = React.createRef() const descriptionInput = React.createRef() + let refList = [ + titleInput, + descriptionInput + ] + let inputList = [ { type: 'text', @@ -47,6 +52,14 @@ const AlbumCreate = ({ } ] + const resetState = () => { + setConsoleHistory( consoleHistory + message ) + setComponentVisible( false ) + setImage('') + setImageInfo('Drop/Click\nfor upload album image...') + setMessage('') + } + const create = async (event) => { event.preventDefault() let title = titleInput.current.value @@ -73,50 +86,6 @@ const AlbumCreate = ({ setMessage( response['info'] + '\n' ) }) } - - // useEffect( - // () => { - // if ( componentVisible ) { - // document.getElementById('titleAlbumInput').focus() - // } else { - // activateConsoleInput() - // } - // if ( message !== '' ) { - - // titleInput.current.value = '' - // descriptionInput.current.value = '' - - // setConsoleHistory( consoleHistory + message ) - // setComponentVisible( false ) - // setImage('') - // setImageInfo('Drop/Click\nfor upload album image...') - // setMessage('') - // } - // } - // ) - - const resetState = () => { - setConsoleHistory( consoleHistory + message ) - setComponentVisible( false ) - setImage('') - setImageInfo('Drop/Click\nfor upload album image...') - setMessage('') - } - - let refList = [ - titleInput, - descriptionInput - ] - - // useEffect( () => { - - // ResetComponent( - // resetState, refList, - // message, - // componentVisible, 'titleAlbumInput', - // activateConsoleInput - // )} - // ) return (