TigerTrading's picture
fix all
6e81cb0 verified
raw
history blame contribute delete
641 Bytes
import { createSlice } from '@reduxjs/toolkit';
const initialState = {
theme: 'dark-professional',
layout: 'multi-pane',
notifications: [],
soundEnabled: true,
accessibility: { highContrast: false, reducedMotion: false }
};
export const appSlice = createSlice({
name: 'app',
initialState,
reducers: {
setTheme: (state, action) => {
state.theme = action.payload;
},
updateNotifications: (state, action) => {
state.notifications = [action.payload, ...state.notifications.slice(0, 4)];
},
},
});
export const { setTheme, updateNotifications } = appSlice.actions;
export default appSlice.reducer;