Added login functionality

This commit is contained in:
Keannu Christian Bernasol 2023-11-19 16:10:36 +08:00
parent 2aeb1ddd27
commit 508e353fdb
9 changed files with 252 additions and 10 deletions

View file

@ -0,0 +1,19 @@
/* eslint-disable react-refresh/only-export-components */
import { createSlice } from "@reduxjs/toolkit";
export const AuthSlice = createSlice({
name: "Auth",
initialState: {
value: false,
},
reducers: {
Toggle_Login: (state) => {
state.value = !state.value;
},
},
});
// Action creators are generated for each case reducer function
export const { Toggle_Login } = AuthSlice.actions;
export default AuthSlice.reducer;

View file

@ -1,7 +1,10 @@
import { configureStore } from "@reduxjs/toolkit";
import AuthReducer from "../Slices/AuthSlice/AuthSlice";
const store = configureStore({
reducer: {},
reducer: {
auth: AuthReducer,
},
});
export default store;