Skip to content

Commit

Permalink
Merge pull request #40 from rajanlagah/style-fix
Browse files Browse the repository at this point in the history
Unnecessary Ternary operator removed
  • Loading branch information
jeanfredrik committed Jan 21, 2021
2 parents e2ed017 + e83d593 commit c99557d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions addon/src/SyntaxHighlighter.js
Expand Up @@ -76,7 +76,11 @@ export default class SyntaxHighlighter extends Component {
...rest
} = this.props;
const { copied } = this.state;
return children ? (
if(!children){
return null
}

return (
<>
<ScrollArea vertical>
<ReactSyntaxHighlighter
Expand All @@ -93,14 +97,13 @@ export default class SyntaxHighlighter extends Component {
{children.trim()}
</ReactSyntaxHighlighter>
</ScrollArea>
{copyable ? (
{ copyable &&
<ActionBar
actionItems={[
{ title: copied ? 'Copied' : 'Copy', onClick: this.onClick },
]}
/>
) : null}
/>}
</>
) : null;
)
}
}

0 comments on commit c99557d

Please sign in to comment.