mirror of
https://github.com/lemeow125/EquipmentTracker-Frontend.git
synced 2025-06-30 01:05:45 +08:00
Added login functionality
This commit is contained in:
parent
2aeb1ddd27
commit
508e353fdb
9 changed files with 252 additions and 10 deletions
19
src/Components/Plugins/Redux/Slices/AuthSlice/AuthSlice.tsx
Normal file
19
src/Components/Plugins/Redux/Slices/AuthSlice/AuthSlice.tsx
Normal 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;
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue