Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server and client side changes to implement the final project require… #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sentimentAnalyzeClient/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ class App extends React.Component {
let output = data.label;
let color = "white"
switch(output) {
case "positive": color = "black";break;
case "negative": color = "black";break;
default: color = "black";
case "positive": color = "green";break;
case "negative": color = "red";break;
default: color = "yellow";
}
output = <div style={{color:color,fontSize:20}}>{output}</div>
this.setState({sentimentOutput:output});
Expand Down
8 changes: 8 additions & 0 deletions sentimentAnalyzeClient/src/EmotionTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ class EmotionTable extends React.Component {
/*Write code to use the .map method that you worked on in the
Hands-on React lab to extract the emotions. If you are stuck,
please click the instructions to see how to implement a map*/
Object.entries(this.props.emotions).map(function(mapentry) {
return (
<tr>
<td>{mapentry[0]}</td>
<td>{mapentry[1]}</td>
</tr>
)
})
}
</tbody>
</table>
Expand Down
Loading