Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jehartzog/232ed2f8c203a4666443143dde5cd4c6 to your computer and use it in GitHub Desktop.
Save jehartzog/232ed2f8c203a4666443143dde5cd4c6 to your computer and use it in GitHub Desktop.
Avoid occasional iOS CPU looping for stream-chat-react-native
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