Skip to content

Commit

Permalink
Enhancement: Reusable button for showing comments
Browse files Browse the repository at this point in the history
Reference:
-
Podcastindex-org#253 (comment)

Co-authored-by: Steven Crader <[email protected]>
  • Loading branch information
dellagustin and stevencrader committed May 4, 2023
1 parent b7d2b76 commit 4df46d9
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 4df46d9

Please sign in to comment.