Moved all reducers and actions to their own folders

This commit is contained in:
Deluan
2020-11-08 13:15:46 -05:00
parent 24b040adf9
commit 3fc81638c7
33 changed files with 204 additions and 206 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ import {
DialogContent,
DialogTitle,
} from '@material-ui/core'
import { closeAddToPlaylist } from './dialogState'
import { closeAddToPlaylist } from '../actions'
import SelectPlaylistInput from './SelectPlaylistInput'
const AddToPlaylistDialog = () => {
-36
View File
@@ -1,36 +0,0 @@
const ADD_TO_PLAYLIST_OPEN = 'ADD_TO_PLAYLIST_OPEN'
const ADD_TO_PLAYLIST_CLOSE = 'ADD_TO_PLAYLIST_CLOSE'
const openAddToPlaylist = ({ selectedIds, onSuccess }) => ({
type: ADD_TO_PLAYLIST_OPEN,
selectedIds,
onSuccess,
})
const closeAddToPlaylist = () => ({
type: ADD_TO_PLAYLIST_CLOSE,
})
const addToPlaylistDialogReducer = (
previousState = {
open: false,
},
payload
) => {
const { type } = payload
switch (type) {
case ADD_TO_PLAYLIST_OPEN:
return {
...previousState,
open: true,
selectedIds: payload.selectedIds,
onSuccess: payload.onSuccess,
}
case ADD_TO_PLAYLIST_CLOSE:
return { ...previousState, open: false, onSuccess: undefined }
default:
return previousState
}
}
export { openAddToPlaylist, closeAddToPlaylist, addToPlaylistDialogReducer }