Skip to content

Conversation

@khushal87
Copy link
Member

This pull request refactors the image gallery to simplify state management and remove legacy props and logic related to image gallery behavior. The main improvement is the introduction of a centralized imageGalleryStateStore, which replaces the previous pattern of passing multiple state setters and props.

Additionally, the video is now managed by a pool and a player class same as audio. This is for easy state management and ease of usage.

Additionally, the dependency on @gorhom/bottom-sheet is updated, and related code is streamlined to use the new approach.

Refactoring and State Management Improvements:

  • Replaced legacy props (setMessages, setSelectedMessage, legacyImageViewerSwipeBehaviour) in Gallery, Giphy, and related components with a single imageGalleryStateStore prop, centralizing image gallery state handling. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]
  • Updated the logic for opening the image viewer and Giphy attachments to use imageGalleryStateStore.openImageGallery, removing conditional logic for legacy behavior. [1] [2]
  • Removed all references to legacyImageViewerSwipeBehaviour from the codebase, including context, props, and hooks. [1] [2] [3] [4] [5]

Dependency and Import Updates:

  • Upgraded @gorhom/bottom-sheet dependency from version 5.1.8 to 5.2.8.
  • Updated ImageGallery.tsx to use the new imageGalleryStateStore and removed unused imports and legacy bottom sheet modal code. [1] [2] [3]

These changes modernize and simplify the gallery and attachment components, making state management more robust and maintainable.

@Stream-SDK-Bot
Copy link
Contributor

Stream-SDK-Bot commented Dec 15, 2025

SDK Size

title develop branch diff status
js_bundle_size 304 KB 314 KB +10200 B 🔴

@khushal87 khushal87 marked this pull request as ready for review December 16, 2025 06:00
@khushal87 khushal87 changed the title feat: introduce image gallery state store feat!: introduce image gallery state store Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants