Added image picker and cleaned up main and job list screens.
This commit is contained in:
@@ -24,3 +24,6 @@ export const documentUploadFailure = (error) => ({
|
||||
type: AppActionTypes.DOCUMENT_UPLOAD_FAILURE,
|
||||
payload: error,
|
||||
});
|
||||
export const toggleDeleteAfterUpload = () => ({
|
||||
type: AppActionTypes.TOGGLE_DLETE_AFTER_UPLOAD,
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ const INITIAL_STATE = {
|
||||
cameraJob: null,
|
||||
documentUploadInProgress: null,
|
||||
documentUploadError: null,
|
||||
deleteAfterUpload: true,
|
||||
};
|
||||
|
||||
const appReducer = (state = INITIAL_STATE, action) => {
|
||||
@@ -37,6 +38,11 @@ const appReducer = (state = INITIAL_STATE, action) => {
|
||||
documentUploadError: action.payload,
|
||||
documentUploadInProgress: null,
|
||||
};
|
||||
case AppActionTypes.TOGGLE_DLETE_AFTER_UPLOAD:
|
||||
return {
|
||||
...state,
|
||||
deleteAfterUpload: !state.deleteAfterUpload,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -6,15 +6,23 @@ export const selectCurrentCameraJobId = createSelector(
|
||||
[selectApp],
|
||||
(app) => app.cameraJobId
|
||||
);
|
||||
|
||||
export const selectCurrentCameraJob = createSelector(
|
||||
[selectApp],
|
||||
(app) => app.cameraJob
|
||||
);
|
||||
|
||||
export const selectDocumentUploadInProgress = createSelector(
|
||||
[selectApp],
|
||||
(app) => app.documentUploadInProgress
|
||||
);
|
||||
|
||||
export const selectDocumentUploadError = createSelector(
|
||||
[selectApp],
|
||||
(app) => app.documentUploadError
|
||||
);
|
||||
|
||||
export const selectDeleteAfterUpload = createSelector(
|
||||
[selectApp],
|
||||
(app) => app.deleteAfterUpload
|
||||
);
|
||||
|
||||
@@ -4,5 +4,6 @@ const AppActionTypes = {
|
||||
DOCUMENT_UPLOAD_START: "DOCUMENT_UPLOAD_START",
|
||||
DOCUMENT_UPLOAD_SUCCESS: "DOCUMENT_UPLOAD_SUCCESS",
|
||||
DOCUMENT_UPLOAD_FAILURE: "DOCUMENT_UPLOAD_FAILURE",
|
||||
TOGGLE_DLETE_AFTER_UPLOAD: "TOGGLE_DLETE_AFTER_UPLOAD",
|
||||
};
|
||||
export default AppActionTypes;
|
||||
|
||||
Reference in New Issue
Block a user