-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #383 from WordPress/add/toolbar-icons
Toolbar polish
- Loading branch information
Showing
15 changed files
with
191 additions
and
17 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
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,21 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import './style.scss'; | ||
import classnames from 'classnames'; | ||
|
||
function Button( { type = 'button', isPrimary, isLarge, className, children } ) { | ||
const classes = classnames( 'editor-button', className, { | ||
button: ( isPrimary || isLarge ), | ||
'button-primary': isPrimary, | ||
'button-large': isLarge | ||
} ); | ||
|
||
return ( | ||
<button type={ type } className={ classes }> | ||
{ children } | ||
</button> | ||
); | ||
} | ||
|
||
export default Button; |
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,4 @@ | ||
.editor-button { | ||
background: none; | ||
border: none; | ||
} |
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,16 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import './style.scss'; | ||
import Button from '../button'; | ||
import Dashicon from '../dashicon'; | ||
|
||
function IconButton( { icon, label } ) { | ||
return ( | ||
<Button title={ label } className="editor-icon-button"> | ||
<Dashicon icon={ icon } /> | ||
</Button> | ||
); | ||
} | ||
|
||
export default IconButton; |
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,14 @@ | ||
.editor-icon-button { | ||
display: flex; | ||
align-items: center; | ||
width: 36px; | ||
height: 36px; | ||
border: none; | ||
background: none; | ||
color: $dark-gray-500; | ||
cursor: pointer; | ||
|
||
&:hover { | ||
color: $blue-medium; | ||
} | ||
} |
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
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
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,16 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import './style.scss'; | ||
import Dashicon from '../../components/dashicon'; | ||
|
||
function SavedState() { | ||
return ( | ||
<div className="editor-saved-state"> | ||
<Dashicon icon="yes" /> | ||
{ wp.i18n.__( 'Saved' ) } | ||
</div> | ||
); | ||
} | ||
|
||
export default SavedState; |
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,9 @@ | ||
.editor-saved-state { | ||
display: flex; | ||
align-items: center; | ||
margin-right: $item-spacing; | ||
|
||
.dashicon { | ||
margin-right: 4px; | ||
} | ||
} |
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
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,32 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import './style.scss'; | ||
import Dashicon from '../../components/dashicon'; | ||
import IconButton from '../../components/icon-button'; | ||
import Button from '../../components/button'; | ||
|
||
function Tools() { | ||
return ( | ||
<div className="editor-tools"> | ||
<IconButton icon="undo" label={ wp.i18n.__( 'Undo' ) } /> | ||
<IconButton icon="redo" label={ wp.i18n.__( 'Redo' ) } /> | ||
<IconButton icon="plus-alt" label={ wp.i18n.__( 'Insert block' ) } /> | ||
<div className="editor-tools__tabs"> | ||
<Button> | ||
<Dashicon icon="visibility" /> | ||
{ wp.i18n._x( 'Preview', 'imperative verb' ) } | ||
</Button> | ||
<Button> | ||
<Dashicon icon="admin-generic" /> | ||
{ wp.i18n.__( 'Post Settings' ) } | ||
</Button> | ||
</div> | ||
<Button isPrimary isLarge> | ||
{ wp.i18n.__( 'Publish' ) } | ||
</Button> | ||
</div> | ||
); | ||
} | ||
|
||
export default Tools; |
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,32 @@ | ||
.editor-tools { | ||
margin: 0 0 0 auto; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.editor-tools__tabs { | ||
margin: 0 $item-spacing; | ||
padding: 0 0 0 $item-spacing; | ||
border-left: 1px solid $light-gray-500; | ||
border-right: 1px solid $light-gray-500; | ||
display: flex; | ||
align-items: center; | ||
|
||
.editor-button { | ||
display: flex; | ||
align-items: center; | ||
border: none; | ||
background: none; | ||
color: $dark-gray-500; | ||
margin-right: $item-spacing; | ||
cursor: pointer; | ||
|
||
&:hover { | ||
color: $blue-medium; | ||
} | ||
} | ||
|
||
.editor-button .dashicon { | ||
margin-right: 4px; | ||
} | ||
} |
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
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
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