Skip to content

Commit

Permalink
Me: Use SitesDropdown instead of SelectSite in /me/account
Browse files Browse the repository at this point in the history
  • Loading branch information
ebinnion committed Dec 18, 2015
1 parent 4a912e4 commit ce04479
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions client/me/account/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import LanguageSelector from 'components/forms/language-selector';
import MeSidebarNavigation from 'me/sidebar-navigation';
import protectForm from 'lib/mixins/protect-form';
import formBase from 'me/form-base';
import SelectSite from 'me/select-site';
import config from 'config';
import Card from 'components/card';
import FormTextInput from 'components/forms/form-text-input';
Expand All @@ -40,6 +39,7 @@ import observe from 'lib/mixins/data-observe';
import eventRecorder from 'me/event-recorder';
import Main from 'components/main';
import SectionHeader from 'components/section-header';
import SitesDropdown from 'components/sites-dropdown';

import _sites from 'lib/sites-list';
import _user from 'lib/user';
Expand Down Expand Up @@ -209,6 +209,13 @@ module.exports = React.createClass( {
} );
},

onSiteSelect( siteSlug ) {
let selectedSite = sites.getSite( siteSlug );
if ( sites.getSite( siteSlug ) ) {
this.props.userSettings.updateSetting( 'primary_site_ID', selectedSite.ID );
}
},

renderHolidaySnow() {
// Note that years and months below are zero indexed
const today = this.moment();
Expand Down Expand Up @@ -350,13 +357,9 @@ module.exports = React.createClass( {
}

return (
<SelectSite
disabled={ this.getDisabledState() }
id="primary_site_ID"
name="primary_site_ID"
onFocus={ this.recordFocusEvent( 'Primary Site Field' ) }
sites={ sites }
valueLink={ this.valueLink( 'primary_site_ID' ) } />
<SitesDropdown
onSiteSelect={ this.onSiteSelect }
/>
);
},

Expand Down

0 comments on commit ce04479

Please sign in to comment.