/**
* Copyright 2004-present Facebook. All Rights Reserved.
* @flow
*/
'use strict';
var React = require('react-native');
var {
ExpandingText,
Image,
PixelRatio,
ScrollView,
StyleSheet,
Text,
View,
} = React;
var getImageSource = require('./getImageSource');
var getStyleFromScore = require('./getStyleFromScore');
var getTextFromScore = require('./getTextFromScore');
var MovieScreen = React.createClass({
render: function() {
return (
{this.props.movie.title}
{this.props.movie.year}
{this.props.movie.mpaa_rating}
);
},
});
var Ratings = React.createClass({
render: function() {
var criticsScore = this.props.ratings.critics_score;
var audienceScore = this.props.ratings.audience_score;
return (
Critics:
{getTextFromScore(criticsScore)}
Audience:
{getTextFromScore(audienceScore)}
);
},
});
var Cast = React.createClass({
render: function() {
if (!this.props.actors) {
return null;
}
return (
Actors
{this.props.actors.map(actor =>
• {actor.name}
)}
);
},
});
var styles = StyleSheet.create({
contentContainer: {
padding: 10,
},
rightPane: {
justifyContent: 'space-between',
flex: 1,
},
movieTitle: {
flex: 1,
fontSize: 16,
fontWeight: 'bold',
},
rating: {
marginTop: 10,
},
ratingTitle: {
fontSize: 14,
},
ratingValue: {
fontSize: 28,
fontWeight: 'bold',
},
mpaaWrapper: {
alignSelf: 'flex-start',
borderColor: 'black',
borderWidth: 1,
paddingHorizontal: 3,
marginVertical: 5,
},
mpaaText: {
fontFamily: 'Palatino',
fontSize: 13,
fontWeight: 'bold',
},
mainSection: {
flexDirection: 'row',
},
detailsImage: {
width: 134,
height: 200,
backgroundColor: '#eaeaea',
marginRight: 10,
},
separator: {
backgroundColor: 'rgba(0, 0, 0, 0.1)',
height: 1 / PixelRatio.get(),
marginVertical: 10,
},
castTitle: {
fontWeight: 'bold',
marginBottom: 3,
},
castActor: {
marginLeft: 2,
},
});
module.exports = MovieScreen;