forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Expensify#31267 from VickyStash/ts-migration/dragA…
…ndDrop-component [TS migration] Migrate 'DragAndDrop' component to TypeScript
- Loading branch information
Showing
14 changed files
with
88 additions
and
74 deletions.
There are no files selected for viewing
9 changes: 0 additions & 9 deletions
9
src/components/DragAndDrop/Consumer/dragAndDropConsumerPropTypes.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
...ents/DragAndDrop/Consumer/index.native.js → ...nts/DragAndDrop/Consumer/index.native.tsx
This file contains 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 |
---|---|---|
@@ -1,10 +1,7 @@ | ||
import dragAndDropConsumerPropTypes from './dragAndDropConsumerPropTypes'; | ||
|
||
function DragAndDropConsumer() { | ||
return null; | ||
} | ||
|
||
DragAndDropConsumer.propTypes = dragAndDropConsumerPropTypes; | ||
DragAndDropConsumer.displayName = 'DragAndDropConsumer'; | ||
|
||
export default DragAndDropConsumer; |
This file contains 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
This file contains 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,11 @@ | ||
import {ReactNode} from 'react'; | ||
|
||
type DragAndDropConsumerProps = { | ||
/** Children to render inside this component. */ | ||
children: ReactNode; | ||
|
||
/** Function to execute when an item is dropped in the drop zone. */ | ||
onDrop: (event: DragEvent) => void; | ||
}; | ||
|
||
export default DragAndDropConsumerProps; |
This file was deleted.
Oops, something went wrong.
This file contains 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 @@ | ||
import type NoDropZoneProps from './types'; | ||
|
||
const NoDropZone = ({children}: NoDropZoneProps) => children; | ||
|
||
NoDropZone.displayName = 'NoDropZone'; | ||
|
||
export default NoDropZone; |
This file contains 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
This file contains 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,8 @@ | ||
import {ReactNode} from 'react'; | ||
|
||
type NoDropZoneProps = { | ||
/** Content */ | ||
children: ReactNode; | ||
}; | ||
|
||
export default NoDropZoneProps; |
12 changes: 0 additions & 12 deletions
12
src/components/DragAndDrop/Provider/dragAndDropProviderPropTypes.js
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,12 @@ | ||
import type {DragAndDropContextParams, DragAndDropProviderProps} from './types'; | ||
|
||
const DragAndDropContext: DragAndDropContextParams = {}; | ||
|
||
function DragAndDropProvider({children}: DragAndDropProviderProps) { | ||
return children; | ||
} | ||
|
||
DragAndDropProvider.displayName = 'DragAndDropProvider'; | ||
|
||
export default DragAndDropProvider; | ||
export {DragAndDropContext}; |
This file contains 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
This file contains 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,27 @@ | ||
import {ReactNode} from 'react'; | ||
|
||
type DragAndDropProviderProps = { | ||
/** Children to render inside this component. */ | ||
children: ReactNode; | ||
|
||
/** Should this dropZone be disabled? */ | ||
isDisabled?: boolean; | ||
|
||
/** Indicate that users are dragging file or not */ | ||
setIsDraggingOver: (value: boolean) => void; | ||
}; | ||
|
||
type SetOnDropHandlerCallback = (event: DragEvent) => void; | ||
|
||
type DragAndDropContextParams = { | ||
/** Whether something is dragging over a drop zone. */ | ||
isDraggingOver?: boolean; | ||
|
||
/** Execute callback when an item is dropped in the drop zone. */ | ||
setOnDropHandler?: (callback: SetOnDropHandlerCallback) => void; | ||
|
||
/** Drop zone id. */ | ||
dropZoneID?: string; | ||
}; | ||
|
||
export type {DragAndDropProviderProps, DragAndDropContextParams, SetOnDropHandlerCallback}; |
This file contains 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