Changeset 4467 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/plugin/favorite-button/index.jsx
- Timestamp:
- 12/04/2016 05:14:43 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/favorite-button/index.jsx
r4223 r4467 1 1 import React from 'react'; 2 import { connect } from 'react-redux';3 import includes from 'lodash/includes';4 2 5 3 import FavoriteButton from './button'; … … 10 8 } from 'actions/index'; 11 9 12 const FavoriteButtonContainer =React.createClass( {10 export default React.createClass( { 13 11 componentDidMount() { 14 12 this.getFavorites(); … … 34 32 35 33 render() { 36 return <FavoriteButton { ...this.props }toggleFavorite={ this.toggleFavorite } />;34 return <FavoriteButton toggleFavorite={ this.toggleFavorite } />; 37 35 } 38 36 } ); 39 40 const mapStateToProps = ( state, ownProps ) => ( {41 initialFavorite: includes( state.favorites, ownProps.plugin.slug )42 } );43 44 export default connect( mapStateToProps )( FavoriteButtonContainer );
Note: See TracChangeset
for help on using the changeset viewer.