diff options
Diffstat (limited to 'plugins/jetpack/extensions/blocks/likes')
-rw-r--r-- | plugins/jetpack/extensions/blocks/likes/editor.js | 7 | ||||
-rw-r--r-- | plugins/jetpack/extensions/blocks/likes/index.js | 8 | ||||
-rw-r--r-- | plugins/jetpack/extensions/blocks/likes/likes-checkbox.js | 45 |
3 files changed, 0 insertions, 60 deletions
diff --git a/plugins/jetpack/extensions/blocks/likes/editor.js b/plugins/jetpack/extensions/blocks/likes/editor.js deleted file mode 100644 index 9adee220..00000000 --- a/plugins/jetpack/extensions/blocks/likes/editor.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Internal dependencies - */ -import { name, settings } from '.'; -import registerJetpackPlugin from '../../shared/register-jetpack-plugin'; - -registerJetpackPlugin( name, settings ); diff --git a/plugins/jetpack/extensions/blocks/likes/index.js b/plugins/jetpack/extensions/blocks/likes/index.js deleted file mode 100644 index 693fbdca..00000000 --- a/plugins/jetpack/extensions/blocks/likes/index.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Internal dependencies - */ -import LikesCheckbox from './likes-checkbox'; - -export const name = 'likes'; - -export const settings = { render: LikesCheckbox }; diff --git a/plugins/jetpack/extensions/blocks/likes/likes-checkbox.js b/plugins/jetpack/extensions/blocks/likes/likes-checkbox.js deleted file mode 100644 index f8bf0736..00000000 --- a/plugins/jetpack/extensions/blocks/likes/likes-checkbox.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * External dependencies - */ -import { __ } from '@wordpress/i18n'; -import { CheckboxControl } from '@wordpress/components'; -import { compose } from '@wordpress/compose'; -import { PostTypeSupportCheck } from '@wordpress/editor'; -import { withDispatch, withSelect } from '@wordpress/data'; - -/** - * Internal dependencies - */ -import JetpackLikesAndSharingPanel from '../../shared/jetpack-likes-and-sharing-panel'; - -const LikesCheckbox = ( { areLikesEnabled, editPost } ) => ( - <PostTypeSupportCheck supportKeys="jetpack-post-likes"> - <JetpackLikesAndSharingPanel> - <CheckboxControl - label={ __( 'Show likes.', 'jetpack' ) } - checked={ areLikesEnabled } - onChange={ value => { - editPost( { jetpack_likes_enabled: value } ); - } } - /> - </JetpackLikesAndSharingPanel> - </PostTypeSupportCheck> -); - -// Fetch the post meta. -const applyWithSelect = withSelect( select => { - const { getEditedPostAttribute } = select( 'core/editor' ); - const areLikesEnabled = getEditedPostAttribute( 'jetpack_likes_enabled' ); - - return { areLikesEnabled }; -} ); - -// Provide method to update post meta. -const applyWithDispatch = withDispatch( dispatch => { - const { editPost } = dispatch( 'core/editor' ); - - return { editPost }; -} ); - -// Combine the higher-order components. -export default compose( [ applyWithSelect, applyWithDispatch ] )( LikesCheckbox ); |