Repository navigation
Refactor: Upgrade the bottom-sheet package with BottomSheetModal implementation [CRNS-494] - #1073
Conversation
|
I'd suggest squashing the commits here to one, along the lines of
If we need to look into why the change was made, it'll make it easier to see the whole context in one changeset, since we don't (yet, at least) enforce squash merges |
|
I'm getting some warnings about unmet peer reqs: warning "stream-chat-react-native-core > @gorhom/bottom-sheet > @gorhom/portal@1.0.7" has unmet peer dependency "react@*".
warning "stream-chat-react-native-core > @gorhom/bottom-sheet > @gorhom/portal@1.0.7" has unmet peer dependency "react-native@*".
warning "stream-chat-react-native-core > @gorhom/bottom-sheet > react-native-redash@16.2.0" has unmet peer dependency "react@*".
warning "stream-chat-react-native-core > @gorhom/bottom-sheet > react-native-redash@16.2.0" has unmet peer dependency "react-native@*".
warning "stream-chat-react-native-core > @gorhom/bottom-sheet > react-native-redash@16.2.0" has unmet peer dependency "react-native-gesture-handler@*".
warning "stream-chat-react-native-core > @gorhom/bottom-sheet > react-native-redash@16.2.0" has unmet peer dependency "react-native-reanimated@>=2.0.0-rc.0"I think this is easier to resolve in the context of this change than by itself in the future. react and react-native should be added as devDependencies, redash should probably be a direct dependency for us I think |
…odal for ImageGallery fix: broken tests while using BottomSheetModal component fix: build fail due to data type in BottomSheetFlatlist chore: fix dependency issues
c22ad9a to
1a29ce7
Compare
| <BottomSheetModalProvider> | ||
| <BottomSheetModal | ||
| animatedIndex={animatedBottomSheetIndex} | ||
| enablePanDownToClose={true} | ||
| handleComponent={() => ( | ||
| <ImageGridHandle | ||
| closeGridView={closeGridView} | ||
| {...imageGalleryCustomComponents?.gridHandle} | ||
| /> | ||
| )} | ||
| handleHeight={imageGalleryGridHandleHeight ?? 40} | ||
| index={0} | ||
| onChange={(index: number) => setCurrentBottomSheetIndex(index)} | ||
| ref={bottomSheetModalRef} | ||
| snapPoints={imageGalleryGridSnapPoints || snapPoints} | ||
| > | ||
| <ImageGrid | ||
| closeGridView={closeGridView} | ||
| {...imageGalleryCustomComponents?.gridHandle} | ||
| numberOfImageGalleryGridColumns={numberOfImageGalleryGridColumns} | ||
| photos={photos} | ||
| resetVisibleValues={resetVisibleValues} | ||
| setImage={setImage} | ||
| {...imageGalleryCustomComponents?.grid} | ||
| /> |
There was a problem hiding this comment.
Do you think it'd be possible to extract these to a separate smaller component, or do you it'd make things trickier? Would be nice to break down the bigger components we have when we have the chance I think, but there might be things I haven't considered for this case
There was a problem hiding this comment.
I think we can take up that as a separate PR(if it doesn't seem to be a blocker) because currently it doesn't seem to be doable in one shot and might need some head-up configuring the code. I will create a separate task on JIRA for this if you are fine with it?
There was a problem hiding this comment.
Sure, if you think that's the better option, I'm happy to do it that way. I can also share a diff of what I'm thinking of if you'd like/think that might be of value
…t-native into khushal87-crns-494
🎯 Goal
The
@gorhom/bottom-sheetpackage was upgraded to v4 and the v3 was deprecated. Hence, this PR focuses on upgrading the package as well as modifying the changes to adapt to the new APi level changes.Fixes #1053
🛠 Implementation details
The following are the changes introduced in the PR:
ImageGridcomponent's BottomSheet is modified and now usesBottomSheetModal.snapToproperty is changed tosnapToIndex.🎨 UI Changes
No UI changes as such.
iOS
Android
🧪 Testing
☑️ Checklist
developbranch