code
stringlengths
26
5k
intent
stringlengths
3
2.56k
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; import styles from './styles.scss'; const KEY_ESC = 27; class Navigation extends Component { static displayName = 'react-awesome-navigation/Navigation'; static pro...
A component that is rendered when a navigation is opened.
import React from 'react'; export default function Icon({ name }) { return <span className={`glyphicon glyphicon-${name}`} />; }
A component that renders a warning in a glyphicon
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionSwapVerticalCircle = (props) => ( <SvgIcon {...props}> <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM6.5 9L10 5.5 13.5 9H11v4H9V9H6.5zm11 6L14 18.5 10.5 15H13v-4h2v4h2.5z"/> ...
A component that exports a vertical action on a vertical circle.
import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; export default function Bar(props) { const { useBoxShadow, height, color, className, progress: { active, value } } = props; const barStyles = { width: value + '%', height, backgroundColor: color }; ...
A bar that shows a single non - number non - zero value in a progress bar.
import React from 'react'; import { Localized } from 'fluent-react/compat'; export default function App(props) { const { currentLocales, handleLocaleChange } = props; const [current] = currentLocales; const available = ['en-US', 'pl']; const next = available[(available.indexOf(current) + 1) % available.length...
The default implementation of with a bunch of different components.
import React from 'react'; import { StyleSheet, Text, View, Button, ScrollView } from 'react-native'; import BasicText from './sub/basicText.js'; import { prefs } from '../routes/prefs.js'; import { research } from '../content/research.js'; import { translatedText, translatedTitle, printLinks } from '../routes/shared.j...
The main function for the navigation screen.
import React, { Component } from 'react'; import { browserHistory } from 'react-router' import './Article.scss' class Article extends Component { onReturnBack () { browserHistory.goBack() } render () { const FaChevronLeft = require('react-icons/lib/fa/chevron-left') return ( <div> ...
This function is used to render a component.
import React from 'react' import PropTypes from 'proptypes' import cn from 'classnames' const CmcTypeButton = ({ thisType, activeType, onChange, label }) => ( <button className={ cn( 'cmc-filter__button btn btn-default', { 'active': activeType === thisType } ) } title={thisTyp...
Generates a component that can be used to filter a sequence of objects.
import React from 'react'; import List from 'material-ui/lib/lists/list'; import ListItem from 'material-ui/lib/lists/list-item'; import ActivityfeedAction from '../../actions/ActivityFeed/ActivityfeedAction'; import StatusStore from '../../stores/StatusStore'; import ActivityList from './trendactivityListComp.react'; ...
The main activity list component
import React from 'react' import PropTypes from 'prop-types' import classNames from 'classnames' import styled from 'styled-components' import { pxToRem } from '../../../helpers/utils/typography' const StyledMessagesMenu = styled.ul` display: flex; flex-direction: column; gap: ${pxToRem(5)}; list-style: none; ...
export a function to create a menu of messages
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageFilter6 = (props) => ( <SvgIcon {...props}> <path d="M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zm-8-2h2c1.1 0 2-.89 2-2v-2...
A filter that returns an image that can be used to render a series of icons.
import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { injectIntl } from 'react-intl'; import { setupListEditor, clearListSuggestions, ...
A component that displays a list of items that can be selected by a user.
import React from 'react' import { Button } from 'semantic-ui-react' const ButtonExampleGroupColored = () => ( <Button.Group color='blue'> <Button>One</Button> <Button>Two</Button> <Button>Three</Button> </Button.Group> ) export default ButtonExampleGroupColored
Example group of buttons that are not part of a group of buttons.
import React from 'react' import { inject, observer } from 'mobx-react' import { withRouter, Link } from 'react-router-dom' // import SimpleMDE from 'simplemde' import Toolbox from './Toolbox' function EditorHeader(props) { return ( <div className='writer-head'> <div className='writer-head-left'> ...
Component for a single post editor
// @flow import React from 'react'; import MarkdownDocs from 'metadata-react/Markdown/MarkdownDocs'; import markdown from './NotFound.md'; export default function Page() { return <MarkdownDocs markdown={markdown} subtitle="Flowcon" />; }
The default page for a single unknown element.
import React from 'react' import {increment, startClock} from '../actions' import {withReduxSaga} from '../store' import Page from '../components/page' class Counter extends React.Component { static async getInitialProps ({store}) { store.dispatch(increment()) } componentDidMount () { this.props.dispat...
A component that is rendered when a component is mounted.
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; import omit from 'lodash-es/omit'; // https://github.com/oliviertassinari/babel-plugin-transform-react-remove-prop-types#is-it-safe const propTypes = { /** * sections */ children: PropTypes.node.isRequi...
A component which is a component that can be rendered as a card.
import React, { Component } from 'react'; import UserList from './user_list'; export default class App extends Component { render() { return ( <div> <UserList /> </div> ); } }
The default app class.
import React from 'react' import Image from 'next/image' const Page = () => { return ( <div> <p>Drop srcSet prop (cannot be manually provided)</p> <Image src="/moving-truck.jpg" width={300} height={100} srcSet="/moving-truck-mobile.jpg 375w, /moving-truck-m...
The default page for missing missing node - tag.
import React from 'react'; import Layout from '../../components/Layout'; import Register from './Register'; const title = 'New User Registration'; export default { path: '/register', action() { return { title, component: <Layout><Register title={title} /></Layout>, }; }, };
export default function for missing user registration
import React from 'react'; import { Surface, CartesianGrid } from 'recharts'; export default React.createClass({ render () { let horizontalPoints = [10, 20, 30, 100, 400]; let verticalPoints = [100, 200, 300, 400]; return ( <Surface width={500} height={500}> <CartesianGrid width=...
create a single object with a default render function
import React from 'react'; import { connect } from 'react-redux'; import Order from '../components/Order'; import { setOrderVerified, setOrderAccepted, setOrderPending, setOrderCompleted, cancelCancel, confirmCancel, confirmBill, billOrder, viewOrd...
Create a new order pane with a map of state and order - specific properties.
import React from 'react'; import { connect } from 'react-redux'; const SubmitButton = ({ user }) => <button type="submit"> Finish registration, {user.firstName} {user.lastName}! </button>; SubmitButton.propTypes = { user: React.PropTypes.shape({ firstName: React.PropTypes.string.isRequired, lastNam...
The default registration logic for missing - user - related components.
import React from 'react'; import Ul from './Ul'; import Wrapper from './Wrapper'; function List(props) { const ComponentToRender = props.component; let content = (<div></div>); // If we have items, render them if (props.items) { content = props.items.map((item, index) => ( <ComponentToRender key={...
List - List of components that can be rendered by a component
import React from 'react'; import Motion from 'react-motion/lib/Motion'; import spring from 'react-motion/lib/spring'; import PropTypes from 'prop-types'; const Collapsable = ({ fullHeight, isVisible, children }) => ( <Motion defaultStyle={{ opacity: !isVisible ? 0 : 100, height: isVisible ? fullHeight : 0 }} style=...
Creates a collapsable view of a node.
import React from 'react'; import PropTypes from 'prop-types'; import Link from 'gatsby-link'; import Helmet from 'react-helmet'; import styled from 'styled-components'; import { rhythm } from '../utils/typography'; import loadWebFonts from '../services/web-fonts'; import Content from '../components/Content'; import ...
A template class that renders a single node in a template.
import React from 'react'; import { FormField, FormInput, FormRow, SegmentedControl } from 'elemental'; const DISTANCE_OPTIONS = [ { label: 'Max distance (km)', value: 'max' }, { label: 'Min distance (km)', value: 'min' }, ]; function getDefaultValue () { return { lat: undefined, lon: undefined, distance: {...
The default filter for a single node in a network.
import React from 'react'; import { Icon } from '../Icon'; import { spacable } from '../../hocs'; function HeroUnit(props) { const { children, icon, iconTheme, style, title, } = props; return ( <div className="ui-hero-unit" style={style}> <div className="ui-hero-unit-header"> ...
The HeroUnit is a component that creates a hierarchy of nodes that can be used to create a hero.
import React from 'react'; import styled from '@emotion/styled'; import Markdownify from './markdownify'; import theme from '../theme'; const Box = styled.div` margin-bottom: ${theme.space[5]}; img { margin-bottom: ${theme.space[3]}; margin-left: -${theme.space[2]}; } `; const Title = styled.h3` col...
The default feature list generator.
import React from 'react' import { Dialog, DialogTitle, DialogContent, DialogActions, Checkbox, Button } from 'react-mdl' const Welcome = ({ handleCloseDialog, openDialog }) => ( <Dialog open={openDialog} style={{'width':'600px'}}> <DialogTitle>Welcome</DialogTitle> <DialogContent> ...
Dialog - dialog - buttons
import React from 'react'; import ReactDOM from 'react-dom'; import IconSnackBarContent from './index'; ['default', 'primary', 'secondary', 'success', 'warning', 'error', 'info'].map(variant => { test(`${variant} renders with required props`, () => { const div = document.createElement('div'); ReactDOM.render...
Imports the icons and icons snack bar content.
import React from 'react' import styled from 'styled-components' import { faFileContract } from '@fortawesome/free-solid-svg-icons' import { Row, Section } from '../../components/grid' import { Icon, Title } from '../../components/typography' export const Hireme = () => ( <Container> <Title> <div> ...
export React. Component
import React from 'react'; import { render } from 'react-dom'; import createApp from 'shared/components/app'; const App = createApp(React); const props = window.payload || { title: 'Default client title' }; render( <App { ...props } />, document.getElementById('root') );
Imports a component and renders it into a DOM.
import React from 'react'; import renderer from 'react-test-renderer'; import { IntlProvider } from 'react-intl'; // See: https://github.com/yahoo/react-intl/wiki/Testing-with-React-Intl#jest const createComponentWithIntl = (children, props = { locale: 'en' }) => { return renderer.create( <IntlProvider {...prop...
Create a component with a IntlProvider
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { withRouter } from 'react-router-dom'; import ReactMarkdown from 'react-markdown'; import gfm from 'remark-gfm'; import raw from 'raw.macro'; import {...
The main entry point for the info view.
import './public'; import React from 'react'; import { render } from 'react-dom'; import { AppContainer } from 'react-hot-loader'; import config from './config'; import Router from './components/Router'; const mountNode = document.getElementById('app'); document.title = config.app.title; const renderApp = () => { ...
Devuelve un objeto nuevo
import { Box } from '@rocket.chat/fuselage'; import React from 'react'; import BusinessHoursTimeZone from './BusinessHoursTimeZone'; export default { title: 'omnichannel/businessHours/ee/BusinessHoursTimeZone', component: BusinessHoursTimeZone, }; export const Default = () => ( <Box maxWidth='x600' alignSelf='cen...
export default function
import * as THREE from 'three'; import React from 'react'; import SettingsStore from 'stores/settings_store'; import Scene3D from 'components/models/scene.react'; import World from 'components/models/world.react'; import Model from 'components/models/model.react'; import Stats from 'components/models/stats.react'; /* ...
The main react component for a single unknown node.
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './components/App'; import registerServiceWorker from './registerServiceWorker'; import { BrowserRouter as Router, } from 'react-router-dom' ReactDOM.render(<Router><App/></Router>, document.getElementById('root'...
Imports a single application.
import React from 'react'; import axios from 'axios'; import { connect } from 'react-redux'; let style = require('./AnalyticsBox.less'); class AnalyticsBox extends React.Component { constructor(props) { super(props); } componentDidMount() {} componentDidUpdate() {} render() { ...
A base class that implements a series of functions that can be used to create a new AnalyticsBox component.
import React from 'react'; export default class Text extends React.Component { render() { const { value } = this.props; return ( <p> {value.content.split('\n').map((line, index) => <span key={index}>{line}<br /></span>)} </p> ); } };
A component that renders a text field with a key and a value.
import React from 'react'; import { Nav, Navbar, NavDropdown, MenuItem, NavItem } from 'react-bootstrap'; import { IndexLinkContainer, LinkContainer } from 'react-router-bootstrap'; import {Flag} from 'ioc-liturgical-react'; import FontAwesome from 'react-fontawesome'; import { connect } from 'react-redux'; import Acti...
A component that is a component that can be used to render a header with a hidden hidden
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, { Component } from 'react'; import { connect } from 'react-redux'; import { fetchData } from 'redux/inventory/actions'; import Header from 'components/Header'; import List from 'components/List'; import SearchInput from 'components/Fields/SearchInput'; import Pagination from 'components/Pagination'; impor...
Component that is rendered when a component is destroyed.
/** * The MIT License (MIT) * * Copyright (c) 2016 Ricardo Pallas * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to...
A class that displays a single missing - user record in the system.
'use strict'; import React from 'react'; let { View, StyleSheet, TextInput, Text} = require('react-native'); import {LinkComponent} from '../lib/LinkComponent'; export class LinkField extends React.Component{ render(){ return(<LinkComponent {...this.props} labelStyle={[formStyles.fieldText, this....
A component that is rendered as a link field with a hidden hidden input.
import React from 'react'; import PropTypes from 'prop-types'; import AVAILABLE_CONFIGS from 'parser/AVAILABLE_CONFIGS'; class ConfigLoader extends React.PureComponent { static propTypes = { children: PropTypes.func.isRequired, // eslint-disable-next-line react/no-unused-prop-types specId: PropTypes.num...
A component that loads a config from a list of available configurations.
import React from 'react'; import SPELLS from 'common/SPELLS'; import ITEMS from 'common/ITEMS'; import UptimeIcon from 'interface/icons/Uptime'; import CriticalStrikeIcon from 'interface/icons/CriticalStrike'; import ItemStatistic from 'interface/statistics/ItemStatistic'; import BoringItemValueText from 'interface/s...
A class that exports a single node in the system that has a light whispers.
import React from 'react'; import Container from 'components/Common/Container'; import { Grid } from 'semantic-ui-react'; const UhOh = ({children}) => { return( <Container className="uhoh"> <Grid columns="equal"> {children} </Grid> </Container> ); }; exp...
export default functions
import React from 'react' import ReactDOM from 'react-dom' import createStore from './store/createStore' import AppContainer from './containers/AppContainer' // ======================================================== // Store Instantiation // ======================================================== const initialState...
Initialize a single node with a store
import React from 'react'; import Forms from './forms'; export default { path: '/forms', action() { return <Forms />; }, };
export.
import React from 'react' import { Dropdown, Input } from 'semantic-ui-react' const DropdownExampleInput = () => ( <Dropdown text='Filter' floating labeled button className='icon'> {/* <i class="filter icon"></i> */} <Dropdown.Menu> <Dropdown.Header content='Search Issues' /> <Input icon='search'...
Example input for a single node in a dropdown.
import React from 'react'; import SvgIcon from '../../SvgIcon'; const NavigationChevronRight = (props) => ( <SvgIcon {...props}> <path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/> </SvgIcon> ); NavigationChevronRight.displayName = 'NavigationChevronRight'; NavigationChevronRight.muiName = 'SvgIcon'; e...
NavigationChevronRight exports a component that can be used to render a chevron right.
import React from 'react'; import PropTypes from 'prop-types'; const emptyComponent = () => null; const noop = () => { }; class Bundle extends React.PureComponent { static propTypes = { fetchComponent: PropTypes.func.isRequired, loading: PropTypes.func, error: PropTypes.func, children: PropTypes.fu...
A component that is rendered by a component in a bundle.
import React from 'react'; import { Field, reduxForm } from 'redux-form'; import { TextField, SelectField } from 'redux-form-material-ui'; import { CustomToggle } from 'modules/shared/form'; import api from 'lib/api'; import messages from 'lib/text'; import style from './style.css'; import Divider from 'material-ui/D...
A component that can be used to render a summary of a single order.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionLightbulbOutline = (props) => ( <SvgIcon {...props}> <path d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1...
A light light that shows a single action on a light.
import React from 'react'; import { connect } from 'react-redux'; import { Redirect } from 'react-router' import { Button } from "@blueprintjs/core"; import { login } from '../store/actions/auth'; class LoginPanel extends React.Component { constructor(props) { super(props); this.state = { username: p...
The login panel component is a component that can be used to login a user.
import React from 'react'; import classnames from 'classnames'; import {currencySymbolLookup} from '../lib/format_currency'; import Currency from './Currency'; import Input from './Input'; import Select from './Select'; export default ({value, currency, frequency, presets, onChange, showCurrencyPicker, i18n}) => { ...
Generate a dropdown with a list of possible options for a specific unknown key.
import React from 'react'; import TripLocation from './trip-location'; export default React.createClass( { propTypes: { tripLocations: React.PropTypes.array, getLocationById: React.PropTypes.func.isRequired, getLocationById: React.PropTypes.func.isRequired, onRemoveTripLocation: React.PropTypes.func....
The default constructor for a node that can be used to render a list of TripLocations.
/** * Navbar Menu Button * * React Native Starter App * https://github.com/mcnamee/react-native-starter-app */ import React from 'react'; import PropTypes from 'prop-types'; import { TouchableOpacity } from 'react-native'; import Icon from 'react-native-vector-icons/Ionicons'; /* Component =======================...
Navbar Menu Button
import React from 'react' import BrandGallery from '../components/BrandGallery' export default () => ( <BrandGallery brand='4 Her' /> )
This module imports a non - empty object and returns it as a string.
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <g><path d="M12 6c0-.55-.45-1-1-1H5.82l.66-3.18.02-.23c0-.31-.13-.59-.33-.8L5.38 0 .44 4.94C.17 5.21 0 5.59 0 6v6.5c0 .83.67 1.5 1.5 1.5h6.75c.62 0 1.15-.38 1.38-.91l2.26-5.29c.07-.17.11-.36.11-.55V6zm10.5 4h-...
How to show the thumbs up down in the menu
import React from 'react'; export default function WeaponItem({ imageUrl, name }) { return ( <div className="weapon-item-wrapper"> <div className="weapon-item"> <img className="weapon-item-image" src={imageUrl} alt={name} /> <div className="weapon-item-...
WeaponItem - WeaponItem
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let NavigationArrowBack = (props) => ( <SvgIcon {...props}> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/> </SvgIcon> ); NavigationArrowBack = pure(NavigationArrowBack); NavigationArrowB...
NavigationArrowBack is a function that exports a navigation arrow back to a hidden element.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ContentContentCopy = (props) => ( <SvgIcon {...props}> <path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/> </SvgIcon> );...
A component that renders a series of icons that can be used to render a series of icons.
import _transformLib from 'transform-lib'; const _components = { Foo: { displayName: 'Foo' } }; const _transformLib2 = _transformLib({ filename: '%FIXTURE_PATH%', components: _components, locals: [], imports: [] }); function _wrapComponent(id) { return function (Component) { return _transformLib...
Private functions - Component that transforms a component into a component that can be rendered by a component.
import NextHead from 'next/head' import { string } from 'prop-types' import React from 'react' const defaultDescription = '' const defaultOGURL = '' const defaultOGImage = '' export const Head = (props) => ( <NextHead> <meta charSet="UTF-8" /> <title>{props.title || ''}</title> <meta name="descrip...
export next - head
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; import registerServiceWorker from './registerServiceWorker'; ReactDOM.render(<App />, document.getElementById('root')); registerServiceWorker();
Imports a single application.
/* eslint max-len: 0 */ /* eslint no-unused-vars: 0 */ /* eslint no-alert: 0 */ import React from 'react'; import { BootstrapTable, TableHeaderColumn, ButtonGroup } from 'react-bootstrap-table'; const products = []; function addProducts(quantity) { const startId = products.length; for (let i = 0; i < quantity; i...
The main logic for adding products to a BootstrapTable.
import React from 'react' import { Header } from 'shengnian-ui-react' const HeaderExampleDisabled = () => ( <Header as='h2' disabled> Disabled Header </Header> ) export default HeaderExampleDisabled
Imports a React component and exports a default header if no header is found.
import React from 'react' import 'material-design-icons/iconfont/material-icons.css' export default (props) => { return ( <i className={`material-icons ${props.className}`}>{props.name}</i> ) }
The default function for missing icons.
import React from 'react' const formats = [ { startTag: '[i]', endTag: '[/i]', style: 'font-italic' }, { startTag: '[b]', endTag: '[/b]', style: 'font-bold' } ] export const format = (text = '') => { let formatted = text let snippet, start, end let key = 0 formats.forEach(forma...
export format function
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.
/** * React Static Boilerplate * https://github.com/koistya/react-static-boilerplate * Copyright (c) Konstantin Tarkus (@koistya) | MIT license */ import React, { Component } from 'react'; export default class extends Component { render() { return ( <div> <h1>Blog</h1> <p>Coming soon....
The base class for a missing component that is not a component of a component type.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let MapsDirectionsWalk = (props) => ( <SvgIcon {...props}> <path d="M13.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM9.8 8.9L7 23h2.1l1.8-8 2.1 2v6h2v-7.5l-2.1-2 .6-3C14.8 12 16.8 13 19 13v-2c-1.9 0-3.5-1-4.3-...
A component that exports a sequence of icons.
import React from 'react'; import { View, Text, ActivityIndicator, } from 'react-native'; const styles = { container: { flex: 1, alignItems: 'center', justifyContent: 'center', paddingLeft: 20, paddingRight: 20, }, title: { fontSize: 26, marginBottom: 20, fontWeight: '700', ...
Dice un error de la
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionViewQuilt = (props) => ( <SvgIcon {...props}> <path d="M10 18h5v-6h-5v6zm-6 0h5V5H4v13zm12 0h5v-6h-5v6zM10 5v6h11V5H10z"/> </SvgIcon> ); ActionViewQuilt = pure(ActionViewQuilt); ActionViewQuilt.displayN...
A component that exports a single action in a quilt fashion.
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ToggleRadioButtonChecked = (props) => ( <SvgIcon {...props}> <path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3...
A component that renders a component that can be checked by a radio button.
import React from 'react'; export default function NotFound() { return ( <div className="container"> <h1>Doh! 404!</h1> <p>These are <em>not</em> the droids you are looking for!</p> </div> ); }
404 - Not all droids are the droids you are looking for!
import React from 'react' import Header from '../../components/Header' import classes from './CoreLayout.scss' import '../../styles/core.scss' export const CoreLayout = ({ children }) => ( <div className='container text-center'> <Header /> <div className={classes.mainContainer}> {children} </div> ...
React - core - layout
// @flow import React from 'react'; class MyComponent extends React.Component<void, Props, State> { defaultProps: T; static props: T; static state: T; a: T; b = 5; c: T = 5; method() {} } const expression = () => class extends React.Component<void, Props, State> { defaultProps: T; static prop...
A component that is not part of a component s hierarchy.
/* eslint-disable flowtype/require-valid-file-annotation */ /* eslint-disable react/no-multi-comp */ import React from 'react'; import PropTypes from 'prop-types'; import { withStyles } from 'material-ui/styles'; import Button from 'material-ui/Button'; import Avatar from 'material-ui/Avatar'; import List, { ListItem,...
A component that displays a single confirmation box that
import React, { Component } from 'react'; import classNames from 'classnames'; export default class Switch extends React.Component { constructor(props) { super(props); this.state = {checked: props.checked}; this.onChange = this.onChange.bind(this); } onChange(e) { this.set...
A component that implements switch.
import React, { Component } from 'react'; class Game extends Component { render() { console.log(this.props) return ( <div> <div className="Game"> {"WASSUP LETS PLAY"} </div> </div> ); } } export default Game;
A component that
import React from 'react'; import { Text, View, TextInput, Button, ScrollView, StyleSheet, TouchableOpacity, KeyboardAvoidingView, } from 'react-native'; import firebase from 'firebase'; import styles from './Styles'; import Header from './Header'; const NICKNAME = 'NICKNAME'; const NAME = '@jugend...
View that displays a list of messages that can be typed by a user.
import React from 'react'; import ReactDOM from 'react-dom'; import GraphiQL from 'graphiql'; import fetch from 'isomorphic-fetch'; app.get('/', (req, res) => { function graphQLFetcher(graphQLParams) { return fetch(window.location.origin + '/graphql', { method: 'post', headers: { 'Content-Type': 'app...
Imports the GraphiQL API and renders the DOM.
import React from 'react'; import Tabs from '../src/Tabs'; import Tab from '../src/Tab'; export default <Tabs className='tab-demo z-depth-1'> <Tab title="Test 1">Test 1</Tab> <Tab title="Test 2" active>Test 2</Tab> <Tab title="Test 3">Test 3</Tab> <Tab title="Test 4">Test 4</Tab> </Tabs>;
Imports a bunch of components from the system.
import React, { Component } from 'react'; import { Platform, StyleSheet, Text, View } from 'react-native'; import ConversationsList from '../components/ConversationsList'; const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'stretch', backg...
export default conversations class
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table'; import { connect } from 'react-redux'; import InsertRegistersModal from './InsertRegistersModal'; import * as actions from '../actions/'; import * as utils from '../ut...
A component that creates a register modal with a table that can be used to register a row of data.
import React from 'react' import Header from './Header' import NoteList from './NoteList' import Footer from './Footer' import '../styles/App.css'; class App extends React.Component { constructor() { super() this.state = { notes: [{ title: 'MSD Code Academy', text: 'Let\'s crete React a...
Component class that extends React. Component with a series of notes.
import React from 'react'; const ValueAxis = React.memo(({ scale, label, width, height, }) => { const [y1, y2] = scale.range(); return ( <g className="y axis" transform={`translate(${width - 1} -1)`} fill="none" fontSize="10" fontFamily="sans-serif" textAnchor="start...
Generate a series of memoized nodes that can be used to show a series of missing nodes.
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './containers/App'; import registerServiceWorker from './utils/registerServiceWorker'; ReactDOM.render( <React.StrictMode> <App /> </React.StrictMode>, document.getElementById('root') ); registerServiceWorker()...
Imports a single node in the DOM and renders it as a service worker.
import React from 'react'; import {Route} from 'react-router-dom' const RouteWithSubRoutes = (route) => ( <Route path={route.path} render={props => ( // pass the sub-routes down to keep nesting <route.component {...props} routes={route.routes}/> )}/> ); export default RouteWithSubRoutes
RouteWithSubRoutes export a function that renders a route with a sub - route.
import PropTypes from 'prop-types'; import React from 'react'; import badgeCssModule from './Badge.scss'; import { getTheme } from '../theme'; import BadgeLib from './BadgeComposition'; const theme = getTheme(badgeCssModule); const SIZES = { large: 'large', small: 'small', }; const TYPES = { VALID: 'valid', IN...
Provides a function to render a single unknown node in the DOM.
import React, { Component } from 'react'; import dateformat from 'dateformat'; import Container from './utils/container'; import { closeQuestion, watchQuestion, answerQuestion } from '../actions'; class QuestionPanel extends Container { constructor(props) { super(props); this.onClose = this.onClose.bind(th...
ComponentPanel class which renders a single question or question - panel with no children.
import React from 'react' class IntroBlock extends React.Component { render() { return ( <div className="db dt-ns mw9 center"> <div className="fl-m fl-l w-33-m w-33-l"> <div className="pa4 pa4-m"> <h3 className="f3">Whats in the Name?</h3> <p className="mid-gray f4 lh-c...
A component that can be rendered as a single intro block.
/** * NotFoundPage * * This is the page we show when the user visits a url that doesn't have a route * * NOTE: while this component should technically be a stateless functional * component (SFC), hot reloading does not currently support SFCs. If hot * reloading is not a necessity for you then you can refactor it...
NotFoundPage - The page we show when the user visits a url that doesn t have a route .
import React, { Component } from 'react'; export default class Dashboard extends Component { render() { return ( <div> Dashboard. This is a protected route. You can only see this if you're authed. </div> ); } }
The default dashboard class
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let NotificationEnhancedEncryption = (props) => ( <SvgIcon {...props}> <path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM8.9 6c0-1.71 1.39-3....
A component that renders a single missing - component component in a network network.
import React from 'react'; import { HashRouter, Switch, Route } from 'react-router-dom'; import { createBrowserHistory } from 'history'; import { Provider } from 'react-redux'; import App from '../components/Layout'; import Auth from '../components/auth'; import Documents from '../components/Documents'; import Document...
Imports a bunch of modules that are required to render a single page.