Skip to content

Enhance the add new comment UI #2

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

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
24 changes: 1 addition & 23 deletions api/db.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@
{
"posts": [
{
"id": 1,
"title": "json-server",
"author": "typicode"
}
],
"items": [
{
"name": "Item One",
"description": "some item",
"id": 1
},
{
"name": "Item Two",
"description": "a regular item",
"id": 2
}
],
"comments": [
{
"text": "First comment, a seed comment",
"id": 1,
"score": 1
}
],
"profile": {
"name": "typicode"
}
]
}
6,502 changes: 3,212 additions & 3,290 deletions client/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.0",
"@testing-library/user-event": "^7.2.1",
"axios": "^0.19.1",
"axios": "^0.21.1",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"lodash": "^4.17.15",
"lodash": "^4.17.21",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-redux": "^7.1.3",
Expand Down
20 changes: 13 additions & 7 deletions client/src/components/Comments/CreateComment.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ class CreateComment extends Component {

render() {
return (
<div className="create-comment">
<label>Add Comment</label>
<input
value={this.state.text}
onChange={(e) => this.setState({ text: e.target.value })}
/>
<button onClick={this.createComment} className="ui button primary">
<div className="create-comment ">
<div className="ui labeled input">
<div class="ui label">Add Comment</div>
<input
value={this.state.text}
onChange={(e) => this.setState({ text: e.target.value })}
/>
</div>
<button
id="creat-comment_btn"
onClick={this.createComment}
className="small ui button primary "
>
Add Comment
</button>
</div>
Expand Down
3 changes: 1 addition & 2 deletions client/src/components/Comments/comment-list.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.comment-list {

}
.comment-list ul {
margin: 0;
Expand All @@ -19,4 +18,4 @@

.comment-list ul li span {
margin: 0 1rem;
}
}
8 changes: 7 additions & 1 deletion client/src/components/Comments/create-comment.css
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
.create-comment {}
.create-comment input {
min-width: 30em;
}

#creat-comment_btn {
margin-left: 1em;
}
Loading