diff --git a/src/containers/SiteHeader/index.jsx b/src/containers/SiteHeader/index.jsx index 8ffc3a1..05dceb8 100644 --- a/src/containers/SiteHeader/index.jsx +++ b/src/containers/SiteHeader/index.jsx @@ -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: (
diff --git a/src/data/reducers/index.js b/src/data/reducers/index.js index 97a480b..3aa9ca4 100755 --- a/src/data/reducers/index.js +++ b/src/data/reducers/index.js @@ -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; diff --git a/src/index.jsx b/src/index.jsx index 2c7bc00..b1c8b12 100755 --- a/src/index.jsx +++ b/src/index.jsx @@ -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() {