add presentational component to allow for wrapping deeplinking links

This commit is contained in:
Greg Thompson
2017-12-01 14:30:37 -06:00
parent 0256b97855
commit 0b8cd7e32f
4 changed files with 32 additions and 13 deletions

View File

@@ -30,6 +30,7 @@ export default class Operations extends React.Component {
const OperationContainer = getComponent("OperationContainer", true)
const Collapse = getComponent("Collapse")
const Markdown = getComponent("Markdown")
const DeepLinkingLink = getComponent("DeepLinkingLink")
let {
docExpansion,
@@ -72,12 +73,10 @@ export default class Operations extends React.Component {
onClick={() => layoutActions.show(isShownKey, !showTag)}
className={!tagDescription ? "opblock-tag no-desc" : "opblock-tag" }
id={isShownKey.join("-")}>
<a
className="nostyle"
onClick={isDeepLinkingEnabled ? (e) => e.preventDefault() : null}
href= {isDeepLinkingEnabled ? `#/${tag}` : null}>
<span>{tag}</span>
</a>
<DeepLinkingLink
isDeepLinkingEnabled={isDeepLinkingEnabled}
path={tag}
text={tag} />
{ !tagDescription ? null :
<small>
<Markdown source={tagDescription} />