Rename UserProfile to UserAccount.

This commit is contained in:
Robert Raposa
2019-02-08 15:06:53 -05:00
parent 050688826f
commit f4a6223301
3 changed files with 7 additions and 6 deletions

View File

@@ -5,8 +5,8 @@ import SiteHeader from '@edx/frontend-component-site-header';
const mapStateToProps = state => ({
accountMenu: {
avatar: state.userProfile.userProfileImageUrl,
username: state.userProfile.username,
avatar: state.userAccount.profileImage.imageUrlMedium,
username: state.userAccount.username,
menuContent: (
<div>
<Hyperlink className="btn btn-outline-secondary btn-block" content="Logout" destination={process.env.LOGOUT_URL} />

View File

@@ -1,5 +1,5 @@
import { combineReducers } from 'redux';
import { userProfile } from '@edx/frontend-auth';
import { userAccount } from '@edx/frontend-auth';
const identityReducer = (state) => {
const newState = { ...state };
@@ -10,7 +10,7 @@ const rootReducer = combineReducers({
// The authentication state is added as initialState when
// creating the store in data/store.js.
authentication: identityReducer,
userProfile,
userAccount,
});
export default rootReducer;

View File

@@ -4,7 +4,7 @@ import ReactDOM from 'react-dom';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import { Provider } from 'react-redux';
import SiteFooter from '@edx/frontend-component-footer';
import { fetchUserProfile } from '@edx/frontend-auth';
import { fetchUserAccount, UserAccountApiService } from '@edx/frontend-auth';
import apiClient from './data/apiClient';
import { handleTrackEvents, identifyUser } from './analytics';
@@ -18,7 +18,8 @@ import './App.scss';
class App extends Component {
componentDidMount() {
const { username } = store.getState().authentication;
store.dispatch(fetchUserProfile(apiClient, username));
const userAccountApiService = new UserAccountApiService(apiClient, process.env.LMS_BASE_URL);
store.dispatch(fetchUserAccount(userAccountApiService, username));
}
render() {