diff --git a/src/components/Button/Button.css b/src/components/Button/Button.css new file mode 100644 index 0000000..0de60bc --- /dev/null +++ b/src/components/Button/Button.css @@ -0,0 +1,27 @@ +@import '../variables.css'; + +.root { + display: block; + box-sizing: border-box; + margin: 0; + padding: 10px 16px; + width: 100%; + opacity: 0.75; + outline: 0; + border: 4px solid #fff; + border-radius: 14px; + background: var(--colour-nearblack); + color: #fff; + text-align: center; + text-decoration: none; + font-size: 18px; + line-height: 1.3333333; + cursor: pointer; + transition: opacity ease-in-out 0.25s, box-shadow ease-in-out 0.25s; +} + +.root:hover, +.root:focus { + opacity: 0.9; + box-shadow: 0 0 4px #fff; +} diff --git a/src/components/Button/Button.js b/src/components/Button/Button.js new file mode 100644 index 0000000..b4d6c51 --- /dev/null +++ b/src/components/Button/Button.js @@ -0,0 +1,23 @@ +import React, { PropTypes } from 'react'; +import withStyles from 'isomorphic-style-loader/lib/withStyles'; +import s from './Button.css'; + +class Button extends React.Component { + static propTypes = { + children: PropTypes.node, + onClick: PropTypes.func, + }; + + handleClick = (event) => { + if (this.props.onClick) { + this.props.onClick(event); + } + }; + + render() { + const { children, ...props } = this.props; + return ; + } +} + +export default withStyles(s)(Button); diff --git a/src/components/Button/package.json b/src/components/Button/package.json new file mode 100644 index 0000000..b7a877a --- /dev/null +++ b/src/components/Button/package.json @@ -0,0 +1,6 @@ +{ + "name": "Button", + "version": "0.0.0", + "private": true, + "main": "./Button.js" +} diff --git a/src/components/Layout/Layout.css b/src/components/Layout/Layout.css index 3ec5cfb..0fe50f6 100644 --- a/src/components/Layout/Layout.css +++ b/src/components/Layout/Layout.css @@ -1,5 +1,4 @@ @import '../../../node_modules/normalize.css/normalize.css'; - @import '../variables.css'; /* diff --git a/src/components/RsvpButton/RsvpButton.css b/src/components/RsvpButton/RsvpButton.css index 7744262..5f23fbe 100644 --- a/src/components/RsvpButton/RsvpButton.css +++ b/src/components/RsvpButton/RsvpButton.css @@ -76,32 +76,6 @@ opacity: 0.9; } -.button { - display: block; - box-sizing: border-box; - margin: 0; - padding: 10px 16px; - width: 100%; - opacity: 0.75; - outline: 0; - border: 4px solid #fff; - border-radius: 14px; - background: var(--colour-nearblack); - color: #fff; - text-align: center; - text-decoration: none; - font-size: 18px; - line-height: 1.3333333; - cursor: pointer; - transition: opacity ease-in-out 0.25s, box-shadow ease-in-out 0.25s; -} - -.button:hover, -.button:focus { - opacity: 0.9; - box-shadow: 0 0 4px #fff; -} - @keyframes shake { 8%, 41% { diff --git a/src/components/RsvpButton/RsvpButton.js b/src/components/RsvpButton/RsvpButton.js index b53e069..1fafef2 100644 --- a/src/components/RsvpButton/RsvpButton.js +++ b/src/components/RsvpButton/RsvpButton.js @@ -2,6 +2,7 @@ import React, { PropTypes } from 'react'; import withStyles from 'isomorphic-style-loader/lib/withStyles'; import s from './RsvpButton.css'; import fetch from '../../core/fetch'; +import Button from '../Button'; class RsvpButton extends React.Component { static propTypes = { @@ -79,9 +80,9 @@ class RsvpButton extends React.Component { !this.state.showRsvpForm ? s.rsvpVisible : null, ].join(' ')} > -