Files
swagger-ui/src/core/components/deeplinking-link.jsx
2017-12-04 14:14:28 -06:00

21 lines
550 B
JavaScript

import React from "react"
import PropTypes from "prop-types"
export const DeepLinkingLink = ({ isDeepLinkingEnabled, path, text }) => {
return (
<a className="nostyle"
onClick={isDeepLinkingEnabled ? (e) => e.preventDefault() : null}
href={isDeepLinkingEnabled ? `#/${path}` : null}>
<span>{text}</span>
</a>
)
}
DeepLinkingLink.propTypes = {
isDeepLinkingEnabled: PropTypes.bool,
isShown: PropTypes.bool,
path: PropTypes.string,
text: PropTypes.string
}
export default DeepLinkingLink