Making WordPress.org


Ignore:
Timestamp:
03/01/2017 06:08:54 PM (8 years ago)
Author:
obenland
Message:

Plugin Directory: Update React client with latest changes.

This is largely a cleanup commit with some WIP around switching to node-wpapi.

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 */
     4import React, { PropTypes } from 'react';
     5import { map } from 'lodash';
    36
    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 */
     13export const DeveloperList = ( { contributors } ) => {
     14    if ( contributors ) {
    1215        return (
    1316            <ul className="plugin-developers">
    14                 { values( this.props.contributors ).map( ( contributor, index ) =>
     17                { map( contributors, ( contributor, index ) =>
    1518                    <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>
    1823                    </li>
    1924                ) }
    2025            </ul>
    21         )
     26        );
    2227    }
    23 } );
     28
     29    return null;
     30};
     31
     32DeveloperList.propTypes = {
     33    contributors: PropTypes.object,
     34};
     35
     36DeveloperList.defaultProps = {
     37    contributors: {},
     38};
     39
     40export default DeveloperList;
Note: See TracChangeset for help on using the changeset viewer.