/**
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* @flow
*/
'use strict';
var React = require('react');
var ReactNative = require('react-native');
var {
Image,
ScrollView,
StyleSheet,
Text,
View,
} = ReactNative;
var getImageSource = require('./getImageSource');
var getStyleFromScore = require('./getStyleFromScore');
var getTextFromScore = require('./getTextFromScore');
class MovieScreen extends React.Component {
render() {
return (
{this.props.movie.title}
{this.props.movie.year}
{this.props.movie.mpaa_rating}
{this.props.movie.synopsis}
);
}
}
class Ratings extends React.Component {
render() {
var criticsScore = this.props.ratings.critics_score;
var audienceScore = this.props.ratings.audience_score;
return (
Critics:
{getTextFromScore(criticsScore)}
Audience:
{getTextFromScore(audienceScore)}
);
}
}
class Cast extends React.Component {
render() {
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: '500',
},
rating: {
marginTop: 10,
},
ratingTitle: {
fontSize: 14,
},
ratingValue: {
fontSize: 28,
fontWeight: '500',
},
mpaaWrapper: {
alignSelf: 'flex-start',
borderColor: 'black',
borderWidth: 1,
paddingHorizontal: 3,
marginVertical: 5,
},
mpaaText: {
fontFamily: 'Palatino',
fontSize: 13,
fontWeight: '500',
},
mainSection: {
flexDirection: 'row',
},
detailsImage: {
width: 134,
height: 200,
backgroundColor: '#eaeaea',
marginRight: 10,
},
separator: {
backgroundColor: 'rgba(0, 0, 0, 0.1)',
height: StyleSheet.hairlineWidth,
marginVertical: 10,
},
castTitle: {
fontWeight: '500',
marginBottom: 3,
},
castActor: {
marginLeft: 2,
},
});
module.exports = MovieScreen;