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.
		
		
		
		
		
			
		
			
				
	
	
		
			35 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			35 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
import { PayloadAction, createSlice } from '@reduxjs/toolkit';
 | 
						|
import { TermsOfServicePrivacyDialogProps } from '../../../components/dialog/TermsOfServicePrivacyDialog';
 | 
						|
import { ConfirmModalState } from '../../ducks/modalDialog';
 | 
						|
 | 
						|
export type TermsOfServicePrivacyModalState = TermsOfServicePrivacyDialogProps | null;
 | 
						|
 | 
						|
export type ModalsState = {
 | 
						|
  quitModalState: ConfirmModalState | null;
 | 
						|
  termsOfServicePrivacyModalState: TermsOfServicePrivacyModalState | null;
 | 
						|
};
 | 
						|
 | 
						|
const initialState: ModalsState = {
 | 
						|
  quitModalState: null,
 | 
						|
  termsOfServicePrivacyModalState: null,
 | 
						|
};
 | 
						|
 | 
						|
export const modalsSlice = createSlice({
 | 
						|
  name: 'modals',
 | 
						|
  initialState,
 | 
						|
  reducers: {
 | 
						|
    updateQuitModal(state, action: PayloadAction<ConfirmModalState>) {
 | 
						|
      return { ...state, quitModalState: action.payload };
 | 
						|
    },
 | 
						|
    updateTermsOfServicePrivacyModal(
 | 
						|
      state,
 | 
						|
      action: PayloadAction<TermsOfServicePrivacyModalState>
 | 
						|
    ) {
 | 
						|
      return { ...state, termsOfServicePrivacyModalState: action.payload };
 | 
						|
    },
 | 
						|
  },
 | 
						|
});
 | 
						|
 | 
						|
export const { updateQuitModal, updateTermsOfServicePrivacyModal } = modalsSlice.actions;
 | 
						|
export default modalsSlice.reducer;
 |