{"size": 1377, "ext": "js", "max_stars_repo_path": "src/data/redux/page_details/reducers.js", "max_stars_repo_name": "shamaahlawat/git_folder_removed", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/data/redux/page_details/reducers.js", "max_issues_repo_name": "shamaahlawat/git_folder_removed", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/data/redux/page_details/reducers.js", "max_forks_repo_name": "shamaahlawat/git_folder_removed", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.54, "max_line_length": 75, "alphanum_fraction": 0.452432825}
import actionTypes from '../actiontypes';
import states from './states';

export default function page_details(state = states.page_details, action) {
    switch (action.type) {
        case actionTypes.SYST_LANG_SET:
            return {
                ...state,
                lang: action.payload.lang
            };

        case actionTypes.DEVICE_DATA_LOADED:
            return {
                ...state,
                device_data: action.payload.device_data
            };

        case actionTypes.PAGE_CHANGED:
            return {
                ...state,
                current_page: action.payload.current_page,
                page_title: action.payload.page_title,
                page_load_error: false,
            };
        
        case actionTypes.PAGE_LOADING:
            return {
                ...state,
                loaders: {
                    ...state.loaders,
                    page_loading: true,
                    page_loading_text: action.payload ? action.payload : ""
                }
            };
        
        case actionTypes.PAGE_LOADED:
            return {
                ...state,
                loaders: {
                    ...state.loaders,
                    page_loading: false,
                    page_loading_text: ""
                }
            };

        default:
            return state;
    }
}
