2018-02-08 12:01:06 +01:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* HomePage actions
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-02-16 14:17:24 +01:00
|
|
|
import {
|
|
|
|
DROP_SUCCESS,
|
2018-02-16 15:39:35 +01:00
|
|
|
GET_DATA,
|
|
|
|
GET_DATA_SUCCESS,
|
2018-02-16 14:17:24 +01:00
|
|
|
ON_DROP,
|
|
|
|
ON_SEARCH,
|
|
|
|
} from './constants';
|
|
|
|
|
|
|
|
export function dropSuccess(newFiles) {
|
|
|
|
return {
|
|
|
|
type: DROP_SUCCESS,
|
|
|
|
newFiles,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-02-16 15:39:35 +01:00
|
|
|
export function getData() {
|
|
|
|
return {
|
|
|
|
type: GET_DATA,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getDataSuccess(data, entriesNumber) {
|
|
|
|
return {
|
|
|
|
type: GET_DATA_SUCCESS,
|
|
|
|
data,
|
|
|
|
entriesNumber,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-02-16 14:17:24 +01:00
|
|
|
export function onDrop({ dataTransfer: { files } }) {
|
|
|
|
return {
|
|
|
|
type: ON_DROP,
|
|
|
|
files,
|
|
|
|
}
|
|
|
|
}
|
2018-02-08 12:01:06 +01:00
|
|
|
|
2018-02-15 17:46:57 +01:00
|
|
|
export function onSearch({ target }) {
|
2018-02-08 12:01:06 +01:00
|
|
|
return {
|
2018-02-15 17:46:57 +01:00
|
|
|
type: ON_SEARCH,
|
|
|
|
value: target.value,
|
2018-02-08 12:01:06 +01:00
|
|
|
};
|
|
|
|
}
|