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

Enhancement: Reuse Button for showing comments #258

Merged
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
5 changes: 3 additions & 2 deletions ui/src/components/Comments/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react'
import DOMPurify from 'dompurify'
import Button from '../Button'

import './styles.scss'

Expand Down Expand Up @@ -290,8 +291,8 @@ export default class Comments extends React.PureComponent<IProps, IState> {
render() {
return (
<div className='comments-container'>
{!this.state.showComments && <button disabled={this.state.loadingComments} onClick={() => this.onClickShowComments()}>Show comments</button>}
{this.state.showComments && <button onClick={() => this.onClickHideComments()}>Hide comments</button>}
{!this.state.showComments && <Button disabled={this.state.loadingComments} onClick={() => this.onClickShowComments()}>Show comments</Button>}
{this.state.showComments && <Button onClick={() => this.onClickHideComments()}>Hide comments</Button>}
{this.state.loadingComments && <p>Loading comments...</p>}
{this.state.showComments && this.state.comments.map((comment) => <Comment key={comment.url} comment={comment}/>)}
</div>
Expand Down