Add propTypes and getDefaultProps() to FileTile

This commit is contained in:
Alex Liebowitz 2016-12-25 00:12:50 -05:00
parent 97f6f3bdf8
commit 64d7b680c3

View file

@ -4,6 +4,15 @@ import {Link, DownloadLink, WatchLink} from '../component/link.js';
import {Thumbnail, TruncatedText, CreditAmount} from '../component/common.js';
let FileTile = React.createClass({
propTypes: {
name: React.PropTypes.string.isRequired,
mediaType: React.PropTypes.string.isRequired,
title: React.PropTypes.string.isRequired,
description: React.PropTypes.string,
compact: React.PropTypes.boolean,
cost: React.PropTypes.number,
costIncludesData: React.PropTypes.boolean,
},
getInitialState: function() {
return {
downloading: false,
@ -12,6 +21,11 @@ let FileTile = React.createClass({
costIncludesData: null,
}
},
getDefaultProps: function() {
return {
compact: false,
}
},
handleMouseOver: function() {
this.setState({
isHovered: true,