import { Action } from './actions' ; import { ConfigState , Status } from './types' ; export interface State { config : ConfigState ; status : Status ; } const statusState = { clientOnline : false , clientSpectating : false , gameOnline : false , gameLive : false } ; export const configState = { useRoundedCorners : false , disableOverlayIndicator : false , useDenseOverlayIndicator : true , safeZoneLeft : 35 , safeZoneRight : 35 , safeZoneTop : 20 , safeZoneBottom : 35 , useRadar : false , playerSize : 40 , bombSize : 40 , maxRounds : 4 , otRounds : 6 , radarNumberSize : 32 , usePreSetName : false , showTeamLogo : true , showPlayerNationality : false , showPlayerPhotoContainerAllways : true , showPlayerPhotoIfSet : false } ; const getDefaultState = ( ) : State => ( { config : configState , status : statusState } ) ; export default function reducer ( state = getDefaultState ( ) , action ) { switch ( action . type ) { case 'set-config' : return { ... state , config : action . config } ; case 'set-status' : return { ... state , status : action . status } ; default : return state ; } }