add presentational component to allow for wrapping deeplinking links
This commit is contained in:
19
src/core/components/deeplinking-link.jsx
Normal file
19
src/core/components/deeplinking-link.jsx
Normal file
@@ -0,0 +1,19 @@
|
||||
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.boolean,
|
||||
path: PropTypes.string,
|
||||
text: PropTypes.string
|
||||
}
|
||||
|
||||
export default DeepLinkingLink
|
||||
Reference in New Issue
Block a user