code stringlengths 26 5k | intent stringlengths 3 2.56k |
|---|---|
import React from 'react'
const PageTitle = () => (
<div>
<h1 className="page__title">Embrace Open Source</h1>
<h2 className="page__subtitle">A list of GitHub issues to help beginners make their first pull request.</h2>
<style jsx>{`
.page__title {
color: #3d4752;
font-weight: 400;... | A page title that displays a list of issues that can be found in a sequence of scenarios. |
'use strict' /* @flow */
import React from 'react'
import ReactCSS from 'reactcss'
import merge from 'merge'
import isPlainObject from 'lodash.isplainobject'
import debounce from 'lodash.debounce'
import color from '../helpers/color'
import Material from './material/Material'
class ColorPicker extends ReactCSS.Compo... | A component that is a component that can be used to create a color picker. |
import React from 'react'
import { connect } from 'react-redux'
import Instance from './Instance'
export default connect(mapStateToProps)(({
breakCategories,
toggle
}) => {
return (
<div>
{breakCategories.sort((a, b) => b.default).map(breakCategory =>
<Instance
key={breakCategory._id... | React - redux - react - mapStateToProps |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let HardwareTv = (props) => (
<SvgIcon {...props}>
<path d="M21 3H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5c0-1.1-.9-2-2-2zm0 14H3V5h18v12z"/>
</SvgIcon>
);
HardwareTv = pure(Hardwar... | HardwareTv is a lightweight component that can be used to render a hardware TV. |
/* @flow */
import React from 'react';
import {
Platform,
StyleSheet,
Text,
} from 'react-native';
import type {
Style,
} from '../TypeDefinition';
type Props = {
tintColor?: ?string;
style?: Style,
};
const HeaderTitle = ({ style, ...rest }: Props) => (
<Text numberOfLines={1} {...rest} style={[styl... | Imports a single missing - node node. |
// This is the app's client-side entry point. Webpack starts here when
// bundling the entire codebase.
/* eslint-disable global-require, no-unused-vars */
import React from 'react'
import ReactDOM from 'react-dom'
import { browserHistory } from 'react-router'
import configureStore from './../common/store/configureSto... | This is the client - side entry point for the app. |
/*
* HomePage
*
* This is the first thing users see of our App, at the '/' route
*
* NOTE: while this component should technically be a stateless functional
* component (SFC), hot reloading does not currently support SFCs. If hot
* reloading is not a necessity for you then you can refactor it and remove
* the l... | HomePage - A component that can be used to show a single missing non - hot hot |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from 'material-ui/SvgIcon';
let Filter6 = props =>
<SvgIcon {...props}>
<path d="M3 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.1-.9-2-2-2zm0 16H7V3h14v14zm-8-2h2c1.1 0 2-.89 2-2v-2c0-... | A component that renders a series of icons in a group of icons. |
import React from 'react';
import {Card, CardActions, CardHeader, CardMedia, CardTitle, CardText} from 'material-ui/Card';
import FlatButton from 'material-ui/FlatButton';
import Toggle from 'material-ui/Toggle';
export default class CardExampleControlled extends React.Component {
constructor(props) {
super(pro... | Example of how to render a single missing - node node. |
import React, { Component } from 'react';
var Log = React.createClass({
render: function () {
return (
<li className={this.props.log.logType}><p className="log-data">{this.props.log.logData}</p></li>
);
}
})
module.exports = Log;
| Imports the log component |
import React from 'react';
class Grades extends React.Component {
render () {
var assignments = COURSES[this.props.params.courseId].assignments;
return (
<div>
<h3>Grades</h3>
<ul>
{assignments.map(assignment => (
<li key={assignment.id}>{assignment.grade} - {assi... | A component that renders a list of assignments to a single course. |
/**
* Created by Dat Tran on 9/27/17.
*/
import React from 'react';
import {
StyleSheet,
Text,
TextInput,
View,
LayoutAnimation,
TouchableOpacity,
FlatList
} from 'react-native';
import QuickbloxManager from './QuickbloxManager';
export default class ContactList extends React.Component {
constructor... | The ContactList component which is a list of users that can be selected by a user. |
import React from 'react';
import CatalogFilterButton from './filters/CatalogFilterButton'
export default class FilterTheme extends React.Component {
constructor(){
super()
}
renderThemesButtons(){
if(this.props.themes) {
return this.props.themes.map((theme) => {
... | A theme filter that can be used to filter a theme. |
import React from 'react'
import ReactDOM from 'react-dom'
import { AppContainer } from 'react-hot-loader'
import routes from './routes'
import injectTapEventPlugin from 'react-tap-event-plugin'
injectTapEventPlugin()
const render = (Component) => {
ReactDOM.render(
<AppContainer>
<Component/>
<... | Devuelve un objeto nuevo |
import React from 'react'
import PropTypes from 'prop-types'
import { Form, Input, Modal, Icon } from 'antd'
import UserPower from './UserPower'
import styles from './ModalForm.less'
const FormItem = Form.Item
const formItemLayout = {
labelCol: {
span: 6
},
wrapperCol: {
span: 14
}
}
const ModalForm ... | UI - modal - modal |
import React, { Component } from 'react';
import { fetchBooks } from '../../actions/books';
import { connect } from 'react-redux';
import { Link } from 'react-router';
class BookShow extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.props.fetchBooks();
}
rende... | Component that displays a single non - book - related warning in the books list. |
/**
* 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 chuanzhang extends Component {
render() {
return (
<View style={styles.containe... | Component that is not part of a component in the system |
import React from 'react';
class ControllerUnit extends React.Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
//索引点击事件
handleClick(e) {
if(this.props.arrange.isCenter) {
this.props.inverse();
} else {
this.props.center();
}
e... | ControllerUnit class. |
import React from 'react';
import {shortFormatHash, momentFromNow} from '../../lib/util';
import Button from 'material-ui/Button';
import Card from 'material-ui/Card';
import Divider from 'material-ui/Divider';
import './RevealAuctionInfo.css';
const FinalizeAuctionOn = (props) =>
<div className='FinalizeAuctionOn'>... | A component that renders the auction on and auction on buttons. |
/*
* Copyright (C) Pootle contributors.
*
* This file is a part of the Pootle project. It is distributed under the GPL3
* or later license. See the LICENSE file for a copy of the license and the
* AUTHORS file for copyright and authorship information.
*/
import React from 'react';
import Search from '../Search'... | The main entry point for the missing language. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageAddToPhotos = (props) => (
<SvgIcon {...props}>
<path d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9h-4v4h-2v-4H9V9h4V5h2v4h4v2z"/>
... | A component that adds icons to the icons list. |
'use strict'
import ReactDOM from 'react-dom'
import React from 'react'
import '../node_modules/normalize.css/normalize.css'
import Docs from './components/docs/Docs'
ReactDOM.render(
React.createElement(Docs),
document.getElementById('root')
)
| Imports a single node in the DOM. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let AvShuffle = (props) => (
<SvgIcon {...props}>
<path d="M10.59 9.17L5.41 4 4 5.41l5.17 5.17 1.42-1.41zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4h-5.5zm.33 9.41l-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.... | A component that generates a random order for a sequence of components. |
import React from 'react';
const containerStyle = {
fontFamily: "Roboto"
}
class GameListItemComponent extends React.Component {
selectGame() {
this.props.onClick(this.props.game);
}
render() {
return (
<li style={containerStyle} onClick={this.selectGame.bind(this)}>Game by {this.props.game.pla... | A component that can be used to display a list of game items. |
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import ReduxPromise from 'redux-promise';
import App from './components/app';
import reducers from './reducers';
import { BrowserRouter } from 'react-router... | imports ReactDOM from ReactDOM |
import React from 'react'
import { Grid } from 'semantic-ui-react'
const GridExampleReversedComputer = () => (
<Grid reversed='computer' columns='equal'>
<Grid.Row>
<Grid.Column>Computer A Fourth</Grid.Column>
<Grid.Column>Computer A Third</Grid.Column>
<Grid.Column>Computer A Second</Grid.Colu... | This function imports a sequence of components from a semantic - ui - react module. |
import React, { Component } from 'react';
import './App.css';
import HelloWorld from './component/HelloWorld'
class App extends Component {
render() {
return (
<div className="App">
<HelloWorld/>
</div>
);
}
}
export default App;
| The default app class |
import React from 'react';
import ReactDOM from 'react-dom';
import {Router, useRouterHistory} from 'react-router';
import injectTapEventPlugin from 'react-tap-event-plugin';
import {createHashHistory} from 'history';
import AppRoutes from './AppRoutes';
// Helpers for debugging
window.React = React;
window.Perf = req... | Renders a single app component. |
import React from 'react';
import { Router, Route, browserHistory, IndexRoute } from 'react-router';
// Pages
import App from './containers/App';
var routes = (
<Route path="/" component={App}>
</Route>
);
export default routes;
| Imports the routes from the app. |
// (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 brand - grommet path. |
import React from 'react';
import './ServicesSectionOne.scss';
import {
Column,
Row,
Button
} from 'react-foundation';
import {
Divider
} from '../../../components';
const paragraph1P1 = `Through the `;
const paragraph1P2 = ` platform, we have proven that working collaboratively on
meaningful open sources pr... | ServicesSectionOne - > ServicesSectionOne |
import makeRouteConfig from 'found/lib/makeRouteConfig'
import Route from 'found/lib/Route'
import React from 'react'
import AllSpeciesPage from './components/AllSpeciesPage'
import App from './components/App'
import AuthCallback from './components/AuthCallback'
import AuthRenewCallback from './components/AuthRenewCal... | Generate a config file for a sequence of components |
import React from 'react';
const styles = {
border: '4px #545454',
margin: '90px',
padding: '40px',
};
export default appraisal => (
<div style={{...styles}}>
<h4> Requester Email: {appraisal._email}</h4>
<p>Type: {appraisal._type}</p>
<div><em>Start Date: {appraisal._start}</em></div>
<di... | Default Generator. js |
import React from 'react';
import { connect } from 'react-redux';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { debou... | The following requests component |
import React from 'react'
import PropTypes from 'prop-types'
import {
withStyles,
Button,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
SvgIcon,
} from '@material-ui/core'
import UserRegistrationForm from './UserRegistrationForm'
import GravatarIcon from '../images/Gravatar.svg'
import Dia... | Imports a single node in a dialog with a single style and a Gravatar link. |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { withRouter } from 'react-router-dom';
class BaseComponent extends Component {
componentDidUpdate(prevProps) {
if (this.props.location !== prevProps.location) {
window.scrollTo(0, 0);
}
}
render() {
return (
... | A base component that is used to render a child component. |
import React from 'react';
import NoteDialog from 'components/NoteDialog';
import Rebase from 're-base';
const base = Rebase.createClass('https://noteworthyapp.firebaseio.com');
class NoteDialogContainer extends React.Component {
constructor(props) {
super(props);
}
addNote(newNote) {
let noteKey = bas... | The NoteDialogContainer component is a base component that can be used to show a note dialog. |
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
export const styles = {
root: {
display: 'flex',
flexWrap: 'wrap',
overflowY: 'auto',
listStyle: 'none',
padding: 0,
WebkitOverflowScrolling: 'tou... | A component that can be used to create a grid list of children. |
import React from 'react';
import config from 'docs/src/config';
class GoogleTag extends React.Component {
componentDidMount() {
// Wait for the title to be updated.
this.googleTimer = setTimeout(() => {
window.gtag('config', config.google.id, {
page_path: window.location.pathname,
});
... | The GoogleTag class |
/**
* The external dependencies.
*/
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
/**
* The internal dependencies.
*/
import ContainerBase from 'containers/components/container/base';
/**
* Render the tabs of the container.
*
* @param {Object} props
* @par... | Renders the tabs of the container. |
import test from 'ava';
import '../helpers/setup-test-env';
import React, { Component } from 'react';
import { mount } from 'enzyme';
import { connect, state } from '../../src';
test('should batch forceUpdate', t => {
state.set({ name: 'Ssnau' });
let forceUpdateCallTimes = 0;
let renderCallTimes = 0;
@conne... | App component that can be used to batch update |
import _ from 'lodash';
import React from 'react';
import { PureRenderMixin } from 'react/addons';
import ActorClient from 'utils/ActorClient';
import { Styles, FlatButton } from 'material-ui';
import { KeyCodes } from 'constants/ActorAppConstants';
import ActorTheme from 'constants/ActorTheme';
import MessageAction... | The base component for all messages that are not related to a specific type of message. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let HardwareSecurity = (props) => (
<SvgIcon {...props}>
<path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"/>
</SvgIcon>
);
Hardwa... | Hardware security component |
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import './index.css';
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
| Imports a single application. |
import React from 'react'
import PropTypes from 'prop-types'
import DropdownPanel from '../../utils/DropdownPanel.js'
export default class HLSStream extends React.Component {
render() {
const { mediaPlayer } = this.props
return (
<DropdownPanel title={"HLS Stream"} data={{
... | A component that renders a HLS stream when a user has no effect on a video. |
import React from 'react';
import Star from 'wix-ui-icons-common/Star';
import Download from 'wix-ui-icons-common/Download';
import Duplicate from 'wix-ui-icons-common/Duplicate';
import Print from 'wix-ui-icons-common/Print';
import { classes } from '../TableActionCell.story.st.css';
import { TableActionCell } from ... | Imports a single node in the RTL table. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionFavorite = (props) => (
<SvgIcon {...props}>
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6... | A component that renders a action favorite in a sequence of components. |
import React from 'react'
import { Link } from 'react-router'
import { prefixLink } from 'gatsby-helpers'
import Helmet from 'react-helmet'
import { config } from 'config'
import PhotoCollage from '../components/PhotoCollage'
export default class Index extends React.Component {
render () {
return (
<div>
... | The main function of the Helmet index. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let DeviceAccessTime = (props) => (
<SvgIcon {...props}>
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-1... | Devuelve un objeto DeviceAccessTime |
/* 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 base component for a series of keys. |
import React from 'react';
import Analyzer from 'parser/core/Analyzer';
import Enemies from 'parser/shared/modules/Enemies';
import SPELLS from 'common/SPELLS';
import SpellLink from 'common/SpellLink';
import SpellIcon from 'common/SpellIcon';
import { formatPercentage } from 'common/format';
import SmallStatisticBo... | Protected word pain can be created by a mix of two different modules. |
import React from 'react';
import Header from '../components/Header';
import PageBody from '../components/PageBody';
import SideBar from '../components/SideBar';
import { ExamplePages } from '../Constants';
export default class ExamplesPage {
render() {
return (
<div>
<Header/>
<PageBody ha... | The default implementation of which renders a page with a header and a side bar. |
'use strict';
import React from 'react';
var object = React.PropTypes.object;
/**
* The RouteContext mixin provides a convenient way for route
* components to set the route in context. This is needed for
* routes that render elements that want to use the Lifecycle
* mixin to prevent transitions.
*/
var RouteCon... | RouteContext mixin provides a convenient way to route any missing child components in the hierarchy. |
import React from 'react';
import Avatar from '../../../components/avatar';
import DisplayName from '../../../components/display_name';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
class AutosuggestAccount extends ImmutablePureComponen... | A component that displays a list of unique identifiers that can be used to suggest a user s account. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageCamera = (props) => (
<SvgIcon {...props}>
<path d="M9.4 10.5l4.77-8.26C13.47 2.09 12.75 2 12 2c-2.4 0-4.6.85-6.32 2.25l3.66 6.35.06-.1zM21.54 9c-.92-2.92-3.15-5.26-6-6.34L11.88 9h9.66zm.26 1h-7.49l.29.5 4... | A component that exports a component that displays a camera on the top of a series of icons. |
import React from 'react';
import CircularProgress from 'material-ui/CircularProgress';
export default class CircularProgressExampleDeterminate extends React.Component {
constructor(props) {
super(props);
this.state = {
completed: 0,
};
}
componentDidMount() {
this.timer = setTimeout(() ... | Example of how to render a circular progress bar. |
/**
* Render a header for a popout
*/
import React from 'react';
import Transition from 'react-addons-css-transition-group';
const PopoutHeader = React.createClass({
displayName: 'PopoutHeader',
propTypes: {
leftAction: React.PropTypes.func,
leftIcon: React.PropTypes.string,
title: React.PropTypes.string.is... | Renders a popout header for a specific node in the Popout panel. |
// @flow
import React from 'react'
import type { Node } from 'react'
import styled from 'styled-components'
import cx from 'classnames'
import { myTheme } from '../../styles'
const { fontSize } = myTheme
const StyledCaption = styled.h6`
font-size: ${fontSize.seven};
text-transform: uppercase;
`
const styles = {... | A component that exports a single node in a chain of nodes. |
/*
* HomePage
*
* This is the first thing users see of our App, at the '/' route
*
* NOTE: while this component should technically be a stateless functional
* component (SFC), hot reloading does not currently support SFCs. If hot
* reloading is not a neccessity for you then you can refactor it and remove
* the ... | A component that can be used to show a hidden card in the UI. |
import React from 'react';
import { render } from 'react-dom';
import { App } from './App';
render(<App />, document.getElementById('root'));
| Imports React and ReactDOM. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let DeviceNfc = (props) => (
<SvgIcon {...props}>
<path d="M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 18H4V4h16v16zM18 6h-5c-1.1 0-2 .9-2 2v2.28c-.6.35-1 .98-1 1.72 0 1.1.9 2 2 2... | Devuelve un Nfc |
import React from 'react';
import { Route, IndexRoute } from 'react-router';
import App from '../containers/App';
import DashboardPage from '../containers/DashboardPage';
import CollectionPage from '../containers/CollectionPage';
import EntryPage from '../containers/EntryPage';
import SearchPage from '../containers/Sea... | This module is exported to allow for customization of the router. |
import React from 'react'
import App from 'next/app'
import '../styles/global1.scss'
import '../styles/global2.scss'
class MyApp extends App {
render() {
const { Component, pageProps } = this.props
return <Component {...pageProps} />
}
}
export default MyApp
| A component that renders a single component in a chain of components. |
import React from 'react';
import { sparqlConnect } from 'sparql-connect';
import OperationList from './operation-list';
import Spinner from 'components/shared/spinner'
import D, { getLang } from 'i18n'
/**
* Builds the query that retrieves the series of a given family.
*/
const queryBuilder = series => `
PREFIX dc... | Builds a query that retrieves the series of a given family. |
import React from 'react';
import classNames from 'classnames';
import { ActivityTypes } from 'constants/ActorAppConstants';
import ActivityStore from 'stores/ActivityStore';
import UserProfile from 'components/activity/UserProfile.react';
import GroupProfile from 'components/activity/GroupProfile.react';
const getS... | The activity section class. |
import React from 'react'
import SvgWrapper from './svg-wrapper'
const Bubbles = ({ className, color }) => (
<SvgWrapper className={className} viewBox="0 0 37 32">
<path
d="m22.92 0.81055a4.6385 4.6385 0 1 0 0.001953 9.2773 4.6385 4.6385 0 0 0 -0.001953 -9.2773zm0 1.2656a3.376 3.376 0 0 1 3.373 3.373 3.376... | 9. 2. 1 - 19 |
import Context from './Context'
import React from 'react'
const withContainer = (Component) => {
const ChildComponent = (props) => {
return (
<Context.Consumer>
{(value) => {
return <Component {...value} {...props} />
}}
</Context.Consumer>
)
}
return ChildComponent... | withContainer - export with a child component |
import React from 'react';
export class Hello extends React.Component {
render() {
return <h1>Hello React! yey</h1>;
}
} | A component that renders a Hello component with a header. |
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import Toggle from 'react-toggle';
import AsyncSelect from 'react-select/async';
import { NonceProvider } from 'react-sele... | A column settings class that displays a list of hashtags and tags. |
/* eslint react/prop-types: 0 */
import React from 'react';
import { FormattedRelative } from 'react-intl';
export default class TimeAgoWrapper extends React.Component {
render() {
let {date} = this.props
if(date && /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d$/.test(date)) {
date = date + 'Z' // F... | A component that renders a timeAgo in a way that can be used to render a timeAgo. |
import React, { Component } from 'react';
import IssueProvider from './IssueProvider';
import PropTypes from 'prop-types';
class IssueProviderList extends Component {
render() {
const { issueProviders, statusesForIssues } = this.props;
return (
<div>
{issueProviders && Object.keys(issueProvider... | A component that renders a list of issue providers. |
import React, { Component } from 'react';
import Main from '../components/Main';
import Home from '../components/Home';
import { Router, Route, IndexRoute, Link } from 'react-router'
module.exports = (
<Route path="/" component={Main}>
<IndexRoute component={Home} />
</Route>
);
| Imports a single component in a module. |
import React from 'react'
import useSiteData from '../hooks/useSiteData'
export function SiteData({ children }) {
return children(useSiteData())
}
export function withSiteData(Comp) {
return function componentWithSiteData(props) {
const routeData = useSiteData()
return <Comp {...props} {...routeData} />
... | React component with site data |
import React from 'react';
import { Text, TouchableOpacity } from 'react-native';
const Button = ({ onPress, children }) => {
const { buttonStyle, buttonTextStyle } = styles;
return (
<TouchableOpacity onPress={onPress} style={buttonStyle}>
<Text style={buttonTextStyle}>{children}</Text>
</Touchable... | export Button class |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from 'material-ui/SvgIcon';
let ArrowForward = props =>
<SvgIcon {...props}>
<path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" />
</SvgIcon>;
ArrowForward = pure(ArrowForward);
ArrowForward.muiName = 'SvgIcon';
exp... | A small utility to export a chain of missing components. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let NotificationFolderSpecial = (props) => (
<SvgIcon {...props}>
<path d="M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-2.06 11L15 15.28 12.06 17l.78-3.33-2.59-2.24 3.41-.29... | NotificationFolderSpecial is a special component that can be used to show a notification folder in a special component. |
import React, { Component } from 'react';
import {Image, StyleSheet, AsyncStorage} from 'react-native';
import { StackNavigator } from 'react-navigation';
import { Container, Content, Text, H1, H3, Button, Item, Input, Grid, Col} from 'native-base';
import general from '../styles/general';
import Icon from 'react-nativ... | The signup screen component |
import React from 'react';
import SelectField from 'material-ui/SelectField';
import MenuItem from 'material-ui/MenuItem';
const items = [
<MenuItem key={1} value={1} primaryText="Never" />,
<MenuItem key={2} value={2} primaryText="Every Night" />,
<MenuItem key={3} value={3} primaryText="Weeknights" />,
<Menu... | Example of how to display a floating label when a field is selected. |
import React, { Component } from 'react';
import UserItem from './UserItem';
import MyAction from '../../state/action';
class Contacts extends Component {
render() {
var state = MyAction.getState();
var userid = state.userid;
var users = state.users.filter((user) => {
return user.id != userid;
... | The Contacts component is a component that renders a list of users. |
import React, { Component } from 'react';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
<div className="App-header">
<h2>Welcome to React</h2>
</div>
<p className="App-intro">
To get started, edit <code>src/App.js</co... | The base class for the missing components. |
/**
* 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.
*/
import React from 'react';
import tiniestCat from './assets/tiniest-cat.jpg';
export default () => (
<img id="feature-image-inclusion... | Missing feature image inclusion |
/**
* 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 packageJSON from '../../package.json';
let version = packageJSON.version;
if (/docs/.test(version)) {
version = version.split('-')[0];
}
const PageHeader = React.createClass({
render() {
return (
<footer className="bs-docs-footer" role="contentinfo">
<div c... | A page header for a single node in the hierarchy of nodes. |
import React from 'react';
import { shape, func, string } from 'prop-types';
import { observer } from 'mobx-react';
const IndicatorComponent = observer(({ indicator, type }) => {
if (indicator.get()) {
return <span>({type})</span>;
}
return null;
});
IndicatorComponent.propTypes = {
indicator: shape({ ge... | A component that is rendered when a node is missing a required property. |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call &... | Creates a Router component that stores location in memory. |
import React from 'react';
import Icon from '../Icon';
export default class ViewModuleIcon extends Icon {
getSVG(){return <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M8 22h10V10H8v12zm0 14h10V24H8v12zm12 0h10V24H20v12zm12 0h10V24H32v12zM20 22h10V10H20v12zm12-12v12h10V1... | The view module icon is a class that exports a sequence of icons. |
import React from 'react'
import { Component } from 'react'
let assetsPrefix = process.env.DEV? '..': '.'
class Button extends Component{
constructor(props){
super(props);
let picName = (this.props.status === false || this.props.status === undefined? this.props.name: this.props.name+"-done");
... | Button class for button - done and button - on. |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import merge from 'deep-assign';
import { Container } from 'native-base';
import processBarcode from './services/processBarcode';
import { ReverseCameraIcon, ReverseCameraActiveIcon, FlashCameraIcon, Fla... | Component that is rendered when a button is clicked on a capture scene. |
import React from 'react'
import { WebView } from 'react-native'
export const Feedback = () => {
return (
<WebView
source={{uri: 'https://goo.gl/forms/IxVqYmchYVrHkNLq2'}}
style={{flex: 1}}
/>
)
}
| export from react - native |
import React from 'react';
function getTable(max = 30) {
let table = [];
for (let i = 0; i < max; i++) {
table[i] = [1];
for (let j = 1; j < max; j++) {
const next = table[i][j - 1] - Math.random() * table[i][j - 1] / 10;
table[i].push(next.toFixed(4));
}
}
return table;
}
function get... | The base class for generating unique cells. |
import React, { Component } from 'react';
import { GOLD, BLACK } from './colors';
class Counter extends Component {
constructor(props) {
super(props);
this.state = { counter: 0 };
this.interval = setInterval(() => this.tick(), 2000);
}
tick() {
this.setState({
counter: this.state.counter +... | A component that is rendered by a counter component. |
import React, { Component } from 'react';
export default class HelloWorld extends Component {
render () {
return <h1>Hello World</h1>;
}
}
| The default implementation of a critical class that renders a Hello World page. |
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import styled from 'react-emotion';
import { BOOKMARK_TYPES } from '../../constants';
import { clearAllBookmarks, getAllBookmarks, updateBookmarkTitle } from '../../bookmarks';
import { Textfield, Butt... | The Bookmarks component which is used to display a list of bookmarks and a list of bookmarks. |
import React from 'react';
import PropTypes from 'prop-types';
import ChartByDayOfTheWeek from '../../components/ChartByDayOfTheWeek';
import ChartByHour from '../../components/ChartByHour';
import ChartDaysWithout from '../../components/ChartDaysWithout';
import ChartHistogram from '../../components/ChartHistogram';
i... | Displays a calendar table with a series of all possible frequency - related components. |
/* Dependencies */
import React from 'react'
import PropTypes from 'prop-types'
import { sprintf } from 'sprintf-js'
/**
* @package Gravity PDF
* @copyright Copyright (c) 2021, Blue Liquid Designs
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 6.0
*/
/**
* Disp... | Display information for drop box font variant label |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let MapsLocalPlay = (props) => (
<SvgIcon {...props}>
<path d="M20 12c0-1.1.9-2 2-2V6c0-1.1-.9-2-2-2H4c-1.1 0-1.99.9-1.99 2v4c1.1 0 1.99.9 1.99 2s-.89 2-2 2v4c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-4c-1.1 0-2-.9-2-2zm-4.... | A component that exports a sequence of icons that can be played on the screen. |
import React from 'react';
import SvgIcon from '../../SvgIcon';
const MapsDirectionsBus = (props) => (
<SvgIcon {...props}>
<path d="M4 16c0 .88.39 1.67 1 2.22V20c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h8v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1.78c.61-.55 1-1.34 1-2.22V6c0-3.5-3.58-4-8-4s-8 .5-8 4v10zm3.5 1c-.83 0-1.5... | A component that exports a sequence of icons that can be used to render a sequence of maps. |
// Browser entry point, for Webpack. We'll grab the browser-flavoured
// versions of React mounting, routing etc to hook into the DOM
// ----------------------
// IMPORTS
/* NPM */
// Enable async/await and generators, cross-browser
import 'regenerator-runtime/runtime';
// Patch global.`fetch` so that Apollo calls... | This is the main entry point for the HOC. |
import React from 'react';
export default class UserProfile {
render() {
return (
<dl>
<dt>Фамилия:</dt><dd>{this.props.lastName}</dd>
<dt>Имя:</dt><dd>{this.props.firstName}</dd>
<dt>Отчество:</dt><dd>{this.props.middleName}</dd>
</dl>
);
}
}
| The default user profile class. |
import React from 'react';
import classNames from 'classnames';
import AffixMixin from './AffixMixin';
const Affix = React.createClass({
mixins: [AffixMixin],
render() {
let holderStyle = {
top: this.state.affixPositionTop,
// we don't want to expose the `style` property
...this.props.style... | The base class for a single node. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.