2020-06-26 20:22:56 +00:00
|
|
|
import { types } from './types';
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
export const ImageComponent = (type: string) => {
|
2020-06-26 20:22:56 +00:00
|
|
|
let Component;
|
|
|
|
if (type === types.REACT_NATIVE_IMAGE) {
|
|
|
|
const { Image } = require('react-native');
|
|
|
|
Component = Image;
|
|
|
|
} else {
|
2020-07-17 17:39:06 +00:00
|
|
|
const FastImage = require('@rocket.chat/react-native-fast-image').default;
|
2020-06-26 20:22:56 +00:00
|
|
|
Component = FastImage;
|
|
|
|
}
|
|
|
|
return Component;
|
|
|
|
};
|