code stringlengths 26 5k | intent stringlengths 3 2.56k |
|---|---|
import React, { Component } from 'react';
import Types from 'prop-types';
import StyleCompiler from '../StyleCompiler';
import CodeMirror from 'kvolkovich-sc-react-codemirror';
import 'codemirror/mode/css/css';
const propTypes = {
initialRawStyles: Types.string
};
const defaultProps = {
initialRawStyles: ''
};
ex... | A component that displays a list of styles on a component that has a single style. |
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import PropTypes from '../../../prop_types';
import $ from 'jquery';
import { uuid } from '../../../utils';
import { mixin } from '../../../utils/decorators';
import InputBase from '../input_base';
import InputText from '../input_text';
import... | Ajoute um select de un componente |
import React from 'react'
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'
import { Message } from 'shengnian-ui-react'
const RadioStatesExamples = () => (
<ExampleSection title='States'>
<ComponentExampl... | Imports a sequence of components and returns a function that can be used to generate a sequence of components. |
/**
* Copyright (c) 2017-present, NDLA.
*
* This source code is licensed under the GPLv3 license found in the
* LICENSE file in the root directory of this source tree.
*
*/
// N.B! AUTOGENERATED FILE. DO NOT EDIT
import React from 'react';
import Icon from '../Icon';
const Sad = props => (
<Icon
viewBox="... | END of function |
import React from 'react';
import './SplunkJsExample.css';
import Inputs from './Inputs';
import * as splunkjs from 'splunk-sdk';
// jquery.ajax is used for the underlying http client in ProxyHttp
window.$ = require('jquery');
//const splunkjs = require('splunk-sdk');
const Async = splunkjs.Async;
const clientHttp =... | Example of how to show a list of results of a search. |
import React from 'react';
import SvgIcon from '../../SvgIcon';
const ActionSubject = (props) => (
<SvgIcon {...props}>
<path d="M14 17H4v2h10v-2zm6-8H4v2h16V9zM4 15h16v-2H4v2zM4 5v2h16V5H4z"/>
</SvgIcon>
);
ActionSubject.displayName = 'ActionSubject';
ActionSubject.muiName = 'SvgIcon';
export default ActionS... | A component that exports a sequence of React elements. |
import React from 'react';
import ReactDOM from 'react-dom';
import RootComponent from './components/RootComponent';
ReactDOM.render(<RootComponent />, document.getElementById('root'));
| Imports a React component and renders it into the DOM. |
import React, { Component } from 'react';
export default class NewItem extends Component {
constructor(props) {
super(props);
this.state = { value: '' };
this.onInput = this.onInput.bind(this);
this.onSubmit = this.onSubmit.bind(this);
}
onInput(event) {
this.setState({ value: event.target.... | Create a new item component that can be used to create a new todo item. |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, des... | Creates a new FooterToggleButton component that wraps a component in a footer button. |
import ByeBye from 'byebye';
import Social from 'modules/settings/components/Social';
import React from 'react';
import ReactDOM from 'react-dom';
import FacebookActions from 'actions/FacebookActions';
import TwitterActions from 'actions/TwitterActions';
import FacebookStore from 'stores/FacebookStore';
import TwitterS... | The default social view class |
/**
*
* Carret
*/
import React from 'react';
import PropTypes from 'prop-types';
import styles from './styles.scss';
const Carret = ({ style }) => {
return <div style={style} className={styles.carret} />;
};
Carret.defaultProps = {
style: {},
};
Carret.propTypes = {
style: PropTypes.object,
};
export def... | Exports a single node with a Carret |
import React from 'react';
import { TextInput, View, Text } from 'react-native';
const InputField = ({ label, value, onChangeText, placeholder, secureTextEntry }) => {
const { inputStyle, labelStyle, containerStyle, color } = styles;
return (
<View style={styles.input}>
<TextInput
autoCapitalize... | Create a hidden input that displays a hidden input with a text field. |
"use strict"
import React from 'react'
import classnames from 'classnames'
import Checkbox from './Checkbox'
import { toArray } from './utils/strings'
import { toTextValue } from './utils/objects'
class CheckboxGroup extends React.Component {
static displayName = "CheckboxGroup"
static propTypes = {
classNam... | A component that is rendered as a checkbox group. |
/**
* 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 rn_cli_example extends Component {
render() {
return (
<View style={styles.cont... | Component that is not part of a system - wide hierarchy. |
import './styles.less';
import React from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { Anchor } from '@r/platform/components';
import { makeWikiPath } from 'lib/makeWikiPath';
import Loading from 'app/components/Loading';
import RedditLinkHijacker from 'app/compo... | Create a function that returns a link to a wiki page. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageWbCloudy = (props) => (
<SvgIcon {...props}>
<path d="M19.36 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.64-4.96... | A component that exports a series of images with a series of icons. |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import immutableChildrenToJS from 'binary-utils/lib/immutableChildrenToJS';
import shouldPureComponentUpdate from 'react-pure-render/function';
import StatementCard from './StatementCard';
import statementSelectors from './statementSelect... | The base class for the statement container. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let MapsLocalHotel = (props) => (
<SvgIcon {...props}>
<path d="M7 13c1.66 0 3-1.34 3-3S8.66 7 7 7s-3 1.34-3 3 1.34 3 3 3zm12-6h-8v7H3V5H1v15h2v-3h18v3h2v-9c0-2.21-1.79-4-4-4z"/>
</SvgIcon>
);
MapsLocalHotel = pu... | A component that exports a Navitia - Hotel. |
import React from 'react';
import {Component} from 'react';
import BASE_URL from 'globals/base_url';
import formatDate from 'functions/formatDate'
import { Link } from 'react-router-dom'
// text={comment.text} date={comment.created_at} author={comment.author} document={comment.document_string}
class Comment extends C... | A component that displays a comment on a field. |
import React from 'react';
const PrototyperContext = React.createContext();
export default PrototyperContext;
| export default PrototyperContext |
import React, { Component } from 'react';
import { connect } from 'react-redux';
let Index = () => {
return (
<div>404----</div>
)
}
export default connect()(Index); | This is a hack to work around the fact that the index is not available in the browser. |
import React from 'react';
import Icon from '../Icon';
export default class LibraryMusicIcon extends Icon {
getSVG(){return <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M40 4H16c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V8c0-2.21-1.79-4-4-4zm-4 10h-6v1... | The library - music - icon class. |
import _extends from 'babel-runtime/helpers/extends';
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from ... | A component that can be used to render a bootstrap - only form control. |
/**
* This component serves as the root of your application, and should typically be the only
* component subscribed to the store.
*
* It is also a good place to fetch the current user. Once you have configured 'models/currentUser'
* to fetch the current user (by pointing it to the correct API endpoint) uncomment ... | A component that can be attached to a lore object when a user is requested. |
import React from 'react'
import Wrapper from './info-wrapper'
import Clock from './clock'
import Counter from './count'
import Data from './data'
import {
BrowserRouter as Router,
Route,
Link
} from 'react-router-dom'
export default () => (<div>
<Router>
<main>
<Link to='/info'>Info </Link>
<L... | Imports a single from React. |
import React from 'react';
import classNames from 'classnames';
class FormGroup extends React.Component {
render() {
let classes = {
'form-group': !this.props.standalone,
'form-group-lg': !this.props.standalone && this.props.bsSize === 'large',
'form-group-sm': !this.props.standalone && this.pr... | A component that renders a form group with a series of children. |
import React from 'react'
export default function Button ({children, title, ...props}) {
return <button
className='b--none bg-navy'
{...props}>
{children}
<span className='below'>{title}</span>
</button>
}
| A button that shows a menu with a hidden button. |
import React from 'react';
import TextField from 'material-ui/TextField';
export default answer => {
return <div style={{
whiteSpace: 'nowrap'
}}>
{answer.answers.map((value, index) => {
return <div key={index + value}>
<TextField
value={value}
disabled
/>
... | export default sequence of missing key - cookies |
import React from 'react';
import {http} from 'http'
import bus from 'fluxed/bus';
import * as router from 'react-router';
var Router = router.default;
var { Route, Link, RouteHandler } = Router;
console.log('token', authStore.token())
var Button = React.createClass({
render() {
return (<button onClick={this.... | The default auth provider |
import React from 'react';
import Analyzer from 'parser/core/Analyzer';
import SPELLS from 'common/SPELLS';
import { calculateAzeriteEffects } from 'common/stats';
import { formatPercentage } from 'common/format';
import TraitStatisticBox from 'interface/others/TraitStatisticBox';
const accelerantStats = traits => ... | Accelerant class that exports all of the properties of a single node. |
import React from 'react'
import './Nav.scss'
export const Nav = () => (
<div id='main'>
<ul id='navigationMenu'>
<li>
<a className='home' href='#'>
<span>Home</span>
</a>
</li>
<li>
<a className='about' href='#'>
<span>About</span>
</a>
... | export default Nav function |
/**
* 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 { render } from 'react-dom';
import { Router, browserHistory } from 'react-router';
import routes from '../shared/components/routes';
render (
<Router routes={routes} history={browserHistory} />,
document.getElementById('app')
);
| Imports a component and renders it in the browser history. |
import React from 'react';
export const VERSION = React.version;
export const REACT013 = VERSION.slice(0, 4) === '0.13';
export const REACT014 = VERSION.slice(0, 4) === '0.14';
export const REACT15 = VERSION.slice(0, 3) === '15.';
| Check if the version of React is greater than 0. 13. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let SocialShare = (props) => (
<SvgIcon {...props}>
<path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0... | A component that exports a sequence of components that are not part of a component. |
import Express from 'express';
import React from 'react';
import ReactDOM from 'react-dom/server';
import config from './config';
import favicon from 'serve-favicon';
import compression from 'compression';
import httpProxy from 'http-proxy';
import path from 'path';
import createStore from './redux/create';
import ApiC... | Express - based API server |
import React, { Component } from 'react';
import { Group } from 'react-art';
import HexTile from './hex-tile';
import { makeRadialGrid } from '../utils/hex-layout';
export default class HexGrid extends Component {
render() {
const widthPixels = this.props.dimensions.width;
const heightPixels = this.props.di... | The HexGrid component is a simple simple |
import React from 'react';
import PropTypes from 'prop-types';
import styles from './styles.scss';
const Footer = ({children}) =>
<div className={styles.footer} data-hook="menu-footer">
{children}
</div>;
Footer.propTypes = {
children: PropTypes.node
};
export default Footer;
| Exports a footer for a node - availables node. |
import React from 'react'
import { storiesOf } from '@storybook/react'
import { action } from '@storybook/addon-actions'
import { checkA11y } from '@storybook/addon-a11y'
import Toast from './Toast'
storiesOf('Toast', module)
.addDecorator(checkA11y)
.add('Default', () => (
<div style={{ height: '100vh' }}>
... | Add a decorator to check if a node is a reserved node. |
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { addCheckin, deleteCheckin } from '../reducers/checkin.reducer';
import { inviteUser, removeMember, deleteTeam, addTeam } from '../reducers/team.reducer';
import { joinTeam } from '../reducers/user.reducer';
im... | The base class for a single check - in page. |
import React from 'react';
import SPELLS from 'common/SPELLS';
import { formatNumber, formatPercentage } from 'common/format';
import { calculateAzeriteEffects } from 'common/stats';
import Analyzer from 'parser/core/Analyzer';
import TraitStatisticBox, { STATISTIC_ORDER } from 'interface/others/TraitStatisticBox';
im... | A class that represents a bones of |
import React from 'react';
import Analyzer from 'Parser/Core/Analyzer';
import Combatants from 'Parser/Core/Modules/Combatants';
import SPELLS from 'common/SPELLS';
import { formatNumber } from 'common/format';
import SpellIcon from 'common/SpellIcon';
import SpellLink from 'common/SpellLink';
import Wrapper from 'co... | The T21_4set class |
import React from 'react';
import styles from './Calendar.less';
export default function Calendar() {
return (
<i className={styles.component}/>
);
}
| The default calendar class |
import React from 'react';
export default class Install extends React.Component {
render() {
return (
<section className="mobile-placeholder col-xs row center-xs middle-xs">
<div>
<img alt="Actor messenger"
className="logo"
src="assets/img/logo.png"
... | Package that exports a component with a component that is not installed on the system. |
import React from 'react';
export default class ComboBoxItem extends React.Component{
constructor(props){
super(props);
}
render(){
const { text, value } = this.props;
return (
<option value={value}>
{text}
</option>
)
}
} | Component that renders a checkbox. |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { browserHistory } from 'react-router';
import {
Row,
Col,
ListGroupItem,
FormControl,
FormGroup,
ControlLabel,
InputGroup,
DropdownButton,
MenuItem,
Button,
Panel
} from 'react-bootstrap';
import PlayerList ... | Component that is a tournament and has no tournament - like state. |
import React from 'react';
import canUseDom from 'dom-helpers/util/inDOM';
import getOwnerDocument from 'dom-helpers/ownerDocument';
import getOwnerWindow from 'dom-helpers/ownerWindow';
import contains from 'dom-helpers/query/contains';
import activeElement from 'dom-helpers/activeElement';
import getOffset from 'd... | Get the height of the document and the size of the element. |
import React from 'react';
import ItemsTableCell from '../../components/ItemsTableCell';
import ItemsTableValue from '../../components/ItemsTableValue';
var InvalidColumn = React.createClass({
displayName: 'InvalidColumn',
propTypes: {
col: React.PropTypes.object,
},
renderValue () {
return (
<ItemsTableVal... | Invalid column component |
'use strict'
import React from 'react'
import {connect} from 'react-redux'
import {login} from '../../../modules/auth/actions/index'
export const Login = React.createClass({
do_login (event) {
event.preventDefault()
const {email, pass} = this.refs
const {dispatch, params} = this.props
let data = {... | The default login action is to log in with a user with a password. |
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import registerServiceWorker from './registerServiceWorker';
import injectTapEventPlugin from 'react-tap-event-plugin';
import rootReducer from './reducers';
import App from './App';
... | Imports a single node in the DOM. |
import React from 'react';
import PropTypes from 'prop-types';
import './PushButton.css';
/**
* An example-less button.
*/
export default function PushButton({ color, size, children }) {
const styles = {
color,
fontSize: PushButton.sizes[size],
};
return (
<button className="push-button" style={styles}>
... | The default PushButton class |
/* @flow */
import React from 'react';
import Icon from 'mineral-ui/Icon';
import type { IconProps } from 'mineral-ui/Icon/types';
/* eslint-disable prettier/prettier */
export default function IconReportProblem(props: IconProps) {
const iconProps = {
rtl: false,
...props
};
return (
<Icon {...icon... | A component that renders a missing missing component in a sequence of icons. |
import React from 'react';
import { Card, CardActions } from 'material-ui/Card';
import FlatButton from 'material-ui/FlatButton';
import Dialog from 'material-ui/Dialog';
import TextField from 'material-ui/TextField';
import VideoCore from './video_core';
import { styles } from './styles';
class Video extends React.C... | A component that can be nominally shown in a dialog. |
import React from 'react';
import ProductItem from './ProductItem';
class ProductList extends React.Component {
render() {
return (
<ul className="product-list">
{
this.props.productList.map{function(item, idx) }
return <ProductItem key={idx} {...item}/>
})
... | A component that renders a list of product items. |
import React from 'react'
import InlineLink from './InlineLink'
const wrapIf = (Component, props) => condition => value =>
condition ? <Component {...props}>{value}</Component> : value
const linkIf = uri => wrapIf(InlineLink, { href: uri })(uri)
export default linkIf
| React - related module that returns a link to the component if the condition is true. |
import React from 'react';
import FlagIDIcon from './FlagIDIcon';
export const symbols = {
'FlagIDIcon': <FlagIDIcon />
};
| The default module that exports a sequence of symbols. |
import React, { Component } from 'react';
import { Meteor } from 'meteor/meteor';
import { Session } from 'meteor/session';
import { createContainer } from 'meteor/react-meteor-data';
import FeedbackMessage from '../misc/FeedbackMessage';
class CreationForm extends Component {
constructor(props) {
super(props)... | A component that creates a single hidden hidden |
import React from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import { Form, Button, Input, Modal, message } from 'antd'
import Spin from 'COMPONENT/effects/Spin'
import { setAddUserIdState, addUserId } from 'REDUCER/pages/whiteListManage'
const FormItem = Form.Item
@conne... | A component that adds a user to a group of users. |
/*
Coded by: Simar (github.com/iSimar)
GitHub Project: https://github.com/iSimar/HackerNews-React-Native
*/
import React, { Component } from 'react';
import {
View,
WebView,
StyleSheet,
TouchableOpacity,
Text,
} from 'react-native';
var styles = StyleSheet.create({
container: {
flex: 1,
background... | Demonstrates how to render a single missing - node node in a browser. |
import React from 'react';
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
import Spinner from 'react-spinkit';
import { fadeAnimation } from '../../utils/animationSettings';
class Avatar extends React.Component {
static propTypes = {
src: React.PropTypes.string.isRequired
};
cons... | The base class for a user - avatar. |
import * as _ from 'lodash'
import {DocumentCard, DocumentCardPreview, DocumentCardTitle} from 'office-ui-fabric-react'
import React from 'react'
const VideoPreviewCard = (
{
className = '',
videoId,
videos
}) => (
<div className={className}>
<DocumentCard onClickHref={`/videos/${videoId}`}>
... | The default implementation of Warnings that creates a video preview card. |
import React from 'react'
import TemplateIcon from './TemplateIcon'
const Check = ({size, color, customStyle}) =>
<TemplateIcon
size={size}
color={color}
customStyle={customStyle}
viewBox="6 6 12 12"
>
<path d="M9.599,11.86c-0.097-0.097-0.097-0.256,0-0.354l1.01-1.009c0.0... | Check for missing missing components. |
import React from 'react';
import Relay from 'react-relay';
import ChangeTodoStatusMutation from '../mutations/ChangeTodoStatusMutation';
import Todo from './Todo';
class TodoList extends React.Component {
getFilteredTodos() {
const edges = this.props.todos.edges;
if (this.props.filter === 'active') {
... | A component that can be used to display a list of todos. |
import React from 'react';
import Analyzer from 'Parser/Core/Analyzer';
import Combatants from 'Parser/Core/Modules/Combatants';
import SPELLS from 'common/SPELLS';
import SpellIcon from 'common/SpellIcon';
import SpellLink from 'common/SpellLink';
import { formatNumber, formatPercentage } from 'common/format';
impo... | Soul Harvest talent |
import React from 'react';
import ContainerState from './ContainerState';
import ContainerClient from './ContainerClient';
import { renderToStaticMarkup } from 'react-dom/server';
const _ = {
mapValues: require('lodash/mapValues')
};
export default function renderTemplate(template) {
const sections = _.mapValues... | Renders a sequence of blocks into a single block of HTML. |
import React from 'react';
import { Route, IndexRoute,IndexRedirect} from 'react-router';
import EditAddressContainer from './containers/EditAddressContainer';
import AddressListPage from './containers/AddressListPage';
import App from './components/App';
import GenericContainer from './containers/GenericContainer';
im... | This module imports all routes that are not part of a specific application. |
import PropTypes from 'prop-types';
import React from 'react';
import shortid from 'shortid';
import Book from './Book';
/**
* Render a collection of books in a grid
* @param {Array} options.booksList The list of books
* @param {Function} options.onShelfChange The callback for shelf change event
* @p... | Render a collection of books in a grid |
import React from 'react';
/* VIEWS */
import Home from '../home';
import Landing from '../landing';
import Error404 from '../error/error-404';
import LoginPage from '../account/login-page';
import RegisterPage from '../account/register-page';
import RegisterFormPage from '../account/register-form-page';
import Recove... | Default implementation of the missing - js error - id property. |
import React, { Component } from 'react';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import AppBar from 'material-ui/AppBar';
import Drawer from 'material-ui/Drawer';
import MenuItem from 'material-ui/MenuItem';
import FlatButton from 'material-ui/FlatButton';
import MnSnackbar from "./MnSnack... | Component that is a component of a component that is not attached to a database. |
import React from 'react';
import PropTypes from 'prop-types';
/**
* **DragBoxSelect** is a specialized usage of [DragBox](#!/DragBox) that is also accessible via `DragBox.Select`. It is
* provided as a convenience as it is a commonly used group of components. All properties available in both
* [Selectable](#!/S... | A component that can be used to drag or drop a key - based box. |
import React from 'react';
import Container from 'instructure-ui/lib/components/Container';
import Heading from 'instructure-ui/lib/components/Heading';
import AppHarness from 'js/shared/components/AppHarness';
export default class Home extends React.Component {
render () {
return (
<AppHarness page="home... | The default component that renders a single non - empty node in the app harness. |
import React from 'react';
import { shape, string, number, element, arrayOf } from 'prop-types';
import { Tab, Tabs, TabTitleText } from '@patternfly/react-core';
import { Switch, Route, Redirect, useLocation, withRouter, HashRouter } from 'react-router-dom';
import { head, last } from 'lodash';
const RoutedTabs = ({
... | Private function to generate a single - tab - based sequence of non - terminal keyboard keyboards. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageFilter4 = (props) => (
<SvgIcon {...props}>
<path d="M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm12 10h2V5h-2v4h-2V5h-2v6h4v4zm6-14H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14... | A filter that returns an image of a series of icons. |
import React from 'react';
import Autocomplete from 'react-autocomplete';
import TicketLink from '../TicketLink';
const TicketForm = (props) => {
return (
<form>
<button
type="button"
className="close-btn btn"
aria-label="close"
onClick={() => props.toggleTicketModal()}
... | JSF - Component for handling a single n - node error in a ticket form. |
import React from 'react';
import SelectField from 'material-ui/SelectField';
import MenuItem from 'material-ui/MenuItem';
const items = [];
for (let i = 0; i < 100; i++ ) {
items.push(<MenuItem value={i} key={i} primaryText={`Item ${i}`} />);
}
export default class DropDownMenuLongMenuExample extends React.Compone... | Example of how to display a dropdown menu in a long menu. |
import React from 'react'
import Link from 'next/link'
export default () => {
const myRef = React.createRef(null)
React.useEffect(() => {
if (!myRef.current) {
console.error(`ref wasn't updated`)
}
})
return (
<Link href="/">
<a ref={myRef}>Click me</a>
</Link>
)
}
| A component that renders a sequence of nodes that are not currently active. |
/**
* Created by bll on 2017/7/18.
*/
import React from 'react';
import {
Button,
Image,
View,
Text
} from 'react-native';
class ChatScreen extends React.Component {
static navigationOptions = {
title:'聊天',
};
render() {
const {params} = this.props.navigation.state;
return (
<View style={{background... | A component that displays a chat screen when a user navigates to a state in a network. |
import 'aframe-core'
import 'babel-polyfill'
import {Animation, Entity, Scene} from 'aframe-react'
import React from 'react'
import ReactDOM from 'react-dom'
import sample from 'lodash.sample'
import {cdn} from '../utils'
import {Camera, Cursor, Light, Sky, CurvedImage, VideoSphere} from '../components/primitives'
cla... | A component that generates a single box in a scene. |
import React, { Component } from 'react';
import { Header, Footer } from './components/index';
export default class App extends Component {
render() {
return (
<div>
<Header />
</div>
);
}
}
| The default app class |
import React from 'react'
import Link from './Link'
/**
* An <IndexLink> is used to link to an <IndexRoute>.
*/
const IndexLink = React.createClass({
render() {
return <Link {...this.props} onlyActiveOnIndex={true} />
}
})
export default IndexLink
| A component that links to a link to a specific index route. |
/*
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/li... | Demonstrates how to display a single missing - node error message when a node is missing. |
import React from 'react';
export default React.createClass({
getInitialState() {
return {enabled: this.props.invocation.state.decorate};
},
handleClick(event) {
stopBubblingUp(event);
var newState = !this.state.enabled;
this.setState({enabled: newState});
this.prop... | Create a single class that can be used to toggle the decoration of a component. |
import React from 'react'
import { Progress } from 'semantic-ui-react'
const ProgressExampleError = () => (
<Progress percent={100} error>
There was an error
</Progress>
)
export default ProgressExampleError
| Import a from a semantic - ui - react module. |
import React from 'react';
import PropTypes from 'prop-types';
import _ from 'lodash';
const RedditHeaderItem = ({name}) => (
<li className={`redditPosts__snippet--${name}`} key={name}>{_.startCase(name)}</li>
);
RedditHeaderItem.propTypes = {
name: PropTypes.string.isRequired
};
RedditHeaderItem.defaultProps = ... | Create a RedditHeaderItem with a property. |
import React from 'react';
import PropTypes from 'prop-types';
import Styled from 'rsg-components/Styled';
const styles = ({ space, color }) => ({
hr: {
borderBottom: [[1, color.border, 'solid']],
marginTop: 0,
marginBottom: space[2],
},
});
export function HrRenderer({ classes }) {
return <hr className={cl... | export a styled component that renders a single in a hr - style element. |
/**
* app.js
*
* This is the entry file for the application, only setup and boilerplate
* code.
*/
// Needed for redux-saga es6 generator support
import 'babel-polyfill';
// Import all the third party stuff
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
impor... | This module is responsible for importing the n - ary component and adding it to the app s state. |
import React from 'react' // eslint-disable-line no-unused-vars
import { Text, TouchableHighlight, StyleSheet } from 'react-native'
export default function SelectFiles (props) {
return (
<TouchableHighlight
onPress={props.showFilePicker}
style={styles.button}
>
<Text style={styles.text}>Sel... | Select files on a menu |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionCompareArrows = (props) => (
<SvgIcon {...props}>
<path d="M9.01 14H2v2h7.01v3L13 15l-3.99-4v3zm5.98-1v-3H22V8h-7.01V5L11 9l3.99 4z"/>
</SvgIcon>
);
ActionCompareArrows = pure(ActionCompareArrows);
Acti... | A component that exports action - compare - arrows to a component that can be used to compare two components. |
import React, { Component } from 'react';
class AddButton extends Component {
render() {
return (
<span className="input-group-btn input-group-sm">
<button type="button" className="btn btn-fab btn-fab-sm" >
<i className="pe-7s-plus pe-va pe-lg" onClick = {this.props.getAction}>Add Fields</i>
... | Add button for adding a new field to a group of fields. |
import React from 'react';
import logo from './logo.svg';
import './App.css';
function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
... | The main function for the missing - js application. |
import React, { Component } from 'react';
import {
View,
StyleSheet,
Text,
TouchableOpacity,
Image
} from "react-native";
import AppStyleSheet from "../styles";
import Icon from 'react-native-vector-icons/Foundation';
export default class Button extends Component {
constructor(props) {
super(props)... | The button class is a component that can be used to show a dropdown dropdown menu. |
// libs
import React from 'react';
import {PropTypes} from 'prop-types';
// components
import {Redirect} from 'react-router-dom';
// other
import styles from './index.less';
export default function AuthLayout({children}, {loggedUserId}) {
if (loggedUserId) {
return <Redirect to="/dashboard" />;
}
return (
... | The default auth layout for a node that is not part of the tree. |
/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */
import React from 'react';
import styles from './Feedback.css';
import withStyles from '../../decorators/withStyles';
@withStyles(styles)
class Feedback {
render() {
return (
<div className="Feedback">
<div className="Feedba... | The main function of the module |
import Component from '../PureRenderComponent.react';
import Radium from 'radium';
import React from 'react';
import RPT from 'prop-types';
import * as colors from '../styles/Colors';
@Radium
export default class Textarea extends Component {
static propTypes = {
key: RPT.string,
onChange: RPT.func,
valu... | A component that renders a text area with a single hidden field. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let CommunicationImportContacts = (props) => (
<SvgIcon {...props}>
<path d="M21 5c-1.11-.35-2.33-.5-3.5-.5-1.95 0-4.05.4-5.5 1.5-1.45-1.1-3.55-1.5-5.5-1.5S2.45 4.9 1 6v14.65c0 .25.25.5.5.5.1 0 .15-.05.25-.05C3.1 2... | A component that |
import React from 'react'
const RefferalHeader = () => (
<thead>
<tr>
<th>Select</th>
<th>Program Name</th>
<th>Program Location</th>
<th>Program Type</th>
</tr>
</thead>
)
RefferalHeader.displayName = 'RefferalHeader'
export default RefferalHeader
| Create a refferal header for a |
import React from 'react';
import Icon from '../Icon';
export default class LocalMallIcon extends Icon {
getSVG(){return <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M38 12h-4c0-5.52-4.48-10-10-10S14 6.48 14 12h-4c-2.21 0-3.98 1.79-3.98 4L6 40c0 2.21 1.79 4 4 4h28c2.21 ... | A tool to render a single missing - missing |
import React from 'react';
import RenewalCallback from '../components/app/RenewalCallback';
const SilentCallbackPage = props => (<RenewalCallback {...props} />);
export default SilentCallbackPage;
| Imports a React component and exports a default callback page. |
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
import React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import withStyles from '../styles/withStyles';
import ListContext from '../List/... | A wrapper to create a list item with a proper styles applied to the list item. |
import React from 'react';
import {Link} from 'react-router';
class HomePage extends React.Component {
render(){
return (
<div className="jumbotron">
<h1>About </h1>
</div>
);
}
}
export default HomePage;
| The default implementation of a class. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.