diff options
Diffstat (limited to 'client/components/UI')
| -rw-r--r-- | client/components/UI/Header.jsx | 2 | ||||
| -rw-r--r-- | client/components/UI/Link.jsx | 29 |
2 files changed, 30 insertions, 1 deletions
diff --git a/client/components/UI/Header.jsx b/client/components/UI/Header.jsx index 31439db..1727f7a 100644 --- a/client/components/UI/Header.jsx +++ b/client/components/UI/Header.jsx @@ -1,5 +1,5 @@ import { h, Component } from 'preact' -import { Link } from 'react-router-dom' +// import { Link } from 'react-router-dom' export default class Header extends Component { constructor(props) { diff --git a/client/components/UI/Link.jsx b/client/components/UI/Link.jsx new file mode 100644 index 0000000..f801979 --- /dev/null +++ b/client/components/UI/Link.jsx @@ -0,0 +1,29 @@ +import { h, Component } from 'preact' +import React from 'react' +// import PropTypes from 'prop-types' + +const Link = ({ active, children, onClick }) => { + if (active) { + return <span>{children}</span> + } + + return ( + // eslint-disable-next-line + <a href="#" + onClick={e => { + e.preventDefault() + onClick() + }} + > + {children} + </a> + ) +} + +// Link.propTypes = { +// active: PropTypes.bool.isRequired, +// children: PropTypes.node.isRequired, +// onClick: PropTypes.func.isRequired +// } + +export default Link |
