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/widget-area/index.jsx

    r4223 r5024  
    1 import React from 'react';
     1/**
     2 * External dependencies.
     3 */
     4import React, { PropTypes } from 'react';
     5import { withRouter } from 'react-router';
    26
    3 export default React.createClass( {
    4     displayName: 'WidgetArea',
     7export const WidgetArea = ( { children, router } ) => {
     8    const classNames = [ 'widget-area' ];
    59
    6     render() {
    7         let classNames = [ 'widget-area' ];
     10    if ( router.isActive( '/', true ) ) {
     11        classNames.push( 'home' );
     12    }
    813
    9         if ( this.props.router.isActive( '/', true ) ) {
    10             classNames.push( 'home' );
    11         }
     14    return (
     15        <aside id="secondary" className={ classNames.join( ' ' ) } role="complementary">
     16            { children }
     17        </aside>
     18    );
     19};
    1220
    13         return (
    14             <aside id="secondary" className={ classNames.join( ' ' ) } role="complementary">
    15                 { this.props.children }
    16             </aside>
    17         )
    18     }
    19 } );
     21WidgetArea.propTypes = {
     22    router: PropTypes.object,
     23};
     24
     25WidgetArea.defaultProps = {
     26    router: {},
     27};
     28
     29export default withRouter( WidgetArea );
Note: See TracChangeset for help on using the changeset viewer.