Put "Media Only" option in column settings instead of content area headline (#7801)

* Action/reducer for changing column settings takes a path and a value
instead of a javascript object

* Settings menu version and column headline version working simultaneously

* remove column headline entirely

* remove css for headlines that aren't possible now

* Remove commented out code from unfruitful attempt at this feature

* Give direct timeline its own column settings bc it doesn't have a media only option

* Fix typo in public timeline code that was preventing per-column settings from working properly

* Fix codeclimate issues

* Missing semicolons

* Use redux state to set onlyMedia, let that do the update instead of a callback. Consequently, unpinned setting works without history modification

* Unused import
This commit is contained in:
chr v1.x
2018-06-15 02:15:15 -07:00
committed by Eugen Rochko
parent f972815f1b
commit 4f42238c29
11 changed files with 125 additions and 133 deletions

View File

@ -93,11 +93,11 @@ const moveColumn = (state, uuid, direction) => {
.set('saved', false);
};
const changeColumnParams = (state, uuid, params) => {
const changeColumnParams = (state, uuid, path, value) => {
const columns = state.get('columns');
const index = columns.findIndex(item => item.get('uuid') === uuid);
const newColumns = columns.update(index, column => column.update('params', () => fromJS(params)));
const newColumns = columns.update(index, column => column.updateIn(['params', ...path], () => value));
return state
.set('columns', newColumns)
@ -127,7 +127,7 @@ export default function settings(state = initialState, action) {
case COLUMN_MOVE:
return moveColumn(state, action.uuid, action.direction);
case COLUMN_PARAMS_CHANGE:
return changeColumnParams(state, action.uuid, action.params);
return changeColumnParams(state, action.uuid, action.path, action.value);
case EMOJI_USE:
return updateFrequentEmojis(state, action.emoji);
case SETTING_SAVE: