stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
44 lines • 1.35 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.buildGallery = buildGallery;
var _buildGalleryOfSingleImage = require("./buildGalleryOfSingleImage");
var _buildGalleryOfThreeImages = require("./buildGalleryOfThreeImages");
var _buildGalleryOfTwoImages = require("./buildGalleryOfTwoImages");
var _buildThumbnailGrid = require("./buildThumbnailGrid");
var _ChatConfigContext = require("../../../../contexts/chatConfigContext/ChatConfigContext");
function buildGallery({
images,
resizableCDNHosts = _ChatConfigContext.chatConfigContextDefaultvalue.resizableCDNHosts,
sizeConfig
}) {
if (images.length === 1) {
return (0, _buildGalleryOfSingleImage.buildGalleryOfSingleImage)({
image: images[0],
resizableCDNHosts,
sizeConfig
});
}
if (images.length === 2) {
return (0, _buildGalleryOfTwoImages.buildGalleryOfTwoImages)({
images,
resizableCDNHosts,
sizeConfig
});
}
if (images.length === 3) {
return (0, _buildGalleryOfThreeImages.buildGalleryOfThreeImages)({
images,
resizableCDNHosts,
sizeConfig
});
}
return (0, _buildThumbnailGrid.buildThumbnailGrid)({
grid: [[1, 1], [1, 1]],
images: images.slice(0, 4),
invertedDirections: true,
resizableCDNHosts,
sizeConfig
});
}
//# sourceMappingURL=buildGallery.js.map