Added frontend folder structure in Ombase's branch

This commit is contained in:
K
2025-02-22 13:00:33 +05:30
parent 33b5c9ccc8
commit 75f31b5b93
60 changed files with 9080 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import { configureStore } from "@reduxjs/toolkit";
import userSlice from "./userSlice";
import messageSlice from "./messageSlice";
import loaderSlice from "./loaderSlice";
const MentifyStore = configureStore({
reducer: {
user: userSlice.reducer,
messages: messageSlice.reducer,
loader: loaderSlice.reducer,
},
});
export default MentifyStore;
+18
View File
@@ -0,0 +1,18 @@
import { createSlice } from "@reduxjs/toolkit";
const loaderSlice = createSlice({
name: "loader",
initialState: false,
reducers: {
showLoader: (state) => {
return true;
},
hideLoader: (state) => {
return false;
},
},
});
export const loaderSliceActions = loaderSlice.actions;
export default loaderSlice;
+15
View File
@@ -0,0 +1,15 @@
import { createSlice } from "@reduxjs/toolkit";
const messageSlice = createSlice({
name: "messages",
initialState: [],
reducers: {
addMessage: (state, action) => {
return [...state, action.payload];
},
},
});
export const messageActions = messageSlice.actions;
export default messageSlice;
+20
View File
@@ -0,0 +1,20 @@
import { createSlice } from "@reduxjs/toolkit";
const userSlice = createSlice({
name: "user",
initialState: {
name: "Unloggedin User",
email: "Unlogged@gmail.com",
avatar: "/images/default1.png",
role: "unloggeduser",
mainInterest: [],
},
reducers: {
addUser: (state, action) => {
return (state = action.payload);
},
},
});
export const userSliceActions = userSlice.actions;
export default userSlice;