Changeset 5024 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/plugin-card/plugin-card.jsx
- Timestamp:
- 03/01/2017 06:08:54 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/plugin-card/plugin-card.jsx
r4223 r5024 1 import React from 'react'; 1 /** 2 * External dependencies. 3 */ 4 import React, { PropTypes } from 'react'; 2 5 import { Link } from 'react-router'; 3 6 … … 8 11 import PluginRatings from 'components/plugin-ratings'; 9 12 10 export default React.createClass( { 11 displayName: 'PluginCard', 13 export const PluginCard = ( { plugin } ) => ( 14 <article className="plugin type-plugin plugin-card"> 15 <PluginIcon slug={ plugin.slug } /> 16 <div className="entry"> 17 <header className="entry-header"> 18 <h2 className="entry-title"> 19 <Link 20 to={ `${ plugin.slug }/` } 21 rel="bookmark" 22 dangerouslySetInnerHTML={ { __html: plugin.title.rendered } } 23 /> 24 </h2> 25 </header> 12 26 13 render() { 14 if ( ! this.props.plugin ) { 15 return ( 16 <div /> 17 ); 18 } 27 { plugin.ratings && <PluginRatings rating={ plugin.meta.rating } ratingCount={ plugin.ratings.length } /> } 19 28 20 return ( 21 <article className="plugin type-plugin plugin-card"> 22 <PluginIcon plugin={ this.props.plugin } /> 23 <div className="entry"> 24 <header className="entry-header"> 25 <h2 className="entry-title"> 26 <Link to={ `${ this.props.plugin.slug }/` } rel="bookmark">{ this.props.plugin.name }</Link> 27 </h2> 28 </header> 29 <div className="entry-excerpt" dangerouslySetInnerHTML={ { __html: plugin.excerpt.rendered } } /> 30 </div> 31 </article> 32 ); 29 33 30 <PluginRatings rating={ this.props.plugin.rating } ratingCount={ this.props.plugin.num_ratings } /> 34 PluginCard.propTypes = { 35 plugin: PropTypes.object, 36 }; 31 37 32 <div className="entry-excerpt">{ this.props.plugin.short_description }</div> 33 </div> 34 </article> 35 ) 36 } 37 } ); 38 export default PluginCard;
Note: See TracChangeset
for help on using the changeset viewer.