Skip to content
Snippets Groups Projects
Commit f2979487 authored by Mihail Hagiu's avatar Mihail Hagiu
Browse files

docs(HandleRecommendation): Wrote documentation for withHandleRecommendation HOC

parent 28df1cb2
No related branches found
No related tags found
3 merge requests!222Sprint #26,!217Sprint #26,!191Hin 1116 documentation
## Hindawi Handling Recommendation HOC.
Injects `createRecommendation` and `onEditorialRecommendation` handlers as props.
### withHandleRecommendation props
`recommendationHandler` namespace contains the following fields:
Name|Type|Description
---|---|---
createRecommendation |`(reduxFormValues, modalProps) => any`|creates a recommendation for the manuscript
onEditorialRecommendation |`(reduxFormValues, modalProps) => any`|handles the recommendation for the manuscript
_Note: The functions must be used withing a modal_
```javascript
const HERecommendationPanel = ({ createRecommendation }) => (
<Modal>
<span>Recommend the manuscript for:</span>
<select>
<option>Approve</option>
<option>Reject</option>
<option>Minor revision</option>
<option>Major revision</option>
</select>
<button onClick={() => createRecommendation(reduxFormValues, { ...modalProps, setFetching })}>
Submit
</button>
</Modal>
)
const EICDecisionPanel = ({ onEditorialRecommendation }) => (
<Modal>
<span>Take decision to:</span>
<select>
<option>Approve</option>
<option>Reject</option>
<option>Minor revision</option>
<option>Major revision</option>
</select>
<button onClick={() => onEditorialRecommendation(reduxFormValues, { ...modalProps, setFetching })}>
Submit
</button>
</Modal>
)
```
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment