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/site-header/site-title/index.jsx

    r4223 r5024  
    1 import React from 'react';
     1/**
     2 * External dependencies.
     3 */
     4import React, { PropTypes } from 'react';
     5import { identity } from 'lodash';
    26import { IndexLink } from 'react-router';
     7import { localize } from 'i18n-calypso';
     8import { withRouter } from 'react-router';
    39
    4 export default React.createClass( {
    5     displayName: 'SiteTitle',
     10export const SiteTitle = ( { router, translate } ) => (
     11    router.isActive( '/', true )
     12        ? <h1 className="site-title"><IndexLink to="/" rel="home">{ translate( 'Plugins' ) }</IndexLink></h1>
     13        : <p className="site-title"><IndexLink to="/" rel="home">{ translate( 'Plugins' ) }</IndexLink></p>
     14);
    615
    7     render() {
    8         if ( this.props.isHome ) {
    9             return <h1 className="site-title"><IndexLink to="/" rel="home">Plugins</IndexLink></h1>;
    10         } else {
    11             return <p className="site-title"><IndexLink to="/" rel="home">Plugins</IndexLink></p>;
    12         }
    13     }
    14 } );
     16SiteTitle.propTypes = {
     17    router: PropTypes.object,
     18    translate: PropTypes.func,
     19};
     20
     21SiteTitle.defaultProps = {
     22    router: {},
     23    translate: identity,
     24};
     25
     26export default withRouter( localize( SiteTitle ) );
Note: See TracChangeset for help on using the changeset viewer.