code
stringlengths
26
5k
intent
stringlengths
3
2.56k
import React, { Component } from 'react'; import { Link, withRouter } from 'react-router-dom'; import { connect } from 'react-redux'; import UserInfo from './UserInfo'; import Nav from './Nav'; class SideBar extends Component { state = {}; render() { let { location, backgroundColor, enableB...
The main function of the frontend.
import { Link, graphql } from 'gatsby'; import kebabCase from 'lodash.kebabcase'; import PropTypes from 'prop-types'; import React from 'react'; import { Helmet } from 'react-helmet'; const TagsPage = ({ data: { allMarkdownRemark: { group }, site: { siteMetadata: { title } } } }) => ( <div> ...
Exports a page of tags in a sequence of objects.
import React from 'react'; const link = { normal: { borderBottom: '1px dotted rgb(0, 168, 0)', }, hover: { borderBottom: '1px solid rgb(0, 168, 0)', color: 'black', }, active: 'hover', touchActive: { borderBottom: '1px dashed rgb(0, 168, 0)', color: 'black', }, focusFromTab: { o...
export default configuration for a single node
/* * Copyright (c) 2017. Caipi Labs. All rights reserved. * * This File is part of Caipi. You can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. ...
A file part of Caipi.
/* eslint no-console: 0 */ import 'colors'; import React from 'react'; import express from 'express'; import path from 'path'; import Router from 'react-router'; import routes from './src/Routes'; import httpProxy from 'http-proxy'; import metadata from './generate-metadata'; import ip from 'ip'; const development =...
The main function that runs the webpack server.
import React from 'react'; export default function PageHeader(props) { return ( <header className="pure-u-1-1 page-header"> {props.children} </header> ); };
The default page header for a sequence of nodes.
/* @flow */ import React from 'react'; export default () => ( <div className="be-spinner"> <div className="spinner-bounce1" /> <div className="spinner-bounce2" /> <div className="spinner-bounce3" /> </div> );
The default implementation of which spawns a spinner for missing nodes.
import React from 'react'; import { getLatestNews } from '../lib/svt_news'; import FlipMove from 'react-flip-move'; const styles = { container: {}, articleTitle: { color: 'white', fontSize: '2.5em', textAlign: 'center', }, article: { color: 'white', fontSize: '1.4em', textAlign: 'cente...
The news component that is used to show a list of articles.
import React from 'react'; export default class WeatherObject { constructor(data) { this.city = data.current_observation.display_location.full; this.condition = data.current_observation.weather; this.day = data.forecast.simpleforecast.forecastday[0].date.day; this.month = data.forecast.simpleforecast...
The WeatherObject class
import React from 'react' const Landing = React.createClass({ render() { return ( <div> <h1>Landing Page</h1> <p>This page is only shown to unauthenticated users.</p> <p>Partial / Lazy loading. Open the network tab while you navigate. Notice that only the required components are do...
The Landing class
import React from 'react' import {render} from 'react-dom' import Options from 'components/options' import {trackView, trackTiming, trackException} from 'utils/analytics' import _template from './options.html' const init = () => { render(<Options />, document.querySelector('#container')) trackView() trackTimin...
Imports a single node in the window.
import React from 'react'; import styled from 'styled-components'; import { Helmet } from 'react-helmet'; import Intro from 'components/Intro'; const StyledPage = styled.div` margin-bottom: 30px; h2 { margin-bottom: 30px; margin-top: 45px; &::before { border-c...
A template that renders a single node in a Helmet page.
import React from 'react' import warning from 'warning' function isValidChild(object) { return object == null || React.isValidElement(object) } export function isReactChildren(object) { return isValidChild(object) || (Array.isArray(object) && object.every(isValidChild)) } function checkPropTypes(componentName, p...
Creates and returns a routes object from the given ReactChildren.
import React from 'react'; import PropTypes from 'prop-types'; import withIntl from '../lib/withIntl'; import Currency from './Currency'; import SmallButton from './SmallButton'; import { FormattedMessage } from 'react-intl'; import { connectAccount } from '../lib/api'; class ConnectPaypal extends React.Component { ...
A component that displays a list of all cards in a PayPal account.
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; }; var _jsxFileName = 'layout/Head.jsx', _this = this; impo...
The head component is a wrapper around React s head component. It is a wrapper around React s head component.
/* eslint-disable no-shadow */ import React, { Component } from 'react'; import styled from 'styled-components'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { ActivityIndicator } from 'react-native'; import CookieManager from 'react-native-cookies'; import { auth, getUser ...
A component that displays a welcome message in the browser.
import React from 'react'; import filter from '../filter'; const defaultClassName = 'flag'; const componentName = 'Flag'; const Basic = (props) => <i {...props}/>; const Flag = new filter(Basic) .classGenerator(defaultClassName) .getComposeComponent(componentName); export default Flag;
Imports a component with a default class and a filter.
import React from 'react' import { createDevTools } from 'redux-devtools' import LogMonitor from 'redux-devtools-log-monitor' import DockMonitor from 'redux-devtools-dock-monitor' export default createDevTools( <DockMonitor toggleVisibilityKey="ctrl-h" changePositionKey="ctrl-w"> <LogMonitor /> ...
import react - devtools
import React, { Component } from 'react'; class Network extends Component { render() { return ( <div> <h1>Network</h1> <hr/> </div> ); } } export default Network;
A base class for the Network class.
import React from 'react'; import Relay from 'react-relay/classic'; import PropTypes from 'prop-types'; import ErrorBoundary from '../../error/ErrorBoundary'; import RelayContainer from '../../../relay/RelayContainer'; import MediaRoute from '../../../relay/MediaRoute'; import ReportDesignerComponent from './ReportDesi...
Create a new report designer component that displays a single node in a report designer container.
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { reduxForm, Field, getFormValues, SubmissionError } from 'redux-form'; import * as widgetActions from 'redux/modules/widgets'; import widgetValidation, { colors } from './widgetValidation'; /* e...
A component that can be used to create a hidden input with a single key and a single value.
import React from 'react' import { render } from 'react-dom' import { createStore, applyMiddleware } from 'redux' import { Provider } from 'react-redux' import thunk from 'redux-thunk' import createLogger from 'redux-logger' import reducer from './reducers' import App from './containers/App' const middleware = [ thunk...
Imports a single node of a and renders it to the browser.
import styles from './AddTeamButton.scss'; import React from 'react'; import cx from 'classnames'; import closesb from '../../actions/closesb-action-creators.js'; var AddTeamButton = React.createClass({ closesb: function () { closesb.emitClose(); }, render: function () { var classList = this.props.visi...
Add a new team button to a team.
'use strict'; import React from 'react'; import { A, BLOCKQUOTE, CODEBLOCK, DEL, EM, H, HR, IMG, INLINECODE, LI, LIST, MARKDOWN, P, REF, SPAN, STRONG, UL, OL } from '../components/basic/index'; export const findComponent = (name, args, children, replace = {}) => { let possible = { 'header': replace.header, ...
Define a component that can be found in a hierarchy.
import React from 'react' const NotFoundPage = () => ( <div> <h1>NOT FOUND</h1> <p>You just hit a route that doesn&#39;t exist... the sadness.</p> </div> ) export default NotFoundPage
Provides a function to return a 404 page if the route is not found.
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.
/** * 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(prefix) { return [ { id: 1, [`${prefi...
The base class for a series of users that can be found in a source tree.
import React from 'react'; import ReactDOM from 'react-dom'; import JqxDropDownList from '../../../jqwidgets-react/react_jqxdropdownlist.js'; class App extends React.Component { render() { let source = [ { html: '<div style="height: 20px; float: left;"><img style="float: left; margin-top: 2px;...
A component that renders a sequence of components in a JQX system.
import React from 'react'; import PropTypes from 'prop-types'; import Icon from 'interface/icons/Information'; import Alert from './index'; const Info = ({ children, ...others }) => ( <Alert kind="info" {...others}> <div className="content-middle"> <div className="icon-container"> <Icon /> ...
export a default dependency that exports a single node with a single child.
import React from 'react'; class Assignment extends React.Component { render () { var { courseId, assignmentId } = this.props.params; var { title, body } = COURSES[courseId].assignments[assignmentId] return ( <div> <h4>{title}</h4> <p>{body}</p> </div> ); } } export d...
A component that renders a missing node in the course s assignment list.
// @flow import React from 'react'; import { render } from 'react-dom'; import { Provider } from 'react-redux'; import { Router, hashHistory } from 'react-router'; import { syncHistoryWithStore } from 'react-router-redux'; import routes from './routes'; import configureStore from './store/app/configureStore'; import '....
Imports a single node.
/* * This file is part of the Kreta package. * * (c) Beñat Espiña <benatespina@gmail.com> * (c) Gorka Laucirica <gorka.lauzirika@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ import React from 'react'; import ReactDO...
The default implementation of the navigable list component.
import React from 'react'; import { render } from 'react-dom'; import ReactApp from './reactApplication'; render(<ReactApp />, document.getElementById('j-application'));
Imports a React application.
import React from 'react'; class Footer extends React.Component { render() { return <p>Footer!</p>; } } module.exports = Footer;
Package that exports a footer component.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let FileCloudDownload = (props) => ( <SvgIcon {...props}> <path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-...
A component that exports a series of images in a series of icons.
/** * Created by Layman(http://github.com/anysome) on 16/4/13. */ import React from 'react'; import {StyleSheet, Navigator, TouchableOpacity, View, Text, Image} from 'react-native'; import {colors, styles, px1} from '../views/styles'; export default class NavigatorWithBar extends React.Component { render() { ...
A component that is rendered as a navigation bar with a left button and a right button.
import React from 'react' import PropTypes from 'prop-types' import { routerRedux } from 'dva/router' import { connect } from 'dva' import UserList from './UserList' import UserFilter from './UserFilter' import UserModal from './UserModal' function Users ({ location, dispatch, users, loading }) { const { list, pagin...
The users section of a user s modal.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ContentTextFormat = (props) => ( <SvgIcon {...props}> <path d="M5 17v2h14v-2H5zm4.5-4.2h5l.9 2.2h2.1L12.75 4h-1.5L6.5 15h2.1l.9-2.2zM12 5.98L13.87 11h-3.74L12 5.98z"/> </SvgIcon> ); ContentTextFormat = pure(C...
A component that renders a series of icons in a group of icons.
/* @flow */ import React from 'react'; import { IconMute, IconStream, IconPrivate } from '../common/Icons'; type Props = { color: string, isPrivate: boolean, isMuted: boolean, size: number, style?: Object, }; export default ({ color, style, isPrivate, isMuted, size }: Props) => { const StreamIcon = (isMu...
The default function for the export.
import React from 'react' import PropTypes from 'prop-types' import SVGDeviconInline from '../../_base/SVGDeviconInline' import iconSVG from './ElmOriginalWordmark.svg' /** ElmOriginalWordmark */ function ElmOriginalWordmark({ width, height, className }) { return ( <SVGDeviconInline className={'ElmOrigina...
Create an element with a width height and a class name.
import React from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import colors from 'atoms/Color/colors.scss'; import styles from './link_wrapper.module.scss'; function LinkWrapper( props ) { const { className, children, color, variant, type, hover, ......
Link wrapper for a single node
import React from 'react' import PropTypes from 'prop-types' import Colors from '../constants/Colors' import Styles from '../styles/PersonList' import HeaderTitle from '../components/HeaderTitle' import PersonListView from '../components/PersonListView' import { Location, Permissions } from 'expo' import { bindActionC...
Component that renders a list of PersonList objects.
import React from 'react'; import { Link } from 'react-router-dom'; import TaskListItemActions from 'components/TaskListItemActions'; import TaskStateMachine from 'components/TaskStateMachine'; import { RelativeTime } from 'components/Time'; import { getClassForScheduleStatus, getDuration, getLastEventTime, isActive ...
A component that is a list of tasks that can be expanded or expanded.
import React, { Component } from 'react'; import { StyleSheet, Text, View, Image, AsyncStorage } from 'react-native'; import FontAwesome from 'react-native-vector-icons/FontAwesome'; import Icon from 'react-native-vector-icons/Ionicons'; class Account extends Component { constructor(props) { super(p...
The Account class
import React from 'react'; import MapboxGL from '@mapbox/react-native-mapbox-gl'; import sheet from '../styles/sheet'; import BaseExamplePropTypes from './common/BaseExamplePropTypes'; import TabBarPage from './common/TabBarPage'; class SetPitch extends React.Component { static propTypes = { ...BaseExampleProp...
Create a new SetPitch component that can be used to render a single unknown tag.
import React from 'react'; class AddFishForm extends React.Component { static propTypes = { addFish: React.PropTypes.func.isRequired }; createFish(event) { event.preventDefault(); const fish = { name: this.name.value, price: this.price.value, status: this.status.value, d...
Adds a FishForm to a single node in the tree.
/* * SonarQube * Copyright (C) 2009-2016 SonarSource SA * mailto:contact AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License...
The base implementation of which is a wrapper around the base class for the uPortal - based
import React from 'react'; const DrawerLoading = () => ( <div className='drawer'> <div className='drawer__pager'> <div className='drawer__inner' /> </div> </div> ); export default DrawerLoading;
export default DrawerLoading
import React from 'react'; import { Modal, View, ActivityIndicator, StyleSheet, Platform, } from 'react-native'; export default function LoadingModal(props) { return ( <Modal animationType={'fade'} onRequestClose={() => false} transparent={true} visible={props.loading} > ...
default loading modal
import React from 'react'; import Markdown from "./Markdown"; import SourceIntro from "./source-intro.md"; import './source-body.less'; export default function SourceBody ({text}) { return ( text ?<div dangerouslySetInnerHTML={{ __html: text}}></div> :<Markdown source={SourceIntro} /> ); }
The default function for the source - body.
import React from 'react'; import { connect } from 'react-redux'; import { expandHomeTimeline, refreshHomeTimeline } from '../../actions/timelines'; import PropTypes from 'prop-types'; import StatusListContainer from '../ui/containers/status_list_container'; import Column from '../../components/column'; import ColumnHe...
Home timeline component
import React, { Component } from 'react'; import { connect } from 'react-redux'; import { withRouter } from 'react-router'; import PropTypes from 'prop-types'; import * as actions from 'components/Auth/actions'; import { selectAuthRequested, selectAuthSignUpErrorMessage, selectAuthSignUpUser } from 'components/Auth/se...
A component that can be used to render a sign - up page.
import React from 'react'; import axios from 'axios'; // import Form from "react-jsonschema-form"; import Register from '../components/Register'; import Login from '../components/Login'; // function ErrorListTemplate(props) { // const {errors} = props; // return ( // <div> // <legend>Ошибка(и)</legend> /...
A component that displays a list of keys that can be found in a cart.
import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; import Alert from '@material-ui/lab/Alert'; const useStyles = makeStyles((theme) => ({ root: { width: '100%', '& > * + *': { marginTop: theme.spacing(2), }, }, })); export default function SimpleAlerts() { const ...
Simple Alerts - the default alert list
import React, { Component } from 'react'; import { View, Text, TouchableHighlight, AsyncStorage, InteractionManager, ActivityIndicator, } from 'react-native'; import ScrollViewList from '../../components/ScrollViewList'; import Contacts from 'react-native-contacts'; import styles from './styles'...
A component that deletes all contacts in a sequence of records.
import 'babel-polyfill'; import React from 'react'; import { render } from 'react-dom'; import { Provider } from 'react-redux'; import rootReducer from './reducers'; import App from './components/App'; import { createStore, applyMiddleware, compose } from 'redux'; import thunk from 'redux-thunk'; const enhancers = com...
Initialize a single node
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let AvPause = (props) => ( <SvgIcon {...props}> <path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/> </SvgIcon> ); AvPause = pure(AvPause); AvPause.displayName = 'AvPause'; export default AvPause;
A component that exports a single node in a sequence of nodes.
import React from 'react'; export const VERSION = React.version; const [major, minor] = VERSION.split('.'); export const REACT013 = VERSION.slice(0, 4) === '0.13'; export const REACT014 = VERSION.slice(0, 4) === '0.14'; export const REACT15 = major === '15'; export const REACT155 = REACT15 && minor >= 5;
Check if a specific component is missing a reserved property.
'use strict'; import React from 'react'; import data from '../data/data'; const DropdownList = ({ items, itemTextKey, itemValueKey, dataKey, value, isListVisible, onItemClick, onSelectedItemClick }) => ( <div className='custom-dropdown'> <span className='custom-dropdown-input' onClick={onSelectedItemClic...
A dropdown list that shows a dropdown list of items with a value for a given key.
import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; class App extends Component { render() { return ( <div className="App"> <div className="App-header"> <img src={logo} className="App-logo" alt="logo" /> <h2>Welcome to React</h2> ...
The base class for the missing components.
import React, { Component } from 'react'; import { push } from 'react-router-redux'; import store from '../../redux/store'; import { Input, InputGroup, InputGroupButton, Button } from 'reactstrap'; class ArtistSearch extends Component { constructor(props) { super(props); this.handleClick = this.handleClick....
Component that is used to display a list of artists in a spotify - access - control.
import React from 'react' import { Row, Col } from 'antd' export default class Index extends React.Component { render () { return ( <Row> <Col span={24} className='appVideoCard'> <video src='./static/videos/Chuckle.mp4' width='100%' height='100%' frameBorder='1' loop autoPlay /> <...
The Index class
import { setPropTypes, setDisplayName, compose } from 'recompose' import PropTypes from 'prop-types' import React from 'react' import { SnackbarAction } from './Action.style' import { SnackbarMessage } from './Message.style' import { proxyStyledStatics } from '../../hocs' import { SnackbarStyle } from './Snackbar.styl...
The default implementation of a that renders a Snackbar with a message and action handler.
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 _jsx from "@babel/runtime/helpers/builtin/jsx"; import React from 'react'; import PropTypes from 'prop-types'; import { translate } from 'react-i18next'; import Paper from "@material-ui/core/es/Paper"; import Typography from "@material-ui/core/es/Typography"; var enhance = translate(); var PasswordResetSuccessP...
Private functions -
import React from 'react' import Content from './Content' import Types from './Types' import Variations from './Variations' const StatisticExamples = () => ( <div> <Types /> <Content /> <Variations /> </div> ) export default StatisticExamples
export a default StatisticExamples object
import React from 'react'; /* eslint-disable */ const Company = (props) => ( <svg {...props} width="148" height="148" viewBox="0 0 148 148"> <g transform="translate(5)"> <path d="M48.4044336 147.763501L80.0395603 147.763501 80.0395603 114.790382 99.0548489 114.790382 99.0548489 147.763501 130.689976 147.76...
A component that displays a sequence of components that are related to a sequence of components.
import React from 'react' import PropTypes from 'prop-types' export const WarningIcon = ({ color, title, ...props }) => { return ( <svg width="2" height="10" xmlns="http://www.w3.org/2000/svg" {...props}> {title && <title>{title}</title>} <path d="M1.82 6.86H.168V0H1.82v6.86zM0 8.96c0-.28.098...
Warning icon for missing missing node.
import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { View, StyleSheet } from 'react-native'; import Chat from './Chat'; import ChatOnline from './ChatOnline'; import { sendMessage } from '../../actions'; function mapStateToProps(state) { return { message...
A component that is rendered as a chat container.
import React from 'react'; import MenuItem from 'material-ui/MenuItem'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; import injectTapEventPlugin from 'react-tap-event-plugin'; import FileUploader from './FileUploader'; import DialogBox from './DialogBox'; import FlatButton from 'material-ui/FlatB...
A component that can be used to show a hidden menu in the sidebar.
import React from 'react'; import { connect } from 'react-redux'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { debounce } from 'lodash'; import PropType...
A component that renders a block of blocks.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let EditorBorderHorizontal = (props) => ( <SvgIcon {...props}> <path d="M3 21h2v-2H3v2zM5 7H3v2h2V7zM3 17h2v-2H3v2zm4 4h2v-2H7v2zM5 3H3v2h2V3zm4 0H7v2h2V3zm8 0h-2v2h2V3zm-4 4h-2v2h2V7zm0-4h-2v2h2V3zm6 14h2v-2h-2v2z...
A component that renders a block of icons that are hidden from the dialog.
import React from 'react'; import PropTypes from 'prop-types'; import { getClassesStatic } from '../addons/get-classes'; import MenuItem from './item'; class MenuDropDown extends React.PureComponent { static propTypes = { options: PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.string.isRe...
MenuDropDown Component for DropDownMenu.
/* global location */ import qs from 'qs'; import React from 'react'; import { Provider } from '@storybook/ui'; import addons from '@storybook/addons'; import createChannel from '@storybook/channel-postmessage'; import Preview from './preview'; export default class ReactProvider extends Provider { constructor() { ...
The base class for the ReactProvider class.
import React from 'react'; class Deactivated extends React.Component { render() { return ( <div className="deactivated row center-xs middle-xs"> <div className="deactivated__window"> <h2>Tab deactivated</h2> <p> Oops, you have opened another tab with Actor, so we had...
Deactivated component which is not a component that is not yet activated.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionViewStream = (props) => ( <SvgIcon {...props}> <path d="M4 18h17v-6H4v6zM4 5v6h17V5H4z"/> </SvgIcon> ); ActionViewStream = pure(ActionViewStream); ActionViewStream.displayName = 'ActionViewStream'; Acti...
A function to create a action view stream for a node in a hierarchy.
import React from 'react'; import PropTypes from 'prop-types'; import { Button as SemanticButton } from 'semantic-ui-react'; const Button = (props) => { const { children, className = '', type = 'button', onClick, disabled = false, ...rest } = props; return ( <SemanticButton typ...
Create a button which can be used to create a group of buttons.
/** * Copyright (c) 2015-present, Alibaba Group Holding Limited. * All rights reserved. * * @providesModule ReactToast */ 'use strict'; import React from 'react'; import Portal from 'ReactPortal'; import Text from 'ReactText'; import StyleSheet from 'ReactStyleSheet'; const LONG_DELAY = 3500; // 3.5 seconds cons...
The main function of the toast.
import React from 'react'; import { Avatar, AvatarStack } from '../../index'; import avatars from '../../static/data/avatar'; import { addStoryInGroup, MID_LEVEL_BLOCKS } from '../../../.storybook/utils'; export default { component: AvatarStack, title: addStoryInGroup(MID_LEVEL_BLOCKS, 'AvatarStack'), parameter...
Exports a default block of icons for a specific node.
import React from 'react' import 'semantic-ui-css/semantic.min.css'; import { Grid, Card, Image, Dropdown } from 'semantic-ui-react' const Shelf = ({ books=[], shelves=[], shelfTitle = '', onUpdateShelf, columns = 5 }) => { const options = shelves.concat([{key: 'none', text: 'None', value: 'none' }]); return ( ...
Imports a single node in a table that has no children.
import React from 'react'; import SimpleReport from './SimpleReport' import $ from 'jquery' import {Pagination,Icon } from 'antd' class SimpleReportList extends React.Component { constructor(props) { super(props); // Operations usually carried out in componentWillMount go here this.state = { page:{...
Component that listens for a single page of records in a report.
import React from 'react'; import { Panel, Tabs, Tab, Row, Col} from 'react-bootstrap'; // Custom components import Tournaments from './tournaments'; import PlayerList from './player_list'; import { OverallTable } from './stats_table'; export default (props) => ( <Row> <Col xs={12} md={5}> <Tournaments />...
Default implementation of
// (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP import React, { Component } from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import CSSClassnames from '../../../utils/CSSClassnames'; import Intl from '../../../utils/Intl'; import Props from '../../../utils/Pro...
A component that renders a toast on top of a toast.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let PlacesSmokeFree = (props) => ( <SvgIcon {...props}> <path d="M2 6l6.99 7H2v3h9.99l7 7 1.26-1.25-17-17zm18.5 7H22v3h-1.5zM18 13h1.5v3H18zm.85-8.12c.62-.61 1-1.45 1-2.38h-1.5c0 1.02-.83 1.85-1.85 1.85v1.5c2.24 0 ...
A component that exports a series of icons that are not part of a series of icons.
import React from 'react'; import './Timer.scss'; const getColorForValue = (value, max = 60.0) => { if (value > 20) { return '#000'; } const weighted = (value / max) * 150; return `hsl(${weighted}, 100%, 50%)`; }; const Timer = ({ seconds }) => ( <div className="timer" style={{ color: getColorForValue(s...
The default timer is a component that displays a timer that will show up after a certain number of seconds.
/** * Sample React Native App * @flow */ import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View } from 'react-native'; import { setValue, getValue } from './count'; import { on, remove, trigger } from './event'; class SimpleReduxApp extends Component { render() ...
App sequence sequence class
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from 'material-ui/SvgIcon'; let WrapText = props => <SvgIcon {...props}> <path d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3 3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z" /> </SvgIcon>; WrapText = pu...
A component that renders a single node in a group of nodes.
import React, { Component } from 'react'; import { MonospacedText, FlatList, View } from '../../../src'; class FlatListScreen extends Component { static navigationOptions = { title: 'Flat List', } render() { let data = [ { key: 1, title: 'Title', }, { key: 2, title:...
Package that contains a sequence of components that can be displayed in a menu.
import React, { Component } from 'react'; import logo from './logo.svg'; import Navigation from './Navigation'; import AboutUs from './AboutUs'; import Team from './Team'; import Footer from './Footer'; import './App.css'; class App extends Component { render() { return ( <div> <Navigation /> ...
Imports a single component and renders it as a single app.
import React from 'react'; import packageJSON from '../../package.json'; let version = packageJSON.version; if (/docs/.test(version)) { version = version.split('-')[0]; } const PageHeader = React.createClass({ render() { return ( <footer className="bs-docs-footer" role="contentinfo"> <div c...
A page header for a single node in the hierarchy of nodes.
import React, { Component } from 'react'; import { Provider } from 'react-redux'; import configureStore from '../store/configureStore'; import AsyncApp from './AsyncApp'; const store = configureStore(); export default class Root extends Component { render() { return ( <Provider store={store}> {() ...
The root component of a component
import React from 'react'; export const LandingPageHeader = () => { return ( <div className="landing-page__header" /> ); }; export default LandingPageHeader;
export default landing - page - header
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-2016 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 Contact from './Contact'...
Provides a javascript function to export a missing missing node in the system.
import React from 'react' export default class extends React.Component { renderLayerCard = (layer) => { if (!layer.source) return this.renderExternalLinkCard(layer) const isSelected = this.props.selectedLayers.indexOf(layer) > -1 const defaultColor = `hsl(${(layer.id * 209) % 360}, 60%, 75%)` const b...
The base component for the unknown - layer - card and external - link - card.
import React from 'react'; import ReactDOM from 'react-dom'; import ReactRouter from 'react-router'; export default class FacebookLike extends React.Component { render() { let styleValue = { border: "none", overflow: "hidden" }; return ( <iframe src="https://www.facebook.com/plugins/like.php?hr...
The Facebook - like component that displays a count of users.
import React from 'react' import { Link } from 'react-router' export class NotFoundView extends React.Component { render () { return ( <div className='container text-center'> <h1>This is a demo 404 page!</h1> <hr /> <Link to='/'>Back To Home View</Link> </div> ) } } exp...
The NotFoundView class is a subclass of a component that can be rendered to a 404 page.
// @flow import React from 'react'; export type CommonProps = { style?: Object; className?: string; children?: React.Element<*>; };
The base component for missing children.
import React from 'react'; import test from 'ava'; import sinon from 'sinon'; import { FormattedMessage } from 'react-intl'; import { PostCreateWidget } from '../../components/PostCreateWidget/PostCreateWidget'; import { mountWithIntl, shallowWithIntl } from '../../../../util/react-intl-test-helper'; const props = { ...
Tests if a specific component is a post - create widget.
import React, { Component } from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { Link } from 'react-router-dom'; // import fetch from 'isomorphic-fetch'; import actions from '../actions/index'; import BreadCrumb from '../components/BreadCrumb'; import '../sass/AlbumC...
Component that is rendered when a component is destroyed.
import React from 'react'; import ReactDOM from 'react-dom'; import { Router } from './Router'; import './index.css'; import { createStore } from 'redux'; import { Provider } from 'react-redux'; import minizincApp from './Reducers'; const store = createStore(minizincApp, window.__REDUX_DEVTOOLS_EXTENSION__ && window....
Imports a single React component.