Changeset 5024 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/site-header/site-title/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/site-header/site-title/index.jsx
r4223 r5024 1 import React from 'react'; 1 /** 2 * External dependencies. 3 */ 4 import React, { PropTypes } from 'react'; 5 import { identity } from 'lodash'; 2 6 import { IndexLink } from 'react-router'; 7 import { localize } from 'i18n-calypso'; 8 import { withRouter } from 'react-router'; 3 9 4 export default React.createClass( { 5 displayName: 'SiteTitle', 10 export const SiteTitle = ( { router, translate } ) => ( 11 router.isActive( '/', true ) 12 ? <h1 className="site-title"><IndexLink to="/" rel="home">{ translate( 'Plugins' ) }</IndexLink></h1> 13 : <p className="site-title"><IndexLink to="/" rel="home">{ translate( 'Plugins' ) }</IndexLink></p> 14 ); 6 15 7 render() { 8 if ( this.props.isHome ) { 9 return <h1 className="site-title"><IndexLink to="/" rel="home">Plugins</IndexLink></h1>; 10 } else { 11 return <p className="site-title"><IndexLink to="/" rel="home">Plugins</IndexLink></p>; 12 } 13 } 14 } ); 16 SiteTitle.propTypes = { 17 router: PropTypes.object, 18 translate: PropTypes.func, 19 }; 20 21 SiteTitle.defaultProps = { 22 router: {}, 23 translate: identity, 24 }; 25 26 export default withRouter( localize( SiteTitle ) );
Note: See TracChangeset
for help on using the changeset viewer.