X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=blobdiff_plain;f=empathy%2Fempathy.jsx;h=4151cf729edf1de6a53151ad49b947aeb2e504d9;hp=0789b463fe5813cb3fc23b8cb4a84610dd32b2a5;hb=e4c308c3331de77071170b0711505a990eaba617;hpb=d49e0aa05e9204fcefa2e7e88653dcd5bdc73a06 diff --git a/empathy/empathy.jsx b/empathy/empathy.jsx index 0789b46..4151cf7 100644 --- a/empathy/empathy.jsx +++ b/empathy/empathy.jsx @@ -482,7 +482,8 @@ class Ambiguities extends React.PureComponent { this.state = { word_sets: word_sets, - selected: null + selected: null, + starred: null }; this.submitted = false; @@ -497,7 +498,8 @@ class Ambiguities extends React.PureComponent { const response = await fetch_post_json( `judged/${this.props.prompt.id}`,{ - word_groups: this.state.word_sets.map(set => Array.from(set)) + word_groups: this.state.word_sets.map(set => Array.from(set)), + kudos: Array.from(this.state.starred) } ); @@ -684,6 +686,21 @@ class Ambiguities extends React.PureComponent { ); })} + { + event.stopPropagation(); + this.setState({ + starred: set + }); + }} + > + {this.state.starred === set ? + '★' : '☆' + } + ); })}