From 725b2c17eb06db25973c243250ca196c1a26972c Mon Sep 17 00:00:00 2001 From: kemboi590 Date: Sun, 7 Jul 2024 02:18:37 +0300 Subject: [PATCH] i can successfully create an account --- src/Redux/store.js | 16 ++++++++-------- src/Redux/uiSlice.js | 2 +- src/pages/Login/Login.jsx | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Redux/store.js b/src/Redux/store.js index d7e952e..8785df2 100644 --- a/src/Redux/store.js +++ b/src/Redux/store.js @@ -4,22 +4,22 @@ import userSlice from "./userSlice"; import { persistStore, persistReducer } from "redux-persist"; import storage from "redux-persist/lib/storage"; -const persistConfig = { - key: "root", +const persistConfig = { //used to store the data in local storage + key: "root", //means the root of the state version: 1, - storage, + storage, // means local storage }; -const rootReducer = combineReducers({ +const rootReducer = combineReducers({ //combining all the reducers ui: uiSlice, user: userSlice, }); -const persistedReducer = persistReducer(persistConfig, rootReducer); +const persistedReducer = persistReducer(persistConfig, rootReducer); //persistReducer is used to store the data in local storage -export const store = configureStore({ +export const store = configureStore({ //configurestore is used to create the store reducer: persistedReducer, middleware: (getDefaultMiddleware) => - getDefaultMiddleware({ - serializableCheck: false, + getDefaultMiddleware({ // getDefaultMiddleware is used to get the default middleware + serializableCheck: false, //used to check the serializable, serializable means the data is in the form of string }), }); export let persistor = persistStore(store); diff --git a/src/Redux/uiSlice.js b/src/Redux/uiSlice.js index 5b6950d..93ab733 100644 --- a/src/Redux/uiSlice.js +++ b/src/Redux/uiSlice.js @@ -5,7 +5,7 @@ const uiSlice = createSlice({ initialState: { selectedComponent: null, }, - reducers: { + reducers: { // reducers are used to change the state selectComponent: (state, action) => { state.selectedComponent = action.payload; }, diff --git a/src/pages/Login/Login.jsx b/src/pages/Login/Login.jsx index 04d3783..77ba88c 100644 --- a/src/pages/Login/Login.jsx +++ b/src/pages/Login/Login.jsx @@ -5,9 +5,9 @@ import * as yup from "yup"; import { yupResolver } from "@hookform/resolvers/yup"; import authimage from "../../Images/authimage.jpg"; import { useNavigate } from "react-router-dom"; -import { loginUser } from "../../Redux/apiCall"; import "react-toastify/dist/ReactToastify.css"; import { useDispatch } from "react-redux"; +import { loginUser } from "../../Redux/apiCall"; import Loading from "../../components/Loading/Loading"; const schema = yup.object().shape({