-
-
Notifications
You must be signed in to change notification settings - Fork 779
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added pre-integrated VirtualizedList component
- Loading branch information
Showing
8 changed files
with
106 additions
and
4 deletions.
There are no files selected for viewing
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
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
29 changes: 29 additions & 0 deletions
29
src/components/bottomSheetScrollable/BottomSheetVirtualizedList.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { memo } from 'react'; | ||
import { | ||
VirtualizedList as RNVirtualizedList, | ||
VirtualizedListProps as RNVirtualizedListProps, | ||
} from 'react-native'; | ||
import Animated from 'react-native-reanimated'; | ||
import { createBottomSheetScrollableComponent } from './createBottomSheetScrollableComponent'; | ||
import type { | ||
BottomSheetVirtualizedListMethods, | ||
BottomSheetVirtualizedListProps, | ||
} from './types'; | ||
|
||
const AnimatedVirtualizedList = | ||
Animated.createAnimatedComponent<RNVirtualizedListProps<any>>( | ||
RNVirtualizedList | ||
); | ||
|
||
const BottomSheetVirtualizedListComponent = | ||
createBottomSheetScrollableComponent< | ||
BottomSheetVirtualizedListMethods, | ||
BottomSheetVirtualizedListProps<any> | ||
>(AnimatedVirtualizedList); | ||
|
||
const BottomSheetVirtualizedList = memo(BottomSheetVirtualizedListComponent); | ||
BottomSheetVirtualizedList.displayName = 'BottomSheetVirtualizedList'; | ||
|
||
export default BottomSheetVirtualizedList as <T>( | ||
props: BottomSheetVirtualizedListProps<T> | ||
) => ReturnType<typeof BottomSheetVirtualizedList>; |
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
export { default as BottomSheetSectionList } from './BottomSheetSectionList'; | ||
export { default as BottomSheetFlatList } from './BottomSheetFlatList'; | ||
export { default as BottomSheetScrollView } from './BottomSheetScrollView'; | ||
export { default as BottomSheetVirtualizedList } from './BottomSheetVirtualizedList'; | ||
|
||
export type { | ||
BottomSheetFlatListMethods, | ||
BottomSheetScrollViewMethods, | ||
BottomSheetSectionListMethods, | ||
BottomSheetVirtualizedListMethods, | ||
} from './types'; |
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