From 4224f18ba7eed0af6d8d886ac46713b6aa99e2b2 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 13 Feb 2018 11:42:25 +0100 Subject: [PATCH] Add BareButton --- client/coral-ui/components/BareButton.css | 3 +++ client/coral-ui/components/BareButton.js | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 client/coral-ui/components/BareButton.css create mode 100644 client/coral-ui/components/BareButton.js diff --git a/client/coral-ui/components/BareButton.css b/client/coral-ui/components/BareButton.css new file mode 100644 index 000000000..0a9c81625 --- /dev/null +++ b/client/coral-ui/components/BareButton.css @@ -0,0 +1,3 @@ +.bare { + composes: buttonReset from "coral-framework/styles/reset.css"; +} diff --git a/client/coral-ui/components/BareButton.js b/client/coral-ui/components/BareButton.js new file mode 100644 index 000000000..6d3f9fa93 --- /dev/null +++ b/client/coral-ui/components/BareButton.js @@ -0,0 +1,23 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import styles from './BareButton.css'; +import cn from 'classnames'; + +/** + * BareButton is a button whose styling is stripped off to a minimum. + * Can pass anchor=true to use `a` instead of `button` + */ +const BareButton = ({ anchor, className, ...props }) => { + let Element = 'button'; + if (anchor) { + Element = 'a'; + } + return ; +}; + +BareButton.propTypes = { + className: PropTypes.string, + anchor: PropTypes.bool, +}; + +export default BareButton;