From d520c67839724e80d8b68b8fe933f1e7755a8f42 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 4 Jul 2017 04:14:03 +0200 Subject: writing task form in a reduxy way --- client/components/UI/Link.jsx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 client/components/UI/Link.jsx (limited to 'client/components/UI/Link.jsx') 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 {children} + } + + return ( + // eslint-disable-next-line + { + e.preventDefault() + onClick() + }} + > + {children} + + ) +} + +// Link.propTypes = { +// active: PropTypes.bool.isRequired, +// children: PropTypes.node.isRequired, +// onClick: PropTypes.func.isRequired +// } + +export default Link -- cgit v1.2.3-70-g09d2