code stringlengths 26 5k | intent stringlengths 3 2.56k |
|---|---|
import React from 'react'
class BuyButton extends React.Component {
render() {
let starIndex = this.props.starIndex;
return(
<button onClick={(event) => this.props.onBuyClick(event, starIndex)}>Buy star</button>
)
}
}
export default BuyButton
| BuyButton class extends React. Component and renders a button that will buy a star. |
/**
* NotFoundPage
*
* This is the page we show when the user visits a url that doesn't have a 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... | NotFoundPage - The page we show when the user visits a url that doesn t have a route . |
import React from 'react';
/**
* Page loading component that hides all content on the screen.
*/
const PageLoading = React.createClass({
render () {
return (
<div className="page-loading-wrapper">
<div className="sk-folding-cube">
<div className="sk-cube1 sk-cube"></div>
... | Page loading component that hides all content on the screen. |
import React from 'react';
import PropTypes from 'prop-types';
import TextInput from '../TextInput';
/** Full Name input with integrated label to enforce consistency in layout, error display, label placement, and required field marker. */
function FullNameInput({htmlId, onChange, ...props}) {
return (
<TextInput... | Full name input with integrated label to enforce consistency in layout error display label placement and required field marker. |
import React from 'react'
import { Image, Reveal } from 'shengnian-ui-react'
const RevealExampleMoveRight = () => (
<Reveal animated='move right'>
<Reveal.Content visible>
<Image src='/assets/images/wireframe/square-image.png' size='small' />
</Reveal.Content>
<Reveal.Content hidden>
<Image s... | Example of moving a node right on a system. |
import React from 'react';
import { inject, observer } from 'mobx-react';
import { Card, CardTitle, CardText, CardSubtitle, CardImg } from "reactstrap";
import { Button } from 'react-bootstrap';
import { LinkContainer } from 'react-router-bootstrap';
ActivityList.propTypes = {
items: React.PropTypes.array.isRequire... | The activity list for the missing - user - related components. |
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, Link, hashHistory, IndexRoute } from 'react-router';
import style from './main.scss';
import Header from './components/Header';
import Layout from './components/Layout';
class App extends React.Component {
render() {
return (
... | This module is used to render a single application. |
import React from 'react'
import { storiesOf } from '@storybook/react-native'
import { action } from '@storybook/addon-actions'
import { linkTo } from '@storybook/addon-links'
import UserConnect_4 from 'app/components/UserConnect_4'
storiesOf('UserConnect_4', module)
.add('default', () => (
<UserConnect_4
butt... | Imports a bunch of components from a module. |
import React from 'react';
import { Link } from 'react-router';
const styles = {};
class GlobalNav extends React.Component {
static defaultProps = {
user: {
id: 1,
name: 'Ryan Florence'
}
};
constructor (props, context) {
super(props, context);
this.logOut = this.logOut.bind(this);... | A component that is rendered when a user enters a calendar. |
import React from 'react';
import PropTypes from 'prop-types';
export default function FlatFieldset({ label, children }) {
return (
<>
<h6>{label}</h6>
{children}
</>
);
}
FlatFieldset.propTypes = {
label: PropTypes.string,
children: PropTypes.node
};
| A fieldset that can be used to show a single node in a tree. |
import _ from 'lodash';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import PropTypes from 'prop-types';
import React from 'react';
import Notification from '../components/Notification';
import { getLayout, getMuiTheme } from '../selectors/index';
import connect from '../utils/reduxers';
import ... | The main layout component is the layout of the application. It is the main layout of the application. |
import Component from 'react-pure-render/component';
import React from 'react';
// When UI renders thousands components, it's useful to check render time.
// Example:
// @logRenderTime
// export default class App extends Component {}
export default function logRenderTime(BaseComponent) {
return class LogRenderTim... | The base class for logging render time of a component. |
import React from 'react'
import Footer from './Footer'
import AddTodo from './AddTodo'
import VisibleTodoList from './VisibleTodoList'
import './App.css';
const App = () => (
<div>
<AddTodo />
<VisibleTodoList />
<Footer />
</div>
)
export default App
| export a single node |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { withStyles } from 'material-ui/styles';
import Input, { InputLabel } from 'material-ui/Input';
import { MenuItem } from 'material-ui/Menu';
import { FormControl } from 'material-ui/Form';
import Select from 'material-ui/Select';
impo... | A component that can be used to filter a page by sequence number. |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import LibRecorder from 'react-recorder';
const STATE_IDLE = 'idle',
STATE_RECORDING = 'recording';
class Recorder extends Component {
constructor(props) {
super(props);
this.state = {
recordState: 'idle'... | Component that displays a record of a sequence of events. |
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react';
import withStyles from 'isom... | Provides a way to render a single node in the hierarchy of a React component. |
import React from 'react';
import SvgIcon from '../../SvgIcon';
const EditorBorderAll = (props) => (
<SvgIcon {...props}>
<path d="M3 3v18h18V3H3zm8 16H5v-6h6v6zm0-8H5V5h6v6zm8 8h-6v-6h6v6zm0-8h-6V5h6v6z"/>
</SvgIcon>
);
EditorBorderAll.displayName = 'EditorBorderAll';
EditorBorderAll.muiName = 'SvgIcon';
exp... | The EditorBorderAll export function |
// @flow
import React from 'react';
import styled from 'styled-components';
import { Errors, WrapActions } from '../components';
import { defaultSpaceInBetween } from '../styles/vars';
import { map, values } from 'ramda';
import Button from 'material-ui/Button';
import TextField from 'material-ui/TextField';
import ty... | A component that displays a single secondary secondary |
import React from 'react';
import SPELLS from 'common/SPELLS';
import TalentStatisticBox from 'parser/ui/TalentStatisticBox';
import STATISTIC_ORDER from 'parser/ui/STATISTIC_ORDER';
import Events from 'parser/core/Events';
import Analyzer, { SELECTED_PLAYER } from 'parser/core/Analyzer';
/**
* Example Report: https:... | A base class for the master of the glaives analysis. |
import {SplitContext} from './splitContext'
import Portal from 'widget/portal'
import PropTypes from 'prop-types'
import React from 'react'
import _ from 'lodash'
import styles from './splitView.module.css'
export class SplitOverlay extends React.Component {
render() {
const {area, children} = this.props
... | A component that can be rendered as a child of a node in a split view. |
import React, { Component } from 'react';
import { List } from '@extjs/ext-react';
Ext.require('Ext.MessageBox');
export default class DisclosureListExample extends Component {
store = Ext.create('Ext.data.Store', {
autoLoad: true,
proxy: {
type: 'rest',
url: 'resources/d... | Example of a list of items that can be disclosured. |
import React from 'react';
import PropTypes from 'prop-types';
const addModifiers = modifiers =>
modifiers
.split(' ')
.map(x => `liveblog-btn--${x}`).join(' ');
const Button = ({ children, click, type, modifiers, onMouseDown }) => (
<span onMouseDown={onMouseDown ? e => e.preventDefault() : null}>
<b... | Create button which can be used to hide a button on a button s children. |
import React from 'react';
import ReactDOM from 'react-dom';
import { Meteor } from 'meteor/meteor';
import {
Row,
Col,
Grid,
Form,
Alert,
Button,
Checkbox,
FormGroup,
FormControl } from '@sketchpixy/rubix';
export default class TodoForm extends React.Component {
state = {
errors: [],
};
... | A component that creates a todo form. |
import React from 'react'
import { connect } from 'react-redux'
import { Flex } from 'rebass'
import styled from 'styled-components'
import cs from 'classnames'
import titleCase from 'title-case'
import defined from 'defined'
import Directory from 'Components/Directory/'
const Root = styled.div`
& .dirs {
heigh... | Component which is a component that can be rendered on a specific node. |
import React from 'react';
import IconBase from './../components/IconBase/IconBase';
export default class AndroidFilm extends React.Component {
render() {
if(this.props.bare) {
return <g>
<path fill="#010101" d="M376,64v42.667h-40V64H176v42.667h-40V64H96v384h40v-42.666h40V448h160v-42.666h40V448h40V64H376z
M176,... | AndroidFilm component that renders a single node in a hierarchy. |
import React from 'react';
import PropTypes from 'prop-types';
import TableCell from '@material-ui/core/TableCell';
import { makeStyles } from '@material-ui/core/styles';
import { truncateLength } from '../../../helpers';
const useStyles = makeStyles({
title: {
whiteSpace: 'nowrap',
overflow: 'hidden',
t... | The default layout for a single node |
/*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 the base App class with a hidden hidden |
// jshint ignore:start
import React from 'react';
export default function(props) {
return (
<select
className={props.className || 'form-control'}
disabled={props.disabled || false}
id={props.id || null}
onChange={props.onChange}
value={props.value}
>
{props.choices.map((it... | default component that renders a single missing - missing |
import React from 'react'
import { Header, Image } from 'semantic-ui-react'
const HeaderExampleImage = () => (
<Header as='h2'>
<Image shape='circular' src='http://semantic-ui.com/images/avatar2/large/patrick.png' />
{' '}Patrick
</Header>
)
export default HeaderExampleImage
| Example of missing - block |
import React, { Component } from 'react';
import ReactGridLayout from 'react-grid-layout';
import SocketIOClient from 'socket.io-client';
import dragIcon from '../images/cursor-move-black.png';
import Log from './log.js';
import Status from './status.js';
import Progress from './progress.js';
import { logElements, stat... | The main app class |
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { withKnobs, boolean } from '@storybook/addon-knobs';
import { Radio } from '@appearhere/bloom';
const stories = storiesOf('FormComponents', module);
stories.addDecorator(withKnobs);
stor... | Add a decorator to the NestedForms class to allow for a specific component to be hidden or hidden. |
import React from 'react';
import Editor from '@components/Base/Editor';
import {
EDITOR_EVENTS,
EDITOR_REACT_EVENTS,
EVENT_BEFORE_ADD_PAGE,
EVENT_AFTER_ADD_PAGE,
} from '@common/constants';
import { pick } from '@utils';
import Global from '@common/Global';
import GGEditorContext from '@common/context/GGEditor... | A component that implements a GGEditor. |
import React from 'react';
import { render } from 'react-dom';
// It's important to not define HelloWorld component right in this file
// because in that case it will do full page reload on change
import HelloWorld from './HelloWorld.jsx';
render(<HelloWorld />, document.getElementById('react-root'));
| Imports a component from a file that has no react - dom. |
import React from 'react';
class ImgFigure extends React.Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
getImgeStyle(){
let styleObj = {};
/* 如果props属性中指定了这张图片的位置,则使用 */
if(this.props.arrange.pos) {
styleObj = this.props.arrange.pos;
... | A component that renders a single image in a figure. |
import React from 'react';
import PropTypes from 'prop-types';
import { FormControl } from 'react-bootstrap';
import withIntl from '../lib/withIntl';
import { FormattedMessage } from 'react-intl';
import { getStripe } from '../lib/stripe';
class InputTypeCreditCard extends React.Component {
static propTypes = {
... | A component that can be used to create a credit card. |
/* @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 IconHotel(props: IconProps) {
const iconProps = {
rtl: false,
...props
};
return (
<Icon {...iconProps}>
... | A hotel - based hotel that shows a link to a map. |
import React from 'react';
import { Provider } from 'react-redux';
import App from './containers/App';
import configureStore from './store/configureStore';
const store = configureStore();
React.render(
<Provider store={store}>
{() => <App />}
</Provider>,
document.getElementById('root')
);
| Imports a single node in the hierarchy. |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Debounced from './../services/Debounced';
class Dropdown extends Component {
input = null;
componentDidMount() {
//Debounced.start(`update-of-${this.props.id}`, () => (this.input.value = this.props.value), 300);
//this.inp... | A dropdown component that can be used to select multiple options. |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
FlatList,
Image,
StyleSheet,
Text,
TouchableOpacity,
View,
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
const styles = StyleSheet.create({
list: {
paddingVertical: 8,
},
item... | A component that is rendered when a user has selected a key. |
import React from 'react';
import './styles.scss';
export default function({ onClick }) {
return (
<button type="button" className="next-btn" onClick={onClick}>Далее</button>
);
}
| A default function to create a menu with a button that will be clicked on next button. |
/**
* This file provided by Facebook is for non-commercial testing and evaluation
* purposes only. Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNES... | This file is used to render a single node in a network. |
import React from 'react';
import { Surface, CartesianGrid } from 'recharts';
export default React.createClass({
render () {
let horizontalPoints = [10, 20, 30, 100, 400];
let verticalPoints = [100, 200, 300, 400];
return (
<Surface width={500} height={500}>
<CartesianGrid
width=... | create a single object with a default render function |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageBrush = (props) => (
<SvgIcon {...props}>
<path d="M7 14c-1.66 0-3 1.34-3 3 0 1.31-1.16 2-2 2 .92 1.22 2.49 2 4 2 2.21 0 4-1.79 4-4 0-1.66-1.34-3-3-3zm13.71-9.37l-1.34-1.34c-.39-.39-1.02-.39-1.41 0L9 12.25... | A component that renders a block of icons that can be used to render a block of icons. |
import React from 'react';
const Image = (props) => <img style={props.style} className={props.classNames.join(' ')} alt={props.alt} src={props.src} />;
Image.propTypes = {
style: React.PropTypes.object,
classNames: React.PropTypes.array,
alt: React.PropTypes.string,
src: React.PropTypes.string,
};
export def... | A component that exports a single image that is not part of a component that has no children. |
import PureComponent from '../components/purecomponent.react';
import React from 'react';
import TodoItem from './todoitem.react';
import immutable from 'immutable';
export default class TodoList extends PureComponent {
render() {
return (
<ol>
{this.props.todos.map((todo, i) =>
<TodoIte... | A component that renders a list of todos. |
import React, { Component } from 'react';
import { connect } from 'react-redux'
import history from '../core/history';
import io from 'socket.io-client';
import * as actions from '../actions/stats';
const mapStateToProps = (state) => {
return { }
};
const mapDispatchToProps = (dispatch) => {
return {
update... | Component that is a component that reacts to a system health state and a system health state. |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { searchQuery } from "../api/queries";
import Select from './Select';
import {
changeSearchOffset,
changeSearchOffsetEnd,
changeCurrentPage,
changeSortType,
} from '../actions';
class SearchSort extends Component {
compon... | The base component for sorting a list of items. |
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import StatusContent from '../../../components/status_content';
import Avatar from '../../../components/avatar';
import Relative... | A modal modal component that shows a list of actions that can be shown on the modal screen. |
import React from 'react';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
import RaisedButton from 'material-ui/RaisedButton';
/**
* Dialog with action buttons. The actions are passed in as an array of React objects,
* in this example [FlatButtons](/#/components/flat-button... | A component that displays a simple dialog with action buttons. |
import React from 'react';
import Layout from '../components/Layout';
export default class About extends React.Component {
render() {
return (
<Layout>
<div className="mdl-cell--2-col"></div>
<div className="mdl-card mdl-cell mdl-cell--8-col mdl-shadow--2dp">
... | A component that displays a single sequence of |
import React from 'react'
import PropTypes from 'prop-types'
import Product from './Product'
const ProductItem = ({ product, onAddToCartClicked }) => (
<div style={{ marginBottom: 20 }}>
<Product
title={product.title}
price={product.price}
inventory={product.inventory} />
<button
onCl... | export a single product item in the cart |
import React from 'react';
import { View, Image } from 'react-native';
import PropTypes from 'prop-types';
import Images from '../../../Images';
import styles from './styles';
const Avatar = ({ icon, small }) => (
<View style={[small ? styles.smallAvatar : styles.avatar]}>
<Image
resizeMode="contain"
... | export default Avatar |
import React from 'react';
import { Router, Route, Link, History } from 'react-router';
var App = React.createClass({
mixins: [ History ],
getInitialState() {
return {
tacos: [
{ name: 'duck confit' },
{ name: 'carne asada' },
{ name: 'shrimp' }
]
};
},
addTaco() {... | The main function that creates a component that can be used to render a taco page. |
// @flow
import React from 'react';
import throttle from 'lodash/throttle';
// ================================================
// Declarations
// ================================================
type Props = {
children: Function, // function-as-a-child
};
type State = {
height: ?number,
};
// ==================... | A component that measures the height of a node in a hierarchy. |
import React from 'react'
import Base from './Base'
import config from './config'
/**
* Dot indicator buttons for use in carousels
*/
const DotIndicator = ({
length,
active,
onClick,
children,
...props
}, { rebass }) => {
const { scale } = { ...config, ...rebass }
const sx = {
root: {
disp... | A component that displays a dot indicator for a single node. |
import moment from 'moment';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import Button from 'react-bootstrap/lib/Button';
import injectT from '../../i18n/injectT';
import { hasProducts } from '../../utils/resourceUtils';
import { getUnitRoleFromResource, getIsUnitStaff } from '../../.... | A component that can be used to render a reservation. |
import React from 'react';
import classNames from 'classnames';
import SafeAnchor from './SafeAnchor';
const MenuItem = React.createClass({
propTypes: {
header: React.PropTypes.bool,
divider: React.PropTypes.bool,
href: React.PropTypes.string,
title: React.PropTypes.string,
target: ... | Create a menu item with a dropdown menu. |
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
export function getAuthPropType() {
return ImmutablePropTypes.mapContains({
token: React.PropTypes.string,
status: React.PropTypes.string,
username: React.PropTypes.string,
message: React.PropTypes.string,
admi... | Get the type of the component that is not part of the system. |
import React, { Component } from 'react';
import { Nav, Navbar } from 'react-bootstrap';
import SortNavbar from '../../components/SortNavbar/SortNavbar';
import NavDropdownComponent from '../../components/NavDropdownComponent/NavDropdownComponent';
import { tagsMenuItems, timeMenuItems } from './menuItems';
import { bi... | A component that can be used to show a dropdown of tags and time - dropdowns. |
/**
* app.js
*
* This is the entry file for the application, only setup and boilerplate
* code.
*/
import 'babel-polyfill';
/* eslint-disable import/no-unresolved, import/extensions */
// Load the manifest.json file and the .htaccess file
import '!file?name=[name].[ext]!./manifest.json';
import 'file?name=[name].... | This module is responsible for importing the main application s JS files. |
import React from 'react';
import {Route, DefaultRoute} from 'react-router';
import Login from 'views/login';
import Signup from 'views/signup';
import Forgot from 'views/forgot';
import Account from 'views/account';
import Application from 'views/application';
import Calculator from 'views/calculator';
import Logout... | Imports a single package of the React module. |
import React from 'react'
import { createHistory, useBasename } from 'history'
import { Router, Route, Link } from 'react-router'
import data from './data'
require('./app.css')
const history = useBasename(createHistory)({
basename: '/sidebar'
})
class Category extends React.Component {
render() {
const categ... | The main logic for the hierarchy hierarchy. |
require('normalize.css/normalize.css');
require('styles/App.css');
import React from 'react';
let imageData =(function(){
var arr = [];
for(let i=0; i<16; i++){
arr[i] = {};
arr[i].url = require('../images/' + (i+1) + '.jpg');
arr[i].title = (i+1) + '.jpg';
arr[i].detail = '我是:'... | JSDSP - 262 |
import React from 'react';
export default class Footer extends React.Component {
render() {
return(
<footer class="text-center">
<div class="footer-above">
<div class="container">
<div class="row">
<div class="footer-col col-md-4">
<h3>Location</h3>
<p>3481 Melro... | Create a new component with the given name and description. |
import React from 'react';
import Paper from 'material-ui/Paper';
const style = {
height: 100,
width: 100,
margin: 20,
textAlign: 'center',
display: 'inline-block',
};
const PaperExampleCircle = () => (
<div>
<Paper style={style} zDepth={1} circle={true} />
<Paper style={style} zDepth={2} circle={... | A component that renders a single in a pretty way. |
import React from 'react'
import PropTypes from 'prop-types'
import axios from 'axios'
// import { useI18n } from '../I18n'
import { path } from '../../Routes'
import Store from './Store'
import styles from './Size.module.css'
Size.propTypes = {
variantId: PropTypes.number.isRequired,
size: PropTypes.object.isR... | UI for missing missing - node - js |
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 &... | Create a new browser router component that can be used to render a browser history. |
'use strict';
import React from 'react';
import { FormattedMessage } from 'react-intl';
import translate from 'app/global/helper/translate';
import { graphql } from 'react-apollo';
import GetAllBoardsQuery from 'app/graphql/queries/boards/All';
import Loading from 'app/components/common/Loading';
import Heading from... | This module is exported to the dashboard component. It is exported to the dashboard component. |
/**
* External dependencies
*/
import ReactDom from 'react-dom';
import React from 'react';
import includes from 'lodash/includes';
import page from 'page';
import i18n from 'i18n-calypso';
/**
* Internal dependencies
*/
import analytics from 'lib/analytics';
import route from 'lib/route';
import userSettings from... | The main function for all components that are not part of the main application. |
import React, { Component } from 'react';
import CartItem from './CartItem';
import CartResult from './CartResult';
class Cart extends Component {
render() {
var { children } = this.props;
return (
<section className="section">
<div className="table-responsive">
<table classNa... | Component - > Cart |
import React from 'react';
import LatestList from '../models/latest';
import Item from './item'
import Pager from './pager'
var latest = new LatestList();
export default class Recommend extends React.Component {
constructor(props){
super(props);
latest.addEventListener('loaded', ()=>{this.reload()});
t... | A Recommend component that renders a list of items that are currently in the latest list. |
// React: https://github.com/facebook/react/releases/tag/v0.14.7
import React from 'react';
import { render } from 'react-dom';
import Dashboard from './components/dashboard/dashboard';
render((
<Dashboard />
), document.getElementById('root'));
| This is a hack to work around the fact that React doesn t render a single in the DOM. |
import React from 'react';
import SvgIcon from '../../SvgIcon';
const ContentSort = (props) => (
<SvgIcon {...props}>
<path d="M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"/>
</SvgIcon>
);
ContentSort.displayName = 'ContentSort';
ContentSort.muiName = 'SvgIcon';
export default ContentSort;
| The default content sort function for missing nodes. |
import React from 'react';
import RegularPage from '../RegularPage';
import Link from '../../components/Link';
import Story from '../../components/Story';
import Icon from '../../components/Icon';
import Wrapper from '../../components/Wrapper';
import { iconWfpHumEmergencyResponsePos } from '@wfp/icons';
import markdow... | Exports a regular page which displays a 404 page if the user is not able to find a 404 page. |
import {render} from 'react-dom'
import React from 'react'
import App from './App.jsx'
const containerEl = document.getElementById("container")
render(<App/>, containerEl)
| Renders a single element in the container. |
import React from 'react';
class LoadingSpinner extends React.Component {
render() {
return (
<div className="alert alert-info" role="alert">
<span className="glyphicon glyphicon-refresh glyphicon-spin"></span>
{this.props.children}
</div>
... | LoadingSpinner class. |
import React from 'react';
import {calculateScore} from '../utils/score';
/**
* Game scoreboard.
*/
export default class Scoreboard extends React.Component {
/**
* Create the score items list.
*/
scoreItems(items, key) {
let index = 0;
return items.map((turn) => {
const thisKey = `${key}${ind... | The scoreboard component. |
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import socket from 'socket.io-client';
import Immutable from 'immutable';
import {createStore} from 'redux';
import {Provider} from 'react-redux';
import tweets from './tweets';
import {ADD_TWEET, addTweet} from './actions';
import { ... | Imports a single component in the browser. |
import React from 'react';
import { Route } from 'react-router-dom';
import NotFound from './container/NotFound';
export const NotFoundRoute = ({ store, ...rest }) => {
return (
<Route {...rest} render={(props) => {
return (
<NotFound {...props} />
)
}} />
)
}
export default NotFoundRoute;
| This module is used to export a 404 route to a router. |
/*
#########################################################################
#
# Copyright (C) 2019 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | Displays a single missing - missing record in the system if it is missing. |
import React from 'react';
import Slider from 'material-ui/Slider';
const SliderExampleDisabled = () => (
<div>
<Slider disabled={true} />
<Slider disabled={true} value={0.5} />
<Slider disabled={true} value={1} />
</div>
);
export default SliderExampleDisabled;
| Provides a function to disable the dropdown dropdown for a single . |
import React from 'react';
import NavMain from './NavMain';
import PageHeader from './PageHeader';
import PageFooter from './PageFooter';
export default class Page extends React.Component {
render() {
return (
<div>
<NavMain activePage="support" />
<PageHeader
title="Nee... | The default implementation of a single page that can be used to render a single page. |
// Must import this first to set up monkey patching.
import isoMarty from './src/isoflux';
import express from 'express';
import {ApplicationContainer} from 'marty';
import React from 'react';
import EchoComponent from './src/EchoComponent';
const app = express();
app.use(isoMarty.middleware);
app.get('/', function... | Monkey patching for the nginx app |
// @flow
import React from 'react';
class Foo extends React.Component<{children: Array<string>}, void> {}
<Foo>{...["a", "b"]}</Foo>
| A component that is not part of a chain of children can be found in a chain of children. |
import React from 'react';
import styles from './styles.css';
const Label = ({ propKey, type, ...otherProps }) => (
<div {...otherProps} className={styles.root}>
<div className={styles.type}>{type}</div>
<div className={styles.propKey}>{propKey}</div>
</div>
);
export default Label;
| export a label for a |
import React, { Component } from 'react';
import { Line } from 'rc-progress';
import Form from 'shared/components/form/form';
import PropTypes from 'prop-types';
import FormSelect from 'shared/components/form/formSelect/formSelect';
import { MILSTATUS, BRANCH } from 'shared/constants/status';
import styles from './form... | A component that displays a single Military state. |
import React from 'react';
import {each, findIndex} from 'lodash';
import { LeftNav, Menu } from 'material-ui';
export default class AccountMenu extends React.Component {
render() {
let {accounts} = this.props;
let menuItems = [{ text: 'Accounts', type: "SUBHEADER"}];
each(accounts.byAddress, (accoun... | Menu for accounts |
/**
* Created by zhoutk on 17-4-18.
*/
import React, { Component } from 'react';
// import styled from 'styled-components';
import './Home.css';
class Home extends Component {
render() {
return (
<div>
<h2>HELLO</h2>
<p>Cras facilisis urna ornare ex volutpat, ... | Component that is a subclass of a base class for all of the nec - sequence - related components. |
import 'core-js/fn/object/assign';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/Main';
// Render the main component into the dom
ReactDOM.render(<App />, document.getElementById('app'));
| Renders the main component into the main DOM. |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { login } from '../Actions/AuthActions';
class LoginForm extends Component {
constructor(props) {
super(props);
this.state = {
username: '',
errors: {},
isLoading: false,
... | A component that can be used to login a user. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionInfoOutline = (props) => (
<SvgIcon {...props}>
<path d="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h... | A component that renders a series of action - related icons. |
import React from 'react';
import _ from 'lodash';
import VisibilityStore from 'stores/VisibilityStore';
import MessageActionCreators from 'actions/MessageActionCreators';
import MessageItem from 'components/common/MessageItem.react';
let _delayed = [];
let flushDelayed = () => {
_.forEach(_delayed, (p) => {
... | The MessagesSection component is a component that can be used to show a message in a single month. |
import React, { Component } from 'react';
export default class SettingsPage extends Component {
render() {
return (
<div />
);
}
}
| The default settings page class. |
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ConversationContainer from '../containers/conversation_container';
import ScrollableList from '../../../components/scroll... | A component that can be used to display a list of conversations. |
import React from 'react';
class Star extends React.Component{
constructor(props) {
super(props);
this.onMouseOver = this.onMouseOver.bind(this);
this.onMouseOut = this.onMouseOut.bind(this);
this.onClick = this.onClick.bind(this);
}
onMouseOver(e){
this.props.MouseOver(this.props.id);
}
onMouseOut(e){
... | The Star component |
/*
* 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 Odometer from './Odomet... | A component that exports a single missing missing value in a tree. |
import React from 'react';
import {Menu , Icon, Button , Modal ,Badge } from 'antd'
import backService from '../../service/backService';
import PubSub from 'pubsub-js';
import {redirect} from '../../util/function.js';
import moment from 'moment'
const SubMenu = Menu.SubMenu;
var BackSlider=React.createClass({
getInit... | The main menu for the user. |
import React from 'react';
import Navigation from './header/navigation'
import Breadcrumbs from './header/breadcrumbs'
class Template extends React.Component {
render() {
return (
<div>
<Navigation />
<Breadcrumbs />
<div>
{thi... | Package that exports a template with a series of children. |
import React from 'react';
import SvgIcon from '../../SvgIcon';
const ImageFilterBAndW = (props) => (
<SvgIcon {...props}>
<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16l-7-8v8H5l7-8V5h7v14z"/>
</SvgIcon>
);
ImageFilterBAndW.displayName = 'ImageFilterBAndW';
ImageFil... | A filter that creates a component that can be used to filter images by a specific component. |
import React from 'react'
class Dashboard extends React.Component {
render() {
return (
<div>
<h3>Course Dashboard</h3>
</div>
)
}
}
export default Dashboard
| The default dashboard implementation. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.