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