Skip to content

Commit 9bbff35

Browse files
authored
Merge pull request #107 from AnshumanDhiman/issue_work
Modified and Added feature to the Button in Comment Section
2 parents a92680f + a401173 commit 9bbff35

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

src/assets/scss/components/comments.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
}
3030
}
3131

32+
.btn-comment-edit {
33+
margin:2% 0;
34+
}
35+
3236
.comment-form {
3337
margin: 16px 0px;
3438
}

src/components/Comments.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,11 @@ const Comments = (props) => {
168168
Reply
169169
</Button>
170170
)}
171-
{data.user_story_comment_replies.length > 0 ? (
171+
<br/>
172+
{data.user_story_comment_replies.length == 1 ? (
173+
172174
<Button
173-
className='btn btn-default'
175+
className='btn btn-default btn-comment-edit'
174176
onClick={() => {
175177
toggleViewReplies(
176178
viewRepliesToggled,
@@ -179,11 +181,23 @@ const Comments = (props) => {
179181
)
180182
}}
181183
>
182-
View Replies ({data.user_story_comment_replies.length})
184+
{data.user_story_comment_replies.length} Reply
183185
</Button>
184-
) : (
186+
) : data.user_story_comment_replies.length == 0 ? (
185187
''
186-
)}
188+
) : ( <Button
189+
className='btn btn-default btn-comment-edit'
190+
onClick={() => {
191+
toggleViewReplies(
192+
viewRepliesToggled,
193+
setViewRepliesToggled,
194+
key
195+
)
196+
}}
197+
>
198+
{data.user_story_comment_replies.length} Replies
199+
</Button>) }
200+
187201
</div>
188202
{viewRepliesToggled.find((item) => item === key + 1) &&
189203
data.user_story_comment_replies.map((reply, key) => (

src/config.json.template

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)