All files / app/reducers ui.ts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69                13x 70x   1x   69x       13x       53x       53x     13x 53x       53x     13x       53x       53x     13x       53x       53x     13x       53x       53x    
import {
  ActionTypes,
  AuthorsContainerSorts,
  CommitsContainerSorts,
  FilesContainerSorts,
  CollapsibleSidePanelGroups,
} from 'app/actions/ActionTypes';
 
export const rerenderRequestedAt = (state = null, action: any) => {
  switch (action.type) {
    case ActionTypes.REQUEST_RERENDER:
      return Date.now();
    default:
      return state;
  }
};
 
export const authorsContainerSort = (
  state = AuthorsContainerSorts.TIME,
  action: any
) => {
  switch (action.type) {
    case ActionTypes.SET_AUTHORS_CONTAINER_SORT:
      return action.sort;
  }
  return state;
};
 
export const search = (state = '', action: any) => {
  switch (action.type) {
    case ActionTypes.SET_SEARCH:
      return action.search;
  }
  return state;
};
 
export const commitsContainerSort = (
  state = CommitsContainerSorts.TIME,
  action: any
) => {
  switch (action.type) {
    case ActionTypes.SET_COMMITS_CONTAINER_SORT:
      return action.sort;
  }
  return state;
};
 
export const filesContainerSort = (
  state = FilesContainerSorts.TIME,
  action: any
) => {
  switch (action.type) {
    case ActionTypes.SET_FILES_CONTAINER_SORT:
      return action.sort;
  }
  return state;
};
 
export const openSidePanelGroup = (
  state = CollapsibleSidePanelGroups.AUTHORS,
  action: any
) => {
  switch (action.type) {
    case ActionTypes.SET_OPEN_SIDEPANEL_GROUP:
      return action.group;
  }
  return state;
};