File size: 524 Bytes
a0fda44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { createSlice } from "@reduxjs/toolkit";

const initialState = {
  visible: false,
  profile: {},
};

const userProfileSlice = createSlice({
  name: "userProfile",
  initialState,
  reducers: {
    showProfile: (state) => {
      state.visible = true;
    },
    hideProfile: (state) => {
      state.visible = false;
    },
    setProfile: (state, { payload }) => {
      state.profile = payload;
    },
  },
});

export const userProfileActions = userProfileSlice.actions;

export default userProfileSlice.reducer;