code
stringlengths
26
5k
intent
stringlengths
3
2.56k
import React from 'react'; import PropTypes from 'prop-types'; const Chip = ({ children, close }) => { return ( <div className='chip'> {children} {close ? <i className='close material-icons'>close</i> : null} </div> ); }; Chip.propTypes = { children: PropTypes.node, /** * If show a clos...
A Chip that renders a node if the node has no children or if the node has a close icon
import React from 'react'; import PropTypes from 'prop-types'; import { injectIntl, defineMessages } from 'react-intl'; import IconButton from '../../../components/icon_button'; const messages = defineMessages({ public_short: { id: 'privacy.public.short', defaultMessage: 'Public' }, public_long: { id: 'privacy.pub...
A component that will show a dropdown dropdown of the reserved words.
import React from 'react'; import emoji from 'react-easy-emoji'; const twemojiImages = require.context('file!../static/72x72', true, /\.png$/); import { NEW_PRIVMSG, NEW_SELF_PRIVMSG, NEW_ACTION } from '../actions/client.js'; export const markup = (text) => { const splitText = text.split('\n'); let linedText = [];...
Private functions - > Babel - > Emoji
import React from 'react'; export const wrapComopnent = (Component) => { const WrappedComponent = props => ( <Wrapper> <Component/> </Wrapper> ); return WrappedComponent; }; export class Wrapper extends React.Component { render() { const { children } = this.props; return ( <div ...
A wrapper for a component that wraps a component in a wrapper class.
import React from 'react'; import {Checkbox} from 'react-bootstrap'; import {Typeahead} from '../../src/'; const options = [ 'Warsaw', 'Kraków', 'Łódź', 'Wrocław', 'Poznań', 'Gdańsk', 'Szczecin', 'Bydgoszcz', 'Lublin', 'Katowice', 'Białystok', 'Gdynia', 'Częstochowa', 'Radom', 'Sosnowiec...
Example of how to filter a single node.
import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ActionBar from './action_bar'; import Avatar from '../../../components/avatar'; import Permalink from '../../../components/permalink'; import IconButton from '../../../components/icon_button...
The navigation bar component.
import React from 'react' import ReactDOM from 'react-dom'; import BlockRoot from '../../components/BlockRoot'; import Knob from '../../components/Knob'; class View extends React.Component { constructor(props) { super(props); } render() { const {offset, setOffset} = this.props; return ( <Block...
A component that can be used to render a single block of a block - level component.
import React from 'react' import { Label, List } from 'semantic-ui-react' const LabelExampleHorizontal = () => ( <List divided selection> <List.Item> <Label color='red' horizontal> Fruit </Label> Kumquats </List.Item> <List.Item> <Label color='purple' horizontal> C...
This module imports a bunch of functions from React.
import React from 'react' import classNames from 'classnames' let FileButton = ({ onFileSelect, id, className, children }) => { const onChange = (e) => { const path = e.target.files[0] onFileSelect(path) } return ( <div className={classNames('d-inline-block', className)}> <label htmlFor={id} c...
The button that creates a hidden input that will show a file in the tree.
import React from 'react' import Content from './Content' import Groups from './Groups' import States from './States' import Types from './Types' import Variations from './Variations' const StepExamples = () => ( <div> <Types /> <Groups /> <Content /> <States /> <Variations /> </div> ) export...
Imports a sequence of non - empty elements into a sequence of non - empty elements.
import React from 'react'; import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; import articles from 'articles'; import DocumentTitle from 'interface/common/DocumentTitle'; import ArticleLoader from './ArticleLoader'; import './News.css'; class Page extends React.PureComponent { static prop...
The base class for a single page.
import {Aoi} from '../aoi' import {Map} from 'app/home/map/map' import {compose} from 'compose' import {getAvailableBands} from './bands' import {getDefaultModel} from './remappingRecipe' import {getPreSetVisualizations} from './visualizations' import {initializeLayers} from '../recipeImageLayerSource' import {msg} fro...
Component that renders a single Sequence with a single recipe.
import React from 'react' import { connect } from 'react-redux' import { fetchMedia } from './actions' import Card from '../kit/Card' import SocialMedia from '../kit/SocialMedia' import PairingSentiments from './PairingSentiments' import LatestNews from './LatestNews' class Media extends React.Component { static pro...
The base component for a media object.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let AvReplay = (props) => ( <SvgIcon {...props}> <path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/> </SvgIcon> ); AvReplay = pure(AvReplay); AvReplay...
A component that exports a single node in a sequence of nodes.
import React, { Component } from 'react'; import Relay from 'react-relay'; class <%- ComponentName %> extends Component { constructor() { super(); } render() { return ( <div></div> ); } }
A component that can be rendered by a component.
'use strict'; /** * This is an example React Native app demonstrates ListViews, text input and * navigation between a few screens. * https://github.com/facebook/react-native */ import React, { Component } from 'react'; import { StackNavigator } from 'react-navigation'; import HomeScreenTabNavigator from './HomeS...
Top - level navigator. Renders the application UI.
// React import React from 'react'; // Redux import { connect } from 'react-redux'; // Icon import Icon from 'react-native-vector-icons/FontAwesome'; // Navigation import { addNavigationHelpers } from 'react-navigation'; import { NavigatorTabSix } from '../navigationConfiguration'; class TabSixNavigation extends Reac...
TabSixNavigation extends a base class for a sequence of tabs.
import React from 'react' import 'bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js' import './Colorpicker.css' export default class Colorpicker extends React.Component { componentDidMount() { $(this.refs.input).colorpicker({}); } render() { return ( <input type="text" ref="input" {...this...
A component that can be used to show a colorpicker in a Bootstrap colorpicker.
import React from 'react' import { Message } from 'semantic-ui-react' const MessageExampleError = () => ( <Message error header='There was some errors with your submission' list={[ 'You must include both a upper and lower case letters in your password.', 'You need to select your home country....
Imports a single node in a sequence and exports it as a message.
import React from 'react'; import Divider from 'material-ui/lib/divider'; import Avatar from 'material-ui/lib/avatar'; import injectTapEventPlugin from 'react-tap-event-plugin'; import Paper from 'material-ui/lib/paper'; import GridList from 'material-ui/lib/grid-list/grid-list'; import GridTile from 'material-ui/lib/...
The base class for a single node that contains a list of items that can be selected by a user.
import React from 'react'; import GraphQLWebClient from './GraphQLWebClient'; import ExtraHeaders from './ExtraHeaders'; var styles = { clear: {clear: "both"} }; export default class GraphQLWebClientWrapper extends React.Component { constructor(props) { super(props); var endpoint = this.props.endpoint;...
The base class for all of the child components that are not part of a GraphQL web - client.
import React from 'react'; import Icon from 'react-icon-base'; function IconFileGeneric(props) { return ( <Icon viewBox="0 0 15 15" {...props}> <g stroke="currentColor" fill="none"> <path d="M13.5,3.5 L13.5,12.9968907 C13.5,13.827035 12.8204455,14.5 12.0044548,14.5 L2.99554521,14.5 C2.169...
The generic icons for the missing -
import React from 'react' import {Link} from 'react-router' import * as StackedList from '../util/View/StackedList' import * as LinkList from '../util/View/LinkList' const makePath = (prefix, type, path) => { return `${prefix}/${type}-${path}` } const stackDependencies = (dependencies = []) => { const firstLevelS...
React - router - related
import React from 'react' import { InfoWindow, Marker } from 'react-google-maps' import { Link } from 'gatsby' const ProjectMarker = ({ project, windowOpen, toggleWindow }) => ( <Marker position={project.position} onClick={() => toggleWindow(project.id)}> {windowOpen && ( <InfoWindow onCloseClick={() => to...
Imports a single non - terminal error in a project.
import React from 'react'; import { ThickBar, LayoutWrapper, LayoutContainer, } from './SimplePanelLayout.styles'; const SimplePanelLayout = props => { const { panel } = props; return ( <LayoutContainer> {/* <ThickBar /> */} <LayoutWrapper>{panel}</LayoutWrapper> </LayoutContainer> ); ...
export a layout that can be used to render a single block of a thick bar.
// @flow import React from 'react' import {compose} from 'redux' import {branch, renderNothing} from 'recompose' import EntitySearchWrapper, {type EntitySearchProps} from '../dataWrappers/EntitySearchWrapper' import EntityWrapper, {type EntityProps} from '../dataWrappers/EntityWrapper' import ConnectionWrapper, {type C...
Dodaje komponente nazwy
import React from 'react'; import SvgIcon from '../../SvgIcon'; const EditorInsertComment = (props) => ( <SvgIcon {...props}> <path d="M20 2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"/> </SvgIcon> ); EditorInsertComment.displayName = 'EditorInsertC...
The default EditorInsertComment function
import React from 'react'; import AvatarItem from 'components/common/AvatarItem.react'; class ContactItem extends React.Component { static propTypes = { contact: React.PropTypes.object, onToggle: React.PropTypes.func } constructor(props) { super(props); this.onToggle = this.onToggle.bind(this)...
The ContactItem component is a component that can be used to show a list of contacts.
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { inject, observer } from 'mobx-react'; import Invite from '../../components/auth/Invite'; import ErrorBoundary from '../../components/util/ErrorBoundary'; export default @inject('stores', 'actions') @observer class InviteScreen exte...
Invite screen component
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionLabelOutline = (props) => ( <SvgIcon {...props}> <path d="M17.63 5.84C17.27 5.33 16.67 5 16 5L5 5.01C3.9 5.01 3 5.9 3 7v10c0 1.1.9 1.99 2 1.99L16 19c.67 0 1.27-.33 1.63-.84L22 12l-4.37-6.16zM16 17H5V7h11l...
ActionLabelOutline is a function that exports a sequence of action labels.
import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { createStore, applyMiddleware, compose } from 'redux'; import ReduxPromise from'redux-promise'; // for AJAX calls import App from './components/app'; import reducers from './reducers'; import 'react-mdl/extra/m...
Imports a single node in the DOM.
import React from 'react' import { storiesOf } from '@kadira/storybook' import { withKnobs } from '@kadira/storybook-addon-knobs' import { withSmartKnobs } from 'storybook-addon-smart-knobs' import Application from './Application' storiesOf('Application') .addDecorator(withSmartKnobs) .addDecorator(withKnobs) ....
Add decorator to Knobs and Knobs
import React, { Component } from 'react'; import ContactList from './ContactList'; import './App.css'; const contacts = [{ id: 1, name: '박병진', img: 'https://avatars0.githubusercontent.com/u/1484002?v=3&s=460', tel: '010-9999-1411', email: 'posquit0.bj@gmail.com' }, { id: 2, name: '홍길동', tel: '010-1234...
Component 반환를 반환를 반환를 반환를 반환를 반환를 반환를 반환를 반환를 반환
import React from 'react'; import { Route, Link } from 'react-router-dom'; import {ReduxWrapper} from '../../../../wrappers'; import { logout } from '../../../../actions/authActions'; // Routes import DashboardIndex from './components/index'; import DashboardSettings from './components/Settings'; class Dashboard exte...
A component that displays a dashboard in the dashboard index.
/** * External dependencies */ import React from 'react'; /** * Internal dependencies */ import { isEnabled } from './utils'; const Column = ( { enabled = true, className = null, children, selected } ) => { if ( isEnabled( selected, enabled ) ) { return ( <td className={ className }>{ children }</td> ); ...
The default column that can be used to create a dependency list.
import React from 'react'; import classNames from 'classnames'; import CustomPropTypes from './utils/CustomPropTypes'; const Row = React.createClass({ propTypes: { /** * You can use a custom element for this component */ componentClass: CustomPropTypes.elementType }, getDefaultProps() { re...
The default row class which is rendered when a component is missing a custom element.
import React from 'react' class LinkButton extends React.Component { constructor() { super(); } renderLinkWarp() { const { showURLInput, onURLChange, urlValue, onLinkInputKeyDown, closeUrlInput } = this.props if (showURLInput) { return ( <div> <div className="url-warpper"> ...
LinkButton - Link button
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */ import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View } from 'react-native'; export default class HelloWorld extends Component { render() { return ( <View style={styles.containe...
Create a component
import React from 'react' import invariant from 'invariant' import { createRouteFromReactElement } from './RouteUtils' import { formatPattern } from './PatternUtils' import { falsy } from './InternalPropTypes' const { string, object } = React.PropTypes /** * A <Redirect> is used to declare another URL path a client ...
This module is used to declare a route a client should not have a path.
import React from 'react'; /** * Generates a spinner with a size based on given size parameter. * Currently sizes are * small = 30px * * @param {string} size * @return {XML} */ export const Spinner = ({size}) => { const className = `spinner-container--${size}`; return ( <div className={className}> ...
Generates a spinner with a size based on a given size parameter.
import React from 'react' import { Button, Comment, Form, Header } from 'semantic-ui-react' const CommentExampleMinimal = () => ( <Comment.Group minimal> <Header as='h3' dividing> Comments </Header> <Comment> <Comment.Avatar as='a' src='/images/avatar/small/matt.jpg' /> <Comment.Conten...
Imports a single language tag with a list of strings that represent a single language tag.
import React from 'react'; import { connect } from 'react-redux'; import TripIndex from './trip_index.jsx'; import { withRouter } from 'react-router-dom'; import { fetchTrips, deleteTrip } from '../../actions/trip_actions'; import { openModal } from '../../actions/modal_actions'; import { selectAll } from '../../reduce...
Imports a single node.
import React from 'react'; import * as UU5 from 'uu5g03'; const StageEditModal = React.createClass({ //@@viewOn:mixins mixins: [ UU5.Common.BaseMixin, UU5.Common.ElementaryMixin, UU5.Layout.FlcMixin, UU5.Common.CcrWriterMixin ], //@@viewOff:mixins //@@viewOn:static...
Component that has a single action on a modal with a modal modal.
import style from './style.css'; import React from 'react'; import { Link } from 'react-router'; export default function Navigation() { return ( <nav className={style.pulseNavContainer}> <b> <svg xmlns="http://www.w3.org/2000/svg" width="31.7" height="31.7"> <path d="M11.6 26c-.5 0-1-.4-1-1L9 17.6l-1 1....
Navigation for the availables index page
import React, { Component } from 'react'; import { Text, TouchableWithoutFeedback, View, LayoutAnimation, UIManager } from 'react-native'; import { connect } from 'react-redux'; import { CardSection } from './common'; import * as actions from '../actions'; class ListItem extends Component { // This lifecy...
The list item component that is rendered when a key is not available on the device.
import React from 'react'; import ReactDOM from 'react-dom'; import { Router, Route, IndexRoute, Link, browserHistory } from 'react-router'; import App from './App'; import Exhibitions from './ExhibitionsContainer/Exhibitions' import Artworks from './ArtworksContainer/Artworks' // STYLES // import injectTapEventPlugi...
Imports a single non - empty sequence of components.
import React from 'react' import PropTypes from 'prop-types' import styles from './sales.less' import classnames from 'classnames' import { color } from '../../../utils' import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts' function Sales ({ data }) { return ( ...
Generate a single critical sequence sequence
import React from 'react'; import AlbumInfo from '../album-info/AlbumInfo'; const Album = props => ( <div className="Album"> <AlbumInfo author="Tame" title="The less" /> <h3>{props.children}</h3> </div> ); Album.propTypes = { children: React.PropTypes.string, }; Album.defaultProps = { children: null, }...
A component that exports an Album with no children.
import React from 'react'; import { StyleSheet, Text, View, ActivityIndicator } from 'react-native'; export default class LoadingScreen extends React.Component { static route = { navigationBar: { visible: false, }, }; render() { return ( <View style={styles.container}> <View styl...
The LoadingScreen class
import React from 'react'; import AddTodo from '../containers/AddTodo'; import VisibleTodoList from '../containers/VisibleTodoList'; import Footer from './Footer'; const App = () => ( <div> <AddTodo /> <VisibleTodoList /> <Footer /> </div> ); export default App
export default app
import React from 'react'; import classNames from 'classnames'; import CustomPropTypes from './utils/CustomPropTypes'; const Row = React.createClass({ propTypes: { /** * You can use a custom element for this component */ componentClass: CustomPropTypes.elementType }, getDefaultProps() { re...
The default row class which is rendered when a component is missing a custom element.
import React from 'react'; // 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'; React.render(<HelloWorld />, document.getElementById('react-root'));
Imports a component with a specific ID and renders it in the DOM.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionAutorenew = (props) => ( <SvgIcon {...props}> <path d="M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 ...
A component that renders a series of icons that can be used to show a series of components.
import assign from 'object-assign' import PropTypes from 'prop-types' import React from 'react' import { isLikeRule, style, merge } from './index.js' export * from './index.js' // convenience // allows for elements to have a 'css' prop export function createElement(tag, allProps, ...children) { // todo - pull ids ...
create a component that can be rendered by a child of a component
import React, { Component } from 'react'; import PropTypes from 'prop-types'; export default class Badge extends Component { static propTypes = { data: PropTypes.object.isRequired, type: PropTypes.string, pill: PropTypes.bool, }; render() { const { type, data, pill } = this...
Create a badge component that renders a badge in the browser.
import React, { Component } from 'react'; import { Provider } from 'react-redux'; import CounterApp from './CounterApp'; import configureStore from '../store/configureStore'; const store = configureStore(); export default class Root extends Component { render() { return ( <Provider store={store}> ...
The root component of a component that is not a React component.
import React from 'react' import { render } from 'react-dom' import { BrowserRouter } from 'react-router-dom' import injectTapEventPlugin from 'react-tap-event-plugin' import WebFont from 'webfontloader' import getMuiTheme from 'material-ui/styles/getMuiTheme' import MuiThemeProvider from 'material-ui/styles/MuiThemePr...
Imports a single and renders it in the UI.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let HardwareHeadset = (props) => ( <SvgIcon {...props}> <path d="M12 1c-4.97 0-9 4.03-9 9v7c0 1.66 1.34 3 3 3h3v-8H5v-2c0-3.87 3.13-7 7-7s7 3.13 7 7v2h-4v8h3c1.66 0 3-1.34 3-3v-7c0-4.97-4.03-9-9-9z"/> </SvgIcon> ...
Hardware Headset.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let EditorFormatLineSpacing = (props) => ( <SvgIcon {...props}> <path d="M6 7h2.5L5 3.5 1.5 7H4v10H1.5L5 20.5 8.5 17H6V7zm4-2v2h12V5H10zm0 14h12v-2H10v2zm0-6h12v-2H10v2z"/> </SvgIcon> ); EditorFormatLineSpacing =...
A component that renders a block of content in a block of icons.
import React from 'react'; import { Link } from 'react-router'; import messages from './messages' export default class goNorth extends React.Component { render(){ return( <div className='pointer' onClick={() => this.props.goNorthStart()}>Go {messages.goNorth[this.props.startMap.locationY]}</div> ) } ...
The base component for a sequence of nodes that are not part of a sequence of nodes.
/* global module */ import React from 'react'; import { storiesOf } from '@storybook/react'; import { boolean } from '@storybook/addon-knobs'; import JobState from '../../../app/components/icons/JobState'; import JobStates from '../../../app/constants/JobStates'; const all = () => ( <table> <tbody> {Obje...
The main function for the missing - node - module - filter
import React from 'react' import warning from './routerWarning' const { bool, object, string, func, oneOfType } = React.PropTypes function isLeftClickEvent(event) { return event.button === 0 } function isModifiedEvent(event) { return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) } functio...
Create a link that links to a route or to a state.
// Component that will show the videos that the user searched for on the right side of the page // This component doesn't need state, it doesn't record any user intereactions, // it doesn't rerender itself, so we can make it functional component import React from 'react'; import VideoListItem from './video_list_item'...
Component that will show the videos that the user has selected on the right side of the page
import React from 'react'; import { ThemeProvider } from 'react-native-material-ui'; import { ListItem as MaterialUiListItem } from 'react-native-material-ui'; import theme from '../../config/theme'; export default class ListItem extends React.Component { render() { return <ThemeProvider uiTheme={theme}><Materia...
The ListItem class is a class that implements a list item that can be rendered with a theme.
import test from 'tape'; import React from 'react'; import {mount} from 'enzyme'; import { SensibleDefaults, ColorInXYPlot, ColorSpecificity, CategoryColorAtMarkLevel, CategoryColorAtMarkLevelCustomPalette, CategoryColorAtMarkLevelFixedStroke, GradientCharts, LinearColorAtMarkLevel, LinearColorAtMark...
Tests that a specific node is on the right of the plot.
import React from 'react' import AppBar from 'material-ui/AppBar' import IconButton from 'material-ui/IconButton' import ActionCached from 'material-ui/svg-icons/action/cached' import Paper from 'material-ui/Paper' import { List, ListItem } from 'material-ui/List' import ActionTrendingDown from 'material-ui/svg-icons/a...
Imports a single non - terminal or non - terminal network error into a dialog.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from 'material-ui/SvgIcon'; let SwitchCamera = props => <SvgIcon {...props}> <path d="M20 4h-3.17L15 2H9L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-5 11.5V13H9v2.5L5.5 12 9 8.5V11h6V8.5l3.5 3.5-3.5 3....
A component that renders a single orphan icon.
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import {Dialog, CardHeader} from 'material-ui'; import {Glyphicon} from 'react-bootstrap'; import {getTranslatedParts} from '../helpers/localizationHelpers'; class DialogComponent extends Component { constructor(props) { super(props); ...
A component that displays a dialog with a single hidden hidden input.
import React from 'react' import { Button, Label } from 'shengnian-ui-react' const ButtonExampleLabeledProps = () => ( <div> <Button label={1048} icon='fork' labelPosition='left' /> <Button label='1,048' icon='fork' labelPosition='left' /> <Button label={{ content: '2,048' }} icon='heart' content='Like' ...
Example of how to show a single in a tree.
import PropTypes from 'prop-types'; import React from 'react'; import { injectIntl } from 'react-intl'; import { connect } from 'react-redux'; import withAsyncData from '../../common/hocs/AsyncDataContainer'; import withCsvDownloadNotifyContainer from '../../common/hocs/CsvDownloadNotifyContainer'; import { fetchCollec...
Provides a way to create a single object with a source list of all the sources of a single sequence.
/*eslint-disable*/ import React from 'react'; import {AppRegistry} from 'react-native'; import platformSpecific from './deprecated/platformSpecificDeprecated'; import Screen from './Screen'; import PropRegistry from './PropRegistry'; const registeredScreens = {}; function registerScreen(screenID, generator) { regi...
The base implementation of a component that is not registered with React.
import React from 'react'; import _ from 'underscore'; export default function pubReferenceList(values) { // Render each of the links, with null for each value without an identifier property if (values && values.length) { const links = _.compact(values.map((value) => { if (value.identifier...
Public function pubReferenceList - Returns HTML for a list of key - value pairs.
import React from 'react' import urlDialog from './urlDialog' class generateUrl extends React.Component { constructor() { super() this.state = {} this.state.isGeneratingUrl = false this.openDialog = this.openDialog.bind(this) this.closeDialog = this.closeDialog.bind(this) } componentWillMoun...
The generateUrl component
import React from 'react'; import ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; import {observer} from 'mobx-react'; import {action} from 'mobx'; const ENTER_KEY = 13; @observer export default class TodoEntry extends React.Component { render() { return (<input ref="newField" className="new-t...
The TodoEntry class is a component that can be used to store the value of a new field in todoStore.
import React from 'react' import PropTypes from 'prop-types' import styled from 'styled-components' import Tab from './Tab' const Container = styled.div` display: ${props => (props.isActive ? 'display' : 'none')}; ` const PersistentTabControl = ({ activeTab, children, className }) => ( <> {React.Children.map(...
A control that renders a single with a persistent tab.
/** * 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, { Component } from 'react'; import PropTypes from 'prop-types'; function load() { return Promise.resolve([ { id: 1,...
The base class for a single node in the source tree.
import React from 'react'; import Paper from 'material-ui/Paper'; import {Card, CardActions, CardHeader, CardText} from 'material-ui/Card'; import Cards from './card.js'; import {Grid, Row, Col} from 'react-flexbox-grid/lib/index'; import GraphCard from './graphcard.js'; const style = { paperstyle:{ width...
A component that renders a commit list.
import React from 'react'; import Card from './expandable-card'; import info from '../assets/about-card-info.js'; import '../styles/card.scss'; class About extends React.Component { render () { const cards = info.map(card => (<Card info={card} />)); return (<div className="about-us"> <div className="content...
The About component is a component that can be rendered by a user.
import React from 'react' import { render } from 'react-dom' import { Router, browserHistory } from 'react-router' import { Provider } from 'react-redux' import routes from './config/routes' import { Map } from 'immutable' import { syncHistoryWithStore } from 'react-router-redux' /** Global styles */ import './scss/se...
Imports a single and renders it in the DOM.
import React from 'react'; import PropTypes from 'prop-types'; export default class ColumnHeader extends React.PureComponent { static propTypes = { icon: PropTypes.string, type: PropTypes.string, active: PropTypes.bool, onClick: PropTypes.func, hideOnMobile: PropTypes.bool, columnHeaderId: P...
A component that renders a column header when a button is clicked on a column.
import React from 'react'; export default (props = {}) => { return ( <input {...{ type: 'text', ...props, autoComplete: 'off', }} /> ) };
Demonstration of default module
import _$ from 'jquery'; import React from 'react'; import ReactDOM from 'react-dom'; import TestUtils from 'react-addons-test-utils'; import jsdom from 'jsdom'; import chai, { expect } from 'chai'; import chaiJquery from 'chai-jquery'; import { Provider } from 'react-redux'; import { createStore } from 'redux'; import...
A component that can be rendered by a component that is not yet rendered by a component.
/** * Created by tareq on 18/11/17. */ import React, { Component } from 'react'; import { connect } from 'react-redux'; class BookDetail extends Component{ render() { if(!this.props.book){ return <div>Select a book to get start</div> } return( <div> ...
Demonstrates how to render a single missing - free sequence of items in a book.
import React from 'react'; import PropTypes from 'prop-types'; import styles from './teamCard.css'; const TeamCard = ({ name, role, slackUsername, email, isBoard, description, imageSrc }) => ( <div className={styles.teamCard}> {imageSrc && <img src={imageSrc} alt={`Headshot of ${name}`} />} <h6 className={...
Generates a team - card tag that can be used to render a single node.
import React from 'react' import { Route } from 'react-router' export const r = (path, component) => <Route path={path} component={component} />
export from react - router
/** * 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 PropTypes from 'prop-...
Provides a way to render a single missing component in the DOM.
import React from 'react' import StoryBox from './story_box.js' React.render( <StoryBox />, document.getElementById('container') )
Renders a in a DOM element.
import React, { Component } from 'react'; import { Text, TouchableWithoutFeedback, View, Image } from 'react-native'; import { CardSection, Card, Button } from '../common/card_produto'; import { Icon } from 'native-base'; class ProdutoItem extends Component { render() { const { categoria, nome_produto, valor } ...
Demonstrate a single nome in a produto component.
import React, { Component } from 'react'; import { Modal, Button, Form, Input } from 'semantic-ui-react'; import { Field, reduxForm } from 'redux-form'; import PollNameInput from './PollNameInput'; import PollOptionInput from './PollOptionInput'; class PollCreateModal extends Component{ constructor(props) { ...
Component that creates a modal with a single modal.
/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */ import 'babel/polyfill'; import path from 'path'; import express from 'express'; import React from 'react'; import ReactDOM from 'react-dom/server'; import Router from './routes'; import Html from './components/Html'; const server = global.serve...
Register the API middleware and the server - side rendering
import React from 'react'; import PropTypes from 'prop-types'; import burger from 'images/icons/menu.svg'; import styles from './burger.css'; const Burger = (props) => { const { onClick } = props; const handleClick = (e) => { e.preventDefault(); onClick(); }; return ( <div className={styles.burge...
A function that exports a burger component.
import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { ConnectedRouter } from 'react-router-redux'; import { createMemoryHistory } from 'history'; import routes from './routes'; import configureStore from './store'; import * as ipcRenderer from './i...
The base class for all components that are not react - dom and react - router - redux.
import React, { Component } from 'react'; import HeaderTemplate from './template/header'; import FooterTemplate from './template/footer'; class App extends Component { render() { return ( <div> <HeaderTemplate logo="Your Site" /> <div className="container"> {this.props.children} ...
The base class for all components that are not part of a component s children.
import React, { Component } from 'react'; import './App.css'; import ShowCollection from './ShowCollection/ShowCollection'; class App extends Component { render() { return ( <div className="App"> <ShowCollection /> </div> ); } } export default App;
The base class for all the components that are not part of a show collection.
import React from 'react' import { createRenderer } from 'react-addons-test-utils' import createComponent from 'react-unit' import tape from 'tape' import addAssertions from 'extend-tape' import jsxEquals from 'tape-jsx-equals' const test = addAssertions(tape, {jsxEquals}) import Header from '../components/Header' co...
Test for missing dependencies on Home. js
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ import Rea...
This module imports a from the root DOM and renders it into the app.
import React from 'react' import { Dropdown } from 'shengnian-ui-react' const options = [ { key: 1, text: 'Choice 1', value: 1 }, { key: 2, text: 'Choice 2', value: 2 }, ] const DropdownExampleActive = () => ( <Dropdown text='Dropdown' options={options} open /> ) export default DropdownExampleActive
Example of how to open a single node in a dropdown.
/* * 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 assign from 'object-assi...
---------------------------- Private methods -------------------------------
import Icon from '../Icon'; import React from 'react'; import PropTypes from 'prop-types'; import Typography from '../Typography'; import Counter from '../Counter'; import classNames from 'classnames'; import styles from './styles.css'; function getTypographyType(size) { switch (size) { case 'small': return '...
export label - title
import React from 'react'; import { Icon } from '../components'; export default function NavIcon(name, color) { return <Icon name={name} color={color} size={32} />; }
NavIcon - Nav icon