Skip to content

Instantly share code, notes, and snippets.

View PaulieScanlon's full-sized avatar

Paul Scanlon PaulieScanlon

View GitHub Profile
@PaulieScanlon
PaulieScanlon / ButtonAction.js
Created July 18, 2018 14:58
Conditional Render of ButtonAction component as <button> or <a>
import React from "react";
import PropTypes from "prop-types";
import { flexAlignmentConvertor } from "../../utils/flexAlignmentConvertor";
import ButtonBase from "../ButtonBase/index";
import "./ButtonAction.scss";
export const defaultProps = {
actor: {
id: 1465706,
login: "PaulieScanlon",
display_login: "PaulieScanlon",
gravatar_id: "",
url: "https://api.github.com/users/PaulieScanlon"
},
created_at :"2018-08-20T13:15:57Z",
id: "8137880759",
payload: {
import * as React from "react";
import { FetcherIndicator } from "../FetcherIndicator";
import { fetchType } from "../../utils/fetch";
interface IProps {
fetchMethod: {
method: string;
query?: string;
<Fetcher
fetchMethod={{
method: "gitHubActivity"
}}
dataReducer={gitHubActivityHandler}
renderComponent={data => <GitHubActivity {...data} />}
/>
const onClick = (event, store) => {
store.set({ checked: !store.state.checked });
action("onClick")(event, store.state.checked);
};
stories.add(
"default usage",
withState({
checked: false
})(
import * as React from 'react'
import { colors } from '../../utils/theme'
import { paths } from './paths'
import { IDefaultProps } from '../../utils/types'
import { StyledSvg } from './styles'
type TIconStyles = 'sm' | 'lg' | string | number
interface IIconStyles {
@PaulieScanlon
PaulieScanlon / Link.js
Created July 31, 2019 10:27
Gatsby Link activeClassName
@PaulieScanlon
PaulieScanlon / gatsby-mdx-embed.html
Last active January 8, 2020 09:31
Example gist for gatsby-mdx-embed
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
@PaulieScanlon
PaulieScanlon / some-page.mdx
Last active February 16, 2020 13:43
mdx => react => markdown
<Flex sx={{ flexWrap: "wrap" }}>
  <Box
    sx={{
      width: ["100%", "50%", "33%"]
    }}
  >
    # heading 1
  </Box>
@PaulieScanlon
PaulieScanlon / theme-ui.js
Last active March 1, 2020 12:04
All the design tokens for theme-ui and theme-ui/components
export default {
// theme-spec
borders,
borderStyles,
borderWidth,
colors,
fonts,
fontSizes,
fontWeights,
lettingSpacings,