Changeset 5024 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/plugin/sections/reviews/index.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/sections/reviews/index.jsx
r4464 r5024 1 import React from 'react'; 1 /** 2 * External dependencies. 3 */ 4 import React, { PropTypes } from 'react'; 5 import { identity } from 'lodash'; 6 import { localize } from 'i18n-calypso'; 2 7 3 export default React.createClass( { 4 displayName: 'Reviews', 8 export const Reviews = ( { content, numberFormat, numRatings, slug, translate } ) => { 9 if ( ! numRatings ) { 10 return null; 11 } 5 12 6 render() { 7 return ( 8 <div> 9 <div id="reviews" className="read-more"> 10 <div className="plugin-reviews"> 11 <h2>Reviews</h2> 12 <div dangerouslySetInnerHTML={ { __html: this.props.content } } /> 13 </div> 13 return ( 14 <div> 15 <div id="reviews" className="section"> 16 <div className="plugin-reviews"> 17 <h2>{ translate( 'Reviews' ) }</h2> 18 <div dangerouslySetInnerHTML={ { __html: content } }/> 14 19 </div> 15 <a className="reviews-link" href={ `https://wordpress.org/support/plugin/${ this.props.slug }/reviews/` } aria-expanded="false">Read all { this.props.numRatings } reviews</a>16 20 </div> 17 ) 18 } 19 } ); 21 <a 22 className="reviews-link" 23 href={ `https://wordpress.org/support/plugin/${ slug }/reviews/` } 24 aria-expanded="false" 25 > 26 { translate( 'Read all %(numRatings)s reviews', { 27 args: { numRatings: numberFormat( numRatings ) }, 28 } ) } 29 </a> 30 </div> 31 ); 32 }; 33 34 Reviews.propTypes = { 35 content: PropTypes.string, 36 numberFormat: PropTypes.func, 37 numRatings: PropTypes.number.isRequired, 38 slug: PropTypes.string.isRequired, 39 translate: PropTypes.func, 40 }; 41 42 Reviews.defaultProps = { 43 content: null, 44 numberFormat: identity, 45 translate: identity, 46 }; 47 48 export default localize( Reviews );
Note: See TracChangeset
for help on using the changeset viewer.