stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
29 lines • 941 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 => {
var _ref$current;
if ((_ref$current = ref.current) != null && _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 => {
var _ref$current2;
if ((_ref$current2 = ref.current) != null && _ref$current2.close) {
ref.current.close();
}
}, []);
return {
bottomSheetRef,
closePicker,
openPicker
};
};
exports.useAttachmentPickerBottomSheet = useAttachmentPickerBottomSheet;
//# sourceMappingURL=useAttachmentPickerBottomSheet.js.map