-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new FileDrop implementation. #936
Add new FileDrop implementation. #936
Conversation
240ecc9
to
c3e9a60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fantastic change. Much better user experience.
Just a few comments.
setUserSelect(true) | ||
} else if (extension === 'grass') { | ||
fileLoader(files[0], importGrass) | ||
const action = executeCommand(':style') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a race condition here since the loading is async. The executed :style
command might show the old style and not the imported one.
@@ -138,7 +138,6 @@ | |||
"react-dnd": "^2.5.1", | |||
"react-dnd-html5-backend": "^2.5.1", | |||
"react-dom": "^16.8.1", | |||
"react-dropzone": "^4.1.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something tells me that the yarn lock file should have changes when a dependency is being removed.
export function FileDrop (props) { | ||
const [fileHoverState, setFileHoverState] = useState(false) | ||
const [userSelect, setUserSelect] = useState(false) | ||
const [file, setFile] = useState(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hooks ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
:style
command to give feedback.changelog: Drag and drop cypher and grass files anywhere to import