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

    r4223 r5024  
    1 import React from 'react';
     1/**
     2 * External dependencies.
     3 */
     4import React, { PropTypes } from 'react';
    25
    3 export default React.createClass( {
    4     displayName: 'SiteMain',
     6export const SiteMain = ( { children, params } ) => {
     7    const classNames = [ 'site-main' ];
    58
    6     render() {
    7         let classNames = [ 'site-main' ];
     9    if ( params.slug ) {
     10        classNames.push( 'single' );
     11    }
    812
    9         if ( this.props.params.slug ) {
    10             classNames.push( 'single' );
    11         }
     13    return (
     14        <main id="main" className={ classNames.join( ' ' ) } role="main">
     15            { children }
     16        </main>
     17    );
     18};
    1219
    13         return (
    14             <main id="main" className={ classNames.join( ' ' ) } role="main">
    15                 { this.props.children }
    16             </main>
    17         )
    18     }
    19 } );
     20SiteMain.propTypes = {
     21    params: PropTypes.object,
     22};
     23
     24SiteMain.defaultProps = {
     25    params: {},
     26};
     27
     28export default SiteMain;
Note: See TracChangeset for help on using the changeset viewer.