This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Route from 'react-router-dom/Route'; | |
import Link from 'react-router-dom/Link'; | |
import Switch from 'react-router-dom/Switch'; | |
const App = ({ routes, initialData }) => { | |
return routes | |
? <div> | |
<Switch> | |
{routes.map((route, index) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Joi from 'joi'; | |
import * as monk from 'monk'; | |
export interface DaoProps { | |
/** | |
* Name of table | |
*/ | |
name: string; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const autoprefixer = require('autoprefixer'); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
const path = require('path'); | |
const { | |
CheckerPlugin, | |
TsConfigPathsPlugin, | |
} = require('awesome-typescript-loader'); | |
const HappyPack = require('happypack'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import toClass from 'recompose/toClass'; | |
export default function debug(WrappedComponent) { | |
if (typeof WrappedComponent === 'function') { | |
WrappedComponent = toClass(WrappedComponent); | |
} | |
return class Enhancer extends WrappedComponent { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
class PopoverExample extends React.Component { | |
state = { | |
isOpen: false, | |
}; | |
toggle = () => { | |
this.setState(state => ({ | |
isOpen: !state.isOpen, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import axios from 'axios'; | |
// This is a Higher Order Component that abstracts duplicated data fetching | |
// on the server and client. | |
export default function SSR(Page) { | |
class SSR extends React.Component { | |
static getInitialData(ctx) { | |
// Need to call the wrapped components getInitialData if it exists | |
return Page.getInitialData |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
'20': '1128.497220', | |
'19': '2256.994440', | |
'18': '4513.988880', | |
'17': '9027.977761', | |
'16': '18055.955520', | |
'15': '36111.911040', | |
'14': '72223.822090', | |
'13': '144447.644200', | |
'12': '288895.288400', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var { Component, PropTypes } = React; | |
var throttle = require('lodash/function/throttle'); | |
class InfiniteScroll extends React.Component { | |
static propTypes = { | |
hasMore: PropTypes.bool.isRequired, | |
isLoading: PropTypes.bool.isRequired, | |
onLoadMore: PropTypes.func.isRequired, | |
threshold: PropTypes.number, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is converted from @palantir/blueprint's editable text. | |
* | |
* @see http://blueprintjs.com/docs/#components.editable | |
*/ | |
import React, {Component} from 'react' | |
import classNames from 'classnames' | |
import { clamp, safeInvoke } from '../utils' | |
import PureRender from "pure-render-decorator"; |