-
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
Reader: Use SectionHeading on Manage Followed Sites #1391
Conversation
debounce = require( 'lodash/function/debounce' ); | ||
debounce = require( 'lodash/function/debounce' ), | ||
classnames = require( 'classnames' ), | ||
assign = require( 'lodash/object/assign' ); |
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.
Can use Object.assign
directly now, instead of pulling in lodash.
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.
fixed
This is a vast improvement over the double-input-box UI. Kudos @shaunandrews! One small thing: I noticed that the sidebar doesn't seem to collapse away correctly and I can see part of the nav underneath the Manage Following content at smaller window sizes. This also means the |
Here's a screen recording of the odd sidebar behaviour: https://cloudup.com/iyMatVc96R3 |
I think this is much better. It offers improved context (seeing the total number of sites), and a central place for all the related tools to preside over the interface. The search makes sense being attached to the list in this case. I was worried that we're switching the order of the The only note on the code will go away once #1358 gets merged (Search will use gridicons) |
|
||
<FollowingEditSortControls onSelectChange={ this.handleSortOrderChange } sortOrder={ this.state.sortOrder } /> | ||
|
||
<SectionHeaderButton onClick={ this.toggleAddSite }> |
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.
SectionHeader
button is deprecated, just using a regular Button inside it with the compact
prop should be the same.
the search results and adding a blank slate.
0abfc02
to
63db848
Compare
}, | ||
|
||
getInitialState: function() { | ||
return { | ||
keyword: this.props.initialValue || '' | ||
keyword: this.props.initialValue || '', | ||
isOpen: this.props.isOpen || false |
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.
Not sure if we prefer it, but isOpen: !! this.props.isOpen
works as well.
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.
👍 Updated in 18b7b1d.
@@ -31,11 +31,11 @@ const FollowingEditSortControls = React.createClass( { | |||
const sortOrder = this.props.sortOrder; | |||
|
|||
return ( | |||
<div className="following-edit-sort-controls"> | |||
<div className="following-edit__sort-controls"> | |||
<label htmlFor="sort-control-select">{ this.translate( 'Sort by' ) }</label> | |||
<select id="sort-control-select" ref="sortControlSelect" className="is-compact" onChange={ this.handleSelectChange } value={ sortOrder }> |
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.
Probably not necessary in this PR, but could we switch to using select dropdown instead of a select element here for consistency?
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.
Or maybe segmented-control?
This placement and style of Add button is becoming a pattern across calypso, it just hasn't been put in place anywhere yet. Plugins and People will be the next sections to implement it, but I don't see any problem with its use here. In the plans for those other sections we've been playing with the idea of an icon in conjunction with the button text. Also perhaps in this case it could stand to be a The count next to the |
I would agree with that. I think the dropdown is a bit terse too. So while this is visually cleaner than what's in master, it doesn't seem as functionally clear to me. We have quite a bit of room though... could we be a bit more explicit with the "add" and "by date/by name" controls? |
👍 Looks great @shaunandrews. I think I prefer to 'Add Site' to 'Follow Site' as a call to action, but both work. |
I'm with @bluefuton, but it looks good Primary. |
The thinking behind "Follow Site" over "Add Site" was to hopefully quell any confusion between creating a new site and adding a site to your followed list. When viewing a site or post in Reader (or the front end) the button is "Follow" not "Add" — so I was thinking the consistency would help. |
👍 |
…header Reader: Use SectionHeading on Manage Followed Sites
Here's what follow management looks like on
master
:The double input is really obnoxious, and I often find myself mixing up the add and search inputs. Also, the search result is a little loud.
Lets bring in the
<SectionHeading>
component and clean things up a bit:We bring back the once-upon-a-time subscription count, and hide the add input behind a button. Clicking/tapping the add button transitions to show a placeholder and the focused add input:
Type a URL and you get the preview:
Hitting follow (or enter) adds a placeholder to your list, which is then replaced by the actual site:
There's also a new ellipsis icon which can be use to open a
<Popover>
with Import, Export, and Delivery Settings options that @blowery is working on.@bluefuton I'd love it if you could take a look at this.