Created
July 22, 2021 01:03
-
-
Save jehartzog/232ed2f8c203a4666443143dde5cd4c6 to your computer and use it in GitHub Desktop.
Avoid occasional iOS CPU looping for stream-chat-react-native
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
diff --git a/node_modules/stream-chat-react-native-core/src/components/ImageGallery/ImageGallery.tsx b/node_modules/stream-chat-react-native-core/src/components/ImageGallery/ImageGallery.tsx | |
index a443f69..7ea15c7 100644 | |
--- a/node_modules/stream-chat-react-native-core/src/components/ImageGallery/ImageGallery.tsx | |
+++ b/node_modules/stream-chat-react-native-core/src/components/ImageGallery/ImageGallery.tsx | |
@@ -180,6 +180,7 @@ export const ImageGallery = < | |
: vh(100); | |
const halfScreenHeight = screenHeight / 2; | |
const quarterScreenHeight = screenHeight / 4; | |
+ const snapPoints = React.useMemo(() => [0, (screenHeight * 9) / 10], []); | |
/** | |
* BottomSheet ref | |
@@ -1154,7 +1155,8 @@ export const ImageGallery = < | |
/> | |
<BottomSheet | |
animatedIndex={animatedBottomSheetIndex} | |
- containerHeight={Dimensions.get('screen').height} | |
+ // ch46225 | |
+ containerHeight={fullScreenHeight} | |
handleComponent={() => ( | |
<ImageGridHandle | |
closeGridView={closeGridView} | |
@@ -1165,7 +1167,7 @@ export const ImageGallery = < | |
index={0} | |
onChange={(index: number) => setCurrentBottomSheetIndex(index)} | |
ref={bottomSheetRef} | |
- snapPoints={imageGalleryGridSnapPoints || [0, (screenHeight * 9) / 10]} | |
+ snapPoints={imageGalleryGridSnapPoints || snapPoints} | |
> | |
<ImageGrid | |
closeGridView={closeGridView} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment