Making WordPress.org


Ignore:
Timestamp:
03/01/2017 06:08:54 PM (7 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/site-header/site-description/index.jsx

    r4223 r5024  
    1 import React from 'react';
    2 import { IndexLink } from 'react-router';
     1/**
     2 * External dependencies.
     3 */
     4import React, { PropTypes } from 'react';
     5import { identity } from 'lodash';
     6import { localize } from 'i18n-calypso';
     7import { withRouter } from 'react-router';
    38
    4 export default React.createClass( {
    5     displayName: 'SiteDescription',
     9/**
     10 *
     11 * @param {Boolean}  router    Router object.
     12 * @param {Function} translate i18n translation function.
     13 * @return {*}                 Component or null.
     14 * @constructor
     15 */
     16export const SiteDescription = ( { router, translate } ) => {
     17    if ( router.isActive( '/', true ) ) {
     18        return (
     19            <p className="site-description">
     20                { translate( 'Extend your WordPress experience with 40,000 plugins.' ) }
     21            </p>
     22        );
     23    }
    624
    7     render() {
    8         if ( this.props.isHome ) {
    9             return <p className="site-description">Extend your WordPress experience with 40,000 plugins.</p>;
    10         } else {
    11             return <span />;
    12         }
    13     }
    14 } );
     25    return null;
     26};
     27
     28SiteDescription.propTypes = {
     29    router: PropTypes.object,
     30    translate: PropTypes.func,
     31};
     32
     33SiteDescription.defaultProps = {
     34    router: {},
     35    translate: identity,
     36};
     37
     38export default withRouter( localize( SiteDescription ) );
Note: See TracChangeset for help on using the changeset viewer.