react-native/Examples/Movies/getImageSource.js

16 lines
345 B
JavaScript
Raw Normal View History

2015-01-30 01:10:49 +00:00
/**
* Copyright 2004-present Facebook. All Rights Reserved.
* @flow
*/
'use strict';
function getImageSource(movie: Object, kind: ?string): {uri: ?string} {
var uri = movie && movie.posters ? movie.posters.thumbnail : null;
if (uri && kind) {
uri = uri.replace('tmb', kind);
}
return { uri };
}
module.exports = getImageSource;