Changeset 3764 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/js/client/components/archive/browse/index.jsx
- Timestamp:
- 08/02/2016 07:37:38 PM (8 years ago)
- 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';1 import React from 'react'; 2 2 import { connect } from 'react-redux'; 3 3 4 /**5 * Internal dependencies.6 */7 4 import { getBrowse } from 'actions'; 8 import ContentNone from 'components/content-none'; 9 import PluginCard from 'components/plugin-card'; 5 import Browse from './browse'; 10 6 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 { 7 const BrowseContainer = React.createClass( { 35 8 componentDidMount() { 36 9 this.getBrowse(); 37 } 10 }, 38 11 39 12 componentDidUpdate( previousProps ) { … … 41 14 this.getBrowse(); 42 15 } 43 } 16 }, 44 17 45 18 getBrowse() { 46 19 this.props.dispatch( getBrowse( this.props.params.type ) ); 47 } 20 }, 48 21 49 22 render() { 50 return < ArchiveBrowse { ...this.props } />;23 return <Browse { ...this.props } />; 51 24 } 52 } 25 } ); 53 26 54 27 const mapStateToProps = ( state, ownProps ) => ( { … … 56 29 } ); 57 30 58 export default connect( mapStateToProps )( ArchiveBrowseContainer );31 export default connect( mapStateToProps )( BrowseContainer ); 59 32 60 33
Note: See TracChangeset
for help on using the changeset viewer.