Skip to content
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 @@ -9,6 +9,14 @@ class EmotionTable extends React.Component {
<table className="table table-bordered">
<tbody>
{
Object.entries(this.props.emotions).map(function(mapentry) {
return (
<tr>
<td>{mapentry[0]}</td>
<td>{mapentry[1]}</td>
</tr>
)
})
/*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*/
Expand Down
Loading