-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Menus: add icons for move / cancel buttons in menu edit #729
Conversation
Hi sendilkumarn — thank you for this contribution. Could you please add a before / after screenshot for visual reference? That's really helpful. Note: we'd also like to use Gridicons instead of Noticons for the icons. |
@lancewillett Please find the gridicons sample attached, I also committed the changes Also, have added tooltip as label for these buttons. |
CC @folletto for a review. |
Hi! Thanks for your help there! About issue #25, could you limit this PR to just the switch to Gridicons and the button alignment? The reason is that icon only makes the buttons obscure on meaning, which impacts the usability and effectiveness of the UI. This means that, with a few exceptions (like the trash can icon) due to clarity or reduced usage, we try to always use text labels, or text labels and icon together. If you want to read more about it, check the article on NNG "Icons Usability" as a starting point. So, we can proceed to merge this issue if:
Thank you! |
Taken that into consideration, i added tooltip for those buttons. If not okay lemme change that and recommit them again |
Tooltips are not enough unfortunately. Many user don't even know they exist (they are mostly for experts, ironically) and on touch devices they are overall invisible. |
Okay let me recommit with those changes |
Ok, tested on Chrome, Safari, Firefox, Edge, IE11. 👍 If you want to add a nice extra, mark the trash icon with the |
Thought of adding that, but somehow decided against it. |
I thought design wise that will be odd. Are you sure that you need something like that? |
That's our current design pattern for the whole of Calypso. |
Design: 👍 |
@folletto I have also merged the code. |
var className = ( this.props.className || '' ) + ' button', | ||
icon =this.props.icon, gridiconButton = ""; | ||
|
||
if(icon) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whitespace is not quite right here. Take a look at the spacing guidelines.
The code looks great—just a few minor style issues to fix. In particular, make sure tabs are used to indent lines. |
onClick: this.remove | ||
}, | ||
{ | ||
key: 'move', | ||
label: this.translate( 'Move', { textOnly: true } ), | ||
label: this.translate( 'Move' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to keep the { textOnly: true }
option, otherwise the translator code will wrap the label in an element.
@seear updated the code please advise if something else needs to be changed. |
@ehg Thanks, Will update the same. |
@@ -24,9 +25,17 @@ var siteMenus = require( 'lib/menu-data' ), | |||
var Button = React.createClass({ | |||
render: function() { | |||
var className = ( this.props.className || '' ) + ' button'; | |||
var icon = this.props.icon; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this var
is necessary, we can just use this.props.icon
, since it's only used in two places.
@sendilkumarn we still have spaces here instead of tabs for line indentation, so the lines aren't aligned correctly: You may need to adjust some settings in your editor? |
@seear can you please let me know in which editor you check? I have used Atom / sublime text both shows correctly in editor but not when uploaded |
@@ -24,9 +25,16 @@ var siteMenus = require( 'lib/menu-data' ), | |||
var Button = React.createClass({ | |||
render: function() { | |||
var className = ( this.props.className || '' ) + ' button'; | |||
var gridiconButton = ''; | |||
|
|||
if( icon ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting an error here, we likely need to use this.props.icon
.
This is looking good :) There are still some mixed tabs and spaces, though. If you're using Atom, it will help a lot to install an Sublime also has similar plugins. |
@ehg thanks, you want me to change this merge after installing those plugin. In github page the code is neatly aligned. |
24bf1b0
to
d6a8a51
Compare
Thanks a lot @ehg Really appreciate your patience. Have updated and there was no errors in my atom now. |
return ( | ||
<button className={ className } onClick={ this.props.onClick }> | ||
<button className={ className } onClick={ this.props.onClick } title={ this.props.title }> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we're using title
here? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Removed
This looks great! Thanks for fixing some of the other Before we merge this, it's good practice to squash the commits, so our history looks clean. You can also edit the commit message to something more accurate/descriptive. |
changed icons into text added is-scary to delete button removed is-primary from delete button aligning to style guide added textonly true identation problems identation updates formatting formatted title removed
e1989cc
to
5aa0db4
Compare
@ehg Squashed the commits |
Moving this to #1739 |
Added icons for move / cancel in menu edit also added a new class to Ok button in that page.
fix #25