diff --git a/app/components/UI/Button.js b/app/components/UI/Button.js new file mode 100644 index 00000000..510b4b7c --- /dev/null +++ b/app/components/UI/Button.js @@ -0,0 +1,83 @@ +import React from 'react' +import PropTypes from 'prop-types' +import styled from 'styled-components' +import { Button as BaseButton, Flex, Text } from 'rebass' +import Spinner from './Spinner' + +const Wrapper = styled(BaseButton)` + transition: all 0.25s; + outline: none; + border-radius: 5; + font-weight: normal; + line-height: '18px'; + &:focus { + box-shadow: 0 0 3px ${props => props.theme.lightningOrange}; + } + &:disabled { + opacity: 0.5; + } + &:hover:enabled { + cursor: pointer; + } +` +Wrapper.displayName = 'Button' + +/** + * @render react + * @name Button + * @example + * ) + .add('With Icon', () => ( +
+ {' '} + +
+ )) + .add('Processing', () => ( + + )) + .add('Disabled', () => ( + + )) + .add('Primary', () => ( + + )) + .add('Secondary', () => ( + + )) + .add('Small', () => ( + + )) + .add('Medium', () => ( + + )) + .add('Large', () => ( + + )) diff --git a/test/unit/components/UI/Button.spec.js b/test/unit/components/UI/Button.spec.js new file mode 100644 index 00000000..feac8b98 --- /dev/null +++ b/test/unit/components/UI/Button.spec.js @@ -0,0 +1,10 @@ +import React from 'react' +import Button from 'components/UI/Button' +import renderer from 'react-test-renderer' + +describe('component.UI.Button', () => { + it('should render correctly', () => { + const tree = renderer.create( +`;