You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			20 lines
		
	
	
		
			592 B
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			20 lines
		
	
	
		
			592 B
		
	
	
	
		
			TypeScript
		
	
import { PayloadAction, createSlice } from '@reduxjs/toolkit';
 | 
						|
import { ThemeStateType } from '../../themes/constants/colors';
 | 
						|
 | 
						|
// TODO Move primary color into this slice
 | 
						|
export const initialThemeState: ThemeStateType = 'classic-dark' as ThemeStateType;
 | 
						|
 | 
						|
const themeSlice = createSlice({
 | 
						|
  name: 'theme',
 | 
						|
  initialState: initialThemeState,
 | 
						|
  reducers: {
 | 
						|
    updateTheme(_, action: PayloadAction<ThemeStateType>) {
 | 
						|
      return action.payload;
 | 
						|
    },
 | 
						|
  },
 | 
						|
});
 | 
						|
 | 
						|
export const { actions, reducer } = themeSlice;
 | 
						|
export const { updateTheme } = actions;
 | 
						|
export const defaultThemeReducer = reducer;
 |