mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-28 14:16:38 +08:00
* ⚡️ improve: delete google fonts * ⚡️ improve: Optimized priority input handling in TableRow component. * 🔖 chore: channel batch add * ✨ feat: add dark mod * ✨ feat: support token limit ip range and models * ✨ feat: add MessagePusher * ✨ feat: add lark login
53 lines
1.1 KiB
JavaScript
53 lines
1.1 KiB
JavaScript
// project imports
|
|
import config from 'config';
|
|
|
|
// action - state management
|
|
import * as actionTypes from './actions';
|
|
|
|
export const initialState = {
|
|
isOpen: [], // for active default menu
|
|
defaultId: 'default',
|
|
fontFamily: config.fontFamily,
|
|
borderRadius: config.borderRadius,
|
|
opened: true,
|
|
theme: 'light'
|
|
};
|
|
|
|
// ==============================|| CUSTOMIZATION REDUCER ||============================== //
|
|
|
|
const customizationReducer = (state = initialState, action) => {
|
|
let id;
|
|
switch (action.type) {
|
|
case actionTypes.MENU_OPEN:
|
|
id = action.id;
|
|
return {
|
|
...state,
|
|
isOpen: [id]
|
|
};
|
|
case actionTypes.SET_MENU:
|
|
return {
|
|
...state,
|
|
opened: action.opened
|
|
};
|
|
case actionTypes.SET_FONT_FAMILY:
|
|
return {
|
|
...state,
|
|
fontFamily: action.fontFamily
|
|
};
|
|
case actionTypes.SET_BORDER_RADIUS:
|
|
return {
|
|
...state,
|
|
borderRadius: action.borderRadius
|
|
};
|
|
case actionTypes.SET_THEME:
|
|
return {
|
|
...state,
|
|
theme: action.theme
|
|
};
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export default customizationReducer;
|