code
stringlengths
26
5k
intent
stringlengths
3
2.56k
import React from 'react'; import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn, } from 'material-ui/Table'; /** * A simple table demonstrating the hierarchy of the `Table` component and its sub-components. */ const TableExampleSimple = () => ( <Table> <TableHeader> ...
A simple table demonstrating the hierarchy of the Table component and its sub - components.
import React from 'react'; import classNames from 'classnames'; import Icon from '../../Icon'; /* |-------------------------------------------------------------------------- | ToggleButton |-------------------------------------------------------------------------- | | Stateless component | */ const ToggleButton = () ...
Demonstrate how to toggle a single node in a system.
import React from 'react'; import mixpanel from 'utils/Mixpanel'; import MyProfileActions from 'actions/MyProfileActions'; import LoginActionCreators from 'actions/LoginActionCreators'; import AvatarItem from 'components/common/AvatarItem.react'; import MyProfileModal from 'components/modals/MyProfile.react'; import ...
The main header section for a specific user.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let NotificationRvHookup = (props) => ( <SvgIcon {...props}> <path d="M20 17v-6c0-1.1-.9-2-2-2H7V7l-3 3 3 3v-2h4v3H4v3c0 1.1.9 2 2 2h2c0 1.66 1.34 3 3 3s3-1.34 3-3h8v-2h-2zm-9 3c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1...
NotificationRvHookup is a function that can be used to lookup a specific element in a hierarchy.
import React from 'react'; import classNames from 'classnames'; const Glyphicon = React.createClass({ propTypes: { /** * bootstrap className * @private */ bsClass: React.PropTypes.string, /** * An icon name. See e.g. http://getbootstrap.com/components/#glyphicons */ glyph: Re...
The main function of the bootstrap component.
import React from 'react'; import { FormattedMessage } from 'react-intl'; import './Hero.less'; const Hero = () => (<div className="Hero"> <div className="container container-small"> <h1 className="hero-message"> <FormattedMessage id="hero" defaultMessage="Ensuring compensation for the creators of ...
The Hero class.
import React from 'react' import { Link } from 'react-router' export class AboutView extends React.Component { render () { return ( <div className='container text-center'> <h1>This is the about view!</h1> <hr /> <Link to='/'>Back To Home View</Link> </div> ) } } export ...
A component that displays a about view.
/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /* @flow */ import React, { Component } from 'react'; import { black } from '../styles'; import type { Node as ReactNode } from 'react'...
The base class for a node in the source tree.
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 renders a dropdown list item.
import React from 'react'; import InlineSVG from 'svg-inline-react'; import svg from '!svg-inline-loader!../../assets/svg/radio-station.svg'; import MusicStream from '../../classes/musicStream'; import TranslationStore from '../../stores/translation'; export default class MusicPlayerComponent extends React.Component...
The MusicPlayerComponent class is a base class for all MusicPlayerComponent and is used to play a music player.
import React from 'react' import { Row, Col, Table, Button } from 'antd' import { connect } from 'react-redux' import OperationDetails from '../components/OperationDetails' import { Link } from 'react-router-dom' import { availableColumns } from '../lib/operations' class Operations extends React.Component { handleC...
A component that renders a sequence of non -
import React from 'react' export default function (data) { function scaleAndFormat (num) { return (num / data.highValTotal) * 100 + '%' } return ( <div> <div className='lineplot'> <div className='line' style={{width: scaleAndFormat(Math.abs(data.students - data.slots)), left: scaleAndFor...
default missing - node - count filter
import React from 'react'; import PropTypes from 'prop-types'; import { View, TextInput, StyleSheet, Image } from 'react-native'; import { connect } from 'react-redux'; import SearchPlaylistResult from './SearchPlaylistResult'; import { searchPlaylists } from '../../actions'; const mapStateToProps = (state, ownProps)...
The base component for a sequence of search results.
import React from 'react' import styled from 'styled-components' import Card from './card' import { media } from '../utils' const Title = styled.h3`` const Wrapper = styled.div` display: flex; overflow-x: auto; align-items: center; flex-direction: column; flex-flow: row nowrap; ${media.desktop` justif...
Imports a missing - type - specific key - set.
import React from 'react'; import style from 'modules/ui/checkbox'; class Checkbox extends React.Component { render() { const { children, ...props } = { ...this.props }; return ( <label className={ style.checkboxLabel }> <input className={ style.checkbox } type="checkbox" ...
A component that can be used to toggle a single checkbox.
import React from 'react'; import PropTypes from 'prop-types'; import { createFragmentContainer, graphql } from 'react-relay'; import { Form, Col, FormGroup, ControlLabel, FormControl, HelpBlock, Modal, Grid, Alert } from 'react-bootstrap'; import Button from 'react-bootstrap-button-loader'; impo...
The CreateUserModal component is a component that creates a new user.
/** * 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 Layout from '../../co...
Provides a function to create a new missing - missing node in the system.
import React, { Component } from 'react'; import { observer, inject } from 'mobx-react'; import CSSTransitionGroup from 'react-addons-css-transition-group' import { Button, Label, Segment } from 'semantic-ui-react'; import { DiscordIcon } from 'components/'; import classNames from 'classnames/bind'; import scss from '...
Component that creates a list of all nagios in a guild.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ContentBlock = (props) => ( <SvgIcon {...props}> <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8...
A component that exports a single node in a hierarchy.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let NotificationVoiceChat = (props) => ( <SvgIcon {...props}> <path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12l-4-3.2V14H6V6h8v3.2L18 6v8z"/> </SvgIcon> ); NotificationVoic...
A component that exports a single orphan in a group of icons.
import React from 'react'; import DomainsContainer from '../containers/DomainsContainer'; class DomainsCheckPage extends React.Component { render() { return ( <DomainsContainer /> ); } } export default DomainsCheckPage;
The DomainsCheckPage class
import React from 'react'; import { Row, Col, Button } from 'react-bootstrap'; import { Meteor } from 'meteor/meteor'; import { Loading } from '../components/loading'; import { composeWithTracker } from 'react-komposer'; import { Races } from '../../api/races.js'; import { LaneTimer } from '../components/LaneTimer'; i...
A component that displays a countdown and a time - based finish cycle.
import React from 'react'; import ScrollAnimation from 'react-animate-on-scroll'; import '../scss/components/_description.scss'; class Description extends React.Component { render() { return ( <div className='event-description'> <div className='details'> <ScrollAnimation animateOnce animateIn='fadeInU...
The description class for a single node.
import React from 'react'; import { Text } from 'grommet'; // Always should store amount in cents to avoid precision errors export const data = [ { id: 1, name: 'Eric', email: 'eric@local', amount: 3775, }, { id: 2, name: 'Chris', email: 'chris@local', amount: 5825, }, { ...
Exports a table of a single n - ary node.
import React from 'react'; import classNames from 'classnames'; import BootstrapMixin from './BootstrapMixin'; const Label = React.createClass({ mixins: [BootstrapMixin], getDefaultProps() { return { bsClass: 'label', bsStyle: 'default' }; }, render() { let classes = this.getBsClassSe...
create a label with a bootstrap class
import AccountSwitcher from './account-switcher' import ChannelSwitcher from './channel-switcher' import Main from './main' import React from 'react'; export default class Application extends React.Component { render() { return( <div className="application"> <AccountSwitcher account={this...
The application component which renders a single node in the application hierarchy.
import React from 'react' import PropTypes from 'prop-types' import styles from './cpu.less' import { color } from '../../../utils' import CountUp from 'react-countup' import { LineChart, Line, XAxis, YAxis, CartesianGrid, ResponsiveContainer } from 'recharts' const countUpProps = { start: 0, duration: 2.75, use...
Generate a tree of all non - terminal nodes that cover a single node.
import React from 'react'; import axios from 'axios'; import { Table, Header } from 'semantic-ui-react'; import ReviewListItem from './ReviewListItem'; // import { Link } from 'react-router-dom'; // import { Button } from 'semantic-ui-react'; class Reviews extends React.Component { constructor() { super(); t...
The base class for all the components that are not part of a mission.
import React from 'react'; export default class OrderBy extends React.Component { static propTypes = { orderBy: React.PropTypes.object.isRequired, handleOrderByChange: React.PropTypes.func.isRequired }; orderByChange = (event) => { if (event.target.value) { const [value, ascendingText] = event...
The default OrderBy component which sorts by age and rate.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionViewQuilt = (props) => ( <SvgIcon {...props}> <path d="M10 18h5v-6h-5v6zm-6 0h5V5H4v13zm12 0h5v-6h-5v6zM10 5v6h11V5H10z"/> </SvgIcon> ); ActionViewQuilt = pure(ActionViewQuilt); ActionViewQuilt.displayN...
A function to create a action view for a single node in a hierarchy.
import React, { Component } from 'react'; import ReactDOM from 'react-dom'; //import axios from 'axios'; import GithubSearch from './components/GithubSearch'; //import SearchBar from './components/SearchBar'; // import User from './components/User'; // import Repos from './components/Repos'; // import RepoRow from '....
Component that extends a component that is not attached to a component.
import React from 'react'; /** * A counter button: tap the button to increase the count. */ class Counter extends React.Component { constructor() { super(); this.state = { count: 0, }; } render() { return ( <button onClick={() => { this.setState({ count: this.stat...
A counter component that can be used to increase the count.
import React from 'react' import VideoListItem from './video_list_item' const VideoList = (props) => { const videoItems = props.videos.map((video) => { return <VideoListItem onVideoSelect={props.onVideoSelect} key={video.etag} video={video} /> }) return ( <ul className="col-md-4 list-group"...
React - > VideoList
import React from 'react' import Timelapse from './timelapse' import Donut from './donut' import Snapshot from './snapshot' import Fluxxor from 'fluxxor' export default React.createClass({ render: function() { var charts = this.props.charts.map(function(chart, index) { switch(chart.chartType) { case...
The main render function for the class
import React from 'react'; import BootstrapButton from 'react-bootstrap/lib/Button'; var Button = React.createClass({ render: function() { return <BootstrapButton>Button</BootstrapButton>; } }); export default Button;
The default button class is a component that can be used to render a BootstrapButton.
import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { autoPlayGif } from 'flavours/glitch/util/initial_state'; export default class AvatarOverlay extends React.PureComponent { static propTypes = { account: ImmutablePropTypes.map.isReq...
The base component for the avatar overlay.
import React from 'react' import SelectOption from '../partials/SelectOption' export default function OptionRenderer(option, index) { let style = {} if (option.virtualized) { style = { position: 'absolute', width: '100%', top: `${option.virtualizedOptionHeight * index}px`, maxHeight: `$...
OptionRenderer - Select option renderer
import React from 'react'; const LoadingPanel = () => { return ( <div key="loading-panel-panel" className="loading-panel"> <div className="loading-panel__content"> <img className="loading-panel__logo animated flipInX" alt="Voyageur logo" src="/assets/logo-medium-smooth.png" /> <div classNam...
The LoadingPanel class
/** * Function to get the shallow output for a given component * As we are using phantom.js, we also need to include the fn.proto.bind shim! * * @see http://simonsmith.io/unit-testing-react-components-without-a-dom/ * @author somonsmith */ import React from 'react'; import TestUtils from 'react-addons-test-utils'...
Get the shallow rendered component
import React, { Component } from 'react'; import { connect } from 'react-redux' import Button from '@material-ui/core/Button'; import InputIcon from '@material-ui/icons/Input'; import { selectAuthProvider } from '../../redux/ducks/app' class Login extends Component { render = () => { return ( <Button...
A component that can be used to log in in a user s login screen.
import React, { Component } from 'react'; import { Provider } from 'react-redux'; import configureStore from '../stores/configureStore'; import IndexWrapper from '../container/index'; import CommentWrapper from '../container/comment'; import DetailWrapper from '../container/detail'; import App from '../container/app'...
Imports a single component and its children.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let MapsNearMe = (props) => ( <SvgIcon {...props}> <path d="M21 3L3 10.53v.98l6.84 2.65L12.48 21h.98L21 3z"/> </SvgIcon> ); MapsNearMe = pure(MapsNearMe); MapsNearMe.displayName = 'MapsNearMe'; MapsNearMe.muiName...
Imports a series of missing components and exports them as MapsNearMe.
import React from 'react'; import { AppFabButton } from 'components/frame'; function FabButtonPres(props) { const { isLoggedIn, isOwner, onClickEdit, onClickCopy, ...rest } = props; return ( isLoggedIn && ( <AppFabButton {...{ variant: isOwner ? 'edit' : 'copy', tooltipTitle...
Demonstrates how to render a single FabButton.
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <g><path d="M21.99 8c0-.72-.37-1.35-.94-1.7L12 1 2.95 6.3C2.38 6.65 2 7.28 2 8v10c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2l-.01-10zM12 13L3.74 7.84 12 3l8.26 4.84L12 13z" /></g> , 'Drafts');
Missing element in a drafts container
import React from 'react'; // https://thenounproject.com/jngll2/uploads/?i=1219368 // Created by jngll from the Noun Project const Icon = ({ ...other }) => ( <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" className="icon" {...other}> <path d="M80.64,10.87l-.52,0-.26,0H30.64A11.24,11.24,0,0,0,19.42...
Missing - block block for the Noun project
import 'babel-polyfill'; import React, { Component } from 'react'; import { createStore, combineReducers, applyMiddleware } from 'redux'; import { Provider } from 'react-redux'; import thunkMiddleware from 'redux-thunk'; import rootReducer from './reducers'; import DashboardApp from './DashboardApp'; import createFireb...
Extend a component with a base class that implements a series of react - react
'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _classCallCheck(instance, Constructor...
A component that links to an index in a route.
import React, { Component } from 'react'; import { ProgressCircle } from 'react-desktop/macOs'; export default class extends Component { render() { return ( <ProgressCircle size={25}/> ); } }
A component that can be rendered by a component that is not rendered by a component.
'use strict' import React from 'react' import QueueControls from './QueueControls' import Icon from '../Icon' var tabs = [ 'playlist', 'queue', 'chat', 'users' ] export default class MainContainerTabBar extends React.Component { constructor(props) { super(props) this.state = { activeTab: this.prop...
A component that displays a tab bar in a modal window.
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 modal body component that renders a bootstrap bootstrap bootstrap box.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageStyle = (props) => ( <SvgIcon {...props}> <path d="M2.53 19.65l1.34.56v-9.03l-2.43 5.86c-.41 1.02.08 2.19 1.09 2.61zm19.5-3.7L17.07 3.98c-.31-.75-1.04-1.21-1.81-1.23-.26 0-.53.04-.79.15L7.1 5.95c-.75.31-1....
A component that renders a series of icons in a sequence of icons.
import React from 'react'; import GenerateHeaders from './generateHeaders'; class H6 extends React.PureComponent { render() { return <GenerateHeaders size="6" {...this.props} />; } } H6._idyll = { name: 'H6', tagType: 'open', children: ['My Header Size 6'] }; export default H6;
A component that renders a block of blocks with a header size of 6.
import React from 'react'; import { store } from './stores/lastfm-store'; import Topbar from './components/Topbar'; import styled from 'styled-components'; import PropTypes from 'prop-types'; const StyledApp = styled.div` font-size: 2rem; `; class App extends React.Component { componentWillMount() { this.s...
The base component for all of the topbar - based components.
//require('bootstrap/dist/css/bootstrap.css'); require('styles/App.styl'); import React from 'react'; let yeomanImage = require('../images/yeoman.png'); class AppComponent extends React.Component { render() { return ( <div className="index"> <img src={yeomanImage} alt="Yeoman Generator" /> ...
The AppComponent class is a base class for all components that can be rendered in a template.
import React from 'react'; import clsx from 'clsx'; import styles from './HomepageCardList.module.css'; const ResourceList = [ { icon: '🌟', description: ( <> Documentation for the Northstar platform, including the staff Admin interface. </> ), href: 'docs/', title: '...
Generate a page of homepage card list.
import PropTypes from 'prop-types'; import React from 'react'; import styles from './DescriptionListItemDescription.css'; function DescriptionListItemDescription(props) { const { className, children } = props; return ( <dd className={className}> {children} </dd> ); } DescriptionListItem...
Description of a node in a list
require('./index.scss'); import React from 'react'; import ReactDOM from 'react-dom'; import { SpyableMarkdownPreview, SpyableMarkdownTocWrapper, SpyableToc, } from './../src/index.js'; const SampleText = require('./sample.md'); const App = function App() { return ( <div className="App"> <SpyableMar...
The main function that creates a single object that can be used to render a single node in a browser.
/** * Used by the Popout component and the Lightbox component of the fields for * popouts. Renders a non-react DOM node. */ import React from 'react'; import ReactDOM from 'react-dom'; module.exports = React.createClass({ displayName: 'Portal', portalElement: null, // eslint-disable-line react/sort-comp compone...
The Popout component and the Lightbox component of the fields for Popout and Lightbox components.
import CodeMirror from 'codemirror'; import 'codemirror/addon/runmode/runmode'; import 'codemirror/mode/htmlmixed/htmlmixed'; import './assets/javascript'; import createBrowserHistory from 'history/lib/createBrowserHistory'; import React from 'react'; import ReactDOM from 'react-dom'; import {Router} from 'react-route...
Imports a single CodeMirror object and renders it in a browser.
import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { createStore, applyMiddleware } from 'redux'; import { BrowserRouter, Route, Switch } from 'react-router-dom'; import promise from 'redux-promise'; import reducers from './reducers'; import PostsIndex from './c...
Imports a single node in the DOM.
// Copyright 2015-2017 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity 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 // (at your option) any lat...
Creates a new DappCard based on a single base component.
/** * Created by prime on 04.03.2017. */ import React from 'react'; import { renderToString } from 'react-dom/server'; import AppContainer from './containers/AppContainer'; const reactHTML = (store, renderProps) => renderToString(<AppContainer store={store} renderProps={renderProps} />); export default re...
The default reactHTML function for .
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import { Provider } from 'react-redux'; import store from './redux/store'; import App from './App'; import registerServiceWorker from './registerServiceWorker'; ReactDOM.render( <Provider store={store}> <App /> </Provider>, ...
Imports a single node.
/** * Created by tomihei on 17/03/29. */ import React from 'react'; import {Grid, Row, Col} from 'react-flexbox-grid'; import AddVideoIcon from '../../containers/video/addVideoIcon'; import {Link} from 'react-router'; import styles from './videoListContent.css'; import Paper from 'material-ui/Paper'; import ContentDe...
Component that renders a single sequence of non - terminal keyboards in a video list.
import React from 'react'; import { SvgIcon } from 'material-ui'; const GithubIcon = (props) => ( <SvgIcon viewBox="0 0 512 512" {...props}> <path d="M256 70.7c-102.6 0-185.9 83.2-185.9 185.9 0 82.1 53.3 151.8 127.1 176.4 9.3 1.7 12.3-4 12.3-8.9V389.4c-51.7 11.3-62.5-21.9-62.5-21.9 -8.4-21.5-20.6-27.2-20.6-27.2 ...
A component that displays a sequence of components in a sequence of components.
import React from 'react'; const IndexComponent = () => ( <div className="not-found"> <h1> Well this is awkward... </h1> </div> ); export default IndexComponent;
IndexComponent is a function that returns a sequence of components that can be used to create a new component.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageCropDin = (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 16H5V5h14v14z"/> </SvgIcon> ); ImageCropDin = pure(ImageCropDin); Image...
Din image with no image
// @flow import React from 'react' import { FlatList, Image, StyleSheet, Text, TouchableWithoutFeedback, ScrollView, View } from 'react-native' import { gql, graphql } from 'react-apollo' import Dimensions from 'Dimensions' const { width } = Dimensions.get('window') type FeedProps = { data: { err...
The base feed class for a single n - node node.
import React from 'react'; // import {Component} from 'react'; import Markdown from './Markdown'; import GetStartedSection from './content/HomeGetStartedSection.md'; import WhySection from './content/HomeWhySection.md'; import ContributingSection from './content/HomeContributingSection.md'; import {Link} from "react-se...
The HomepageBody class is used to render a single Collection.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageBrightness2 = (props) => ( <SvgIcon {...props}> <path d="M10 2c-1.82 0-3.53.5-5 1.35C7.99 5.08 10 8.3 10 12s-2.01 6.92-5 8.65C6.47 21.5 8.18 22 10 22c5.52 0 10-4.48 10-10S15.52 2 10 2z"/> </SvgIcon> ); I...
A component that exports a sequence of icons that are not part of a component.
'use strict'; import React from 'react'; import { TouchableOpacity, View, Text } from 'react-native' import styles from './Home.style.js'; export default class Home extends React.Component{ constructor(props){ super(props); this.state = { name : 'Frank' }; } /**接收传递过来的参数 ...
Home component that displays a hidden hidden
import React from 'react'; import styles from './style.scss'; export default class StockEventView extends React.Component { static propTypes = { name: React.PropTypes.string.isRequired, current: React.PropTypes.number.isRequired, diff: React.PropTypes.number.isRequired }; static d...
A component that displays a series of events that occur on a specific node.
import './Legacy.css'; import './App.css'; import React from 'react'; import { BrowserRouter as Router } from 'react-router-dom'; import { Switch, Route } from 'react-router'; import { Provider } from 'react-redux'; import NotFound from './NotFound'; import Header from './Header'; import Footer from './Footer'; impo...
Imports a bunch of modules that are not part of a system.
import React from 'react'; import Button from './Button'; import { wrap } from '../wrap'; export const NavButton = ({ onPress, content, colorKey, gbs, textStyle, buttonStyle }) => ( <Button onPress={ onPress || (() => {})} addStyles={ { button: [ { justifyContent: 'center', ...
A button that is a nav bar with a single color key.
import React from 'react'; import { Link } from 'react-router'; import styled from 'styled-components'; const StyledLink = styled(Link)` color: tomato; display: block; margin: 0.5em 0; font-family: Helvetica, Arial, sans-serif; &:hover { text-decoration: underline;...
A component that shows a list of categories that can be selected by a user.
/** * Created by KangYe on 2017/4/28. */ import React from 'react'; import {connect} from 'react-redux'; import {Switch, Form, Icon} from 'antd'; import _ from 'lodash'; import {initFormData,initDynamicFormData, updateFormData,updateDynamicFormData} from '../../actions/formAction'; import {FormItemLayout, MapStateToP...
Component which displays a switch with a dynamic key.
/** * 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'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionFace = (props) => ( <SvgIcon {...props}> <path d="M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-...
A component that exports a series of action - related icons.
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import './ConversationInput.css'; class ConversationInput extends Component { _onEnter(event) { if (event.key === 'Enter') { this.props.onMessage(event.target.value); event.target.value = ''; } } render() { re...
A component that can be used to enter a message in a conversation.
import React from 'react' import Link from 'next/link' export default function Page() { return ( <> <Link href="https://vercel.com/"> <a id="absolute-link">https://vercel.com/</a> </Link> <br /> <Link href="mailto:idk@idk.com"> <a id="mailto-link">mailto:idk@idk.com</a> ...
The default page implementation of
import 'babel-core/polyfill'; import React from 'react'; import Root from './containers/Root'; React.render( <Root />, document.getElementById('root') );
Imports a from React
import React, { Component } from 'react'; import { Button } from 'react-bootstrap'; import FontAwesome from 'react-fontawesome'; class NoteItem extends Component { render() { return ( <li className="list-group-item pull-left note-item" onClick={this.props.onClick}> <Button ...
A note item that can be used to show a list of notes.
import React, { Component } from 'react'; import PropTypes from 'prop-types'; export default class HeadingRow extends Component { static propTypes = { navItems: PropTypes.array.isRequired }; render() { const { navItems } = this.props; const styles = require('./NavList.scss'); const items = navIt...
A headings row for a single missing node.
import React from 'react'; import Card from '../components/card'; import {ButtonGroup, ButtonGroupItem } from '../components/button_group'; export default class Everyone extends React.Component { state = { people: require('../../data/people.json') }; render() { var people = this.state.people.map(function(pers...
The Everyone component which is a component that can be rendered by a button group and a list of people.
import React from 'react'; import { Route, Link } from 'react-router-dom'; import { Breadcrumb, BreadcrumbItem } from 'reactstrap'; import routes from '../../routes'; const findRouteName = url => routes[url]; const getPaths = (pathname) => { const paths = ['/']; if (pathname === '/') return paths; pathname.sp...
Generate a breadcrumb and a menu item for a specific route.
/** * 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 ReactDOM from 'react-dom'; import {HashRouter as Router} from 'react-router-dom'; import {Provider} from 'mobx-react'; import {createMuiTheme, MuiThemeProvider} from 'material-ui/styles'; import {Layout} from 'app'; import {store as chatStore} from 'chat'; import Routes from './routes'...
Imports a single node in the DOM.
import React from 'react' import { Icon, Input } from 'semantic-ui-react' const InputExampleIconChild = () => ( <div> <Input icon placeholder='Search...'> <input /> <Icon name='search' /> </Input> <br /> <br /> <Input iconPosition='left' placeholder='Email'> <Icon name='at' /> ...
InputExampleIconChild onnables - > InputExampleIconChild onnables
import React, { Component } from 'react'; import { Input } from 'reactstrap'; import fieldHolder from 'components/FieldHolder/FieldHolder'; import i18n from 'i18n'; import PropTypes from 'prop-types'; class LookupField extends Component { constructor(props) { super(props); this.getValueCSV = this.getValueCS...
A component that can be used to display a list of values in a CSV file.
/** * The external dependencies. */ import $ from 'jquery'; import React from 'react'; import ReactDOM from 'react-dom'; class SortableList extends React.Component { /** * Lifecycle hook. * * @return {void} */ componentDidMount() { this.handleSortableUpdate = this.handleSortableUpdate.bind(this); this...
The list component that is used to sort the DOM items.
import React from 'react'; const ReferenceCell = (refs) => { return ( <span> { refs && refs.map((ref) => { if (ref.pubMedId && ref.pubMedUrl) { return <a href={ref.pubMedUrl}>{ref.pubMedId}</a>; } else if (ref.publicationModId && ref.pubModUrl) { return <...
Generate a cell that can be used to display a list of missing missing references.
import React from 'react'; import { Platform } from 'react-native'; import IonIcon from 'react-native-vector-icons/Ionicons'; import styles from './styles'; export default function Icon(props) { let iconName = Platform.OS === 'android' ? `md-${props.name}` : `ios-${props.name}`; if (props.name === 'caret-for...
default icon for android
import React from 'react' const CrossIcon = React.createClass({ propTypes: { onClick: React.PropTypes.func.isRequired }, getCrossStyle(type) { return { position: 'absolute', width: 3, height: 14, top: 14, right: 18, cu...
Demonstration of the cross - icon - modal dialog.
import React from 'react'; import { Zerotorescue } from 'CONTRIBUTORS'; import AntorusImage from 'raids/antorustheburningthrone/images/antorus.jpg'; import ImageArticle from 'interface/news/ImageArticle'; export default ( <ImageArticle title="Updated for Antorus" publishedAt="2017-12-24" publishedBy={Zerotorescue} ...
The default implementation of which imports the missing element from the system.
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _objectWithoutProperties(obj, keys) { var target = {...
A higher - order component to access the router.
import React from 'react'; import styled from 'styled-components'; import { Link } from 'gatsby'; import { navLinks } from '../../config'; const StyledNav = styled.nav` display: none; @media (min-width: ${({ theme }) => theme.breakpoints.lg}) { display: flex; justify-content: space-between; align-item...
Imports a Navbar with a menu and a button.
import {compose} from 'compose' import {withMapContext} from '../../../map/mapContext' import {withRecipe} from '../recipeContext' import PropTypes from 'prop-types' import React from 'react' import _ from 'lodash' import api from 'api' class _Aoi extends React.Component { render() { return null } ...
A component that wraps a sequence of components with a sequence of react - react
import React from 'react'; import { // Button, Menu, } from 'semantic-ui-react'; import { Link } from 'react-router-dom'; const MainMenu = function ({ translations }) { return ( <Menu inverted secondary size = { `large` }> <Menu.Item> <Link className = { `main-nav`...
The main menu for a menu item.
import React from 'react' import PropTypes from 'prop-types' import styles from './styles/ScrollContainer.css' export default class ScrollContainer extends React.PureComponent { static propTypes = { className: PropTypes.string, children: PropTypes.node, onScroll: PropTypes.func } static defaultProps...
Create a scroll container class
import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; const FormInputErrors = ({ className, errors, ...props }) => { if (errors.length < 1) { return null; } return ( <p className={classNames('mt1 mb2 p0 red', className)} {...props}> {errors.reduce( ...
FormInputErrors exports a function that exports errors from a form input.