stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
27 lines • 814 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useAttachmentPickerBottomSheet = void 0;
var _react = require("react");
var useAttachmentPickerBottomSheet = () => {
var bottomSheetRef = (0, _react.useRef)(null);
var openPicker = (0, _react.useCallback)(ref => {
if (ref.current?.snapToIndex) {
ref.current.snapToIndex(0);
} else {
console.warn('bottom and top insets must be set for the image picker to work correctly');
}
}, []);
var closePicker = (0, _react.useCallback)(ref => {
if (ref.current?.close) {
ref.current.close();
}
}, []);
return {
bottomSheetRef,
closePicker,
openPicker
};
};
exports.useAttachmentPickerBottomSheet = useAttachmentPickerBottomSheet;
//# sourceMappingURL=useAttachmentPickerBottomSheet.js.map