code stringlengths 26 5k | intent stringlengths 3 2.56k |
|---|---|
import React from 'react';
import styles from './styles.module.css';
import classNames from 'classnames';
export default ({ children, className,style }) => (
<span
className={classNames(styles.reset, className)}
style={style}
>
{children}
</span>
); | Default module that exports a |
'use strict';
import React from 'react';
import InputBase from './input-base';
import lengthValidator from '../validators/length';
export default class TextInput extends React.Component {
render() {
let {
length,
validators,
...otherProps
} = this.props;
if (length !== undefined) {
... | A text input that is a sequence of text that can be rendered by a component. |
import _ from 'underscore';
import React from 'react';
import {connect} from 'react-redux';
import Header from 'components/Header';
import CodeEditor from 'components/CodeEditor';
import Console from 'components/Console';
import FileList from 'components/FileList'
import {openFile, saveFile} from 'actions/files';
imp... | The main app class. |
import React from 'react';
const Panel = ({ focus, header, content }) =>
<div className="panel">
{ /* TODO: Replace hardcoded data with data from the backend */ }
<h3 className="panel-heading">
<div className="focus"> { focus } </div>
<div className="text-center"> { header } </div>
</h3>
... | Panel showing a single unknown node in a panel with a panel - heading header and content. |
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';
import IconButton from '../../../components/icon_button';
import { defineMessages, inject... | A component that renders a single missing - item list. |
import React from 'react'
import ActionForm from 'microcosm/addons/action-form'
import { addList } from '../../../actions/lists'
class ListForm extends React.PureComponent {
state = {
name: ''
}
reset = () => {
this.setState({ name: '' })
}
setName = e => {
this.setState({ name: e.target.value ... | A component that can be used to create a list of items in a sequence. |
import React from 'react'
import Team from './Team'
function getMaxes(players) {
const maxes = {
'level': 0,
'kills': 0,
'deaths': 0,
'assists': 0,
'last_hits': 0,
'denies': 0,
'gold_per_min': 0,
'xp_per_min': 0,
'hero_damage': 0,
'hero_healing': 0,
'tower_damage': 0,
... | Get a Scoreboard that finds the maxes of a list of players. |
import React from 'react'
import withGraphQL from 'react-apollo-decorators/lib/withGraphQL'
import gql from 'graphql-tag'
import withMutation from 'react-apollo-decorators/lib/withMutation'
import Provider from './Provider'
import Loading from './Loading'
import PropTypes from 'prop-types'
@withGraphQL(
gql`
que... | A component that renders a node in a network network. |
import React from 'react';
import Grid from 'react-bootstrap/lib/Grid';
import ReactDOM from 'react-dom';
import { IndexRedirect, Route, Router } from 'react-router';
import hashHistory from 'react-router/lib/hashHistory';
import ButtonVisual from './ButtonVisual';
import Home from './Home';
import ListGroupItemVisual... | The main function that is used to render a sequence of modules. |
import React from 'react';
import createAll from './components/createAll';
export const { Provider, connect } = createAll(React);
| Imports and exports a . |
import React from 'react';
import {
StyleSheet,
View,
Text,
Dimensions,
} from 'react-native';
import MapView, { MAP_TYPES, PROVIDER_DEFAULT } from 'react-native-maps';
const { width, height } = Dimensions.get('window');
const ASPECT_RATIO = width / height;
const LATITUDE = 37.78825;
const LONGITUDE = -122.4... | A component that renders a custom sequence of items with a specific map type. |
import React from 'react';
import { PropTypes } from 'prop-types';
import classNames from 'classnames';
/*
Watches the scroll position and applies affix classses to the child
*/
export default class AffixWrap extends React.Component {
static propTypes = {
offset: PropTypes.number,
affixAdditionalClass: P... | A component that wraps a component in a affix - top hierarchy. |
import Radium from 'radium';
import React from 'react';
import theme from './theme.js';
@Radium
class Button extends React.Component {
render() {
const style = this.getStyle();
return (<div style={[this.props.style, this.getStyle()]}>{this.props.children}</div>);
}
getStyle() {
re... | Button class for button - based buttons. |
/*globals COURSES:true */
import React from 'react'
import Dashboard from './Dashboard'
import GlobalNav from './GlobalNav'
class App extends React.Component {
render() {
return (
<div>
<GlobalNav />
<div style={{ padding: 20 }}>
{this.props.children || <Dashboard courses={COURSES... | Extend App with a nagios hierarchy. |
/* eslint max-len: 0 */
import React from 'react';
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';
const products = [];
function addProducts(quantity) {
const startId = products.length;
for (let i = 0; i < quantity; i++) {
const id = startId + i;
products.push({
id: id,
... | The default sorting table for a series of products. |
/* eslint react/prop-types: 0 */
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import enhancer from './enhancer';
import { propTypes, defaultProps } from './types';
class Circle extends Component {
getPathStyles() {
const { percent, strokeWidth, gapDegree = 0, gapPosition } = this... | A base class for a single missing - node node that is rendered as a circle. |
/**
* 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, { Component } from 'react';
import { IonToggle } from '@ionic/react';
import PropTypes from 'prop-types';
class Toggle extends Component {
constructor(props) {
super(props);
this.toggleRef = React.createRef();
this.onToggle = this.onToggle.bind(this);
}
onToggle(e) {
const { checke... | A component that can toggle the state of a node. |
import React from 'react'
import PropTypes from 'prop-types'
function ErrorDialog(props) {
return (
<div className="error">
<h2>{props.heading}</h2>
<pre>
<code>{props.error.message || props.error}</code>
</pre>
</div>
)
}
ErrorDialog.propTypes = {
heading: PropTypes.string,
... | A component that displays an error in a dialog when a node is missing or missing. |
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import Issue from './kanban/Issue';
import EditForm from './kanban/EditForm';
// import { Link } from 'react-router-dom';
import styles from './kanban.scss';
class KanbanBoard extends Component {
state = {
edit_open: false,
cu... | A component that is rendered on a board showing the issues of the kanban board. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageFilter = (props) => (
<SvgIcon {...props}>
<path d="M15.96 10.29l-2.75 3.54-1.96-2.36L8.5 15h11l-3.54-4.71zM3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1... | A filter that returns an image that can be used to render a series of images. |
'use strict';
import React from 'react';
import ReactDOM from 'react-dom';
import Login from './views/Login.react';
class Author extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
return (
<div style={{ paddingTop: '20px'}}>
... | A component that renders a login page with a hidden hidden input. |
import React from 'react';
import get from 'lodash/get';
import LocaleListCell from '../components/LocaleListCell/LocaleListCell';
const addColumnToTableHook = ({ displayedHeaders, layout }) => {
const isFieldLocalized = get(layout, 'contentType.pluginOptions.i18n.localized', false);
if (!isFieldLocalized) {
... | Add a column to the table if the field is localized. |
import React from 'react';
import { formatPercentage } from 'common/format';
import SpellIcon from 'common/SpellIcon';
import SpellLink from 'common/SpellLink';
import StatisticBox, { STATISTIC_ORDER } from 'interface/others/StatisticBox';
import Analyzer from 'parser/core/Analyzer';
import Enemies from 'parser/shared/... | The base class for all moonfire analyses. |
import React from 'react';
import styles from './styles.css';
export default class UserBadge extends React.Component { // eslint-disable-line react/prefer-stateless-function
static propTypes = {
picture: React.PropTypes.string.isRequired,
};
render() {
return <img alt="avatar" src={this.props.picture} c... | A badge component that shows a picture of a user s confirmation. |
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import {ApolloClient, createNetworkInterface, ApolloProvider} from 'react-apollo'
import {BrowserRouter} from 'react-router-dom'
import * as Blueprint from "@blueprintjs/core";
const client = new ApolloClient({
networkInterface: cr... | Imports a single node in the DOM. |
import React from 'react'
import { createDevTools } from 'redux-devtools'
import LogMonitor from 'redux-devtools-log-monitor'
import DockMonitor from 'redux-devtools-dock-monitor'
export default createDevTools(
<DockMonitor
toggleVisibilityKey="ctrl-h"
changePositionKey="ctrl-q"
defaultIsVisible={false}
... | import react - devtools |
import React, { Component } from 'react';
import {
StyleSheet,
Text,
TextInput,
Modal,
View,
Image,
TouchableHighlight,
TouchableNativeFeedback,
ToastAndroid,
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
// const dtj = require('directory-to-json');
export default c... | A component that displays a list of rules that can be used to show a list of rules. |
/** @format */
/**
* External dependencies
*/
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
/**
* Internal dependencies
*/
import QueryLabelSettings from 'woocommerce/woocommerce-services/components/... | A component that can be used to display a list of external dependencies. |
import React from 'react';
import Title from 'react-title-component';
import CodeExample from '../../../CodeExample';
import PropTypeDescription from '../../../PropTypeDescription';
import MarkdownElement from '../../../MarkdownElement';
import timePickerReadmeText from './README';
import TimePickerExampleSimple from... | Imports a single - time - pickable component. |
import React from 'react';
import classNames from 'classnames';
import { ActivityTypes } from 'constants/ActorAppConstants';
import ActivityActionCreators from 'actions/ActivityActionCreators';
import ActivityStore from 'stores/ActivityStore';
import ActivityHeader from 'components/activity/ActivityHeader.react';
im... | The activity section class |
import React from 'react';
class Tooltip extends React.Component {
render() {
return null;
}
}
export default Tooltip;
| The Tooltip class is a base class that can be used to render a Tooltip. |
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import Form from 'Components/Form/Form';
import FormGroup from 'Components/Form/FormGroup';
import FormInputGroup from 'Components/Form/FormInputGroup';
import FormLabel from 'Components/Form/FormLabel';
import Button from 'Components/Link/Bu... | Constructor for a single missing - node node that has no children. |
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import Modal from '../../components/Modal';
import { makeModalSelector } from '../../containers/App/selectors';
import { modalDismiss } from '../../containers/App/a... | Create a modal container which can be used to show a modal modal. |
import React from 'react';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { useDispatch } from 'react-redux';
import get from 'lodash/get';
import truncate from 'lodash/truncate';
import pluralize from 'pluralize';
import OneToOne from '@strapi/icons/OneToOne';
import OneWay from '@str... | Renders a single missing - value key in a modal window. |
import React from 'react';
import { string, number } from 'prop-types';
import classNames from 'classnames';
import CSS from './style.scss';
function PlaceholderTile({ className, index }) {
return (
<div className={classNames(CSS.placeholderTile, CSS[`index-${index}`], className)}>
<div className={CSS.cont... | The PlaceholderTile component |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionTrendingDown = (props) => (
<SvgIcon {...props}>
<path d="M16 18l2.29-2.29-4.88-4.88-4 4L2 7.41 3.41 6l6 6 4-4 6.3 6.29L22 12v6z"/>
</SvgIcon>
);
ActionTrendingDown = pure(ActionTrendingDown);
ActionTre... | A component that exports a single action trending down in a group of icons. |
// @flow
import React from 'react'
import Link from './Link'
import type {RouterProviderContext} from './types'
import internalRouterContextTypeCheck from './internalRouterContextTypeCheck'
const EMPTY_STATE = {}
export default class StateLink extends React.PureComponent<*, *> {
props: {
state?: Object,
toI... | A state link that links to a child element. |
import React from 'react';
import classnames from 'classnames';
function Arrow(props) {
return (
<span
onClick={props.onClick}
className={classnames('collapsableArrow c-pointer', { open: !props.isClosed })}>
►
</span>
);
}
const TreeItem = function (props) {
let arrow;
if ... | The treeItem component that creates a treeItem with a arrow to the node that is closed or has no children. |
import React from 'react'
import { langs } from 'i18n/lang'
import _ from 'lodash'
module.exports = class Exporter extends React.Component {
render() {
let blob = new Blob([JSON.stringify(this.props.deck, null, 2)], {
type: 'application/json'
})
let blobURL = window.URL.createObjectURL(blob)
re... | Exports a single single node in a modal window. |
'use strict';
import React from 'react';
import { Text } from 'react-native';
import PropTypes from 'prop-types';
import nodeEmoji from 'node-emoji';
const keys = Object.keys(nodeEmoji.emoji);
const names = [
...keys,
...keys.map((key) => `:${key}:`)
];
const defaultStyle = {
color: '#000'
};
const Emoji = (... | Exports a node - emoji with a nice style |
import React from 'react';
import IconBase from '@suitejs/icon-base';
function DvBrackets(props) {
return (
<IconBase viewBox="0 0 48 48" {...props}>
<path d="M36 6c4.4 0 8 3.6 8 8v20c0 4.4-3.6 8-8 8H12c-4.4 0-8-3.6-8-8V14c0-4.4 3.6-8 8-8h24zm0 4.4H12A3.604 3.604 0 0 0 8.4 14v20c0 1.985 1.615 3.6 3.6 3.6h2... | DvBrackets is a special case for the DvBrackets component. |
/**
* Created by courtneybolivar on 05/04/2017.
*/
import React from 'react';
import TextFieldGroup from './TextFieldGroup';
import validateRegisterInput from '../../../../server/controllers/validateRegisterInput';
import validateLoginInput from '../../../../server/controllers/validateLoginInput';
import { login } fr... | XML component that displays a login or register form. |
import React from 'react';
var { object, string, func } = React.PropTypes;
function isLeftClickEvent(event) {
return event.button === 0;
}
function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
}
/**
* <Link> components are used to create an <a> element t... | Creates a link component that links to a route. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageCameraRear = (props) => (
<SvgIcon {...props}>
<path d="M10 20H5v2h5v2l3-3-3-3v2zm4 0v2h5v-2h-5zm3-20H7C5.9 0 5 .9 5 2v14c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2zm-5 6c-1.11 0-2-.9-2-2s.89-2 1.99-... | A component that exports a single image camera rear. |
import React from 'react'
import Navbar from './navbar'
const CoreLayout = ({ children }) => {
return(
<div>
<Navbar />
<div>{ children }</div>
</div>
)
}
export default CoreLayout
| export default CoreLayout |
/**
* Created by lilu on 2017/10/15.
*/
/**
* Created by lilu on 2017/9/19.
*/
import React from 'react';
import {Table} from 'antd';
import mathjs from 'mathjs'
const columnsDetail = [{
title: "服务点名称",
dataIndex: "station.name",
render: (text,record)=>{return(
<div>{record.station&&record.station.name?r... | Renders a single in a table. |
import React from 'react';
import Location from './Location';
import History from './History';
var { func, object, arrayOf, instanceOf, oneOfType, element } = React.PropTypes;
function falsy(props, propName, componentName) {
if (props[propName])
return new Error(`<${componentName}> should not have a "${propName... | Private module that exports a function that checks if a component is missing a property on it. |
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import PathInputConnector from 'Components/Form/PathInputConnector';
import Icon from 'Components/Icon';
import Button from 'Components/Link/Button';
import ModalBody from 'Components/Modal/ModalBody';
import ModalContent from 'Components/Mod... | Component constructor for modal modal |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let DeviceSignalWifi3Bar = (props) => (
<SvgIcon {...props}>
<path fillOpacity=".3" d="M12.01 21.49L23.64 7c-.45-.34-4.93-4-11.64-4C5.28 3 .81 6.66.36 7l11.63 14.49.01.01.01-.01z"/><path d="M3.53 10.95l8.46 10.54.0... | A component that exports a device - signal - wifi3 - bar. |
// @flow
require('babel-polyfill')
import React from 'react'
import ReactDOM from 'react-dom'
import request from 'superagent'
import BoredImage from './Image'
type State = {
data: Array<any>,
isLoading: boolean,
page: number
}
class App extends React.Component<{},State> {
constructor(props) {
super(props... | Component that will render a bunch of images in a page. |
/* eslint-env browser */
/* global process */
import 'babel/polyfill';
import React from 'react';
import BrowserHistory from 'react-router/lib/BrowserHistory';
import HashHistory from 'react-router/lib/HashHistory';
import Root from './Root';
const history = (process.env.NODE_ENV === 'production')
? new BrowserHisto... | Devuelve un nuevo nuevo nuevo browser - history |
import React from 'react'
import { Field, reduxForm } from 'redux-form'
const FilterForm = ({ handleSubmit }) =>
<form onSubmit={handleSubmit}>
<div>
<label>
Show only events where food is provided
<Field type='checkbox' component='input' name='foodToggle' />
</label>
</div>
<... | React - related module |
import React from 'react';
import { indexOf, filter } from './compat';
import TabBar from './TabBar';
import TabPanel from './TabPanel';
var TabContainer = React.createClass({
displayName: 'TabContainer',
propTypes: {
active: React.PropTypes.arrayOf(React.PropTypes.string),
className: React.PropTypes.stri... | Creates a new TabContainer with a valid bar and panel. |
import DateInput from '../../components/DateInput';
import Field from '../Field';
import moment from 'moment';
import React from 'react';
import { Button, InputGroup, FormInput } from 'elemental';
/*
TODO: Implement yearRange Prop, or deprecate for max / min values (better)
*/
const DEFAULT_INPUT_FORMAT = 'YYYY-MM-DD... | A component that creates a date input that can be used to enter a date. |
/**
*
* TableHeader
*
*/
import React from 'react';
import { FormattedMessage } from 'react-intl';
import messages from './messages';
import Header from './Header';
import RowName from './RowName';
import RowUnits from './RowUnits';
import RowValue from './RowValue';
import Table from './Table';
class TableHeader ex... | TableHeader - TableHeader with no extra children |
import PropTypes from 'prop-types';
import React from 'react';
import classnames from 'classnames';
import {
MDCDialog,
MDCDialogFoundation,
} from '@material/dialog';
import '@material/dialog/dist/mdc.dialog.min.css';
const DIALOG = 'mdc-dialog';
export class DialogFooter extends React.Component {
static prop... | A component that is rendered when a dialog is opened. |
// editor globals
import React from 'react';
export const INLINE_STYLES = [
{label: () => <span className="flaticon-bold"></span>, style: 'BOLD', tooltip: 'Qalin'},
{label: () => <span className="flaticon-italic"></span>, style: 'ITALIC', tooltip: 'Qiya'},
{label: () => <span className="flaticon-... | Adds a function to create a new GUI element with the given label and style. |
/* @flow */
import React from 'react';
import { DialogFooterRoot as Root } from './styled';
import { dialogFooterPropTypes } from './propTypes';
import type { DialogFooterProps } from './types';
const DialogFooter = (props: DialogFooterProps) => <Root {...props} />;
DialogFooter.displayName = 'DialogFooter';
DialogF... | Imports a bunch of modules that are required to render a single dialog footer. |
import React from 'react';
import { StyleSheet, Text,Button, View,ScrollView,StatusBar,Image } from 'react-native';
import {addNavigationHelpers,TabNavigator,DrawerNavigator,StackNavigator,DrawerItems} from 'react-navigation';
import Deposit from './../components/Deposit';
import PropTypes from 'prop-types';
import {co... | export default state |
/**
* 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 Scores from '../Scores';... | JSDoc for a single node in the hierarchy. |
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
ListView,
Image,
TouchableOpacity
} from 'react-native';
export default class ES6View extends Component {
static navigationOptions = {
title:'ES6',
tabBar: {
label: 'ES6',
icon: ({ focused, tint... | A component that can be rendered in a list view. |
import React from 'react';
import SvgIcon from '../../SvgIcon';
const NavigationUnfoldLess = (props) => (
<SvgIcon {...props}>
<path d="M7.41 18.59L8.83 20 12 16.83 15.17 20l1.41-1.41L12 14l-4.59 4.59zm9.18-13.18L15.17 4 12 7.17 8.83 4 7.41 5.41 12 10l4.59-4.59z"/>
</SvgIcon>
);
NavigationUnfoldLess.displayNam... | NavigationUnfoldLess is a component that renders a navigation unfold less icon. |
import React, { Component } from 'react';
import CharacterIcon from './characterIcon';
export default function CharacterScroll(props) {
const characters = props.characters.map((character) => {
return (
<CharacterIcon
character={character}
key={character.id}
/>
);
});
let load... | Character scroll component |
import { jsComponent as About } from './About.re'
import React from 'react'
export default () => <About />
| Imports About from React. |
/**
* 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 PropTypes from 'prop-types';
import { Content, Text, ListItem, Icon, Container, Left, Badge, View } from 'native-base';
import Styles from '../../Style';
class Navigator extends React.Component {
render() {
const itemStyles = {
Dashboard: Styles.inactiveItem,
Notific... | Very basic component that navigates into a navigation hierarchy. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let NotificationPower = (props) => (
<SvgIcon {...props}>
<path d="M16.01 7L16 3h-2v4h-4V3H8v4h-.01C7 6.99 6 7.99 6 8.99v5.49L9.5 18v3h5v-3l3.5-3.51v-5.5c0-1-1-2-1.99-1.99z"/>
</SvgIcon>
);
NotificationPower = pu... | A component that exports a notification power to a component that displays a notification power. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let NavigationExpandLess = (props) => (
<SvgIcon {...props}>
<path d="M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"/>
</SvgIcon>
);
NavigationExpandLess = pure(NavigationExpandLess);
NavigationExpandLess.displa... | A component that exports a navigation - expand - less element. |
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import BaseText from '../utils/rnw-compat/BaseText';
import { TEXT_COLORS } from '../utils/constants';
const propTypes = {
children: PropTypes.node.isRequired,
color: PropTypes.oneOf(TEXT_COLORS),
align: PropTypes.oneOf([... | A component that wraps a node in a sequence of text nodes. |
import React from 'react';
import PropTypes from 'prop-types';
import Paper from 'material-ui/Paper';
import ParticipantItem from './ParticipantItem';
import './styles/ParticipantList.css';
class ParticipantList extends React.Component {
_renderParticipants(participants) {
if (!participants) {
// display... | The ParticipantList class |
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import cx from 'classnames';
import { applyContainerQuery } from 'react-container-query';
import noop from '../../../utils/noop';
import EditorialCard from './EditorialCard';
import linkcss from '../../Link/Link.css';
import css from './Gui... | A component that can be used to show a guide card. |
import React from 'react';
import DocumentTitle from 'react-document-title';
import { RegistrationForm, Link } from 'react-router';
export default class RegisterOptionsPage extends React.Component {
render() {
return(
<DocumentTitle title={`Shops with open work`}>
<div className="container">
... | The base class for all of the CNC work that can be registered with the application. |
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('root'));
| Imports a React application. |
import React from 'react';
import { popFade, none, slideLeft, slideUp } from './animations';
function getInnerDisplayName(InnerPage) {
return InnerPage.displayName || InnerPage.name || 'Component';
}
export default function (InnerPage) {
return React.createClass({
displayName: `ReactAnimatedView(${getInnerDi... | The default implementation of a React AnimatedView is to create a new component that will animate the inner page. |
import React from 'react'
import { Route } from 'react-router'
import App from './containers/App.jsx'
/**
* Asynchronously load a file
* @param main {String} - Main component
* @returns {Function}
*/
function requireAsync(main) {
return function(location, next) {
next(null, require('./containers/pages/... | Imports a component and routes asynchronously. |
import React from 'react';
import styles from './Chore.css';
const Chore = ({ chore, onDelete }) => {
return <div>
<span className={styles.x}
onClick={() => onDelete(chore.id)}
>×</span> {chore.name}
</div>;
}
Chore.propTypes = {
chore: React.PropTypes.object.isRequired,
onDelete: React.Prop... | A component that exports a single node in a Chore. |
import React from 'react';
const RedBlock = React.createClass({
render() {
return <div style={{background: 'rgba(255, 0, 0, 0.3)', minHeight: 100}}>Red Block</div>;
}
});
export default RedBlock;
| The Red Block class |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let SocialNotificationsActive = (props) => (
<SvgIcon {...props}>
<path d="M7.58 4.08L6.15 2.65C3.75 4.48 2.17 7.3 2.03 10.5h2c.15-2.65 1.51-4.97 3.55-6.42zm12.39 6.42h2c-.15-3.2-1.73-6.02-4.12-7.85l-1.42 1.43c2.02... | A component that exports a sequence of components that can be used to show a social notification. |
import React from 'react';
import Analyzer from 'Parser/Core/Analyzer';
import Enemies from 'Parser/Core/Modules/Enemies';
import Combatants from 'Parser/Core/Modules/Combatants';
import SPELLS from 'common/SPELLS';
import SpellIcon from 'common/SpellIcon';
import { formatPercentage } from 'common/format';
import Sta... | The Sunfire uptime class |
import React from 'react';
import Codemirror from 'react-codemirror';
import 'codemirror/lib/codemirror.css';
import 'codemirror/mode/gfm/gfm';
import '../lib/style.css';
export default class MarkdownEditor extends React.Component {
render() {
return (
<Codemirror value={this.props.value} options={{
... | The MarkdownEditor class |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionFingerprint = (props) => (
<SvgIcon {...props}>
<path d="M17.81 4.47c-.08 0-.16-.02-.23-.06C15.66 3.42 14 3 12.01 3c-1.98 0-3.86.47-5.57 1.41-.24.13-.54.04-.68-.2-.13-.24-.04-.55.2-.68C7.82 2.52 9.86 2 12... | A component that returns a sequence of components that can be used to render a sequence of components. |
import React from 'react';
import teams from './csgo-teams';
import Header from './header';
import TeamsList from './teams-list';
import moment from 'moment';
export class App extends React.Component {
constructor(props) {
super(props);
this.state = {
teams,
upcomingMatches: [],
hotMatche... | The base class for all of the tags that are related to a specific tag. |
import React from 'react'
import { Route } from 'react-router'
const routes = (
<Route path="/">
<Route path=":calendarType/:calendarId"/>
</Route>
)
export default routes
| Imports a bunch of routes from a calendar type. |
import React from 'react'
import Link from 'gatsby-link'
import styled from 'styled-components'
import ui from '../layouts/theme'
import backgroundImage from '../../static/images/house-in-the-jungle.jpg'
const Title = styled.h1`
background: ${ui.color.accent};
padding: ${ui.size.s};
`
const WhoPage = ({ classNa... | Imports a single node in the hierarchy. |
// @flow
import type { State } from '../../common/types';
import type { Theme } from './themes/types';
import * as themes from './themes';
import Footer from './Footer';
import Header from './Header';
import Helmet from 'react-helmet';
import React from 'react';
import favicon from '../../common/app/favicon';
import st... | Package containing all of the components that are not part of a theme. |
/**
* NotFoundPage
*
* This is the page we show when the user visits a url that doesn't have a route
*/
import React from 'react';
import { FormattedMessage } from 'react-intl';
import H1 from 'components/H1';
import messages from './messages';
export default function NotFound() {
return (
<article>
... | NotFoundPage - the page that displays when the user visits a url that doesn t have a route |
import React, { Component } from 'react';
import Registry from '../utils/Registry';
import BaseComponent from './BaseComponent';
import Card from './Card';
export default class Multi extends BaseComponent {
renderChildren() {
let curEls;
let output;
if (typeof this.props.data === 'string') {
curEls ... | The Multi component is a list of all elements that are rendered in a multi - container. |
import React from 'react';
import { Button } from '@extjs/ext-react';
export default function SenchaTestHooks() {
return <Button text="Target" itemId="target"/>
} | The default hook for the test suite. |
/**
* 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 from 'react';
import VisualizationLayout from './VisualizationLayout';
import { HORIZONTAL_SPLITTER, COUNTER, VERTICAL_SPLITTER, PIE_GRAPH, BAR_GRAPH, CLOCK } from '../constants'
const Home = () => (
<VisualizationLayout
components={{
0: {
type: VERTICAL_SPLITTER,
children: [1... | Imports a single node of a hierarchy. |
/**
* Created by raunak on 20/6/17.
*/
import React from 'react'
import {connect} from 'react-redux'
import FoodTypeListItem from './FoodTypeListItem'
class FoodTypeList extends React.Component {
RenderList() {
const cityData = this.props.cityData;
let cityName = Object.keys(cityData)[0];
... | A component that renders a list of food types. |
import React, { Component } from 'react';
import { Table } from 'reactstrap';
import {inject, observer} from "mobx-react";
import "../style/sidebar.css"
class UserList extends Component {
constructor(props) {
super(props)
this.state = {
players: []
};
}
componentDidMount() {
var self = t... | The UserList component is a component that can be used to display a list of users in a room. |
'use strict';
// For react
import React from 'react';
window.React = React;
import injectTapPlugin from 'react-tap-event-plugin';
injectTapPlugin();
import tv4 from 'tv4';
import i18n from './i18n';
tv4.addFormat('datetime', function(value) {
let time = Date.parse(value);
if (isNaN(time)) {
return i18n('Date... | Imports a single node in the DOM. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from 'material-ui/SvgIcon';
let Storage = props =>
<SvgIcon {...props}>
<path d="M2 20h20v-4H2v4zm2-3h2v2H4v-2zM2 4v4h20V4H2zm4 3H4V5h2v2zm-4 7h20v-4H2v4zm2-3h2v2H4v-2z" />
</SvgIcon>;
Storage = pure(Storage);
Storage.muiName = 'SvgI... | A component that exports a sequence of non - empty elements in a sequence of icons. |
import React from 'react';
import Router from 'react-router';
import ReactDOM from 'react-dom';
import createBrowserHistory from 'history/lib/createBrowserHistory';
import routes from './routes';
let history = createBrowserHistory();
ReactDOM.render(<Router history={history}>{routes}</Router>, document.getElementById... | Imports the history page. |
import React from 'react';
import { Text, TouchableOpacity } from 'react-native';
const Button = ({ onPress, children }) => {
const { buttonStyle, textStyle } = styles;
return (
<TouchableOpacity style={buttonStyle} onPress={onPress}>
<Text style={textStyle}>
{children}
</Text>
</Touch... | export Button with a single node |
/**
* 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 'babel-core/polyfill';
import path from 'path';
imp... | Register the API and the API - side middleware |
import React from 'react'
import { Block } from 'jsxstyle'
const Loading = () => (
<Block
className="loading"
position="absolute"
top="0"
right="0"
bottom="0"
left="0"
/>
)
export default Loading
| Imports a single block of blocks. |
import React, { Component } from 'react';
import {
View,
Text,
StyleSheet,
Image,
TouchableNativeFeedback,
TextInput,
TouchableOpacity,
StatusBar,
Platform
} from 'react-native';
import { connect } from 'react-redux';
import {FBLoginManager} from 'react-native-facebook-login';
import Login from './L... | Component that is used to show a signup dialog. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.