-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c05428
commit f8c9ce4
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { connect } from 'react-redux'; | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __ } from 'i18n'; | ||
import { IconButton } from 'components'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import './style.scss'; | ||
|
||
function BlockRightMenu( { onDelete } ) { | ||
return ( | ||
<div className="editor-block-right-menu"> | ||
<IconButton | ||
className="editor-block-right-menu__control" | ||
onClick={ onDelete } | ||
icon="trash" | ||
label={ __( 'Delete the block' ) } | ||
/> | ||
</div> | ||
); | ||
} | ||
|
||
export default connect( | ||
undefined, | ||
( dispatch, ownProps ) => ( { | ||
onDelete() { | ||
dispatch( { | ||
type: 'REMOVE_BLOCKS', | ||
uids: [ ownProps.uid ], | ||
} ); | ||
}, | ||
} ) | ||
)( BlockRightMenu ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.editor-block-right-menu { | ||
position: absolute; | ||
top: 10px; | ||
right: 0; | ||
} | ||
|
||
.editor-block-right-menu__control { | ||
display: block; | ||
padding: 0; | ||
border: none; | ||
outline: none; | ||
background: none; | ||
color: $dark-gray-300; | ||
cursor: pointer; | ||
width: 20px; | ||
height: 20px; | ||
border-radius: 50%; | ||
|
||
&[aria-disabled="true"] { | ||
cursor: default; | ||
color: $light-gray-300; | ||
pointer-events: none; | ||
} | ||
|
||
.dashicon { | ||
display: block; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters