From d2e931f3e1c410da92bcad035d200d9d9ea74a80 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Mon, 11 Dec 2017 14:27:28 -0600 Subject: [PATCH] DeepLink feedback --- src/core/components/deep-link.jsx | 20 ++++++++++++++++++++ src/core/components/deeplinking-link.jsx | 20 -------------------- src/core/components/operation.jsx | 6 +++--- src/core/components/operations.jsx | 6 +++--- src/core/presets/base.js | 4 ++-- test/components/operations.js | 4 ++-- 6 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 src/core/components/deep-link.jsx delete mode 100644 src/core/components/deeplinking-link.jsx diff --git a/src/core/components/deep-link.jsx b/src/core/components/deep-link.jsx new file mode 100644 index 00000000..44aa08bb --- /dev/null +++ b/src/core/components/deep-link.jsx @@ -0,0 +1,20 @@ +import React from "react" +import PropTypes from "prop-types" + +export const DeepLink = ({ enabled, path, text }) => { + return ( + e.preventDefault() : null} + href={enabled ? `#/${path}` : null}> + {text} + + ) +} +DeepLink.propTypes = { + enabled: PropTypes.bool, + isShown: PropTypes.bool, + path: PropTypes.string, + text: PropTypes.string +} + +export default DeepLink diff --git a/src/core/components/deeplinking-link.jsx b/src/core/components/deeplinking-link.jsx deleted file mode 100644 index 97108dec..00000000 --- a/src/core/components/deeplinking-link.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from "react" -import PropTypes from "prop-types" - -export const DeepLinkingLink = ({ isDeepLinkingEnabled, path, text }) => { - return ( - e.preventDefault() : null} - href={isDeepLinkingEnabled ? `#/${path}` : null}> - {text} - - ) -} -DeepLinkingLink.propTypes = { - isDeepLinkingEnabled: PropTypes.bool, - isShown: PropTypes.bool, - path: PropTypes.string, - text: PropTypes.string -} - -export default DeepLinkingLink diff --git a/src/core/components/operation.jsx b/src/core/components/operation.jsx index 8816f17e..1f07fff8 100644 --- a/src/core/components/operation.jsx +++ b/src/core/components/operation.jsx @@ -101,7 +101,7 @@ export default class Operation extends PureComponent { const Schemes = getComponent( "schemes" ) const OperationServers = getComponent( "OperationServers" ) const OperationExt = getComponent( "OperationExt" ) - const DeepLinkingLink = getComponent( "DeepLinkingLink" ) + const DeepLink = getComponent( "DeepLink" ) const { showExtensions } = getConfigs() @@ -120,8 +120,8 @@ export default class Operation extends PureComponent {
{method.toUpperCase()} - diff --git a/src/core/components/operations.jsx b/src/core/components/operations.jsx index 7d6eb3e5..6500587e 100644 --- a/src/core/components/operations.jsx +++ b/src/core/components/operations.jsx @@ -37,7 +37,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") + const DeepLink = getComponent("DeepLink") let { docExpansion, @@ -80,8 +80,8 @@ export default class Operations extends React.Component { onClick={() => layoutActions.show(isShownKey, !showTag)} className={!tagDescription ? "opblock-tag no-desc" : "opblock-tag" } id={isShownKey.join("-")}> - diff --git a/src/core/presets/base.js b/src/core/presets/base.js index e08f4954..1521fa28 100644 --- a/src/core/presets/base.js +++ b/src/core/presets/base.js @@ -61,7 +61,7 @@ import PrimitiveModel from "core/components/primitive-model" import Property from "core/components/property" import TryItOutButton from "core/components/try-it-out-button" import VersionStamp from "core/components/version-stamp" -import DeepLinkingLink from "core/components/deeplinking-link" +import DeepLink from "core/components/deep-link" import Markdown from "core/components/providers/markdown" @@ -123,7 +123,7 @@ export default function() { OperationExtRow, ParameterExt, OperationContainer, - DeepLinkingLink + DeepLink } } diff --git a/test/components/operations.js b/test/components/operations.js index a3de72b7..bfcbed4f 100644 --- a/test/components/operations.js +++ b/test/components/operations.js @@ -3,13 +3,13 @@ import React from "react" import expect, { createSpy } from "expect" import { render } from "enzyme" import { fromJS } from "immutable" -import DeepLinkingLink from "components/deeplinking-link" +import DeepLink from "components/deep-link" import Operations from "components/operations" import {Collapse} from "components/layout-utils" const components = { Collapse, - DeepLinkingLink, + DeepLink, OperationContainer: ({ path, method }) => }