code stringlengths 26 5k | intent stringlengths 3 2.56k |
|---|---|
import React from 'react';
import ReactDOM from 'react-dom';
import JqxDataTable from '../../../jqwidgets-react/react_jqxdatatable.js';
class App extends React.Component {
render() {
let source =
{
dataFields: [
{ name: 'OrderID', type: 'int' },
... | A component which can be used to create a new order based on a sequence of records. |
import React from 'react';
import { connect } from 'react-redux';
const BookDetail = ({ books, activeBook }) => {
if (!books)
return (<div></div>);
if (!activeBook)
return (
<h4 className="col-xs-7">Choose a book</h4>
);
return (
<article className="col-xs-7">
<h1>{ activeBook.title }</h1... | export a function to create a sequence of missing items |
import React from 'react';
import { configure, setAddon, addDecorator } from '@storybook/react';
import chapterAddon from '../src/';
addDecorator((story) => (
<div style={{padding: 20}}>
{story()}
</div>
));
setAddon(chapterAddon);
configure(function () {
require('../example/story');
}, module);
| Imports a bunch of modules that can be used to generate a sequence of tokens. |
import React from 'react';
import Gravatar from 'react-gravatar';
var Option = React.createClass({
propTypes: {
addLabelText: React.PropTypes.string,
className: React.PropTypes.string,
mouseDown: React.PropTypes.func,
mouseEnter: React.PropTypes.func,
mouseLeave: React.PropTypes.func,
option: React.PropTy... | The option component that is rendered when a user clicks on a node in a dropdown list. |
import React from 'react';
import {connect} from 'react-redux';
import * as bookmarkAction from './action';
import * as mapActions from '@boundlessgeo/sdk/actions/map';
// Custom Bookmark Component
class MoveButtonComponent extends React.PureComponent {
// This is the where action really happens, update state and m... | The move button component is a custom action that can be performed on the bookmark and the map. |
import React from 'react';
const AuthUserContext = React.createContext(null);
export default AuthUserContext;
| Imports the AuthUserContext from the module. |
import React, { Component } from 'react';
class SearchBar extends Component {
constructor(props){
super(props);
this.state = { term: 'Search here' };
}
render() {
return (
<div className="search-bar">
<input
value={this.state.term}
onCh... | The base class for the search bar. |
import React from 'react';
import GamesList from './GamesList'
import {bindActionCreators} from 'redux';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import {initGame, selectGame} from '../actions/games'
class GamesPage extends React.Component {
constructor(){
super();
console.l... | The base class for the pages that are not part of the API. |
import React from 'react';
import Select from 'react-select';
import fetch from 'isomorphic-fetch';
const GithubUsers = React.createClass({
displayName: 'GithubUsers',
propTypes: {
label: React.PropTypes.string,
},
getInitialState () {
return {
backspaceRemoves: true,
multi: true
};
},
onChange (val... | The default implementation of a single - valued |
import React from 'react';
//import { Route, IndexRoute } from 'react-router';
import Home from './components/home/index';
import Detail from './components/detail/index';
import Login from './components/login/index';
import Register from './components/register/index';
import Dashbord from './components/Dashbor... | Imports a single node in the system |
import React from 'react';
export default class TodoInput extends React.Component {
static propTypes = {
submitTodo: React.PropTypes.func.isRequired,
onBlur: React.PropTypes.func,
content: React.PropTypes.string,
layout: React.PropTypes.string
};
state = {
text: this.props.content || ''
};... | The TodoInput component is a component that allows to enter a message in a todo box. |
import React from 'react';
// import RaisedButton from 'material-ui/RaisedButton';
import { NavLink } from './NavLink';
import FloatingActionButton from 'material-ui/FloatingActionButton';
import ContentAdd from 'material-ui/svg-icons/content/add';
import kinectsitTheme from '../assets/kinectsitTheme';
import Paper fro... | Imports a single node with a single device. |
import React from 'react';
import PropTypes from 'prop-types';
export default class TutorialNav extends React.Component {
static propTypes = {
tutorialSkip: PropTypes.func.isRequired,
tutorialNextPage: PropTypes.func.isRequired,
navText: PropTypes.string.isRequired,
isLast: PropTypes.bool,
};
t... | A component that shows a tutorial of a sequence of tokens. |
import React from 'react'
import { ActionCreators as UndoActionCreators } from 'redux-undo'
import { connect } from 'react-redux'
let UndoRedo = ({ canUndo, canRedo, onUndo, onRedo }) => (
<p>
<button onClick={onUndo} disabled={!canUndo}>
Undo
</button>
<button onClick={onRedo} disabled={!canRedo}>... | Imports React - redux action creators and undos action creators. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let SocialCake = (props) => (
<SvgIcon {...props}>
<path d="M12 6c1.11 0 2-.9 2-2 0-.38-.1-.73-.29-1.03L12 0l-1.71 2.97c-.19.3-.29.65-.29 1.03 0 1.1.9 2 2 2zm4.6 9.99l-1.07-1.07-1.08 1.07c-1.3 1.3-3.58 1.31-4.89 0l... | A component that renders a component with a SocialCake icon. |
import React from 'react'
import styled from 'styled-components'
const digitColor = props => props.active ? 'black' : 'transparent'
const easing = props => props.active ? 'ease-in' : 'ease-out'
const dur = props => props.active ? '.3s' : '.1s'
const PalkaCore = styled.div`
width: 16px;
background-color: ${dig... | styled - components |
import React from 'react';
const ReminderIcon = props => (
<svg {...props.size || { width: '24px', height: '24px' }} {...props} viewBox="0 0 24 24">
{props.title && <title>{props.title}</title>}
<path d="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A... | A component that renders a reminder icon. |
/**
* Imports
*/
import React from 'react';
import connectToStores from 'fluxible-addons-react/connectToStores';
import {FormattedMessage} from 'react-intl';
// Flux
import FileUploadStore from '../../../stores/Files/FileUploadStore';
import IntlStore from '../../../stores/Application/IntlStore';
import uploadFile f... | Component that handles file library manager. |
import React from 'react'
import { Header, Icon } from 'semantic-ui-react'
const IconExampleTwitterGroup = () => (
<Header as='h2'>
<Icon.Group size='large'>
<Icon name='twitter' />
<Icon corner name='add' />
</Icon.Group>
Add on Twitter
</Header>
)
export default IconExampleTwitterGroup
| Example of how to display a twitter group. |
import React from 'react';
const base = 'https://www.formulate.fyi' // 'http://localhost:3000' : 'https://formulate-fyi.herokuapp.com';
class BroadcastLink extends React.Component {
constructor() {
super();
}
handleFocus(event) {
event.target.select();
}
// testing
render... | A component that broadcasts a message to the user when a user focuses on a link. |
import React from 'react';
import PropTypes from 'prop-types';
/**
* I think this is ugly but it works so I am going to concede and use it. Turns React elements into a human readable sentence.
* E.g. <Maintainer1><Maintainer2><Maintainer3> becomes <Maintainer1>, <Maintainer2> and <Maintainer3>
*/
const ReadableList... | A list of children that can be represented as a list of children. |
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
export default class HelloWorld extends Component {
render() {
return (
<View style={styles.containe... | Create a component |
import React from 'react'
import Link from 'next/link'
export default class Index extends React.Component {
static getInitialProps ({ req }) {
if (req) {
// Runs only in the server
const faker = require('faker')
const name = faker.name.findName()
return { name }
}
// Runs only in... | A component that is rendered when a component is missing a required property. |
import React from 'react';
import test from 'ava';
import { shallow } from 'enzyme';
import PostList from '../../components/PostList';
const posts = [
{ name: 'Prashant', title: 'Hello Mern', slug: 'hello-mern', cuid: 'f34gb2bh24b24b2', content: "All cats meow 'mern!'" },
{ name: 'Mayank', title: 'Hi Mern', slug: ... | Check if a specific exists in the system |
import React from 'react';
import PropTypes from 'prop-types';
import scheduleIdleTask from '../features/ui/util/schedule_idle_task';
import getRectFromEntry from '../features/ui/util/get_rect_from_entry';
// Diff these props in the "unrendered" state
const updateOnPropsForUnrendered = ['id', 'index', 'listLength', 'c... | The base class for all intersection observers. |
/* @flow */
'use strict';
import React from 'react';
import { ProgressViewIOS} from 'react-native';
import NativeBaseComponent from 'native-base/Components/Base/NativeBaseComponent';
import computeProps from 'native-base/Utils/computeProps';
export default class ProgressBarNB extends NativeBaseComponent {
rend... | A component that displays a progress bar in the UI. |
// @flow
import React from 'react'
import { themr } from 'react-css-themr'
import Icon from 'components/Icon'
import cn from 'classnames'
export const defaultStyles = {
root: '',
input: '',
leftIcon: '',
rightIcon: '',
}
const Input = ({
theme,
className,
leftIcon,
rightIcon,
...props
}: {
theme:... | A function to render a single node in a tree. |
import React from 'react';
import { storiesOf } from '@storybook/react';
import Pagination from '../../components/Pagination';
const props = {
onChange: ({ page, pageSize }) => {
console.log(`Page: ${page}`, `Page Size: ${pageSize}`); // eslint-disable-line no-console
},
pageSizes: [10, 20, 30, 40, 50],
};
... | The base class for all non - pagination components. |
import React from 'react';
import shallowCompare from 'shallow-compare';
import shallowEqual from './shallow-equal';
export function compareChildren(props, nextProps) {
const { children } = props;
const { children: nextChildren } = nextProps;
// If the number of children changed, then children are different.
... | Compares two React components and returns true if they are different. |
import React from 'react';
import { FormattedMessage } from 'react-intl';
const LoadingIndicator = () => (
<div className='loading-indicator'>
<FormattedMessage id='loading_indicator.label' defaultMessage='Loading...' />
</div>
);
export default LoadingIndicator;
| export LoadingIndicator from React |
import React from 'react'
import { Segment, Statistic } from 'stardust'
const Floated = () => (
<Segment>
<Statistic floated='right' label='Views' value='2,204' />
<p>
Te eum doming eirmod, nominati pertinacia argumentum ad his. Ex eam alia facete scriptorem, est autem aliquip
detraxit at. Usu o... | Package that implements the sequence of segments in the system. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let DeviceBattery90 = (props) => (
<SvgIcon {...props}>
<path fillOpacity=".3" d="M17 5.33C17 4.6 16.4 4 15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V8h10V5.33z"/><path d="M7 8v12.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1... | Devuelte un objeto DeviceBattery90 |
/* @flow */
import styled from '@emotion/styled';
import React from 'react';
import { pxToEm } from '../../../../../library/styles';
import type { StyledComponent } from '@emotion/styled-base/src/utils';
const Root: StyledComponent<{ [key: string]: any }> = styled('div')(
({ theme, width }) => ({
overflow: 'hidd... | Package for the base component of a dropdown. |
import React from 'react'
import { connect } from 'react-redux'
import ControlBar from './ControlBar'
import Spreadsheet from './Spreadsheet'
const App = ({ spreadsheet }) => {
return (
<div className="App">
<ControlBar />
<Spreadsheet spreadsheet={spreadsheet} />
</div>
)
}
const mapStateToP... | Imports a single by default. |
/*
* HomePage
*
* This is the first thing users see of our App, at the '/' route
*/
import React from 'react';
import Helmet from 'react-helmet';
import { FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import AtPrefix from './AtPre... | The HomePage component which is a component that can handle a sequence of actions and a list of repositories. |
import React, { Component } from 'react';
import Section from 'shared/components/section/section';
import SignUpLink from 'shared/components/signUpLink/signUpLink';
import RequestToken from './requestToken/requestToken';
import SetPassword from './setPassword/setPassword';
import styles from './resetPassword.css';
con... | Initialize a reset password component. |
import classNames from 'classnames';
import noop from 'lodash/noop';
import PropTypes from 'prop-types';
import React from 'react';
import getDefaultT from '../../../translate';
import { SimpleTextKeyValue } from '../../Text';
import theme from '../ModelViewer.scss';
/**
* Union with only two type and one null, are r... | Provides a function to render a single non - optional or non - optional leaf. |
import Component from '../components/component.react';
import DocumentTitle from 'react-document-title';
import React from 'react';
import {Link} from 'react-router';
import {msg} from '../intl/store';
class NotFound extends Component {
render() {
return (
<DocumentTitle title={msg('notFound.title')}>
... | Package that imports a component and renders it as a NotFound. |
import 'babel-core/polyfill';
import React from 'react';
import { Provider } from 'react-redux';
import configureStore from '../common/store/configureStore';
import App from '../common/containers/App';
const initialState = window.__INITIAL_STATE__;
const store = configureStore(initialState);
const rootElement = do... | Imports a single node in the DOM. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImagePhoto = (props) => (
<SvgIcon {...props}>
<path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/>
</SvgIcon>
);
ImagePhoto = p... | A component that exports a component that can be used to render a block of images. |
import React from 'react';
import { storiesOf, action } from '@kadira/storybook';
import Post from '../post';
storiesOf('core.Post', module)
.add('default view', () => {
const post = {
title: 'React storybook is great',
content: `
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
... | Adds a default view and saving functions to the given object. |
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import './static/index.css';
ReactDOM.render(
<App />,
document.getElementById('root')
);
| Imports a single node in the DOM. |
import React from 'react'
// eslint-disable-next-line import/no-mutable-exports
let PropTypes
if (parseFloat(React.version.slice(0, 4)) >= 15.5) {
try {
PropTypes = require('prop-types')
} catch (error) {
// ignore
}
}
PropTypes = PropTypes || React.PropTypes
export default PropTypes
| Imports the React. PropTypes object if it is not available. |
import React from 'react';
import Anchor from '../Anchor';
import ReactPlayground from '../ReactPlayground';
import Samples from '../Samples';
export default function DatePicker2FormatterSection() {
return (
<div className="bs-docs-section">
<h3><Anchor id="date-picker2-year-month-dropdown">年份、月份下拉快速选择</A... | DatePicker2FormatterSection - Section for the DatePicker2YearMonthDropdown section |
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
* ... | Displays a single optional flowtype object. |
import React from 'react';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
import RaisedButton from 'material-ui/RaisedButton';
/**
* Dialog with action buttons. The actions are passed in as an array of React objects,
* in this example [FlatButtons](/#/components/flat-button... | DialogExampleSimple is a simple dialog with no action buttons. |
import React from 'react'
import $script from 'scriptjs'
export default class SmartCKEditor extends React.Component {
componentDidMount() {
$script("https://cdn.ckeditor.com/4.5.11/standard/ckeditor.js", ()=> {
const CKEDITOR = window['CKEDITOR'];
this._editor = CKEDITOR.replace(this.props.contai... | SmartCKEditor component that renders a block of text in the editor. |
import React from 'react'
import DocumentTitle from 'react-document-title'
import { prefixLink } from 'gatsby-helpers'
module.exports = React.createClass({
propTypes () {
return {
title: React.PropTypes.string,
}
},
render () {
const title = DocumentTitle.rewind()
let cssLink
if (pro... | The main function for the missing - js - react - index. js |
import React from 'react';
import generateUniqueId from './util/idGenerator';
// Module constants (change according to your flavor file)
var inputGroupClassName = 'input-group';
// Checkbox component.
export function Checkbox (props){
var outProps = Object.assign({}, props);
if (typeof outProps.labelText === 'undef... | Checkbox component. |
/**
* Function to get the shallow output for a given component
* As we are using phantom.js, we also need to include the fn.proto.bind shim!
*
* @see http://simonsmith.io/unit-testing-react-components-without-a-dom/
* @author somonsmith
*/
import React from 'react';
import TestUtils from 'react-addons-test-utils'... | Get the shallow rendered component |
import React, { Component } from 'react';
import * as T from "prop-types";
import './styles.scss';
import {cssClassName} from 'utils';
const cn = cssClassName('SE_HmqLayout');
import O_Fixed from 'O_Fixed'
import NavBar from './NavBar'
import history from 'history'
class SE_HmqLayout extends Component {
handleSubmi... | A component that renders a menu in the HQM layout. |
import React from 'react';
import { RaisedButton, TextField } from 'material-ui';
import { browserHistory } from 'react-router';
import { getTextFromMic, checkForCorrectPassword, checkForCorrectGoodbye } from './../utils/speech.js';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
class Login exten... | A login component that displays a messr name and a password. |
import React from 'react';
export default function Footer() {
return (
<div className="footer alert alert-success">
<p>Made by Subash Pathak</p>
<p>
Follow me on <i className="fa fa-twitter" />
<a href="http://twitter.com/sbspk">@sbspk</a>,
<i className="fa fa-facebook" />
... | The footer of the app |
/**
* Renders an "Invalid Field Type" error
*/
import React from 'react';
const InvalidFieldType = function (props) {
return (
<div className="alert alert-danger">
Invalid field type <strong>{props.type}</strong> at path <strong>{props.path}</strong>
</div>
);
};
InvalidFieldType.propTypes = {
path: Reac... | Renders an Invalid Field Type error |
import React, { Component } from 'react';
import Sidenav from "./Sidenav";
import { getAPI } from "./service/api"
export default class MyCurriculum extends Component {
constructor(props){
super(props);
this.state = {
MyCurriculum: []
}
}
componentWillMount(){
... | Component class which extends a single missing - curriculum component with no children. |
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<g><path d="M12 5V1L7 6l5 5V7c3.3 0 6 2.7 6 6s-2.7 6-6 6-6-2.7-6-6H4c0 4.4 3.6 8 8 8s8-3.6 8-8-3.6-8-8-8zm-1.1 11H10v-3.3L9 13v-.7l1.8-.6h.1V16zm4.3-1.8c0 .3 0 .6-.1.8l-.3.6s-.3.3-.5.3-.4.1-.6.1-.4 0-.6-.1-.3-... | Missing color in a series of icons |
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
| Imports a single application. |
import React, { Component } from 'react';
import { Field, reduxForm } from 'redux-form';
import { connect } from 'react-redux';
import '../../assets/css/login.css';
import * as Auth from '../../actions/auth';
class Login extends Component {
handleFormSubmit({ email, password }) {
this.props.login({ email, passw... | A component that displays a login form with a user s password. |
import React from 'react';
import ColorPicker from './ColorPicker';
const SidebarCategoryLabel = ({
categoryData: {
categoryName,
color,
visible,
},
onChangeCategoryColor,
toggleCategoryVisible,
className,
}) => (
<div className={className}>
<div className='layer--description'>
<div ... | export SidebarCategory as SidebarCategory |
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react';
import withStyles from 'isomorp... | Provides a function to render a single node in the hierarchy of a React component. |
import React from 'react';
import PropTypes from 'prop-types';
import { Motion, spring } from 'react-motion';
import styles from '../styles/tabs.scss';
const activeStyles = {
border: '1px solid transparent',
background: '#FFF'
};
const inactiveStyles = {
border: '1px solid #D9D9D9',
backgr... | Create a tabular tabular dialog with a single tab. |
import React from 'react';
import ReactDOM from 'react-dom';
import {Provider} from 'react-redux';
import {createStore} from 'redux';
import allReducers from './root_reducer';
import injectTapEventPlugin from 'react-tap-event-plugin';
import App from './components/app';
injectTapEventPlugin();
const store = createSto... | Imports a single node. |
import * as registerPushNotifications from './actions/push_notifications';
import { setupBrowserNotifications } from './actions/notifications';
import { default as Mastodon, store } from './containers/mastodon';
import React from 'react';
import ReactDOM from 'react-dom';
import ready from './ready';
const perf = requ... | This module imports all of the components that are required to be able to be used by the notification system. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let HardwareDock = (props) => (
<SvgIcon {...props}>
<path d="M8 23h8v-2H8v2zm8-21.99L8 1c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99zM16 15H8V5h8v10z"/>
</SvgIcon>
);
HardwareDock = ... | Dock for missing components |
import React from 'react';
import image from '../../images/cloud-upload-download-data-transfer.svg';
import '../../styles/basic_demos.scss';
import '../../styles/currencies_demo.scss';
import data from './data';
import CurrencySelector from './currency_selector';
export class CurrenciesConverter extends React.Compon... | A component that converts a currency into a currency that can be selected by a user. |
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { autoPlayGif } from '../initial_state';
export default class Avatar extends React.PureComponent {
static propTypes = {
account: ImmutablePropTypes.map.isRequired,
size: PropType... | The avatar component which is a component that can be rendered by a user. |
/*
*
* ViewProfiles
*
*/
import React from 'react';
import Helmet from 'react-helmet';
import {Link} from 'react-router-dom';
import './style.css';
import './styleM.css';
import '../../global.css';
import LeftIcon from 'react-icons/lib/fa/chevron-left';
import RightIcon from 'react-icons/lib/fa/chevron-right';
... | The base class for all view profiles that can be used to render a single branch of a view. |
// import required dependencies
import { BrowserRouter as Router } from 'react-router-dom';
import React from 'react';
import ReactDom from 'react-dom';
import Layout from './components/Layout';
import '../public/assets/sass/styles.scss';
const app = document.getElementById('app');
// renders the react components to ... | Imports the required dependencies and renders the react components to the app element |
import React, { Component } from 'react';
import utils from '../utils';
import Autosuggest from '../../../src/Autosuggest';
import SourceCodeLink from '../SourceCodeLink/SourceCodeLink';
import suburbs from 'json!../suburbs.json';
function randomInt(min, max) {
return min + Math.floor(Math.random() * (max - min + 1)... | The component that is used to render multiple sections. |
import React from 'react';
import { connect } from 'react-redux';
import { bind } from '../../utils/reactness';
import api from '../../api';
import style from './Board.css';
import Comment from './Comment';
import Input from './Input';
console.log(api.actions.comments.get())
class Board extends React.Component {
... | A base class that creates a board that can be used to show a list of comments. |
import React from 'react';
import Cell from './Cell'
const Row = (props) => {
const { rowIndex, row, nextPlayer, addPiece } = props;
const generateCells = row.map((rowItem, columnIndex) => {
return (
<Cell
key={`${rowIndex}-${columnIndex}`}
cell={rowItem}
rowIndex={rowI... | export default Row |
import React from 'react';
import { Route } from 'react-router';
export function renderRoutes(routes) {
return routes.map(({ Layout, Component, path, exact }) => {
return (
<Route
key={path}
path={path}
exact={exact}
render={props => (
<Layout {...props}>
... | Render the routes |
// @flow
import React from 'react';
import injectSheet, { JssProvider, ThemeProvider, withTheme, createTheming } from 'react-jss';
import type { Classes, Sheet } from 'react-jss';
const styles = {
root: {
backgroundColor: 'red',
},
[`@media (min-width: ${10}px)`]: {
root: {
width: 200
}
}
};... | A component that can be used to create a single missing - missing component in a theme. |
import React from 'react';
import Analyzer from 'Parser/Core/Analyzer';
import Enemies from 'Parser/Core/Modules/Enemies';
import SPELLS from 'common/SPELLS';
import SpellIcon from 'common/SpellIcon';
import SpellLink from 'common/SpellLink';
import { formatPercentage } from 'common/format';
import StatisticBox, { ST... | The DoomUptime class |
import React from 'react';
import Thruster from './Thruster';
class Thrusters extends React.Component {
static defaultProps = {
width: 100,
height: 100,
data: [0.0, 0.0, 0.0, 0.0, 0.0]
};
render() {
let width = this.props.width;
let height = this.props.height;
let thrusters = this.props.data;
retur... | A component that can be rendered as a thrusters. |
import React from 'react';
import PropTypes from 'prop-types';
import Button from 'material-ui/Button';
import ButtonWithTooltipEnabled from '../../common/buttonWithTooltipEnabled';
const messages = {
text: 'Publish',
};
const PublishCfeiButton = (props) => {
const { handleClick, disabled, tooltipInfo } = props;
... | Publish button with no tooltip |
import React from 'react';
import GroupStyle from '../GroupStyle';
import AccordStyle from './AccordStyle';
export default class TopList extends React.Component { //eslint-disable-line
constructor(props) {
super(props);
this.accordion = this.accordion.bind(this);
}
componentDidMount() {
this.accordio... | TopList is a class that displays a list of items that can be accordion. |
import 'babel-polyfill'
import React from 'react'
import { render } from 'react-dom'
import { createStore, applyMiddleware, combineReducers } from 'redux'
import { Provider } from 'react-redux'
import { syncHistoryWithStore,routerMiddleware } from 'react-router-redux'
import { browserHistory } from 'react-router'
impo... | Imports a single and renders it to the browser. |
import React from 'react';
import './CourseGoals.css';
import Card from '../UI/Card';
import GoalItem from './GoalItem';
function CourseGoals(props) {
const hasNoGoals = !props.goals || props.goals.length === 0;
return (
<section id='course-goals'>
<Card>
<h2>Your Goals</h2>
{hasNoGoals... | The CourseGoals component |
import BrowserProtocol from 'farce/BrowserProtocol';
import React from 'react';
import createFarceRouter from './createFarceRouter';
import resolver from './resolver';
export default function createBrowserRouter(options) {
const FarceRouter = createFarceRouter({
...options,
historyProtocol: new BrowserProto... | create a browser router |
import React from 'react';
import PropTypes from 'prop-types';
import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend } from 'recharts';
import styles from './styles';
class ResponseTime extends React.Component {
static propTypes = {
average: PropTypes.number.isRequired,
data: PropTypes.arra... | The ResponseTime component is a component that renders a series of time series data in a series of time series. |
import React, { Component } from 'react';
// eslint-disable-next-line
import EntityModal from 'ringcentral-widgets/components/EntityModal';
import { Button } from 'ringcentral-widgets/components/Button';
const props = {};
props.currentLocale = 'en-US';
/**
* A example of `EntityModal`
*/
class EntityModalDemo exten... | Demo component for showing or showing a modal of a single Entity type. |
import React from 'react'
import { connect } from 'react-redux'
import { fetchCandidate } from './actions'
import Card from '../kit/Card'
import SocialMedia from '../kit/SocialMedia'
class Candidate extends React.Component {
static propTypes = {
id: React.PropTypes.number.isRequired,
candidate: React.PropTyp... | Component that displays a single missing - candidate error in a modal box. |
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import { uniqueId } from '../../utils';
import { IconSVG } from '../Icon';
const Cell = (props) => {
const {
children,
className,
resizable,
resizableAssistiveText,
scope,
sortable,
sortDirection,... | A component that renders a child cell with a default style and a wrapper for the header cell. |
/**
* React Static Boilerplate
* https://github.com/koistya/react-static-boilerplate
* Copyright (c) Konstantin Tarkus (@koistya) | MIT license
*/
import React, { Component } from 'react';
import rangyClassApplier from 'rangy/lib/rangy-classapplier';
import DocumentPage from '../components/DocumentPage';
import L... | A component that can be used to create a comment index that will display a comment in the current selection. |
import React from 'react';
export default function NotFound() {
return (
<div className="container">
<h1>Doh! 404!</h1>
<p>These are <em>not</em> the droids you are looking for!</p>
</div>
);
}
| 404 - Not all droids are the droids you are looking for! |
import React from 'react';
import './Footer.scss';
const Footer = () => (
<footer className="footer">
</footer>
);
export default Footer;
| Exports a Footer class that can be used to render a . |
import React from 'react';
import Icon from '../Icon';
export default class MenuIcon extends Icon {
getSVG(){return <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M6 36h36v-4H6v4zm0-10h36v-4H6v4zm0-14v4h36v-4H6z"/></svg>;}
}; | MenuIcon exports a menu icon that can be used to show a menu item. |
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<g><path d="M21 5v14h2V5h-2zm-4 14h2V5h-2v14zM14 5H2c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zM8 7.75c1.24 0 2.25 1.01 2.25 2.25S9.24 12.25 8 12.25 5.75 11.24 5.75 10 6.76 7.75 8... | Series of actors in a series of icons. |
import React from 'react';
import ReactDOM from 'react-dom';
function Square(props) {
return (
<button className="square" style={props.style} onClick={() => props.onClick()}>
{props.value}
</button>
);
}
class Board extends React.Component {
renderSquare(i, causedWin) {
let style = (causedWin ... | Private function to render a node in the DOM. |
// < Cell/> Component
// ==================
//
// This file defines the React component `< Cell/>`.
//
// Import Modules
// --------------
//
// ### NPM Modules
import React from 'react';
// Define & Export Module
// ----------------------
//
// This module contains `< Cell/>`.
function getRandomInteger (min, max) {... | Component that returns a random integer between 0 and max inclusive. |
/*
* Package Import
*/
import React from 'react';
import { Link } from 'react-router-dom';
/*
* Local Import
*/
/*
* Component
*/
const SiteMap = () => (
<div id="sitemap">
<h2 id="sitemap-title">Plan du site</h2>
<p id="sitemap-desc">Vous êtes perdu? Pas de soucis, suivez le guide !</p>
<div i... | Imports a single node from the system and exports it as a SiteMap. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let MapsMap = (props) => (
<SvgIcon {...props}>
<path d="M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 ... | A component that exports a Navitia - style map of icons. |
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/* @flow */
import React, { Component } from 'react';
import StackFrame from './StackFrame';
import Collapsible from '../components/Coll... | Generates a stack trace element that can be rendered by a stack trace element. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionCreditCard = (props) => (
<SvgIcon {...props}>
<path d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"/>
</SvgIcon>
);
Action... | A component that displays a action on a card. |
// (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import CSSClassnames from '../../../utils/CSSClassnames';
import Intl from '../../../utils/Intl';
import Props from '../../../utils/Pro... | A component that renders a single critical block of content. |
// @flow
import React from 'react';
import numeral from 'numeral';
import * as StatsActions from '../actions/StatsActions';
import * as ShareActions from '../actions/ShareActions';
import ShareStore from '../stores/ShareStore';
import Constants from '../Constants';
const Footer = React.createClass({
render() {
... | A component that renders a single n - sequence sequence. |
import React from 'react';
const AppointmentIcon = props => (
<svg {...props.size || { width: '18px', height: '20px' }} {...props} viewBox="0 0 18 20">
{props.title && <title>{props.title}</title>}
<g transform="translate(-3.000000, -2.000000)">
<path d="M11,18.5 L13,18.5 L13,15.5 L16,15.5 L16,13.5 L13... | A component that renders a series of possible icons for a single appointment. |
import React, { Component } from 'react';
import Link from 'next/prefetch'
import Header from '../components/Header';
export default class extends Component {
render() {
const { Comp } = this.props;
return (
<div className="App">
<Header />
<div className="App-main">
<Comp />... | A component that renders a single missing - missing |
import React from 'react';
import { render } from 'react-dom';
import { Router, Route, hashHistory } from 'react-router';
import App from './App';
import About from './components/About';
import './styles/main.css';
window.React = React;
render(
(<Router history={hashHistory}>
<Route path="/" component={App}>
... | Imports a single node in the window. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.