Changeset 5024 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/plugin/download-button/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/plugin/download-button/index.jsx
r4223 r5024 1 import React from 'react'; 1 /** 2 * External dependencies. 3 */ 4 import React, { PropTypes } from 'react'; 5 import { connect } from 'react-redux'; 6 import { identity } from 'lodash'; 7 import { localize } from 'i18n-calypso'; 2 8 3 export default React.createClass( { 4 displayName: 'DownloadButton', 9 /** 10 * Internal dependencies. 11 */ 12 import { getPlugin } from 'state/selectors'; 5 13 6 render() { 7 return ( 8 <span> 9 <a className="plugin-download button download-button button-large" href={ this.props.plugin.download_link } itemProp="downloadUrl"> 10 Download 11 </a> 12 <meta itemProp="softwareVersion" content={ this.props.plugin.version } /> 13 <meta itemProp="fileFormat" content="application/zip" /> 14 </span> 15 ) 16 } 17 } ); 14 export const DownloadButton = ( { plugin, translate } ) => ( 15 <span> 16 <a 17 className="plugin-download button download-button button-large" 18 href={ plugin.download_link } 19 itemProp="downloadUrl" 20 > 21 { translate( 'Download' ) } 22 </a> 23 <meta itemProp="softwareVersion" content={ plugin.version } /> 24 <meta itemProp="fileFormat" content="application/zip" /> 25 </span> 26 ); 27 28 DownloadButton.propTypes = { 29 plugin: PropTypes.object, 30 translate: PropTypes.func, 31 }; 32 33 DownloadButton.defaultProps = { 34 plugin: {}, 35 translate: identity, 36 }; 37 38 export default connect( 39 ( state ) => ( { 40 plugin: getPlugin( state ), 41 } ), 42 )( localize( DownloadButton ) );
Note: See TracChangeset
for help on using the changeset viewer.