Changeset 5024 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/site-header/site-description/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-header/site-description/index.jsx
r4223 r5024 1 import React from 'react'; 2 import { IndexLink } from 'react-router'; 1 /** 2 * External dependencies. 3 */ 4 import React, { PropTypes } from 'react'; 5 import { identity } from 'lodash'; 6 import { localize } from 'i18n-calypso'; 7 import { withRouter } from 'react-router'; 3 8 4 export default React.createClass( { 5 displayName: 'SiteDescription', 9 /** 10 * 11 * @param {Boolean} router Router object. 12 * @param {Function} translate i18n translation function. 13 * @return {*} Component or null. 14 * @constructor 15 */ 16 export const SiteDescription = ( { router, translate } ) => { 17 if ( router.isActive( '/', true ) ) { 18 return ( 19 <p className="site-description"> 20 { translate( 'Extend your WordPress experience with 40,000 plugins.' ) } 21 </p> 22 ); 23 } 6 24 7 render() { 8 if ( this.props.isHome ) { 9 return <p className="site-description">Extend your WordPress experience with 40,000 plugins.</p>; 10 } else { 11 return <span />; 12 } 13 } 14 } ); 25 return null; 26 }; 27 28 SiteDescription.propTypes = { 29 router: PropTypes.object, 30 translate: PropTypes.func, 31 }; 32 33 SiteDescription.defaultProps = { 34 router: {}, 35 translate: identity, 36 }; 37 38 export default withRouter( localize( SiteDescription ) );
Note: See TracChangeset
for help on using the changeset viewer.