//component/icon.js var Icon = React.createClass({ propTypes: { style: React.PropTypes.object, fixed: React.PropTypes.bool, }, render: function() { var className = 'icon ' + ('fixed' in this.props ? 'icon-fixed-width ' : '') + this.props.icon; return } }); var TruncatedText = React.createClass({ propTypes: { limit: React.PropTypes.number, }, getDefaultProps: function() { return { limit: 250, } }, render: function() { var text = this.props.children; var limit = this.props.limit; return {text.slice(0, limit) + (text.length > limit ? ' ...' : '')}; } }); var toolTipStyle = { position: 'absolute', zIndex: '1', top: '100%', left: '-120px', width: '260px', padding: '15px', border: '1px solid #aaa', backgroundColor: '#fff', fontSize: '14px', }; var ToolTip = React.createClass({ propTypes: { open: React.PropTypes.bool.isRequired, onMouseOut: React.PropTypes.func }, render: function() { return (
{this.props.children}
); } }); var creditAmountStyle = { color: '#216C2A', fontWeight: 'bold', fontSize: '0.8em' }, estimateStyle = { marginLeft : '5px', color: '#aaa', }; var CreditAmount = React.createClass({ propTypes: { amount: React.PropTypes.number, }, render: function() { var formattedAmount = lbry.formatCredits(this.props.amount); return ( {formattedAmount} { this.props.isEstimate ? (est) : null } ); } });