Made user first and last name display on profile
This commit was merged in pull request #21.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
const initialState = {
|
||||
userInfo: JSON.parse(localStorage.getItem("profile"))
|
||||
};
|
||||
|
||||
export const userSlice = createSlice({
|
||||
name: "user",
|
||||
initialState,
|
||||
reducers: {
|
||||
updateUserInfo: (state,payload) => {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
state.userInfo = payload.payload
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// Action creators are generated for each case reducer function
|
||||
export const { updateUserInfo } = userSlice.actions;
|
||||
|
||||
export default userSlice.reducer;
|
||||
Reference in New Issue
Block a user