Skip to content

Instantly share code, notes, and snippets.

@HriBB
HriBB / classnames_client
Created May 22, 2018 14:09
material-ui + react-apollo ssr className mismatch
AppView-root-1
AppView-progress-2
AppHeader-root-3
AppHeader-toolbar-4
AppHeader-title-5
AppHeader-logo-6
AppHeader-nav-7
AppHeader-button-8
AppHeader-userIcon-9
AppHeader-scrolled-10
@HriBB
HriBB / Confirm.js
Last active April 26, 2018 22:13
React confirmation dialog using new context API
// @flow
import React from 'react'
import { Button } from 'ui/button'
import { Dialog } from 'ui/dialog'
import { withHandlers } from 'recompose'
const { Provider, Consumer } = React.createContext({
isOpen: false,
@HriBB
HriBB / about.js
Last active October 1, 2018 20:27
Gatsby i18next
import React, { Component, Fragment } from 'react'
import Link from 'gatsby-link'
import { translate } from 'utils/i18n'
import About from 'components/About'
class AboutPage extends Component {
componentWillMount() {
this.props.setHeader('transparent')
}
render() {
@HriBB
HriBB / .babelrc
Created August 17, 2016 15:31
Webpack + Babel + React Hot Loader 3
{
"presets": ["es2015", "react", "stage-0"],
"env": {
"development": {
"plugins": [
"react-hot-loader/babel",
[ "babel-plugin-webpack-alias", { "config": "./webpack/config.js" } ]
]
},
"production": {
@HriBB
HriBB / UploadField.js
Created August 10, 2016 01:20
React MDL UploadField for Redux Form
import React, { Component, PropTypes } from 'react'
import classnames from 'classnames'
import './UploadField.scss'
/**
* Upload field polyfill until mdl implements it ... if ever ...
*
* Note: onFocus/onBlur timeouts are needed for mdl animations to work.
*/
@HriBB
HriBB / SelectField.js
Created August 9, 2016 23:43
React MDL SelectField for Redux Form
import React, { Component, PropTypes } from 'react'
import classnames from 'classnames'
import './SelectField.scss'
/**
* Select field polyfill until mdl implements it
* https://github.com/google/material-design-lite/issues/4475
* https://github.com/google/material-design-lite/issues/854
*/
@HriBB
HriBB / designer.html
Created December 21, 2014 21:44
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@HriBB
HriBB / designer.html
Last active August 29, 2015 14:11
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-item/paper-item.html">
@HriBB
HriBB / designer.html
Last active August 29, 2015 14:11
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@HriBB
HriBB / designer.html
Created December 14, 2014 19:15
designer
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;