Skip to content

Instantly share code, notes, and snippets.

View NiallJoeMaher's full-sized avatar
🎯
Focusing

Niall Maher NiallJoeMaher

🎯
Focusing
View GitHub Profile
@NiallJoeMaher
NiallJoeMaher / Button.stories.js
Created May 29, 2019 07:39
Starter code for Clubhouse.io Storybook - Button.stories.js
import React from 'react'
import { storiesOf } from '@storybook/react'
import { action } from '@storybook/addon-actions'
import Button from './'
const seperatorStyles = {
height: 2,
background: '#999',
margin: '30px 0'
}
@NiallJoeMaher
NiallJoeMaher / Button.stories.js
Created May 29, 2019 07:43
Clubhouse.io Storybook completed Button.stories.js
import React from 'react'
import { storiesOf } from '@storybook/react'
import { action } from '@storybook/addon-actions'
import { withInfo } from "@storybook/addon-info";
import Button from './'
const seperatorStyles = {
height: 2,
background: '#999',
margin: '30px 0'
// Before
import OtherComponent from './OtherComponent';
function MyComponent() {
return (
<div>
<OtherComponent />
</div>
);
// Before
import React, { Component, Suspense, lazy } from "react";
import ReactDOM from "react-dom";
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import Home from './Home'
import Topics from './Topics'
import Settings from './Settings'
import { useReducer, useCallback } from 'react';
// Usage
function App() {
const { state, set, undo, redo, clear, canUndo, canRedo } = useHistory({});
return (
<div className="container">
<div className="controls">
<div className="title">👩‍🎨 Click squares to draw</div>
{
"policyName": "Adam Scott",
"policyNumber": 14567862,
"dateOfBirth": "31/08/1965"
}
{
"policyName": "Jane Dobbs",
"policyNumber": 98765465,
"dateOfBirth": "15/11/1968"
}