-
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
Framework: Create new <SitesDropdown> component. #379
Conversation
I know this is in progress, so just dropping it here:
While going to http://calypso.localhost:3000/stats/day/[site] |
6c88097
to
44b2950
Compare
597407b
to
db79348
Compare
Ok, seems good :) |
Tested on Chrome, Firefox, Safari, Edge, IE11. Notes:
That's all. Interaction wise (open / close / site display / search) works. |
@folletto thanks for the feedback!
I don't think we need to do this right now. It's using vh units so you can make the most use of the screen.
Made it overflow in 7ad7e49
That's not just IE, it's everywhere, will disable the indicator for it :)
I think it's fine and consistent — since search applies to what's below, and your selected site is at the top.
Done. Though the animation seems a bit frantic to me. |
Thing is, I expect the site to be below too. ;) Dropdowns don't remove the element that's picked. It's a standard behaviour. I just noticed now that the selected one isn't in the list. Should be. Ok. Tested in Chrome / Firefox, all the above are fixed. Just... a tiny |
That's v2!
That's what we talked about 😧 " It's probably superfluous given it's also at the top, eh?" so now the selected site is hidden from the list. |
I thought we were talking about the highlight of the currently selected Davide ‘Folletto’ Casali |
The old /me/select-site component allows a filtered list of sites to be specified, which /design uses to filter out Jetpack sites. That could be added in #1483. |
As a consumer of this component, how can I find out which site was actually selected? |
(I'm asking because I can't seem to see an easy way. Maybe |
@ockham we just need to provide a |
What you said :) |
}, | ||
|
||
getSelectedSite() { | ||
return sites.getSite( this.state.selected ) || sites.getPrimary(); |
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.
Do we need the || sites.getPrimary()
part? Since getInitialState()
sets this.state.selected
and falls back to sites.getPrimary().slug
, we should be fine without, no?
(This is going to be more relevant once we add filtering.)
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.
Yes, I think we should be fine without it.
This should replace all usages of "me/select-site" and standardize all site selection with our core picker patterns.
Pass site slug onSiteSelect as the prop callback.
- Move all basic styles to site-selector. - Move all the sidebar specific styling under the sidebar namespace. - Clean up resets in sites-popover.
- Add a "hideSelected" prop that allows hiding the selected site from the list. - If not set, the site is shown and highlighted.
d836efe
to
8d196a0
Compare
👍 |
Will squash a couple commits. |
Animate chevron icon when opening. Disable site-indicator in dropdown header.
props @ockham. Avoid redundand getPrimary() call.
398ade4
to
888e7f6
Compare
Framework: Create new <SitesDropdown> component.
left: -272px; | ||
width: 272px; | ||
overflow: hidden; | ||
z-index: 10; |
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.
Could you add this to z-index map?
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.
Ah, good call.
This should replace all usages of "me/select-site" and standardize all site selection with our core picker patterns.
To-do
onSelect
actions.