-
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
Me: Use SitesDropdown instead of SelectSite in /me/account #1837
Conversation
Now that #1886 has been merged, this is the last occurrence of |
Nice.
This is something we'll properly fix once we migrate site-settings to redux and centralize the data. In the meantime you could just set the primary attribute manually, or change the order of the array. This is where we set the attribute. cc @rralian to keep in mind for settings. |
ce04479
to
917fd78
Compare
@mtias - I updated the PR to manually set the primary site. After I did that, I noticed that the old primary site still showed on refresh, which I tracked down to I addressed by adding an After that, I noticed that the site and chevron could overlap each other. So, I adjusted the styling of the component to use flexbox. Overlapping fixed: IE11: iPhone4 @ockham - I went ahead and removed the |
Looks good to me. |
@@ -210,6 +210,13 @@ module.exports = React.createClass( { | |||
} ); | |||
}, | |||
|
|||
onSiteSelect( siteSlug ) { | |||
let selectedSite = sites.getSite( siteSlug ); | |||
if ( sites.getSite( siteSlug ) ) { |
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.
is this a typo? should it be:
if ( selectedSite ) {
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.
heh... you're right 😄 I created the variable so I didn't have to get the site twice, and then I did it anyways 🐼
@ebinnion looks good. My only real question was about a possible typo and the data path for updating the primary site. |
Me: Use SitesDropdown instead of SelectSite in /me/account
Fixes #451
Now that we have a
SitesDropdown
, we can retire our use ofSelectSite
. This component swaps out the former for the latter on the/me/account
route.Note: There is still some jankiness where switching a site and then refreshing the page may not show the proper primary site. This is because the sites list data is stale after we make the change. So, we'll need to find some way to update the primary site in the sites list.
To test:
fix/me-account-site-dropdown
/me/account
wordpress.com/me/account