Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Button component, clean up babel, update index.js files #4

Merged
merged 1 commit into from Sep 2, 2018
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
@@ -27,6 +27,7 @@
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@tulipjs/eslint-config": "^1.1.1",
"babel-loader": "^8.0.1",
"css-loader": "^1.0.0",
@@ -36,5 +37,9 @@
"url-loader": "^1.1.1",
"webpack": "^4.17.1",
"webpack-cli": "^3.1.0"
},
"dependencies": {
"react": "^16.4.2",
"styled-components": "^3.4.5"
}
}
@@ -0,0 +1,17 @@
import React from 'react';
import styled from 'styled-components';

const ButtonWrapper = styled.button`
border-radius: 8px;
color: #fff;
background: mediumvioletred;
padding: 8px 15px;
border: none;
outline: none;
`;

function Button(props) {
return <ButtonWrapper {...props}>{props.children}</ButtonWrapper>;
}

export default Button;
@@ -0,0 +1,26 @@
# Button

This component renders an HTML `<button>` and passes along all props.

## Example Usage

```jsx
import React from 'react';
import { Button } from 'rinse-react';
class MyClass extends React.Component {
buttonClick() {
console.log('Ack! You got me!');
}
render() {
return (
<section>
<Button onClick={this.buttonClick}>
Get me!
</Button>
</section>
)
}
}
```
@@ -0,0 +1,3 @@
import Button from './Button';

export default Button;
@@ -0,0 +1 @@
export { default as Button } from './Button';
@@ -1,3 +1 @@
const testFunction = () => 1 + 1;

export default testFunction;
export * from './components';
@@ -9,9 +9,6 @@ module.exports = {
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
},
{