mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-04 12:26:19 +00:00
feat: use get workspace profile in frontend
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { configureStore } from "@reduxjs/toolkit";
|
||||
import { TypedUseSelectorHook, useSelector } from "react-redux";
|
||||
import globalReducer from "./modules/global";
|
||||
import shortcutReducer from "./modules/shortcut";
|
||||
import globalReducer from "./modules/workspace";
|
||||
|
||||
const store = configureStore({
|
||||
reducer: {
|
||||
|
@ -1,19 +0,0 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
|
||||
type State = {
|
||||
workspaceProfile: WorkspaceProfile;
|
||||
};
|
||||
|
||||
const globalSlice = createSlice({
|
||||
name: "global",
|
||||
initialState: {} as State,
|
||||
reducers: {
|
||||
setGlobalState: (_, action: PayloadAction<State>) => {
|
||||
return action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setGlobalState } = globalSlice.actions;
|
||||
|
||||
export default globalSlice.reducer;
|
20
frontend/web/src/stores/modules/workspace.ts
Normal file
20
frontend/web/src/stores/modules/workspace.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
import { WorkspaceProfile } from "@/types/proto/api/v2/workspace_service";
|
||||
|
||||
type State = {
|
||||
workspaceProfile: WorkspaceProfile;
|
||||
};
|
||||
|
||||
const workspaceSlice = createSlice({
|
||||
name: "workspace",
|
||||
initialState: {} as State,
|
||||
reducers: {
|
||||
setWorkspaceState: (_, action: PayloadAction<State>) => {
|
||||
return action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setWorkspaceState } = workspaceSlice.actions;
|
||||
|
||||
export default workspaceSlice.reducer;
|
Reference in New Issue
Block a user