Skip to content

Commit

Permalink
i can successfully create an account
Browse files Browse the repository at this point in the history
  • Loading branch information
kemboi590 committed Jul 6, 2024
1 parent b9963be commit 725b2c1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/Redux/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 1 addition & 1 deletion src/Redux/uiSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Login/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 725b2c1

Please sign in to comment.