Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
const { uri, style, aspectRatio } = this.props;
const { isLoaded } = this.state;
// web handles missing protocols just fine, native doesn't. This evens out support.
const cleanUri = addMissingProtocol(uri);
const previewUri =
!cleanUri || this.state.isHighResolutionLoaded
? null
: `${cleanUri}&preview=true`; // TODO: Implement a separate uri for preview
const props = {
style: styles.imageBackground,
onLoad: this.handleLoad
};
if (cleanUri) {
props.source = { uri: cleanUri };
}
const previewProps = {
...props,
render() {
const {
aspectRatio,
disablePlaceholder,
highResSize,
lowResSize,
style,
uri,
onLayout,
rounded
} = this.props;
const { imageIsLoaded } = this.state;
const url = addMissingProtocol(uri);
return (
const addMissingProtocolToPoster = poster => ({
uri: addMissingProtocol(poster.uri)
});