-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Ishpaul777/rhn no dropzone #23528
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
Merged
dangrous
merged 13 commits into
Expensify:main
from
ishpaul777:ishpaul777/RHN-no-dropzone
Jul 27, 2023
Merged
Ishpaul777/rhn no dropzone #23528
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
42fa1f6
Update Permissions.js
ishpaul777 f792bed
Merge branch 'Expensify:main' into main
ishpaul777 4797e42
Merge branch 'Expensify:main' into main
ishpaul777 ad73827
Merge branch 'Expensify:main' into main
ishpaul777 c6ba18f
made RHN modal no dropzone
ishpaul777 b6f8f2a
Merge branch 'Expensify:main' into main
ishpaul777 f1f6e94
Merge branch 'main' into ishpaul777/RHN-no-dropzone
ishpaul777 79bc7d2
code linting and permission reverted
ishpaul777 3134ac2
remove consoles and fixes lint errrors
ishpaul777 e3ddd35
fixes flickering cursor on continuous dragover
ishpaul777 1f2edf6
code linting
ishpaul777 4f1cbc3
code clean up
ishpaul777 4ab39f8
remove unnecessary comments
ishpaul777 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {useEffect} from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const propTypes = { | ||
/** Content */ | ||
children: PropTypes.node.isRequired, | ||
}; | ||
|
||
function NoDropZone(props) { | ||
function handleDrag(event) { | ||
event.preventDefault(); | ||
// eslint-disable-next-line no-param-reassign | ||
event.dataTransfer.dropEffect = 'none'; | ||
} | ||
|
||
useEffect(() => { | ||
document.addEventListener('dragenter', handleDrag); | ||
document.addEventListener('dragover', handleDrag); | ||
|
||
return () => { | ||
document.removeEventListener('dragenter', handleDrag); | ||
document.removeEventListener('dragover', handleDrag); | ||
}; | ||
}, []); | ||
|
||
return props.children; | ||
} | ||
|
||
NoDropZone.displayName = 'NoDropZone'; | ||
NoDropZone.propTypes = propTypes; | ||
|
||
export default NoDropZone; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// /components/DragAndDrop/NoDropZone/index.native.js | ||
|
||
const NoDropZone = (props) => props.children; | ||
|
||
NoDropZone.displayName = 'NoDropZone'; | ||
|
||
export default NoDropZone; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.