Skip to content

Instantly share code, notes, and snippets.

View NiallJoeMaher's full-sized avatar
🎯
Focusing

Niall Maher NiallJoeMaher

🎯
Focusing
View GitHub Profile
{
"policyName": "Jane Dobbs",
"policyNumber": 98765465,
"dateOfBirth": "15/11/1968"
}
{
"policyName": "Adam Scott",
"policyNumber": 14567862,
"dateOfBirth": "31/08/1965"
}
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>
// 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'
// Before
import OtherComponent from './OtherComponent';
function MyComponent() {
return (
<div>
<OtherComponent />
</div>
);
@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'
@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.css
Created May 29, 2019 07:30
Starter Code Clubhouse.io Storybook
.c-Button {
background-color: #6515dd;
border: 1px solid transparent;
border-radius: 50px;
box-shadow: none;
box-sizing: border-box;
color: #fff;
cursor: pointer;
display: flex;
font-size: 18px;
// The behaviour was this:
bar.toString() // 'function bar() {}
//now the new behaviour is:
bar.toString(); // 'function /* this is bar */ bar () {}'
console.log(Symbol('test description').description); // "test description"
console.log(Symbol.iterator.description); // "Symbol.iterator"
console.log(Symbol.for('test description').description); // "test description"