summaryrefslogtreecommitdiff
path: root/client/components/UI
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-07-20 17:56:19 +0200
committerJules Laplace <julescarbon@gmail.com>2017-07-20 17:56:19 +0200
commitd02cbad01f3abfa8a1aad0b55b8bd9cf544090cf (patch)
tree0ea170b764e5aad2713c6ed9429729579cc69a63 /client/components/UI
parente9c0ffcd5d58310c6cff6a5a73bdf6062485eba4 (diff)
disabled links
Diffstat (limited to 'client/components/UI')
-rw-r--r--client/components/UI/Link.jsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/components/UI/Link.jsx b/client/components/UI/Link.jsx
index f801979..d71582b 100644
--- a/client/components/UI/Link.jsx
+++ b/client/components/UI/Link.jsx
@@ -2,14 +2,16 @@ import { h, Component } from 'preact'
import React from 'react'
// import PropTypes from 'prop-types'
-const Link = ({ active, children, onClick }) => {
+const Link = ({ active, children, onClick, disabled }) => {
if (active) {
return <span>{children}</span>
}
+ const className = disabled ? 'disabled' : ''
return (
// eslint-disable-next-line
<a href="#"
+ class={className}
onClick={e => {
e.preventDefault()
onClick()