Add propTypes and getDefaultProps() to FileTile
This commit is contained in:
parent
97f6f3bdf8
commit
64d7b680c3
1 changed files with 14 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue