code
stringlengths
26
5k
intent
stringlengths
3
2.56k
import { TouchableWithoutFeedback, Vibration } from 'react-native'; import styled from 'styled-components/native'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import R from 'ramda'; import * as colors from '../constants/colors'; import * as actio...
Component which is a component that is rendered as a group.
import React from 'react'; import styled from 'styled-components'; import { transparentize } from 'polished'; import { gql, graphql } from 'react-apollo'; import TableHead from './TableHead'; import PlayerLine from './PlayerLine'; import color from '../../../libs/color'; import type { Team as TeamType } from '../../../...
export default JSX template for a single unknown node
import React, { Component } from 'react'; import { Container } from '@extjs/ext-react'; import { Cartesian } from '@extjs/ext-react-charts'; import ChartToolbar from '../../ChartToolbar'; import storeData from './storeData'; export default class SplineMarkers extends Component { store = Ext.create('Ext.data.Store...
A component that has a series of markers.
import React from 'react'; import Title from 'react-title-component'; import CodeExample from '../../../CodeExample'; import PropTypeDescription from '../../../PropTypeDescription'; import MarkdownElement from '../../../MarkdownElement'; import circleProgressReadmeText from './README'; import circleProgressCode from ...
The default implementation of a sequence of functions that show a circular progress indicator.
import 'babel-core/polyfill'; import path from 'path'; import express from 'express'; import React from 'react'; import ReactDOM from 'react-dom/server'; import Router from './router/routes'; import Html from '../src/components/Html'; import { _SERVER } from '../src/config/conf'; const server = global.server = expres...
Register the middleware and server - side rendering of a single node.
'use strict'; import React from 'react'; import assign from 'object-assign'; import classnames from 'classnames'; var getSlideClasses = (spec) => { var slickActive, slickCenter, slickCloned; var centerOffset, index; if (spec.rtl) { index = spec.slideCount - 1 - spec.index; } else { index = spec.index...
Private functions - > Style - > slides
import React from 'react'; const styles = { main: { margin: 15, maxWidth: 600, lineHeight: 1.4, fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif', }, logo: { width: 200, }, link: { color: '#1474f3', textDecoration: 'none', borderBottom: '1px ...
A component that shows a link to a UI component in a storybook.
import React from 'react'; import { Text, TouchableOpacity, Dimensions } from 'react-native'; import { Button } from 'native-base'; var width = Dimensions.get('window').width; var height = Dimensions.get('window').height; const ButtonHome = ({ onPress, children, color}) => { const styles = { buttonStyle: { ...
export ButtonHome from react - native
import React from 'react'; var _listingSource = React.PropTypes.shape({ url: React.PropTypes.string.isRequired, }); var _listingResolutions = React.PropTypes.arrayOf(React.PropTypes.shape({ width: React.PropTypes.number.isRequired, height: React.PropTypes.number.isRequired, url: React.PropTypes.string.isRequi...
Exports all properties of the React module.
import React from 'react'; import { connect } from 'react-redux'; import { connectLocalization } from '../../../components/Localization'; import TagSettings from '../../../containers/TagsSettings'; import * as muteTagsActionCreators from '../../../common/actions/muteTags'; const MuteTagSettings = ({ muteTags, i18n, ad...
The default implementation of linking a tag to a mute tag.
import React from 'react' import test from 'tape' import { shallow } from 'enzyme' import IconButton from './' import MdMenu from 'react-icons/lib/md/menu' test('<IconButton />', t => { const wrapper = shallow( <IconButton> <MdMenu /> </IconButton> ) t.ok(wrapper.contains(<MdMenu />)) t.end() })
Check if a node is a
import React from 'react' const pad = n => (n < 10 ? `0${n}` : n) const format = t => { const hours = t.getUTCHours() const minutes = t.getUTCMinutes() const seconds = t.getUTCSeconds() return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}` } function Clock ({ lastUpdate, light }) { return ( <div class...
Create a clock object
import {createStore, compose, applyMiddleware } from 'redux'; import { Provider } from 'react-redux' import React from 'react'; import ReactDOM from 'react-dom'; import thunk from 'redux-thunk'; import './index.css'; import 'hig-react/lib/hig-react.css'; import App from './containers/App'; import rootReducer from './...
Imports a single node in the DOM.
/* container 组件 component 目的 如何工作? (数据获取,状态更新) 如何显示 ?(样式,布局) 是否在数据流中? 是 否 读取数据 从 Redux 中获取 state 从 props 获取数据 修改数据 从 Redux 派发 action 从 props 调用回调函数 实现方式 由 react-dedux 生成 手写 */ import React from 'react'; import AddTodo from "../containers/AddTodo"; import VisibleTodoList fro...
app - > app
import React from 'react'; import VideoPlayer from '../containers/VideoPlayer'; import VideoInfo from '../containers/VideoInfo'; import VideoNav from '../containers/VideoNav'; import VideoList from '../containers/VideoList'; const LocalVideoPage = () => ( <div> <VideoNav /> <VideoPlayer /> <div id="loca...
Imports all non - video objects from the system.
import React from 'react'; import { render } from 'react-dom'; // It's important to not define HelloWorld component right in this file // because in that case it will do full page reload on change import HelloWorld from './HelloWorld.jsx'; render(<HelloWorld />, document.getElementById('react-root'));
Imports a component from a file that has no react - dom.
import React from 'react' import { Link } from 'react-router-dom' const NavBar = () => ( <div> <div><Link to="/">Home</Link> <Link to="/hello">Hello</Link> <Link to="/counter">Counter</Link></div> </div> ) export default NavBar
A component that displays a NavBar in a window where the node is not found in a hierarchy.
import React from 'react'; import {Home} from 'components'; const HomeContainer = React.createClass({ render () { return ( <Home/> ); } }); export default HomeContainer;
Imports and exports a single HomeContainer.
import ReactDOM from 'react-dom'; import React from 'react'; import ComponentLibrary from './components/component-library'; ReactDOM.render( <ComponentLibrary />, document.getElementById( 'wp-react-component-library' ) );
Imports a React component and renders it into the DOM.
import './index.css'; import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; ReactDOM.render(<App />, document.getElementById('root'));
Imports the index. css and react - dom.
import React from 'react'; import {withInfo} from '@storybook/addon-info'; import BreakdownBars from 'app/components/charts/breakdownBars'; export default { title: 'Charts/BreakdownBars', }; export const Default = withInfo('Horizontal bar chart with labels')(() => { const data = [ {label: 'unknown', value: 9...
Horizontally creates a breakdown bar chart with a simple header
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import styles from './styles'; import { ThemePropagator, GenericBrick } from '../../'; class StrongMessageBrick extends Component { renderMessageLevel1(styles, props) { if (props.renderMessageLevel1) { return props.renderMessag...
The StrongMessageBrick component is a class that renders a message with a specific style.
import React from 'react'; import { Step, Stepper, StepLabel, } from 'material-ui/Stepper'; import RaisedButton from 'material-ui/RaisedButton'; import FlatButton from 'material-ui/FlatButton'; /** * Horizontal steppers are ideal when the contents of one step depend on an earlier step. * Avoid using long step ...
Horizontal stepper which can handle long steppers.
/** * Created by ngnono on 16-12-30. */ import React from 'react'; import {Router,Redirect, Route, IndexRoute, hashHistory, browserHistory} from 'react-router'; import Counter from './containers/CounterContainer'; import App from './containers/AppContainer'; import Home from './containers/HomeContainer'; import Show ...
Imports all components of a system.
import { View, TextInput } from 'react-native'; import PropTypes from 'prop-types'; import React from 'react'; import * as globalStyles from '../styles/global'; const AppTextInput = ({ children, style, containerFlex, ...rest }) => ( // We wrap the text input in a View here to remove inconsistencies that exist betwe...
A text input that can be used to show a single node in a text input field.
import * as registerPushNotifications from './actions/push_notifications'; import { setupBrowserNotifications } from './actions/notifications'; import { default as Mastodon, store } from './containers/mastodon'; import React from 'react'; import ReactDOM from 'react-dom'; import ready from './ready'; const perf = requ...
This module imports all of the components that are required to be able to be used by the notification system.
import React from 'react'; import { FormattedMessage } from 'react-intl'; const LoadingIndicator = () => ( <div className='loading-indicator'> <div className='loading-indicator__figure' /> <FormattedMessage id='loading_indicator.label' defaultMessage='Loading...' /> </div> ); export default LoadingIndicat...
export LoadingIndicator from React
import React from 'react' import { Link } from 'react-router' export default () => ( <div> <Link to="/repositories">Repositories</Link> <Link to="/issues">Issues</Link> </div> )
A component that exports a from a React router.
import classnames from 'classnames'; import CurrentListStore from '../stores/CurrentListStore'; import Popout from './Popout'; import PopoutList from './PopoutList'; import React from 'react'; import vkey from 'vkey'; import { FormNote } from 'elemental'; const Transition = React.addons.CSSTransitionGroup; var ListHe...
The list header is a list of all the columns that are currently selected in the list.
import React, { Component } from 'react'; import CoffeeStore from "../Stores/Coffee"; let getState = () => { return { processings: CoffeeStore.getProcessings(), filter: CoffeeStore.getFilter() }; }; class CoffeeFilter extends Component { constructor(props) { super(props); this.state = getState(...
The base component for handling CoffeeFilter.
import styles from './css/style.scss' import React from 'react' import ReactDOM from 'react-dom' import createBrowserHistory from 'history/lib/createBrowserHistory' import App from './pages/App' import configureStore from './stores' const store = configureStore() const targetEl = document.getElementById('root') c...
Imports a single node from the DOM.
import Field from '../Field'; import React from 'react'; import { FormInput } from 'elemental'; module.exports = Field.create({ displayName: 'MoneyField', valueChanged (event) { var newValue = event.target.value.replace(/[^\d\s\,\.\$€£¥]/g, ''); if (newValue === this.props.value) return; this.props.onChange(...
The main function of the component that creates a field that can be used to display a money field.
// @flow import React from 'react'; import SpotEditForm from './SpotEditForm'; import { Grid } from 'react-bootstrap'; import { type SpotForm, type Values } from '../modules/spotEdit'; export type StateProps = {| form: ?SpotForm, |}; export type DispatchProps = {| onSubmit: (values: Values) => any, onCancel: () ...
Displays a spot edit with a hidden hidden input.
import { Box, Field, Flex, InputBox } from '@rocket.chat/fuselage'; import React from 'react'; import { ResetSettingButton } from '../ResetSettingButton'; export function IntSettingInput({ _id, label, value, placeholder, readonly, autocomplete, disabled, onChangeValue, hasResetButton, onResetButtonClick, })...
Private function to export a single in a form.
import React from 'react'; import {Route} from 'react-router'; import { App, Home, Widgets, About, Login, RequireLogin, LoginSuccess, Survey, NotFound, } from 'containers'; export default function(store) { return ( <Route component={App}> <Route path="/" component={Hom...
This module exports a list of all components that are not found in the system.
import React from 'react'; import { View } from 'react-native'; import PropTypes from 'prop-types'; import { DANGER_RED } from '../globalStyles'; const SIZES = { large: { width: 120, height: 40 }, }; export const Rectangle = ({ children, colour, size }) => { const dimensions = SIZES[size]; const background = {...
Exports a single node in a hierarchy with a border radius and a background.
import AuthActions from '../../auth/actions.js'; import AuthStore from '../../auth/store.js'; import AuthConstants from '../../auth/constants.js'; import {IndexLink} from 'react-router'; import React from 'react'; require('./styles.scss'); export default class Header extends React.Component { constructor() { s...
Header class for the wordpress authentication dialog.
/** * This is your main component. Feel free to change it however you want. */ import React from 'react'; const App = () => ( <div className="hero is-success is-bold is-fullheight"> <div className="hero-body"> <div className="container has-text-centered"> <h1 className="title is-1">You made it!</h1> </d...
The default app for missing a missing component
/** * Created by muratguney on 29/03/2017. */ import React from 'react'; import {Card, CardHeader,Icon,Table, TableRow, TableHeaderColumn, TableHeader, TableRowColumn, TableBody} from '../../lib'; import HighLight from 'react-highlight.js' export default class CardPage extends React.Component { state = {open: f...
A page that displays a single sequence of words in a sequence of unique words.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let FileCloudOff = (props) => ( <SvgIcon {...props}> <path d="M19.35 10.04C18.67 6.59 15.64 4 12 4c-1.48 0-2.85.43-4.01 1.17l1.46 1.46C10.21 6.23 11.08 6 12 6c3.04 0 5.5 2.46 5.5 5.5v.5H19c1.66 0 3 1.34 3 3 0 1.13-...
A component that displays a series of icons that are not part of a component.
import React from 'react'; import PropTypes from 'prop-types'; import { StaticQuery, graphql } from 'gatsby'; import { Col, Row } from '@freecodecamp/react-bootstrap'; import { NavigationContext } from '../../contexts/GuideNavigationContext'; import DefaultLayout from './Default'; import SideNav from './components/gui...
Package that contains a series of components that can be selected by a node.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageBurstMode = (props) => ( <SvgIcon {...props}> <path d="M1 5h2v14H1zm4 0h2v14H5zm17 0H10c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zM11 17l2.5-3.15L15.29 16l2.5-3.22L21 17H11z"/...
A component that renders a sequence of images in a sequence of icons.
import React from 'react'; import axios from 'axios'; import Form from "react-jsonschema-form"; const log = (type) => console.log.bind(console, type); const loginForm = { "title": "Войти", "description": "Уже зарегистрированы? Войдите:", "type": "object", "required": [ "email", "password" ], "prope...
A component that registers a user with a password.
import React from 'react' import { connect } from 'react-redux' import Button from 'material-ui/Button' import Instance from './Instance' import findInvalidInstitutions from './findInvalidInstitutions' import onSubmit from './onSubmit' export default connect(mapStateToProps)(({ draft, onChange, institutions, ...
React - Redux - Component that creates a sequence of invalid components.
// Presenter component for a Floor content type from Contentful import React from 'react' import PropTypes from 'prop-types' import 'static/css/global.css' import LibMarkdown from 'components/LibMarkdown' import PageLink from '../../PageLink' import Librarians from 'components/Librarians' import Related from '../../Rel...
Presents a single missing - block block of content as a content type
import _ from 'intl' import Component from 'base-component' import Dropzone from 'dropzone' import React from 'react' export default class ImportVdiModalBody extends Component { get value() { return this.state.file } render() { const { file } = this.state return ( <Dropzone onDrop={thi...
Vdi modal body for a single
import React from 'react'; import { Link } from 'react-router'; export default function Layout(props) { return ( <div> <header> <nav> <ul> <li> <Link to="/">Home</Link> </li> <li> <Link to="/about">About</Link> ...
Layout function for missing node - hotkey warning
import React from 'react'; class DashboardHeader extends React.Component { constructor(props) { super(props); this.displayName = 'DashboardHeader'; this.title = ""; } componentWillUpdate(nextProps, nextState) { if (typeof nextProps.product != 'undefined' && typeof nextProps.entity !=...
A component that shows a header for the dashboard.
import React from 'react' import { View } from 'react-native' import PropTypes from './PropTypes' import PureComponent from './PureComponent' import StyleSheet from './StyleSheet' export default class Card extends PureComponent { static contextTypes = { theme: PropTypes.any } render() { const { theme ...
Create a card with a single child.
import _ from 'underscore'; import classNames from 'classnames'; import React from 'react'; import { FormField, FormInput, FormRow, FormSelect, SegmentedControl } from 'elemental'; const TOGGLE_OPTIONS = [ { label: 'Matches', value: false }, { label: 'Does NOT Match', value: true } ]; const MODE_OPTIONS = [ { lab...
The base implementation of a filter that can be used to filter a number or a text field.
import Field from '../Field'; import React from 'react'; import { FormRow, FormField, FormInput } from 'elemental'; module.exports = Field.create({ displayName: 'GeopointField', focusTargetRef: 'lat', valueChanged (which, event) { this.props.value[which] = event.target.value; this.props.onChange({ path: t...
The field that is used to display a single nanosecond field.
import React from 'react' import './dialog-operation-button.style.scss' export default ({ buttonType = '', title = '', click = () => {} }) => { let className = 'dialog-operation-button' if (buttonType) { className += ` dialog-${buttonType}-button` } return ( <button className={className} onClick={clic...
Dialog button with no action
/** * External dependencies */ import React from 'react'; import { translate as __ } from 'i18n-calypso'; /** * Internal dependencies */ import ContextType from '../context-type'; function ContextValue( { context, rowId, column, schema, setReplacement, className } ) { if ( context.type === 'keyvalue' ) { ret...
The default ContextValue implementation
import React from 'react' import { reduxForm } from 'redux-form' export const fields = [] const validate = (values) => { const errors = {} return errors } type Props = { handleSubmit: Function, fields: Object, } export class <%= pascalEntityName %> extends React.Component { props: Props; defaultProps = ...
React - > React. Component
/** * 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 missing component in a Jupyter notebook.
import React from 'react'; import Router from 'react-router'; const Root = React.createClass({ statics: { /** * Get the doctype the page expects to be rendered with * * @returns {string} */ getDoctype() { return '<!doctype html>'; }, /** * Get the list of pages that a...
Get the base url of the app that is rendered with a specific doctype.
import React from 'react'; import IconBase from '@suitejs/icon-base'; function MdBackup(props) { return ( <IconBase viewBox="0 0 48 48" {...props}> <path d="M38.71 20.07C43.89 20.44 48 24.72 48 30c0 5.52-4.48 10-10 10H12C5.37 40 0 34.63 0 28c0-6.19 4.69-11.28 10.7-11.93C13.21 11.28 18.22 8 24 8c7.28 0 13.3...
A backup of the missing icons.
import React from 'react' import 'css/markdown-styles.css' import Helmet from 'react-helmet' import { config } from 'config' module.exports = React.createClass({ propTypes () { return { router: React.PropTypes.object, } }, render () { const post = this.props.route.page.d...
Demonstrate a necessarse of a Helmet meteor in a page.
import React from 'react'; import PropTypes from 'prop-types'; const Posts = ({ posts }) => { const list = posts.map((post, i) => <li key={i}>{post.title}</li>); return <ul>{list}</ul>; }; Posts.propTypes = { posts: PropTypes.array, }; Posts.defaultProps = { posts: [], }; export default Posts;
Exports a list of posts for a .
import React from 'react' import 'css/markdown-styles.css' import Helmet from 'react-helmet' import { config } from 'config' module.exports = React.createClass({ propTypes () { return { router: React.PropTypes.object, } }, render () { const post = this.props.route.page.data return ( <...
The main function for the Helmet - related component.
import React, { Component } from 'react'; import { View, Text, StyleSheet, SectionList, TouchableHighlight, } from 'react-native'; import Icon from 'react-native-vector-icons/Ionicons'; import ContainerView from '../../app_components/container_view'; import SeparatorLine from '../../app_components/separator_...
Component which is a component that renders a gist.
import React, { Component } from 'react'; import 'whatwg-fetch'; export class ResultTwoPartyPreferredByCandidate extends Component { constructor(props) { super(props); this.state = {votes: {}}; this.getVotes = this.getVotes.bind(this); } componentDidMount() { this.getVotes(); } getVotes() {...
A component that shows the votes of a candidate.
import React from 'react'; // Since this component is simple and static, there's no parent container for it. const Hello = () => { return ( <div> <h2>Hello from semi theme!</h2> </div> ); }; export default Hello;
The default implementation of a critical critical
import React from 'react'; import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; import Icon from 'mastodon/components/icon'; const ColumnLink = ({ icon, text, to, href, method, badge }) => { const badgeElement = typeof badge !== 'undefined' ? <span className='column-link__badge'>{badge}</span...
A column link that links to a node in a table.
import React from 'react' import { IndexLink, Link } from 'react-router' import PropTypes from 'prop-types' import Navbar from '../../components/Navbar' import { CSSTransitionGroup } from 'react-transition-group'; import './PageLayout.scss' export const PageLayout = ({ children, location }) => { let displayNav = () ...
The default page layout implementation
import React, { Component } from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import { Redirect } from 'react-router-dom'; export default (ChildComponent) => { class AuthDispatcher extends Component { render() { return ( this.props.isAuth ? <ChildCom...
The default implementation of a middleware that dispatches to a child component.
import React from 'react' export default function ExitWhite(props) { return ( <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" {...props} > {/* Generator: Sketch 46.2 (44496) - http://www.bohemian...
Exit white - only export
import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import styles from './styles.css'; const propTypes = { message: PropTypes.string.isRequired }; function Cover({message}) { return ( <div className={classNames('webex-cover-message', styles.message)}> <di...
The default Cover function
import React from 'react'; import './ChatBoxCard.css'; class ChatBoxCard extends React.Component { render() { let className = 'ChatBoxCard'; if (this.props.isUserAuthor) className += ' me'; else if (this.props.author === 'System') className += ' system'; r...
A component that displays a message in a modal box.
// @flow import type { TextProps } from './Text'; import type { Theme } from '../themes/types'; import Text from './Text'; import React from 'react'; type ParagraphContext = { theme: Theme, }; const Paragraph = (props: TextProps, { theme }: ParagraphContext) => { const { marginBottom = theme.paragraph.marginB...
A component that renders a block of text if it is missing.
/** * app.js * * This is the entry file for the application, only setup and boilerplate * code. */ import 'babel-polyfill'; /* eslint-disable import/no-unresolved */ // Load the manifest.json file and the .htaccess file import '!file?name=[name].[ext]!./manifest.json'; import 'file?name=[name].[ext]!./.htaccess';...
This module is responsible for importing the main application s JS files.
/** * Created by helge on 09.03.17. */ import React from 'react'; import { connect } from 'react-redux'; import { formValueSelector } from 'redux-form/immutable'; import Radial from '../../components/RadialProgress'; export function LoginProgressWrapper(props) { return ( <div> <h2>Waiting to login ... <...
A function to connect a state to a state that is waiting for a login.
import React from 'react'; import PanelGroup from './PanelGroup'; const Accordion = React.createClass({ render() { return ( <PanelGroup {...this.props} accordion> {this.props.children} </PanelGroup> ); } }); export default Accordion;
The accordion class
import React from 'react'; // https://thenounproject.com/search/?q=warning&i=976488 // Warning by Gregor Cresnar from the Noun Project const Icon = ({ ...other }) => ( <svg xmlns="http://www.w3.org/2000/svg" viewBox="15 15 70 70" className="icon" {...other}> <path d="M52.64,21a3,3,0,0,0-5.28,0L16.08,75.23a3.5,3....
Missing - Object in the hierarchy of a component.
import _ from 'lodash'; import Immutable from 'immutable'; import keymirror from 'keymirror'; import React from 'react'; import { Styles, TextField, FlatButton } from 'material-ui'; import CreateGroupActionCreators from 'actions/CreateGroupActionCreators'; import ContactStore from 'stores/ContactStore'; import Cont...
A component that creates a modal group with a single group of members.
// @flow import React from 'react'; import GameFull from '.'; export default { default: ( <GameFull disabled={false} onWatch={() => console.log('Just watch')} /> ), disabled: ( <GameFull disabled={true} onWatch={() => console.log('Just watch')} /> ), };
Exports a default configuration for a .
import React from 'react' import elementType from 'react-prop-types/lib/elementType' // import ListItem from '../ListItem' import fabricComponent from '../fabricComponent' import style from './List.scss' const List = ({ children, componentClass: Component, selectable, ...props }) => ( <Component data-fabric="List"...
A component that can be used to render a list of items in a hierarchy.
import React from 'react'; import PropTypes from 'prop-types'; const ColumnSubheading = ({ text }) => { return ( <div className='column-subheading'> {text} </div> ); }; ColumnSubheading.propTypes = { text: PropTypes.string.isRequired, }; export default ColumnSubheading;
export a column subheading
import React, { Component } from 'react'; import { Text, View, } from 'react-native'; import styles from './styles'; class Calendar extends Component { render() { return ( <View style={styles.view}> <Text>Calendar View</Text> </View> ); } } export default Calendar;
Imports a calendar from a React component.
import './MainMenu.scss' import React from 'react' class MainMenu extends React.Component { constructor(props) { super(props) this.logoutHandler = this.logoutHandler.bind(this) } logoutHandler() { } render() { return ( <nav className='menu-container'> <div className='dropdown-co...
The main menu component
import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import { Header} from 'semantic-ui-react' import ReactTable from 'react-table' import 'react-table/react-table.css' class ExecUsers extends Component { componentDidMount() { this.props.fetchUsers(); } render () { ...
Demonstrates how to render a user sequence.
import React from 'react'; import styles from '../../../styles/index.js'; export default ({ name, color }) => ( <div className={`${styles.flex.horizontalCenterY} ${styles.inline.height36}`}> <div className={styles.inline.padding12x24}> <div className={styles.component.legendItem} style={{ backgr...
default function to render a single object
import React from 'react' import UniversalLink from 'components/UniversalLink' export default () => { return ( <div> <h2>Page not found</h2> <p> <UniversalLink to="/"> Go back to home page </UniversalLink> </p> </div> ) }
The default function for returning a boolean that indicates whether a page is not found or not.
/** * Copyright IBM Corp. 2016, 2018 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import React from 'react'; import { storiesOf } from '@storybook/react'; import { withKnobs, select, text } from '@storybook/addon-knobs'; i...
Adds a decorator to the given element that creates a hidden hidden element with a tooltip.
import React from 'react'; export default React.createClass({ render() { return <div>About</div>; }, });
Create a new class with a default render method.
import React from 'react'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; import RaisedButton from 'material-ui/RaisedButton'; import DatePicker from 'material-ui/DatePicker'; /** * Dialogs can be nested. This example opens a Date Picker from within a Dialog. */ export defa...
Example of how to open a Date Picker from a Dialog.
import React from 'react' export default React.createClass({ render() { return <div className="browser-component--dev-panel"> {this.props.children} </div> } })
Create a new component with a single child
import React from 'react'; import { Link } from 'react-router-dom'; import ScrollUpButton from 'react-scroll-up-button'; import SocialMedia from 'shared/components/socialMedia/socialMedia'; import centerLogo from 'images/icons/Medal-Icon.svg'; import styles from './footer.css'; const Footer = () => ( <div className=...
Imports the missing - node - related modules and exports a default Footer.
import React from 'react' import { TextInput } from '../../../components/inputs' import * as Form from '../../../components/Form' function PullQuoteEmbedComponent(props) { return ( <div className='o-embed o-embed--quote'> <Form.Container> <Form.Input label='Content'> <TextInput ...
Demonstration of how to render a quote - based sequence of tags.
import React from 'react'; import PropTypes from 'prop-types'; import Motion from 'react-motion/lib/Motion'; import spring from 'react-motion/lib/spring'; import { FormattedMessage } from 'react-intl'; export default class UploadProgress extends React.PureComponent { static propTypes = { active: PropTypes.bool,...
The base class for the upload progress component.
import React from 'react' import { connect } from 'react-redux' import { createStructuredSelector } from 'reselect' import PropTypes from 'prop-types' import Head from 'next/head' import { addView, deleteView } from 'actions/user' import { makeEmail, makeViewList, makeLoading } from 'selectors/user' import stylesheet...
A component that can be used to render a view with a link to a view in a view list.
import React from 'react'; const MicrosoftIcon = props => ( <svg {...props.size || { width: '24px', height: '24px' }} {...props} viewBox="0 0 49 49"> {props.title && <title>{props.title}</title>} <path d="M0,0 L23.7179487,0 C23.7165242,7.92857143 23.7179487,15.8571429 23.7165242,23.7857143 L0,23.7857143 L0,0...
A component that renders a sequence of nodes that are not part of a sequence of components.
import React from 'react'; import { FlatList, Image, View, TouchableOpacity } from 'react-native'; import { RkText, RkCard, RkStyleSheet } from 'react-native-ui-kitten'; import {SocialBar} from '../../components'; import {data} from '../../data'; let moment = require('moment'); export class Articles2 exten...
Component that renders a single item in a list of articles.
import React from 'react' import PropTypes from 'prop-types' import {Carousel} from 'react-responsive-carousel' import styles from 'react-responsive-carousel/lib/styles/carousel.min.css' function Gallery({images}) { return ( <Carousel axis="horizontal" showArrows showStatus={false} showTh...
Gallery images of a single
import React from 'react' import { Input } from 'semantic-ui-react' const InputExampleRightLabeledBasic = () => ( <Input label={{ basic: true, content: 'kg' }} labelPosition='right' placeholder='Enter weight...' /> ) export default InputExampleRightLabeledBasic
Example of how to label a node with a right label
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ToggleCheckBox = (props) => ( <SvgIcon {...props}> <path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/> </SvgIcon> );...
A component that renders a toggle check box on a node.
/** * 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 from 'react'; import Header from '../components/Header'; import StackTrace from './StackTrace'; import type { ...
Generate a JSX error header for a unhandled error in a source tree.
import React from 'react'; import classNames from 'classnames'; import BootstrapMixin from './BootstrapMixin'; import CustomPropTypes from './utils/CustomPropTypes'; const ButtonGroup = React.createClass({ mixins: [BootstrapMixin], propTypes: { vertical: React.PropTypes.bool, justified: React.PropTypes.b...
The button group is a button group that displays buttons with a vertical state.
import { Kbd } from 'components'; import React from 'react'; import { ENTER, SPACE, } from 'helpers/KeyCodes'; const textExpandTime = 900; const textCloseTime = 500; const msPerLetter = 35; function generateText( text:string, index:number ) { return <span> { text.substr( 0, index, ) } { index >= t...
Private functions - Private
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <g><path d="M22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 ...
9. 2. 2. 2