Initial commit

This commit is contained in:
Krisztu
2026-02-25 09:17:51 +01:00
commit dd7afe755d
18 changed files with 10091 additions and 0 deletions

22
store/authSlice.ts Normal file
View File

@@ -0,0 +1,22 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
interface AuthState {
user: { uid: string; email: string } | null;
}
const initialState: AuthState = {
user: null,
};
const authSlice = createSlice({
name: 'auth',
initialState,
reducers: {
setUser: (state, action: PayloadAction<{ uid: string; email: string } | null>) => {
state.user = action.payload;
},
},
});
export const { setUser } = authSlice.actions;
export default authSlice.reducer;

11
store/store.ts Normal file
View File

@@ -0,0 +1,11 @@
import { configureStore } from '@reduxjs/toolkit';
import authReducer from './authSlice';
export const store = configureStore({
reducer: {
auth: authReducer,
},
});
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;