Making WordPress.org


Ignore:
Timestamp:
08/02/2016 07:37:38 PM (8 years ago)
Author:
obenland
Message:

Plugin Directory: Add search functionality to React client.

See #1719.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/js/client/components/archive/browse/index.jsx

    r3734 r3764  
    1 import React, { Component } from 'react';
     1import React from 'react';
    22import { connect } from 'react-redux';
    33
    4 /**
    5  * Internal dependencies.
    6  */
    74import { getBrowse } from 'actions';
    8 import ContentNone from 'components/content-none';
    9 import PluginCard from 'components/plugin-card';
     5import Browse from './browse';
    106
    11 
    12 const ArchiveBrowse = React.createClass( {
    13     displayName: 'ArchiveBrowse',
    14 
    15     render() {
    16         if ( this.props.plugins ) {
    17             return (
    18                 <div>
    19                     <header className="page-header">
    20                         <h1 className="page-title">Browse: <strong>{ this.props.params.type }</strong></h1>
    21                         <div className="taxonomy-description"></div>
    22                     </header>
    23                     { this.props.plugins.map( slug =>
    24                         <PluginCard key={ slug } slug={ slug } />
    25                     ) }
    26                 </div>
    27             )
    28         }
    29 
    30         return <ContentNone { ...this.props } />;
    31     }
    32 } );
    33 
    34 class ArchiveBrowseContainer extends Component {
     7const BrowseContainer = React.createClass( {
    358    componentDidMount() {
    369        this.getBrowse();
    37     }
     10    },
    3811
    3912    componentDidUpdate( previousProps ) {
     
    4114            this.getBrowse();
    4215        }
    43     }
     16    },
    4417
    4518    getBrowse() {
    4619        this.props.dispatch( getBrowse( this.props.params.type ) );
    47     }
     20    },
    4821
    4922    render() {
    50         return <ArchiveBrowse { ...this.props } />;
     23        return <Browse { ...this.props } />;
    5124    }
    52 }
     25} );
    5326
    5427const mapStateToProps = ( state, ownProps ) => ( {
     
    5629} );
    5730
    58 export default connect( mapStateToProps )( ArchiveBrowseContainer );
     31export default connect( mapStateToProps )( BrowseContainer );
    5932
    6033
Note: See TracChangeset for help on using the changeset viewer.