import { History } from 'history' ; export function getCurrentView ( history ) { let currentView = '' ; if ( history . location . pathname ) { if ( history . location . pathname . startsWith ( '/kanban/' ) ) { currentView = 'kanban' ; } else if ( history . location . pathname . startsWith ( '/calendar/' ) ) { currentView = 'calendar' ; } else if ( history . location . pathname . startsWith ( '/edit/' ) ) { currentView = 'edit' ; } else if ( history . location . pathname . startsWith ( '/config/' ) ) { currentView = 'config' ; } } return currentView ; }