Skip to content

Instantly share code, notes, and snippets.

import React from "react";
import styled from "@emotion/styled";
import { font, primaryColors, shape } from "../config/styles";
const Wrapper = styled.button`
${font}
${primaryColors}
${shape}
`;
import { css } from "@emotion/core";
export const font = css`
text-transform: uppercase;
font-size: 1.5em;
font-weight: bold;
letter-spacing: 4px;
`;
export const shape = css`
import React from "react";
import styled from "@emotion/styled";
const Wrapper = styled.button`
text-transform: uppercase;
font-size: 1.5em;
font-weight: bold;
letter-spacing: 4px;
background: #5cdb95;
A very simple button.
```jsx
import Button from "./Button";
<Button text="We Salute You!" />
```
import React from "react";
export default function Button({ text }) {
return <button>{text}</button>;
}
module.exports = {
webpackConfig: {
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: "babel-loader"
}
]
module.exports = {
webpackConfig: {
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: "babel-loader"
}
]
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
{
"name": "react-sample-components-library",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
@tfiechowski
tfiechowski / rspec.rb
Created April 10, 2019 08:08
Sample RSpec unit test
class HelloWorld
def say_hello
"Hello World!"
end
end
describe HelloWorld do
context “When testing the HelloWorld class” do