Refactor: use ternary operators at attribute level instead of element level

This commit is contained in:
Kyle Shockey
2017-08-25 12:06:11 -07:00
parent f63d2b1ae8
commit 5da3843281
2 changed files with 12 additions and 24 deletions

View File

@@ -79,18 +79,12 @@ export default class Operations extends React.Component {
onClick={() => layoutActions.show(isShownKey, !showTag)}
className={!tagDescription ? "opblock-tag no-desc" : "opblock-tag" }
id={isShownKey.join("-")}>
{
isDeepLinkingEnabled ?
<a
className="nostyle"
onClick={(e) => e.preventDefault()}
href= {`#/${tag}`}>
<span>{tag}</span>
</a>:
<a className="nostyle">
<span>{tag}</span>
</a>
}
<a
className="nostyle"
onClick={isDeepLinkingEnabled ? (e) => e.preventDefault() : null}
href= {isDeepLinkingEnabled ? `#/${tag}` : null}>
<span>{tag}</span>
</a>
{ !tagDescription ? null :
<small>
{ tagDescription }