Browser: Update UI with new components and elements (#5671)

This commit is contained in:
Rushan
2018-03-21 23:39:23 +05:30
committed by Harshavardhana
parent 384b4fdf28
commit 1459c4be1e
199 changed files with 10549 additions and 4702 deletions

View File

@@ -21,16 +21,16 @@ const add = (files, action) => ({
[action.slug]: {
loaded: 0,
size: action.size,
name: action.name
}
name: action.name,
},
})
const updateProgress = (files, action) => ({
...files,
[action.slug]: {
...files[action.slug],
loaded: action.loaded
}
loaded: action.loaded,
},
})
const stop = (files, action) => {
@@ -39,27 +39,33 @@ const stop = (files, action) => {
return newFiles
}
export default (state = { files: {}, showAbortModal: false }, action) => {
export default (
state = {
files: {},
showAbortModal: false,
},
action,
) => {
switch (action.type) {
case uploadsActions.ADD:
return {
...state,
files: add(state.files, action)
files: add(state.files, action),
}
case uploadsActions.UPDATE_PROGRESS:
return {
...state,
files: updateProgress(state.files, action)
files: updateProgress(state.files, action),
}
case uploadsActions.STOP:
return {
...state,
files: stop(state.files, action)
files: stop(state.files, action),
}
case uploadsActions.SHOW_ABORT_MODAL:
return {
...state,
showAbortModal: action.show
showAbortModal: action.show,
}
default:
return state