Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function renderRating(elm, props) {
- const { uid, idfield, iddata, average, note, votesCount } = props;
- const assessmentCatalog = document.querySelector('#row' + iddata + ' .card-rating');
- render(<UIRatingStars
- key={iddata}
- firstToVote={_l('voting.firstToRate')}
- evaluateTheStartup={_l('voting.evaluateTheStartup')}
- myNoteIs={_l('voting.myNoteIs')}
- note={note}
- onVoted={(newValue) => {
- getNewAverage(newValue, idfield, iddata, uid)
- .then((json) => {
- json && renderRating(elm, { ...json, uid, idfield, iddata });
- });
- }}
- average={average}
- votesCount={votesCount}
- />, elm);
- if(assessmentCatalog){
- render(<UIRatingStars
- key={iddata}
- firstToVote={_l('voting.firstToRate')}
- evaluateTheStartup={_l('voting.evaluateTheStartup')}
- myNoteIs={_l('voting.myNoteIs')}
- note={note}
- onVoted={(newValue) => {
- getNewAverage(newValue, idfield, iddata, uid)
- .then((json) => {
- json && renderRating(document.querySelector('#row' + iddata + ' .card-rating'), { ...json, uid, idfield, iddata });
- });
- }}
- average={average}
- votesCount={votesCount}
- />, document.querySelector('#row' + iddata + ' .card-rating'));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement