Changeset 5024 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/plugin/sections/developers/list.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/developers/list.jsx
r4223 r5024 1 import React from 'react'; 2 import values from 'lodash/values'; 1 /** 2 * External dependencies. 3 */ 4 import React, { PropTypes } from 'react'; 5 import { map } from 'lodash'; 3 6 4 export default React.createClass( { 5 displayName: 'DeveloperList', 6 7 render() { 8 if ( ! this.props.contributors ) { 9 return <div />; 10 } 11 7 /** 8 * 9 * @param {Object} contributors Plugin contributors. 10 * @return {*} React Element 11 * @constructor 12 */ 13 export const DeveloperList = ( { contributors } ) => { 14 if ( contributors ) { 12 15 return ( 13 16 <ul className="plugin-developers"> 14 { values( this.props.contributors ).map(( contributor, index ) =>17 { map( contributors, ( contributor, index ) => 15 18 <li key={ index }> 16 <img className="avatar avatar-32 photo" height="32" width="32" src={ contributor.avatar } /> 17 <a href={ contributor.profile }>{ contributor.display_name }</a> 19 <a href={ contributor.profile }> 20 <img className="avatar avatar-32 photo" height="32" width="32" src={ contributor.avatar } /> 21 { contributor.display_name } 22 </a> 18 23 </li> 19 24 ) } 20 25 </ul> 21 ) 26 ); 22 27 } 23 } ); 28 29 return null; 30 }; 31 32 DeveloperList.propTypes = { 33 contributors: PropTypes.object, 34 }; 35 36 DeveloperList.defaultProps = { 37 contributors: {}, 38 }; 39 40 export default DeveloperList;
Note: See TracChangeset
for help on using the changeset viewer.