Rename UserProfile to UserAccount.
This commit is contained in:
@@ -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} />
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user