@digidem/wcmc-mapeo-mobile-intro
Version:
Intro screens for Mapeo Mobile for the WCMC ICCA registration app
64 lines (56 loc) • 1.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactNative = require("react-native");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// import url from 'url'
// import { SvgUri, SvgXml } from 'react-native-svg'
/**
* For a source that is either SVG or bitmap, render the best way. SVGs in
* react-native are a real pain, and expo and bare react-native projects differ
* in how they handle require'ing SVG files.
*/
const UniversalImage = ({
source,
style
}) => {
// if (typeof source === 'string' && /^<svg\s/.test(source)) {
// return (
// <SvgXml
// width="100%"
// height="100%"
// xml={source}
// style={[styles.fill, style]}
// />
// )
// }
// const { uri } = Image.resolveAssetSource(source)
// const { pathname } = url.parse(uri)
// if (pathname && /\.svg$/.test(pathname)) {
// return (
// <SvgUri
// width="100%"
// height="100%"
// uri={uri}
// style={[styles.fill, style]}
// />
// )
// } else {
return /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
source: source,
style: [styles.fill, style],
resizeMode: "contain"
}); // }
};
const styles = _reactNative.StyleSheet.create({
fill: {
width: '100%',
height: '100%'
}
});
var _default = UniversalImage;
exports.default = _default;
//# sourceMappingURL=UniversalImage.js.map