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… #132

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
40 changes: 24 additions & 16 deletions sentimentAnalyzeClient/src/EmotionTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,29 @@ import './bootstrap.min.css';

class EmotionTable extends React.Component {
render() {
//Returns the emotions as an HTML table
return (
<div>
<table className="table table-bordered">
<tbody>
{
/*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*/
}
</tbody>
</table>
</div>
);
}

//Returns the emotions as an HTML table
return (
<div>
<table className="table table-bordered">
<tbody>
{
/*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>
</div>
);
}

}
export default EmotionTable;
Loading