Changeset 5024 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/widget-area/index.jsx
- Timestamp:
- 03/01/2017 06:08:54 PM (8 years ago)
- 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 */ 4 import React, { PropTypes } from 'react'; 5 import { withRouter } from 'react-router'; 2 6 3 export default React.createClass({4 displayName: 'WidgetArea',7 export const WidgetArea = ( { children, router } ) => { 8 const classNames = [ 'widget-area' ]; 5 9 6 render() { 7 let classNames = [ 'widget-area' ]; 10 if ( router.isActive( '/', true ) ) { 11 classNames.push( 'home' ); 12 } 8 13 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 }; 12 20 13 return ( 14 <aside id="secondary" className={ classNames.join( ' ' ) } role="complementary"> 15 { this.props.children } 16 </aside> 17 ) 18 } 19 } ); 21 WidgetArea.propTypes = { 22 router: PropTypes.object, 23 }; 24 25 WidgetArea.defaultProps = { 26 router: {}, 27 }; 28 29 export default withRouter( WidgetArea );
Note: See TracChangeset
for help on using the changeset viewer.