path
stringlengths
5
195
repo_name
stringlengths
5
79
content
stringlengths
25
1.01M
packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassModulesInclusion.js
facebookincubator/create-react-app
/** * 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 from 'react'; import styles from './assets/sass-styles.module.sass'; import indexStyles from './assets/index.module.sass'; const SassModulesInclusion = () => ( <div> <p className={styles.sassModulesInclusion}>SASS Modules are working!</p> <p className={indexStyles.sassModulesIndexInclusion}> SASS Modules with index are working! </p> </div> ); export default SassModulesInclusion;
src/ui/components/EndpointsList.js
BE-Webdesign/wp-rest-api-reference
/** * External dependecies. */ import React from 'react' /** * Internal dependecies. */ import ReferenceEndpoint from './ReferenceEndpoint' const EndpointsList = ( { endpoints } ) => { return ( <div className="endpoints-list"> <h3 className="endpoints-list__title">Endpoints:</h3> <ul> { endpoints.map( ( endpoint, index ) => <ReferenceEndpoint endpoint={ endpoint } key={ index } /> ) } </ul> </div> ) } export default EndpointsList
src/svg-icons/navigation/close.js
spiermar/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let NavigationClose = (props) => ( <SvgIcon {...props}> <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/> </SvgIcon> ); NavigationClose = pure(NavigationClose); NavigationClose.displayName = 'NavigationClose'; NavigationClose.muiName = 'SvgIcon'; export default NavigationClose;
ui/src/core/components/Navigation.js
erlanglab/erlangpl
// @flow import React from 'react'; import { Link, Route } from 'react-router-dom/'; import './Navigation.css'; const NavigationLink = ({ to, icon }) => ( <Route path={to} exact={false} children={({ match }) => ( <div className={`item ${match ? 'active' : ''}`}> <Link to={to}> {icon} </Link> </div> )} /> ); type Props = { tabs: Array<{ path: string, icon: string }> }; const Navigation = ({ tabs }: Props) => { return ( <div className="Navigation"> {tabs.map((tab, i) => ( <NavigationLink key={i} to={tab.path} icon={<i className={`fa fa-2x fa-${tab.icon}`} />} /> ))} </div> ); }; export default Navigation;
frontend/src/courses/components/header.js
OptimusCrime/youkok2
import React from 'react'; import { HeaderColumn } from './header-column'; import {COLUMN_CODE, COLUMN_NAME} from "../constants"; import {formatNumber} from "../../common/utils"; export const Header = ({ column, order, changeOrder, numCourses }) => ( <div className="course-row course-row__header"> <HeaderColumn id={COLUMN_CODE} text="Emnekode" column={column} order={order} changeOrder={changeOrder} /> <HeaderColumn id={COLUMN_NAME} text={`Emnernavn ${numCourses === 0 ? '' : `(${formatNumber(numCourses)})`}`} column={column} order={order} changeOrder={changeOrder} /> </div> );
04-mybooks-lab4/src/Header.js
iproduct/course-node-express-react
import React from 'react'; export default function Header() { return ( <React.Fragment> <h2 className="header center orange-text">My Library</h2> <div className="row center"> <h5 className="header col s12 light">Bookmark your favourite books</h5> </div> <div className="row center"> <a href="http://materializecss.com/getting-started.html" id="download-button" className="btn waves-effect waves-light orange" > View Favourites </a> </div> </React.Fragment> ); }
pnpm-offline/.pnpm-store-offline/1/registry.npmjs.org/react-bootstrap/0.31.0/es/MediaList.js
Akkuma/npm-cache-benchmark
import _extends from 'babel-runtime/helpers/extends'; import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn'; import _inherits from 'babel-runtime/helpers/inherits'; import classNames from 'classnames'; import React from 'react'; import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils'; var MediaList = function (_React$Component) { _inherits(MediaList, _React$Component); function MediaList() { _classCallCheck(this, MediaList); return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); } MediaList.prototype.render = function render() { var _props = this.props, className = _props.className, props = _objectWithoutProperties(_props, ['className']); var _splitBsProps = splitBsProps(props), bsProps = _splitBsProps[0], elementProps = _splitBsProps[1]; var classes = getClassSet(bsProps); return React.createElement('ul', _extends({}, elementProps, { className: classNames(className, classes) })); }; return MediaList; }(React.Component); export default bsClass('media-list', MediaList);
docs/app/Examples/collections/Message/Variations/MessageExampleInfo.js
aabustamante/Semantic-UI-React
import React from 'react' import { Message } from 'semantic-ui-react' const MessageExampleInfo = () => ( <Message info> <Message.Header>Was this what you wanted?</Message.Header> <p>Did you know it's been a while?</p> </Message> ) export default MessageExampleInfo
docs/client/components/pages/Sticker/gettingStarted.js
koaninc/draft-js-plugins
// It is important to import the Editor which accepts plugins. import Editor from 'draft-js-plugins-editor'; // eslint-disable-line import/no-unresolved import createStickerPlugin from 'draft-js-sticker-plugin'; // eslint-disable-line import/no-unresolved import React from 'react'; import { fromJS } from 'immutable'; // Creates an Instance. Passing in an Immutable.js List of stickers as an // argument. const stickers = fromJS({ data: { 'b3aa388f-b9f4-45b0-bba5-d92cf2caa48b': { id: 'b3aa388f-b9f4-45b0-bba5-d92cf2caa48b', url: '../images/unicorn-4.png', }, 'adec3f13-823c-47c3-b4d1-be4f68dd9d6d': { id: 'adec3f13-823c-47c3-b4d1-be4f68dd9d6d', url: '../images/unicorn-1.png', }, }, }); const stickerPlugin = createStickerPlugin({ stickers }); // The Editor accepts an array of plugins. In this case, only the stickerPlugin // is passed in, although it is possible to pass in multiple plugins. const MyEditor = ({ editorState, onChange }) => ( <Editor editorState={editorState} onChange={onChange} plugins={[stickerPlugin]} /> ); export default MyEditor;
docs/src/pages/blog.js
Gisto/Gisto
import React from 'react'; import { Helmet } from 'react-helmet'; import { graphql, Link } from 'gatsby'; import Header from 'components/header'; import Footer from 'components/footer'; const Blog = ({ data }) => ( <React.Fragment> <Helmet> <title>Blog</title> </Helmet> <Header/> <h1>Blog</h1> <section className="whiter boxes is-page-blog page-docs"> <div className="w-container content-container"> <div className="w-row w-col"> { data.allMarkdownRemark.edges.map((post) => ( <React.Fragment> <h2> <span>{post.node.frontmatter.date}</span> {post.node.frontmatter.title} </h2> <p>{post.node.excerpt}</p> <Link className="more" to={ post.node.frontmatter.path }> Read more <i className="fa fa-chevron-right"/> </Link> </React.Fragment> )) } </div> </div> </section> <Footer/> </React.Fragment> ); export const query = graphql` query { allMarkdownRemark(sort: { order: DESC, fields: [frontmatter___date] }) { edges { node { id excerpt(pruneLength: 250) frontmatter { date(formatString: "MMMM DD, YYYY") path title } } } } } `; export default Blog;
threeforce/node_modules/react-bootstrap/es/MediaRight.js
wolfiex/VisACC
import _extends from 'babel-runtime/helpers/extends'; import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn'; import _inherits from 'babel-runtime/helpers/inherits'; import classNames from 'classnames'; import React from 'react'; import Media from './Media'; import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils'; var propTypes = { /** * Align the media to the top, middle, or bottom of the media object. */ align: React.PropTypes.oneOf(['top', 'middle', 'bottom']) }; var MediaRight = function (_React$Component) { _inherits(MediaRight, _React$Component); function MediaRight() { _classCallCheck(this, MediaRight); return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); } MediaRight.prototype.render = function render() { var _props = this.props; var align = _props.align; var className = _props.className; var props = _objectWithoutProperties(_props, ['align', 'className']); var _splitBsProps = splitBsProps(props); var bsProps = _splitBsProps[0]; var elementProps = _splitBsProps[1]; var classes = getClassSet(bsProps); if (align) { // The class is e.g. `media-top`, not `media-right-top`. classes[prefix(Media.defaultProps, align)] = true; } return React.createElement('div', _extends({}, elementProps, { className: classNames(className, classes) })); }; return MediaRight; }(React.Component); MediaRight.propTypes = propTypes; export default bsClass('media-right', MediaRight);
examples/with-url-object-routing/pages/index.js
arunoda/next.js
import React from 'react' import Link from 'next/link' const href = { pathname: '/about', query: { name: 'next' } } const as = { pathname: '/about/next', hash: 'title-1' } export default () => ( <div> <h1>Home page</h1> <Link href={href} as={as}> <a>Go to /about/next</a> </Link> </div> )
src/svg-icons/notification/tap-and-play.js
rscnt/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let NotificationTapAndPlay = (props) => ( <SvgIcon {...props}> <path d="M2 16v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm0 4v3h3c0-1.66-1.34-3-3-3zm0-8v2c4.97 0 9 4.03 9 9h2c0-6.08-4.92-11-11-11zM17 1.01L7 1c-1.1 0-2 .9-2 2v7.37c.69.16 1.36.37 2 .64V5h10v13h-3.03c.52 1.25.84 2.59.95 4H17c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99z"/> </SvgIcon> ); NotificationTapAndPlay = pure(NotificationTapAndPlay); NotificationTapAndPlay.displayName = 'NotificationTapAndPlay'; export default NotificationTapAndPlay;
src/views/pages/home/index.js
raycent/ARWM_Exercise_Redux
import React, { Component } from 'react'; import { connect } from 'react-redux'; import { Loader } from 'semantic-ui-react'; import { stockActions } from 'core/stock'; import { Dashboard } from 'views/components/Dashboard'; import { NotFound } from 'views/components/notFound'; class StockPage extends Component { constructor(props) { super(props); this.body = this.body.bind(this); } componentDidMount() { const ticker = this.props.ticker ? this.props.ticker : 'AAPL'; if (ticker.length > 5) { this.props.fetchStockDataFailure(); } else { this.props.fetchStockDataRequest(ticker); } } body() { const {stock} = this.props; if (stock.data) { return <Dashboard stock={stock} />; } else if (stock.error) { return <NotFound error={stock.error} />; } else { return <Loader size="massive" content="Loading..." active />; } } render() { return ( <div> {this.body()} </div> ); } } StockPage.propTypes = { fetchStockDataFailure: React.PropTypes.func, fetchStockDataRequest: React.PropTypes.func, stock: React.PropTypes.object, ticker: React.PropTypes.string }; const mapStateToProps = (state, props) => ({ stock: state.stock, ticker: props.location.pathname.split('/')[1] }); const mapDispatchToProps = { fetchStockDataRequest: stockActions.fetchStockDataRequest, fetchStockDataFailure: stockActions.fetchStockDataFailure }; export default connect( mapStateToProps, mapDispatchToProps )(StockPage);
app/components/Dash.js
scalegray/scalegray
import React from 'react'; import AuthenticatedComponent from './AuthenticatedComponent' export default AuthenticatedComponent(class Dash extends React.Component { render() { return (<h1>Hello user!!</h1>); } });
frontend/scripts/components/common/TextInput.js
jakubzloczewski/react-exercise
import React from 'react'; class TextInput extends React.Component { render() { const {onChange, placeholder} = this.props; const style = this.getStyle(); return (<input style={style} type="text" placeholder={placeholder} onChange={onChange}/>); } getStyle() { return { padding: '0.5em 1em', margin: '0.5em', fontSize: '0.7em' }; } } export default TextInput;
src/pages/home/index.js
joefraley/ratticusscript
'use strict' import Helmet from 'react-helmet' import { ListOfPosts } from '../../components/blog/list-of-posts' import Path from 'path-browserify' import { ProfilePhoto } from '../../components/profile-photo' import React from 'react' import { getPosts } from '../../utilities' export const HomePage = props => { return <section className="home"> <Helmet title="Home | RatticusScript" meta={[{ content: `The internet home base of Joe Fraley. That's me. You get what you pay for (you didn't pay anything...check yourself!)`, name: 'description' }]} /> <header> <ProfilePhoto /> <div role="introduction"> <h1>Joe Fraley</h1> <p>Just hoping to leave the world a little better than I found it.</p> </div> </header> <ListOfPosts posts={ getPosts() }/> </section> }
internals/templates/homePage/homePage.js
adoveil/max
/* * HomePage * * This is the first thing users see of our App, at the '/' 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 and remove * the linting exception. */ import React from 'react'; import { FormattedMessage } from 'react-intl'; import messages from './messages'; export default class HomePage extends React.Component { // eslint-disable-line react/prefer-stateless-function render() { return ( <h1> <FormattedMessage {...messages.header} /> </h1> ); } }
generators/component/templates/4/components/StatelessCssModules.js
react-webpack-generators/generator-react-webpack
import React from 'react'; import cssmodules from 'react-css-modules'; import styles from '<%= style.webpackPath %>'; const <%= component.className %> = () => ( <div className="<%= style.className %>" styleName="<%= style.className %>"> Please edit <%= component.path %><%= component.fileName %> to update this component! </div> ); <%= component.className %>.displayName = '<%= component.displayName %>'; <%= component.className %>.propTypes = {}; <%= component.className %>.defaultProps = {}; export default cssmodules(<%= component.className %>, styles);
src/components/Markdown/Markdown.js
nolawi/champs-dialog-sg
/** * Copyright 2017 dialog LLC <[email protected]> * @flow */ import React, { Component } from 'react'; import classNames from 'classnames'; import { parse, parseInline, decorators } from '@dlghq/markdown'; import { renderBlocks, renderText } from './render'; import styles from './Markdown.css'; export type Props = { className?: string, text: string, inline?: boolean, tagName?: string, decorators: typeof decorators, renderText: typeof renderText, renderBlocks: typeof renderBlocks, emojiSize: number }; class Markdown extends Component { props: Props; static defaultProps = { decorators, renderText, renderBlocks, emojiSize: 18 }; shouldComponentUpdate(nextProps: Props): boolean { return nextProps.text !== this.props.text || nextProps.className !== this.props.className; } render() { if (this.props.inline) { const TagName = this.props.tagName || 'span'; const tokens = parseInline(this.props.text, this.props.decorators); const inlineClassName = classNames(styles.inline, this.props.className); return ( <TagName className={inlineClassName}> {this.props.renderText(tokens, this.props.emojiSize, true)} </TagName> ); } const TagName = this.props.tagName || 'div'; const className = classNames(styles.container, this.props.className); const tokens = parse(this.props.text, this.props.decorators); return ( <TagName className={className}> {this.props.renderBlocks(tokens)} </TagName> ); } } export default Markdown;
src/entypo/ChevronSmallRight.js
cox-auto-kc/react-entypo
import React from 'react'; import EntypoIcon from '../EntypoIcon'; const iconClass = 'entypo-svgicon entypo--ChevronSmallRight'; let EntypoChevronSmallRight = (props) => ( <EntypoIcon propClass={iconClass} {...props}> <path d="M11,10L7.859,6.58c-0.268-0.27-0.268-0.707,0-0.978c0.268-0.27,0.701-0.27,0.969,0l3.83,3.908c0.268,0.271,0.268,0.709,0,0.979l-3.83,3.908c-0.267,0.272-0.701,0.27-0.969,0c-0.268-0.269-0.268-0.707,0-0.978L11,10z"/> </EntypoIcon> ); export default EntypoChevronSmallRight;
public/components/tehtPage/tabsComponents/tehtava/Kohdekortti.js
City-of-Vantaa-SmartLab/kupela
import React from 'react'; import Showcase from '../reusables/templates/Showcase'; import { connect } from 'react-redux'; const Kohdekortti = (props) => ( <div className="kohdekortti"> <h2>Kohdekortti:</h2> {props.kohdekortit.map((card) => <Showcase src={card.url}/> )} </div> ); const mapStateToProps = ({ kohdekortit }) => ({ kohdekortit }); export default connect(mapStateToProps, null)(Kohdekortti);
src/index.js
udfalkso/react-redux
import React from 'react'; import createAll from './components/createAll'; export const { Provider, connect } = createAll(React);
website/src/AppFrame.js
kkamperschroer/react-navigation
import React from 'react'; import Link from './Link'; import Footer from './Footer'; import { addNavigationHelpers, } from 'react-navigation'; const NavigationLinks = ({navigation, className, reverse}) => { let links = [ ...navigation.state.routes.map((route, i) => { if (route.routeName === 'Home' || route.routeName === 'NotFound') { return null; } return ( <Link to={route.routeName} className={i === navigation.state.index ? 'active':''} key={route.routeName}> {route.routeName} </Link> ); }), <a href="https://github.com/react-community/react-navigation" key="github"> GitHub </a>, ]; if (reverse) { links = links.reverse(); } return ( <div className={className}> {links} </div> ); } class AppFrame extends React.Component { state = {isMobileMenuOpen: false}; componentWillReceiveProps(props) { if (this.props.navigation.state !== props.navigation.state) { this.setState({isMobileMenuOpen: false}); window.scrollTo(0,0); } } render() { const {navigation, router} = this.props; const {isMobileMenuOpen} = this.state; const childNavigation = addNavigationHelpers({ ...navigation, state: navigation.state.routes[navigation.state.index], }); const {state} = navigation; const ScreenView = router.getComponentForRouteName(state.routes[state.index].routeName); const {routes, index} = state; const route = routes[index]; const hasChildNavigation = !!route.routes; return ( <div className={`main-app ${isMobileMenuOpen ? 'mobileMenuActive' : ''}`}> <nav className="pt-navbar" id="navbar"><div className="inner-navbar"> <Link className="pt-navbar-group pt-align-left project-title" to="Home"> <img src="/assets/react-nav-logo.svg" role="presentation" className="logo" /> <h1 className="pt-navbar-heading"> React Navigation </h1> </Link> <NavigationLinks navigation={navigation} className="navbuttons" /> {hasChildNavigation && ( <span className={`pt-icon-properties openMenuButton ${isMobileMenuOpen ? 'active' : ''}`} onClick={() => { this.setState(s => ({ isMobileMenuOpen: !s.isMobileMenuOpen})); window.scrollTo(0,0); }} /> )} </div></nav> <NavigationLinks navigation={navigation} className="mobile-navbuttons" reverse /> <ScreenView navigation={childNavigation} /> <Footer /> </div> ); } } export default AppFrame;
src/svg-icons/notification/phone-paused.js
manchesergit/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let NotificationPhonePaused = (props) => ( <SvgIcon {...props}> <path d="M17 3h-2v7h2V3zm3 12.5c-1.25 0-2.45-.2-3.57-.57-.35-.11-.74-.03-1.02.24l-2.2 2.2c-2.83-1.44-5.15-3.75-6.59-6.59l2.2-2.21c.28-.26.36-.65.25-1C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.5c0-.55-.45-1-1-1zM19 3v7h2V3h-2z"/> </SvgIcon> ); NotificationPhonePaused = pure(NotificationPhonePaused); NotificationPhonePaused.displayName = 'NotificationPhonePaused'; NotificationPhonePaused.muiName = 'SvgIcon'; export default NotificationPhonePaused;
collect-webapp/frontend/src/datamanagement/components/NewRecordParametersDialog.js
openforis/collect
import React from 'react' import PropTypes from 'prop-types' import { Button, Dialog, DialogTitle, DialogActions, Table, TableBody, TableCell, TableHead, TableRow, } from '@mui/material' import L from 'utils/Labels' import Dates from 'utils/Dates' const NewRecordParametersDialog = (props) => { const { onClose, onOk, versions, open } = props return ( <Dialog onClose={onClose} aria-labelledby="new-record-parameters-dialog-title" open={open}> <DialogTitle id="new-record-parameters-dialog-title"> {L.l('dataManagement.formVersioning.selectFormVersion')} </DialogTitle> <div> <Table> <TableHead> <TableRow> <TableCell>{L.l('common.name')}</TableCell> <TableCell>{L.l('common.label')}</TableCell> <TableCell>{L.l('common.date')}</TableCell> </TableRow> </TableHead> <TableBody> {versions.map((v) => ( <TableRow key={v.id} hover onClick={() => onOk(v.id)}> <TableCell>{v.name}</TableCell> <TableCell>{v.label}</TableCell> <TableCell>{Dates.convertFromISOToStandard(v.date)}</TableCell> </TableRow> ))} </TableBody> </Table> </div> <DialogActions> <Button onClick={onClose}>{L.l('general.cancel')}</Button> </DialogActions> </Dialog> ) } NewRecordParametersDialog.propTypes = { onClose: PropTypes.func.isRequired, onOk: PropTypes.func.isRequired, open: PropTypes.bool, versions: PropTypes.array.isRequired, } NewRecordParametersDialog.defaultProps = { open: false, } export default NewRecordParametersDialog
src/parser/deathknight/unholy/modules/features/ClawingShadowsEfficiency.js
fyruna/WoWAnalyzer
import React from 'react'; import SPELLS from 'common/SPELLS'; import SpellIcon from 'common/SpellIcon'; import SpellLink from 'common/SpellLink'; import { formatPercentage } from 'common/format'; import Analyzer from 'parser/core/Analyzer'; import Enemies from 'parser/shared/modules/Enemies'; import StatisticBox, { STATISTIC_ORDER } from 'interface/others/StatisticBox'; import { encodeTargetString } from 'parser/shared/modules/EnemyInstances'; class ClawingShadowsEfficiency extends Analyzer { static dependencies = { enemies: Enemies, }; constructor(...args) { super(...args); this.active = this.selectedCombatant.hasTalent(SPELLS.CLAWING_SHADOWS_TALENT.id); } // used to track how many stacks a target has targets = {}; totalClawingShadowsCasts = 0; clawingShadowCastsZeroWounds = 0; on_byPlayer_applydebuffstack(event){ const spellId = event.ability.guid; if(spellId === SPELLS.FESTERING_WOUND.id){ this.targets[encodeTargetString(event.targetID, event.targetInstance)] = event.stack; } } on_byPlayer_removedebuffstack(event){ const spellId = event.ability.guid; if(spellId === SPELLS.FESTERING_WOUND.id){ this.targets[encodeTargetString(event.targetID, event.targetInstance)] = event.stack; } } on_byPlayer_removedebuff(event){ const spellId = event.ability.guid; if(spellId === SPELLS.FESTERING_WOUND.id){ this.targets[encodeTargetString(event.targetID, event.targetInstance)] = 0; } } on_byPlayer_cast(event){ const spellId = event.ability.guid; if(spellId === SPELLS.CLAWING_SHADOWS_TALENT.id){ this.totalClawingShadowsCasts++; if(this.targets.hasOwnProperty(encodeTargetString(event.targetID, event.targetInstance))){ const currentTargetWounds = this.targets[encodeTargetString(event.targetID, event.targetInstance)]; if(currentTargetWounds < 1){ this.clawingShadowCastsZeroWounds++; } } else { this.clawingShadowCastsZeroWounds++; } } } suggestions(when) { const percentCastZeroWounds = this.clawingShadowCastsZeroWounds/this.totalClawingShadowsCasts; const strikeEfficiency = 1 - percentCastZeroWounds; when(strikeEfficiency).isLessThan(0.80) .addSuggestion((suggest, actual, recommended) => { return suggest(<span>You are casting <SpellLink id={SPELLS.CLAWING_SHADOWS_TALENT.id} /> too often. When spending runes remember to cast <SpellLink id={SPELLS.FESTERING_STRIKE.id} /> instead on targets with no stacks of <SpellLink id={SPELLS.FESTERING_WOUND.id} /></span>) .icon(SPELLS.CLAWING_SHADOWS_TALENT.icon) .actual(`${formatPercentage(actual)}% of Clawing Shadows were used with Wounds on the target`) .recommended(`>${formatPercentage(recommended)}% is recommended`) .regular(recommended - 0.20).major(recommended - 0.40); }); } statistic() { const percentCastZeroWounds = this.clawingShadowCastsZeroWounds/this.totalClawingShadowsCasts; const strikeEfficiency = 1 - percentCastZeroWounds; return ( <StatisticBox icon={<SpellIcon id={SPELLS.CLAWING_SHADOWS_TALENT.id} />} value={`${formatPercentage(strikeEfficiency)} %`} label="Clawing Shadows Efficiency" tooltip={`${this.clawingShadowCastsZeroWounds} out of ${this.totalClawingShadowsCasts} Clawing Shadows were used with no Festering Wounds on the target.`} /> ); } statisticOrder = STATISTIC_ORDER.CORE(3); } export default ClawingShadowsEfficiency;
src/svg-icons/action/backup.js
IsenrichO/mui-with-arrows
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionBackup = (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-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"/> </SvgIcon> ); ActionBackup = pure(ActionBackup); ActionBackup.displayName = 'ActionBackup'; ActionBackup.muiName = 'SvgIcon'; export default ActionBackup;
components/page-title.js
bukinoshita/open-source
import React from 'react' const PageTitle = () => ( <div> <h1 className="page__title">Embrace Open Source</h1> <h2 className="page__subtitle">A list of GitHub issues to help beginners make their first pull request.</h2> <style jsx>{` .page__title { color: #3d4752; font-weight: 400; text-align: center; font-size: 32px; margin-top: 100px; letter-spacing: 2px; } .page__subtitle { margin-bottom: 100px; color: #5a646f; font-weight: 300; text-align: center; font-size: 18px; margin-top: 15px; } `}</style> </div> ) export default PageTitle
src/components/MaterialPicker.js
JedWatson/react-color
'use strict' /* @flow */ import React from 'react' import ReactCSS from 'reactcss' import merge from 'merge' import isPlainObject from 'lodash.isplainobject' import debounce from 'lodash.debounce' import color from '../helpers/color' import Material from './material/Material' class ColorPicker extends ReactCSS.Component { constructor(props: any) { super() this.state = merge(color.toState(props.color, 0), { visible: props.display, }) this.debounce = debounce(function(fn: any, data: any) { fn(data) }, 100) this.handleChange = this.handleChange.bind(this) this.handleHide = this.handleHide.bind(this) this.handleAccept = this.handleAccept.bind(this) this.handleCancel = this.handleCancel.bind(this) } classes(): any { return { 'show': { wrap: { zIndex: '999', position: 'absolute', display: 'block', }, picker: { zIndex: '2', position: 'relative', }, cover: { position: 'fixed', top: '0', bottom: '0', left: '0', right: '0', }, }, 'hide': { wrap: { zIndex: '999', position: 'absolute', display: 'none', }, }, 'right': { wrap: { left: '100%', marginLeft: '20px', top: '0', }, }, 'left': { wrap: { right: '100%', marginRight: '20px', top: '0', }, }, 'below': { wrap: { left: '0', marginLeft: '0', top: '100%', marginTop: '20px', }, }, 'override': { wrap: this.props.positionCSS, }, } } styles(): any { return this.css({ 'below': this.props.position === 'below' && this.props.display !== null, 'right': this.props.position === 'right' && this.props.display !== null, 'left': this.props.position === 'left' && this.props.display !== null, 'show': this.state.visible === true, 'hide': this.state.visible === false, 'override': isPlainObject(this.props.positionCSS), }) } handleHide() { if (this.state.visible === true) { this.setState({ visible: false, }) this.props.onClose && this.props.onClose({ hex: this.state.hex, hsl: this.state.hsl, rgb: this.state.rgb, }) } } handleAccept() { this.handleHide() } handleCancel() { if (this.state.visible === true) { this.setState({ visible: false, }) } } handleChange(data: any) { data = color.simpleCheckForValidColor(data) if (data) { var colors = color.toState(data, data.h || this.state.oldHue) this.setState(colors) this.props.onChangeComplete && this.debounce(this.props.onChangeComplete, colors) this.props.onChange && this.props.onChange(colors) } } componentWillReceiveProps(nextProps: any) { this.setState(merge(color.toState(nextProps.color, this.state.oldHue), { visible: nextProps.display, })) } render(): any { return ( <div is="wrap"> <div is="picker"> <Material {...this.props} {...this.state} onChange={ this.handleChange } onAccept={ this.handleAccept } onCancel={ this.handleCancel } /> </div> <div is="cover" onClick={ this.handleHide }/> </div> ) } } ColorPicker.defaultProps = { color: { h: 250, s: .50, l: .20, a: 1, }, display: null, type: 'sketch', position: 'right', positionCSS: {}, } export default ColorPicker
src/containers/Asians/Published/_AppBar/SmallAppBar/BreakRoundsButtons/index.js
westoncolemanl/tabbr-web
import React from 'react' import { connect } from 'react-redux' import Instance from './Instance' export default connect(mapStateToProps)(({ breakCategories, toggle }) => { return ( <div> {breakCategories.sort((a, b) => b.default).map(breakCategory => <Instance key={breakCategory._id} breakCategory={breakCategory} toggle={toggle} /> )} </div> ) }) function mapStateToProps (state, ownProps) { return { breakCategories: Object.values(state.breakCategories.data) } }
src/svg-icons/hardware/tv.js
pomerantsev/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let HardwareTv = (props) => ( <SvgIcon {...props}> <path d="M21 3H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5c0-1.1-.9-2-2-2zm0 14H3V5h18v12z"/> </SvgIcon> ); HardwareTv = pure(HardwareTv); HardwareTv.displayName = 'HardwareTv'; HardwareTv.muiName = 'SvgIcon'; export default HardwareTv;
src/views/HeaderTitle.js
Steviey/win-react-navigation
/* @flow */ import React from 'react'; import { Platform, StyleSheet, Text, } from 'react-native'; import type { Style, } from '../TypeDefinition'; type Props = { tintColor?: ?string; style?: Style, }; const HeaderTitle = ({ style, ...rest }: Props) => ( <Text numberOfLines={1} {...rest} style={[styles.title, style]} /> ); const styles = StyleSheet.create({ title: { fontSize: Platform.OS === 'ios' ? 17 : 18, fontWeight: Platform.OS === 'ios' ? '600' : '500', color: 'rgba(0, 0, 0, .9)', textAlign: Platform.OS === 'ios' ? 'center' : 'left', marginHorizontal: 16, }, }); HeaderTitle.propTypes = { style: Text.propTypes.style, }; export default HeaderTitle;
client/src/components/Join/Join.js
jenovs/bears-team-14
import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import api from '../../api'; import './style.css'; import Flash from '../Flash'; class Join extends Component { state = { errorStatus: '', busy: false, }; componentDidMount() { if (this.props.loggedIn) { this.props.history.replace('/'); } } componentWillReceiveProps(nextProps) { if (nextProps.loggedIn) { this.props.history.replace(`/`); } } handleChange = e => { this.setState(() => ({ errorStatus: '', })); }; registerUser = e => { e.preventDefault(); this.setState(() => ({ busy: true, })); const username = this.username.value; const password = this.password.value; api.registerNewUser(username, password).then(json => { if (json.error) { return this.setState(() => ({ errorStatus: json.error.text, busy: false, })); } this.props.handleLogin(json.username, json.isAdmin); }); }; render() { const { busy, errorStatus } = this.state; return ( <div className="join"> {errorStatus && <Flash danger>{errorStatus}</Flash>} <div className="columns"> <div className="column is-10 is-offset-1"> <div className="columns"> <div className="column is-one-third"> <h2 className="title">Join the adventure on Jobbatical!</h2> <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sequi natus aliquam, voluptatum iure pariatur vero. </p> <div className="has-text-centered"> <img src="http://via.placeholder.com/180x265" alt="Jobbatical-Dude" /> </div> </div> <div className="column is-two-thirds"> <div className="box"> <div className="field has-addons"> <a href="https://web.facebook.com" className="button is-large is-fullwidth facebook-btn" > <span className="icon is-medium"> <i className="fa fa-facebook-square" /> </span> <span>Sign up with Facebook</span> </a> </div> <div className="field has-addons"> <a href="https://google.com" className="button is-large is-fullwidth google-btn" > <span className="icon is-medium"> <i className="fa fa-google" /> </span> <span>Sign up with Google</span> </a> </div> <div className="divider line">OR</div> <form onSubmit={this.registerUser}> <div className="columns"> <div className="column"> <div className="field"> <label className="label" htmlFor="fname"> First Name </label> <div className="control has-icons-left"> <input className="input is-large" type="text" placeholder="first name" name="fname" /> <span className="icon is-medium is-left"> <i className="fa fa-user" /> </span> </div> </div> </div> <div className="column"> <div className="field"> <label className="label" htmlFor="lname"> Last name </label> <div className="control has-icons-left"> <input className="input is-large" type="tex" placeholder="last name" name="lname" /> <span className="icon is-medium is-left"> <i className="fa fa-user" /> </span> </div> </div> </div> </div> <div className="field"> <label className="label" htmlFor="text"> Username </label> <div className="control has-icons-left"> <input onChange={this.handleChange} autoFocus className="input is-large" type="text" placeholder="username" name="username" ref={el => (this.username = el)} required /> </div> </div> <div className="field"> <label className="label" htmlFor="password"> Password </label> <div className="control has-icons-left"> <input className="input is-large" type="password" placeholder="password" name="password" ref={el => (this.password = el)} required /> <span className="icon is-medium is-left"> <i className="fa fa-lock" /> </span> </div> </div> <div className="columns sign-up"> <div className="column is-size-12"> By signing up, you agree to Jobbatical’s{' '} <Link to="/">Terms of Service</Link> and{' '} <Link to="/">Privacy Policy</Link>. </div> <div className="column"> <div className="field has-addons"> <button type="submit" className="button is-fullwidth is-large is-primary" disabled={busy} > <span>SIGN UP</span> <span className="icon is-medium"> <i className="fa fa-sign-in" /> </span> </button> </div> </div> </div> </form> <hr /> <div className="is-size-12"> Already have an account?{' '} <Link to="/login">Log in here!</Link> </div> </div> </div> </div> </div> </div> </div> ); } } export default Join;
client/index.js
BostonGlobe/elections-2017
// This is the app's client-side entry point. Webpack starts here when // bundling the entire codebase. /* eslint-disable global-require, no-unused-vars */ import React from 'react' import ReactDOM from 'react-dom' import { browserHistory } from 'react-router' import configureStore from './../common/store/configureStore.js' import css from './../common/styles/config.styl' import critical from './../common/appUtils/critical.js' import setPathCookie from './../common/appUtils/setPathCookie.js' import removeMobileHover from './../common/appUtils/removeMobileHover.js' import 'picturefill' // These two calls are apps boilerplate. removeMobileHover() setPathCookie() // Grab the initial Redux state (a JSON string created by the server). const initialState = window.REDUX__INITIALSTATE // Hydrate the Redux store with `initialState`. const store = configureStore(initialState) // Get the DOM element that will house our app. const rootElement = document.getElementById('root') // Setup a `render` function that we will overwrite for hot module // reloading - see https://github.com/reactjs/redux/pull/1455. let render = () => { const Root = require('./../common/components/Root.js').default // Render React app to `rootElement`. ReactDOM.render( <Root history={browserHistory} store={store} />, rootElement) } // If HMR is enabled, if (module.hot) { const renderRoot = render // and we have an error, const renderError = (error) => { const RedBox = require('redbox-react').default // render error with `RedBox` styling. ReactDOM.render(<RedBox error={error} />, rootElement) } // Otherwise try to render app normally. render = () => { try { renderRoot() } catch (error) { renderError(error) } } module.hot.accept('./../common/components/Root.js', () => { setTimeout(render) }) } render()
app/containers/HomePage/index.js
tarioto/Portfolio
/* * HomePage * * This is the first thing users see of our App, at the '/' 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 and remove * the linting exception. */ import React from 'react'; import { FormattedMessage } from 'react-intl'; import messages from './messages'; // import Img from './Img'; // import Headshot from './headshot.png'; export default class HomePage extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function render() { return ( <div className="container"> <div className="row"> <div className="col-xs-12"> <div className="page-header"> <h1><FormattedMessage {...messages.name} /> <small><FormattedMessage {...messages.title} /></small></h1> <FormattedMessage {...messages.header} /> </div> </div> </div> {/* <div className="row"> <div className="col-xs-12"> <div className="panel panel-primary"> <div className="panel-body"> <FormattedMessage {...messages.header} /> </div> </div> </div> </div> */} </div> ); } }
packages/material-ui-icons/src/Filter6.js
AndriusBil/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from 'material-ui/SvgIcon'; let Filter6 = 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-2c0-1.11-.9-2-2-2h-2V7h4V5h-4c-1.1 0-2 .89-2 2v6c0 1.11.9 2 2 2zm0-4h2v2h-2v-2z" /> </SvgIcon>; Filter6 = pure(Filter6); Filter6.muiName = 'SvgIcon'; export default Filter6;
docs/src/app/components/pages/components/Card/ExampleControlled.js
verdan/material-ui
import React from 'react'; import {Card, CardActions, CardHeader, CardMedia, CardTitle, CardText} from 'material-ui/Card'; import FlatButton from 'material-ui/FlatButton'; import Toggle from 'material-ui/Toggle'; export default class CardExampleControlled extends React.Component { constructor(props) { super(props); this.state = { expanded: false, }; } handleExpandChange = (expanded) => { this.setState({expanded: expanded}); }; handleToggle = (event, toggle) => { this.setState({expanded: toggle}); }; handleExpand = () => { this.setState({expanded: true}); }; handleReduce = () => { this.setState({expanded: false}); }; render() { return ( <Card expanded={this.state.expanded} onExpandChange={this.handleExpandChange}> <CardHeader title="URL Avatar" subtitle="Subtitle" avatar="images/ok-128.jpg" actAsExpander={true} showExpandableButton={true} /> <CardText> <Toggle toggled={this.state.expanded} onToggle={this.handleToggle} labelPosition="right" label="This toggle controls the expanded state of the component." /> </CardText> <CardMedia expandable={true} overlay={<CardTitle title="Overlay title" subtitle="Overlay subtitle" />} > <img src="images/nature-600-337.jpg" /> </CardMedia> <CardTitle title="Card title" subtitle="Card subtitle" expandable={true} /> <CardText expandable={true}> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec mattis pretium massa. Aliquam erat volutpat. Nulla facilisi. Donec vulputate interdum sollicitudin. Nunc lacinia auctor quam sed pellentesque. Aliquam dui mauris, mattis quis lacus id, pellentesque lobortis odio. </CardText> <CardActions> <FlatButton label="Expand" onTouchTap={this.handleExpand} /> <FlatButton label="Reduce" onTouchTap={this.handleReduce} /> </CardActions> </Card> ); } }
app/components/Log.js
L-A/Little-Jekyll
import React, { Component } from 'react'; var Log = React.createClass({ render: function () { return ( <li className={this.props.log.logType}><p className="log-data">{this.props.log.logData}</p></li> ); } }) module.exports = Log;
examples/huge-apps/routes/Course/routes/Grades/components/Grades.js
RobertKielty/react-router
import React from 'react'; class Grades extends React.Component { render () { var assignments = COURSES[this.props.params.courseId].assignments; return ( <div> <h3>Grades</h3> <ul> {assignments.map(assignment => ( <li key={assignment.id}>{assignment.grade} - {assignment.title}</li> ))} </ul> </div> ); } } export default Grades;
example/TestLibQuickblox/ContactList.js
ttdat89/react-native-video-quickblox
/** * Created by Dat Tran on 9/27/17. */ import React from 'react'; import { StyleSheet, Text, TextInput, View, LayoutAnimation, TouchableOpacity, FlatList } from 'react-native'; import QuickbloxManager from './QuickbloxManager'; export default class ContactList extends React.Component { constructor() { super() this.state = { user: 'null', users: [] } this.quickbloxManager = new QuickbloxManager() } componentDidMount() { this.quickbloxManager.getUsers(users => { if (typeof (users) === 'string') this.setState({users: JSON.parse(users)}) else if (typeof (users) === 'object' && Array.isArray(users)) this.setState({users: users}) }) } renderListItem(item) { return <TouchableOpacity onPress={() => { this.quickbloxManager.callUsers([item.id], 1, 'Dat Tran', 'https://qph.ec.quoracdn.net/main-qimg-7ea75331d55c74f7e3c0815cca3e8b4a-c') this.props.callSuccess() }}> <View style={{flexDirection: 'row', height: 44, alignItems: 'center'}}> <Text>{item.id}</Text> <View style={{width: 40}}/> <Text>{item.login}</Text> </View> </TouchableOpacity> } render() { return <View> <Text>{`userId: ${this.props.currentUser}`}</Text> <Text>Click to call</Text> <FlatList keyboardShouldPersistTaps='always' style={{backgroundColor: 'white'}} data={this.state.users} keyExtractor={(item, index) => index} renderItem={({item, index}) => this.renderListItem(item, index)}/> </View> } }
react-src/catalog/components/FilterTheme.js
gabzon/experiensa
import React from 'react'; import CatalogFilterButton from './filters/CatalogFilterButton' export default class FilterTheme extends React.Component { constructor(){ super() } renderThemesButtons(){ if(this.props.themes) { return this.props.themes.map((theme) => { return ( <CatalogFilterButton key={theme.id} id={theme.id} name={theme.name} filter_type="FILTER_THEME" options={this.props.options}/> ) }) }else{ return (<h3>No Theme Filters</h3>) } } render() { return ( <div className="column"> <h3 className="ui header"> <i className="soccer icon"/> <div className="content catalog-title">Theme</div> </h3> <div className="ui items" style={{"display": "block"}}> {this.renderThemesButtons()} </div> </div> ); } }
app/Resources/js/index.js
shempignon/podcast-api
import React from 'react' import ReactDOM from 'react-dom' import { AppContainer } from 'react-hot-loader' import routes from './routes' import injectTapEventPlugin from 'react-tap-event-plugin' injectTapEventPlugin() const render = (Component) => { ReactDOM.render( <AppContainer> <Component/> </AppContainer>, document.getElementById('root') ) } render(routes) // Hot Module Replacement API if (module.hot) { module.hot.accept('./routes', () => { render(routes) }) }
src/routes/system/Role/ModalForm.js
daizhen256/i5xwxdoctor-web
import React from 'react' import PropTypes from 'prop-types' import { Form, Input, Modal, Icon } from 'antd' import UserPower from './UserPower' import styles from './ModalForm.less' const FormItem = Form.Item const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 } } const ModalForm = ({ modal: { curItem, type, visible }, loading, form: { getFieldDecorator, validateFields, resetFields }, onOk, onCancel }) => { if(!curItem.power) { curItem.power = {} } function handleOk () { validateFields((errors, values) => { if (errors) { return } const data = { ...values, id: curItem.id, power: curItem.power } onOk(data) }) } const modalFormOpts = { title: type === 'create' ? <div><Icon type="plus-circle-o" /> 新建角色</div> : <div><Icon type="edit" /> 修改角色</div>, visible, wrapClassName: 'vertical-center-modal', className: styles.modalWidth, confirmLoading: loading, onOk: handleOk, onCancel, afterClose() { resetFields() //必须项,编辑后如未确认保存,关闭时必须重置数据 } } const UserPowerGen = () => <UserPower powerList={curItem.power}/> return ( <Modal {...modalFormOpts}> <Form> <FormItem label='角色名称:' hasFeedback {...formItemLayout}> {getFieldDecorator('name', { initialValue: curItem.name, rules: [ { required: true, message: '角色名称不能为空' } ] })(<Input />)} </FormItem> <FormItem> <UserPowerGen/> </FormItem> </Form> </Modal> ) } ModalForm.propTypes = { modal: PropTypes.object, form: PropTypes.object } export default Form.create()(ModalForm)
src/components/secure/show_book.js
haki-projects/mapping-feminism-v2
import React, { Component } from 'react'; import { fetchBooks } from '../../actions/books'; import { connect } from 'react-redux'; import { Link } from 'react-router'; class BookShow extends Component { constructor(props) { super(props); } componentDidMount() { this.props.fetchBooks(); } render() { if(!this.props.book){ return <div className='container text-center'> loading....</div> } const { book } = this.props; return( <div className='container'> <div className='card'> <h3 className='card-header'> Title: {book.original_title} <br /> </h3> <div className='card-block'> <div className='card-text'> Author: {book.author_first_name + ' ' + book.author_last_name} <br /> Original Title: {book.original_title} <br /> Translation Title: {book.translation_title} <br /> Original Language: {book.original_lang} <br /> Translator: {book.translator} <br /> Translation Publication Date: {book.translation_pub_date} <br /> original Publication Date: {book.original_pub_date} <br /> </div> </div> <div className='card-footer'><Link className='btn btn-primary' to='/dashboard'>Back </Link> </div> </div> </div> ) }; } function mapStateToProps({ books }, ownProps){ const id = ownProps.params.id; return { books, book: books[id] }; } export default connect(mapStateToProps, { fetchBooks} )(BookShow);
index.ios.js
jokunhe/react-native-ee-camera
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */ import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View } from 'react-native'; export default class chuanzhang extends Component { render() { return ( <View style={styles.container}> <Text style={styles.welcome}> Welcome to React Native! </Text> <Text style={styles.instructions}> To get started, edit index.ios.js </Text> <Text style={styles.instructions}> Press Cmd+R to reload,{'\n'} Cmd+D or shake for dev menu </Text> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, }); AppRegistry.registerComponent('chuanzhang', () => chuanzhang);
src/components/ControllerUnit.js
budunwang/React-Gallery
import React from 'react'; class ControllerUnit extends React.Component { constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); } //索引点击事件 handleClick(e) { if(this.props.arrange.isCenter) { this.props.inverse(); } else { this.props.center(); } e.stopPropagation(); e.preventDefault(); } render() { //根据图片状态加载索引条 let controllerUnitClassName = 'controller-unit'; controllerUnitClassName = this.props.arrange.isCenter? controllerUnitClassName + ' is-center':controllerUnitClassName; controllerUnitClassName = this.props.arrange.isInverse? controllerUnitClassName + ' is-inverse':controllerUnitClassName; return ( <span className={controllerUnitClassName} onClick={this.handleClick}></span> ) } } export default ControllerUnit;
src/components/RevealAuction/RevealAuctionInfo.js
PhyrexTsai/ens-bid-dapp
import React from 'react'; import {shortFormatHash, momentFromNow} from '../../lib/util'; import Button from 'material-ui/Button'; import Card from 'material-ui/Card'; import Divider from 'material-ui/Divider'; import './RevealAuctionInfo.css'; const FinalizeAuctionOn = (props) => <div className='FinalizeAuctionOn'> <h4>Finalize Auction On:</h4> <p>{props.registratesAt}</p> <p>{props.endsMomentFromNow}</p> <Divider /> </div>; const InfoItem = (props) => { let classes = ''; if (props.title === 'ENS') classes = 'eth-item'; if (props.title === 'TxHash') classes = 'eth-txhash'; if (props.title === 'JSON') classes = 'eth-json'; return ( <div className='RevealAuctionInfo-info-item'> <p> <span>{props.title}:</span> <span className={classes}>{props.children}</span> </p> <Divider /> </div> ) } export const RevealAuctionInfo = (props) => { const endsMomentFromNow = momentFromNow(props.registratesAt); const hidden = (props.registratesAt.year() - 1970) <= 0; const ethersacnUrl = process.env.REACT_APP_ETHERSCAN_URL || 'https://ropsten.etherscan.io/tx/'; const txHashUrl = ethersacnUrl + props.revealTXHash; const finalizeAuctionOn = !hidden && <FinalizeAuctionOn registratesAt={props.registratesAt.toString()} endsMomentFromNow={endsMomentFromNow.toString()} />; const {ethBid, secret} = props.formResult const shorterTxHash = shortFormatHash(props.revealTXHash); const itemTitleValue = [ {title: 'ENS', value: `${props.searchResult.searchName}.eth`}, {title: 'ETH Bid', value: ethBid}, {title: 'Secret', value: secret}, {title: 'TxHash', value: <a target='_blank' href={txHashUrl}>{shorterTxHash}</a>}, {title: 'JSON', value: JSON.parse(props.exportJson)} ]; const infoItems = itemTitleValue.map(({title, value}, index) => <InfoItem key={`infoItem-${index}`} title={title}>{value}</InfoItem> ); return ( <Card raised> <div className='RevealAuctionInfo'> {finalizeAuctionOn} {infoItems} <div className='RevealAuctionInfo-actions'> <Button raised onClick={() => props.backToSearch()}>BACK TO SEARCH</Button> {/*<Button raised>MY ENS LIST</Button>*/} </div> </div> </Card> ); };
pootle/static/js/admin/components/Language/LanguageController.js
pavels/pootle
/* * Copyright (C) Pootle contributors. * * This file is a part of the Pootle project. It is distributed under the GPL3 * or later license. See the LICENSE file for a copy of the license and the * AUTHORS file for copyright and authorship information. */ import React from 'react'; import Search from '../Search'; import LanguageAdd from './LanguageAdd'; import LanguageEdit from './LanguageEdit'; const LanguageController = React.createClass({ propTypes: { items: React.PropTypes.object.isRequired, model: React.PropTypes.func.isRequired, onAdd: React.PropTypes.func.isRequired, onCancel: React.PropTypes.func.isRequired, onDelete: React.PropTypes.func.isRequired, onSearch: React.PropTypes.func.isRequired, onSelectItem: React.PropTypes.func.isRequired, onSuccess: React.PropTypes.func.isRequired, searchQuery: React.PropTypes.string.isRequired, selectedItem: React.PropTypes.object, view: React.PropTypes.string.isRequired, }, render() { const viewsMap = { add: ( <LanguageAdd model={this.props.model} collection={this.props.items} onSuccess={this.props.onSuccess} onCancel={this.props.onCancel} /> ), edit: ( <LanguageEdit model={this.props.selectedItem} collection={this.props.items} onAdd={this.props.onAdd} onSuccess={this.props.onSuccess} onDelete={this.props.onDelete} /> ), }; const args = { count: this.props.items.count, }; let msg; if (this.props.searchQuery) { msg = ngettext('%(count)s language matches your query.', '%(count)s languages match your query.', args.count); } else { msg = ngettext( 'There is %(count)s language.', 'There are %(count)s languages. Below are the most recently added ones.', args.count ); } const resultsCaption = interpolate(msg, args, true); return ( <div className="admin-app-languages"> <div className="module first"> <Search fields={['index', 'code', 'fullname']} onSearch={this.props.onSearch} onSelectItem={this.props.onSelectItem} items={this.props.items} selectedItem={this.props.selectedItem} searchLabel={gettext('Search Languages')} searchPlaceholder={gettext('Find language by name, code')} resultsCaption={resultsCaption} searchQuery={this.props.searchQuery} /> </div> <div className="module admin-content"> {viewsMap[this.props.view]} </div> </div> ); }, }); export default LanguageController;
src/svg-icons/image/add-to-photos.js
ArcanisCz/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageAddToPhotos = (props) => ( <SvgIcon {...props}> <path d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9h-4v4h-2v-4H9V9h4V5h2v4h4v2z"/> </SvgIcon> ); ImageAddToPhotos = pure(ImageAddToPhotos); ImageAddToPhotos.displayName = 'ImageAddToPhotos'; ImageAddToPhotos.muiName = 'SvgIcon'; export default ImageAddToPhotos;
docs/index.js
casesandberg/reactcss
'use strict' import ReactDOM from 'react-dom' import React from 'react' import '../node_modules/normalize.css/normalize.css' import Docs from './components/docs/Docs' ReactDOM.render( React.createElement(Docs), document.getElementById('root') )
src/svg-icons/av/shuffle.js
ArcanisCz/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let AvShuffle = (props) => ( <SvgIcon {...props}> <path d="M10.59 9.17L5.41 4 4 5.41l5.17 5.17 1.42-1.41zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4h-5.5zm.33 9.41l-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04-3.13-3.13z"/> </SvgIcon> ); AvShuffle = pure(AvShuffle); AvShuffle.displayName = 'AvShuffle'; AvShuffle.muiName = 'SvgIcon'; export default AvShuffle;
src/components/GameListItemComponent.js
noraeb/tictactoe
import React from 'react'; const containerStyle = { fontFamily: "Roboto" } class GameListItemComponent extends React.Component { selectGame() { this.props.onClick(this.props.game); } render() { return ( <li style={containerStyle} onClick={this.selectGame.bind(this)}>Game by {this.props.game.playerOne}</li> ); } } export default GameListItemComponent;
src/index.js
raghu666/Reactapp
import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { createStore, applyMiddleware } from 'redux'; import ReduxPromise from 'redux-promise'; import App from './components/app'; import reducers from './reducers'; import { BrowserRouter } from 'react-router-dom'; const createStoreWithMiddleware = applyMiddleware(ReduxPromise)(createStore); ReactDOM.render( <Provider store={createStoreWithMiddleware(reducers)}> <BrowserRouter> <App /> </BrowserRouter> </Provider> , document.querySelector('.container'));
docs/app/Examples/collections/Grid/ResponsiveVariations/GridExampleReversedComputer.js
vageeshb/Semantic-UI-React
import React from 'react' import { Grid } from 'semantic-ui-react' const GridExampleReversedComputer = () => ( <Grid reversed='computer' columns='equal'> <Grid.Row> <Grid.Column>Computer A Fourth</Grid.Column> <Grid.Column>Computer A Third</Grid.Column> <Grid.Column>Computer A Second</Grid.Column> <Grid.Column>Computer A First</Grid.Column> </Grid.Row> <Grid.Row> <Grid.Column>Computer B Fourth</Grid.Column> <Grid.Column>Computer B Third</Grid.Column> <Grid.Column>Computer B Second</Grid.Column> <Grid.Column>Computer B First</Grid.Column> </Grid.Row> </Grid> ) export default GridExampleReversedComputer
react/components-test/src/App.js
MarioCodes/Desarrollo_Proyectos_Clase
import React, { Component } from 'react'; import './App.css'; import HelloWorld from './component/HelloWorld' class App extends Component { render() { return ( <div className="App"> <HelloWorld/> </div> ); } } export default App;
src/app.js
dahtuska/tekstiilit
import React from 'react'; import ReactDOM from 'react-dom'; import {Router, useRouterHistory} from 'react-router'; import injectTapEventPlugin from 'react-tap-event-plugin'; import {createHashHistory} from 'history'; import AppRoutes from './AppRoutes'; // Helpers for debugging window.React = React; window.Perf = require('react-addons-perf'); // Needed for onTouchTap // Can go away when react 1.0 release // Check this repo: // https://github.com/zilverline/react-tap-event-plugin injectTapEventPlugin(); /** * Render the main app component. You can read more about the react-router here: * https://github.com/rackt/react-router/blob/master/docs/guides/overview.md */ ReactDOM.render( <Router history={useRouterHistory(createHashHistory)({queryKey: false})} onUpdate={() => window.scrollTo(0, 0)} > {AppRoutes} </Router>, document.getElementById('app'));
src/router.js
Arinono/uReflect_POC_Electron01
import React from 'react'; import { Router, Route, browserHistory, IndexRoute } from 'react-router'; // Pages import App from './containers/App'; var routes = ( <Route path="/" component={App}> </Route> ); export default routes;
src/js/components/icons/base/BrandGrommetPath.js
kylebyerly-hp/grommet
// (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/Props'; const CLASS_ROOT = CSSClassnames.CONTROL_ICON; const COLOR_INDEX = CSSClassnames.COLOR_INDEX; export default class Icon extends Component { render () { const { className, colorIndex } = this.props; let { a11yTitle, size, responsive } = this.props; let { intl } = this.context; const classes = classnames( CLASS_ROOT, `${CLASS_ROOT}-brand-grommet-path`, className, { [`${CLASS_ROOT}--${size}`]: size, [`${CLASS_ROOT}--responsive`]: responsive, [`${COLOR_INDEX}-${colorIndex}`]: colorIndex } ); a11yTitle = a11yTitle || Intl.getMessage(intl, 'brand-grommet-path'); const restProps = Props.omit(this.props, Object.keys(Icon.propTypes)); return <svg {...restProps} version="1.1" viewBox="0 0 48 48" width="24px" height="24px" role="img" className={classes} aria-label={a11yTitle}><path fill="none" stroke="#865CD6" strokeWidth="5" d="M24,42 C33.9411255,42 42,33.9411255 42,24 C42,14.0588745 33.9411255,6 24,6 C14.0588745,6 6,14.0588745 6,24 C6,33.9411255 14.0588745,42 24,42 Z"/></svg>; } }; Icon.contextTypes = { intl: PropTypes.object }; Icon.defaultProps = { responsive: true }; Icon.displayName = 'BrandGrommetPath'; Icon.icon = true; Icon.propTypes = { a11yTitle: PropTypes.string, colorIndex: PropTypes.string, size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge', 'huge']), responsive: PropTypes.bool };
app/src/containers/Services/SectionOne/ServicesSectionOne.js
RyanCCollins/ryancollins.io
import React from 'react'; import './ServicesSectionOne.scss'; import { Column, Row, Button } from 'react-foundation'; import { Divider } from '../../../components'; const paragraph1P1 = `Through the `; const paragraph1P2 = ` platform, we have proven that working collaboratively on meaningful open sources projects together is an incredible way to improve skills.`; const paragraph2 = `If you are interested in working with us on a meaningful project with a social impact, we can pair you with a mentor who will work with you to get you up to speed with React and the rest of our stack.`; const paragraph3 = `You'll get an oppurtunity to work with a real-life distributed agile team, working towards a common goal of social good.`; const ServicesSectionOne = () => ( <section className="services-section-one"> <div className="section-title">Mentoring</div> <Divider /> <Row> <Column large={8} medium={10} small={12} isColumn centerOnSmall className="services--paragraph-wrapper" > <p>{paragraph1P1}<a href="https://hacksmiths.io">Hacksmiths.io</a> {paragraph1P2}</p> <p>{paragraph2}</p> <p>{paragraph3}</p> </Column> <Column large={8} medium={10} small={12} isColumn centerOnSmall className="services__button-wrapper" > <Button size={'large'} className="button__contact"> <a href="mailto:[email protected]">Contact Me</a> </Button> </Column> </Row> </section> ); export default ServicesSectionOne;
web/src/routes.js
doeg/plantly-graphql
import makeRouteConfig from 'found/lib/makeRouteConfig' import Route from 'found/lib/Route' import React from 'react' import AllSpeciesPage from './components/AllSpeciesPage' import App from './components/App' import AuthCallback from './components/AuthCallback' import AuthRenewCallback from './components/AuthRenewCallback' import Home from './components/Home' import PlantPage from './components/PlantPage' import Root from './components/Root' export default makeRouteConfig( <Route Component={Root} path="/"> <Route Component={AuthCallback} path="/auth/callback" /> <Route Component={AuthRenewCallback} path="/auth/renew" /> <Route Component={App}> <Route Component={Home} /> <Route Component={PlantPage} path="/plant/:plantId/:view?" /> <Route Component={AllSpeciesPage} path="/species" /> </Route> </Route> )
src/components/AppraisalFormat.js
wiserl/appraisal-frontend
import React from 'react'; const styles = { border: '4px #545454', margin: '90px', padding: '40px', }; export default appraisal => ( <div style={{...styles}}> <h4> Requester Email: {appraisal._email}</h4> <p>Type: {appraisal._type}</p> <div><em>Start Date: {appraisal._start}</em></div> <div><p> End Date: {appraisal._end}</p></div> <div><p> Region: {appraisal._address}</p></div> </div> )
app/javascript/mastodon/features/follow_requests/index.js
rainyday/mastodon
import React from 'react'; import { connect } from 'react-redux'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { debounce } from 'lodash'; import LoadingIndicator from '../../components/loading_indicator'; import Column from '../ui/components/column'; import ColumnBackButtonSlim from '../../components/column_back_button_slim'; import AccountAuthorizeContainer from './containers/account_authorize_container'; import { fetchFollowRequests, expandFollowRequests } from '../../actions/accounts'; import ScrollableList from '../../components/scrollable_list'; import { me } from '../../initial_state'; const messages = defineMessages({ heading: { id: 'column.follow_requests', defaultMessage: 'Follow requests' }, }); const mapStateToProps = state => ({ accountIds: state.getIn(['user_lists', 'follow_requests', 'items']), isLoading: state.getIn(['user_lists', 'follow_requests', 'isLoading'], true), hasMore: !!state.getIn(['user_lists', 'follow_requests', 'next']), locked: !!state.getIn(['accounts', me, 'locked']), domain: state.getIn(['meta', 'domain']), }); export default @connect(mapStateToProps) @injectIntl class FollowRequests extends ImmutablePureComponent { static propTypes = { params: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, shouldUpdateScroll: PropTypes.func, hasMore: PropTypes.bool, isLoading: PropTypes.bool, accountIds: ImmutablePropTypes.list, locked: PropTypes.bool, domain: PropTypes.string, intl: PropTypes.object.isRequired, multiColumn: PropTypes.bool, }; componentWillMount () { this.props.dispatch(fetchFollowRequests()); } handleLoadMore = debounce(() => { this.props.dispatch(expandFollowRequests()); }, 300, { leading: true }); render () { const { intl, shouldUpdateScroll, accountIds, hasMore, multiColumn, locked, domain, isLoading } = this.props; if (!accountIds) { return ( <Column> <LoadingIndicator /> </Column> ); } const emptyMessage = <FormattedMessage id='empty_column.follow_requests' defaultMessage="You don't have any follow requests yet. When you receive one, it will show up here." />; const unlockedPrependMessage = locked ? null : ( <div className='follow_requests-unlocked_explanation'> <FormattedMessage id='follow_requests.unlocked_explanation' defaultMessage='Even though your account is not locked, the {domain} staff thought you might want to review follow requests from these accounts manually.' values={{ domain: domain }} /> </div> ); return ( <Column bindToDocument={!multiColumn} icon='user-plus' heading={intl.formatMessage(messages.heading)}> <ColumnBackButtonSlim /> <ScrollableList scrollKey='follow_requests' onLoadMore={this.handleLoadMore} hasMore={hasMore} isLoading={isLoading} shouldUpdateScroll={shouldUpdateScroll} emptyMessage={emptyMessage} bindToDocument={!multiColumn} prepend={unlockedPrependMessage} > {accountIds.map(id => <AccountAuthorizeContainer key={id} id={id} />, )} </ScrollableList> </Column> ); } }
src/components/UserRegistration.js
dkadrios/zendrum-stompblock-client
import React from 'react' import PropTypes from 'prop-types' import { withStyles, Button, DialogActions, DialogContent, DialogContentText, DialogTitle, SvgIcon, } from '@material-ui/core' import UserRegistrationForm from './UserRegistrationForm' import GravatarIcon from '../images/Gravatar.svg' import Dialog from './Dialog' const styles = { icon: { width: 36, height: 36, marginRight: 7, }, link: { color: 'black', }, gravatarNotice: { display: 'flex', maxWidth: 330, }, } const GravatarLink = ({ content }) => ( <a href="https://en.gravatar.com/" target="_blank" rel="noopener noreferrer" > {content} </a> ) GravatarLink.propTypes = { content: PropTypes.node.isRequired } const UserRegistration = ({ active, hideDialog, submitRegistrationForm, serialNumber, classes }) => ( <Dialog open={active} onClose={hideDialog} > <DialogTitle>STOMPBLOCK Registration</DialogTitle> <DialogContent> <DialogContentText> Register yourself as the owner of this STOMPBLOCK <br /> Serial number:<strong> {serialNumber}</strong> </DialogContentText> <UserRegistrationForm /> <div className={classes.gravatarNotice}> <GravatarLink content={( <SvgIcon className={classes.icon}> <GravatarIcon /> </SvgIcon> )} /> <GravatarLink className={classes.link} content="We use Gravatar for displaying profile images, based on your email address" /> </div> </DialogContent> <DialogActions> <Button onClick={hideDialog}>Cancel</Button> <Button variant="contained" onClick={submitRegistrationForm} color="primary" autoFocus > Register </Button> </DialogActions> </Dialog> ) UserRegistration.propTypes = { active: PropTypes.bool.isRequired, hideDialog: PropTypes.func.isRequired, submitRegistrationForm: PropTypes.func.isRequired, serialNumber: PropTypes.string.isRequired, classes: PropTypes.object.isRequired, } export default withStyles(styles)(UserRegistration)
app/components/BaseComponent.js
timothyvanderaerden/React-TMDb
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { withRouter } from 'react-router-dom'; class BaseComponent extends Component { componentDidUpdate(prevProps) { if (this.props.location !== prevProps.location) { window.scrollTo(0, 0); } } render() { return ( <div>{this.props.children}</div> ); } } BaseComponent.propTypes = { location: PropTypes.object.isRequired, children: PropTypes.object.isRequired }; export default withRouter(BaseComponent);
src/containers/NoteDialogContainer.js
dggriffin/noteworthee
import React from 'react'; import NoteDialog from 'components/NoteDialog'; import Rebase from 're-base'; const base = Rebase.createClass('https://noteworthyapp.firebaseio.com'); class NoteDialogContainer extends React.Component { constructor(props) { super(props); } addNote(newNote) { let noteKey = base.push(`teams/${this.props.teamName}/${this.props.boardName}`, { data: { message: newNote.messageValue, dateCreated: new Date().getTime(), likes: 0, comments: [], mood: newNote.moodState, urlList: newNote.urlList, imageUrl: newNote.imageUrl, tags: newNote.tagList, name: newNote.name } }); newNote.tagList.forEach((tag) => { base.push(`tags/${this.props.teamName}/${this.props.boardName}/${tag}`, { data: noteKey.key() }); }); this.props.handleDialogClose(); } render() { return ( <NoteDialog handleAddNote={this.addNote.bind(this)} {...this.props} /> ); } } export default NoteDialogContainer;
packages/material-ui/src/GridList/GridList.js
cherniavskii/material-ui
import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import withStyles from '../styles/withStyles'; export const styles = { root: { display: 'flex', flexWrap: 'wrap', overflowY: 'auto', listStyle: 'none', padding: 0, WebkitOverflowScrolling: 'touch', // Add iOS momentum scrolling. }, }; function GridList(props) { const { cellHeight, children, classes, className: classNameProp, cols, component: Component, spacing, style, ...other } = props; return ( <Component className={classNames(classes.root, classNameProp)} style={{ margin: -spacing / 2, ...style }} {...other} > {React.Children.map(children, currentChild => { if (!React.isValidElement(currentChild)) { return null; } const childCols = currentChild.props.cols || 1; const childRows = currentChild.props.rows || 1; return React.cloneElement(currentChild, { style: Object.assign( { width: `${100 / cols * childCols}%`, height: cellHeight === 'auto' ? 'auto' : cellHeight * childRows + spacing, padding: spacing / 2, }, currentChild.props.style, ), }); })} </Component> ); } GridList.propTypes = { /** * Number of px for one cell height. * You can set `'auto'` if you want to let the children determine the height. */ cellHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(['auto'])]), /** * Grid Tiles that will be in Grid List. */ children: PropTypes.node.isRequired, /** * Useful to extend the style applied to components. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * Number of columns. */ cols: PropTypes.number, /** * The component used for the root node. * Either a string to use a DOM element or a component. */ component: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), /** * Number of px for the spacing between tiles. */ spacing: PropTypes.number, /** * @ignore */ style: PropTypes.object, }; GridList.defaultProps = { cellHeight: 180, cols: 2, component: 'ul', spacing: 4, }; export default withStyles(styles, { name: 'MuiGridList' })(GridList);
docs/src/modules/components/GoogleTag.js
cherniavskii/material-ui
import React from 'react'; import config from 'docs/src/config'; class GoogleTag extends React.Component { componentDidMount() { // Wait for the title to be updated. this.googleTimer = setTimeout(() => { window.gtag('config', config.google.id, { page_path: window.location.pathname, }); }); } componentWillUnmount() { clearTimeout(this.googleTimer); } googleTimer = null; render() { return null; } } export default GoogleTag;
lib/carbon-fields/vendor/htmlburger/carbon-fields/assets/js/containers/components/container/tabs.js
boquiabierto/wherever-content
/** * The external dependencies. */ import React from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; /** * The internal dependencies. */ import ContainerBase from 'containers/components/container/base'; /** * Render the tabs of the container. * * @param {Object} props * @param {Object} prop.container * @param {Array} prop.tabs * @return {React.Element} */ const ContainerTabs = ({ container, tabs }) => { return <div className="carbon-tabs-body"> { tabs.map(({ id, active, fields }) => ( <div key={id} className={cx('carbon-fields-collection', 'carbon-tab', { active })}> <ContainerBase container={container} fields={fields} /> </div> )) } </div>; }; /** * Validate the props. * * @type {Object} */ ContainerTabs.propTypes = { container: PropTypes.object, tabs: PropTypes.arrayOf(PropTypes.shape({ id: PropTypes.string, active: PropTypes.bool, fields: PropTypes.array, })), }; export default ContainerTabs;
test/connect/batch-force-update.js
nofluxjs/noflux-react
import test from 'ava'; import '../helpers/setup-test-env'; import React, { Component } from 'react'; import { mount } from 'enzyme'; import { connect, state } from '../../src'; test('should batch forceUpdate', t => { state.set({ name: 'Ssnau' }); let forceUpdateCallTimes = 0; let renderCallTimes = 0; @connect class App extends Component { onClick() { for (let i = 0; i < 10; i++) { state.set('name', `Malash${i}`); } } forceUpdate(...args) { super.forceUpdate(...args); forceUpdateCallTimes++; } render() { renderCallTimes++; return ( <button type="button" onClick={() => this.onClick()}> {state.get('name')} </button> ); } } const wrapper = mount(<App />); wrapper.find('button').simulate('click'); t.is(forceUpdateCallTimes, 1); t.is(renderCallTimes, 2); t.is(wrapper.find('button').text(), 'Malash9'); });
actor-apps/app-web/src/app/components/dialog/ComposeSection.react.js
allengaller/actor-platform
import _ from 'lodash'; import React from 'react'; import { PureRenderMixin } from 'react/addons'; import ActorClient from 'utils/ActorClient'; import { Styles, FlatButton } from 'material-ui'; import { KeyCodes } from 'constants/ActorAppConstants'; import ActorTheme from 'constants/ActorTheme'; import MessageActionCreators from 'actions/MessageActionCreators'; import TypingActionCreators from 'actions/TypingActionCreators'; import DraftActionCreators from 'actions/DraftActionCreators'; import DraftStore from 'stores/DraftStore'; import AvatarItem from 'components/common/AvatarItem.react'; const ThemeManager = new Styles.ThemeManager(); const getStateFromStores = () => { return { text: DraftStore.getDraft(), profile: ActorClient.getUser(ActorClient.getUid()) }; }; var ComposeSection = React.createClass({ displayName: 'ComposeSection', propTypes: { peer: React.PropTypes.object.isRequired }, childContextTypes: { muiTheme: React.PropTypes.object }, mixins: [PureRenderMixin], getChildContext() { return { muiTheme: ThemeManager.getCurrentTheme() }; }, componentWillMount() { ThemeManager.setTheme(ActorTheme); DraftStore.addLoadDraftListener(this.onDraftLoad); }, componentWillUnmount() { DraftStore.removeLoadDraftListener(this.onDraftLoad); }, getInitialState: function() { return getStateFromStores(); }, onDraftLoad() { this.setState(getStateFromStores()); }, _onChange: function(event) { TypingActionCreators.onTyping(this.props.peer); this.setState({text: event.target.value}); }, _onKeyDown: function(event) { if (event.keyCode === KeyCodes.ENTER && !event.shiftKey) { event.preventDefault(); this._sendTextMessage(); } else if (event.keyCode === 50 && event.shiftKey) { console.warn('Mention should show now.'); } }, onKeyUp() { DraftActionCreators.saveDraft(this.state.text); }, _sendTextMessage() { const text = this.state.text; if (text) { MessageActionCreators.sendTextMessage(this.props.peer, text); } this.setState({text: ''}); DraftActionCreators.saveDraft('', true); }, _onSendFileClick: function() { const fileInput = document.getElementById('composeFileInput'); fileInput.click(); }, _onSendPhotoClick: function() { const photoInput = document.getElementById('composePhotoInput'); photoInput.accept = 'image/*'; photoInput.click(); }, _onFileInputChange: function() { const files = document.getElementById('composeFileInput').files; MessageActionCreators.sendFileMessage(this.props.peer, files[0]); }, _onPhotoInputChange: function() { const photos = document.getElementById('composePhotoInput').files; MessageActionCreators.sendPhotoMessage(this.props.peer, photos[0]); }, _onPaste: function(event) { let preventDefault = false; _.forEach(event.clipboardData.items, function(item) { if (item.type.indexOf('image') !== -1) { preventDefault = true; MessageActionCreators.sendClipboardPhotoMessage(this.props.peer, item.getAsFile()); } }, this); if (preventDefault) { event.preventDefault(); } }, render: function() { const text = this.state.text; const profile = this.state.profile; return ( <section className="compose" onPaste={this._onPaste}> <AvatarItem image={profile.avatar} placeholder={profile.placeholder} title={profile.name}/> <textarea className="compose__message" onChange={this._onChange} onKeyDown={this._onKeyDown} onKeyUp={this.onKeyUp} value={text}> </textarea> <footer className="compose__footer row"> <button className="button" onClick={this._onSendFileClick}> <i className="material-icons">attachment</i> Send file </button> <button className="button" onClick={this._onSendPhotoClick}> <i className="material-icons">photo_camera</i> Send photo </button> <span className="col-xs"></span> <FlatButton label="Send" onClick={this._sendTextMessage} secondary={true}/> </footer> <div className="compose__hidden"> <input id="composeFileInput" onChange={this._onFileInputChange} type="file"/> <input id="composePhotoInput" onChange={this._onPhotoInputChange} type="file"/> </div> </section> ); } }); export default ComposeSection;
src/svg-icons/hardware/security.js
manchesergit/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let HardwareSecurity = (props) => ( <SvgIcon {...props}> <path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"/> </SvgIcon> ); HardwareSecurity = pure(HardwareSecurity); HardwareSecurity.displayName = 'HardwareSecurity'; HardwareSecurity.muiName = 'SvgIcon'; export default HardwareSecurity;
playground/client/src/index.js
JHerrickII/NewsTree
import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; import registerServiceWorker from './registerServiceWorker'; import './index.css'; ReactDOM.render(<App />, document.getElementById('root')); registerServiceWorker();
src/components/VideoPlayer/HLS/Stream.js
matmoi/react-adaptive-streaming
import React from 'react' import PropTypes from 'prop-types' import DropdownPanel from '../../utils/DropdownPanel.js' export default class HLSStream extends React.Component { render() { const { mediaPlayer } = this.props return ( <DropdownPanel title={"HLS Stream"} data={{ url: mediaPlayer.url, video: mediaPlayer.levels, audio: mediaPlayer.audioTracks, subtitles: mediaPlayer.subtitleTracks }} /> ) } } HLSStream.propTypes = { mediaPlayer: PropTypes.object.isRequired };
packages/wix-style-react/src/TableActionCell/docs/examples/PrimarySecondaryRTLExample.js
wix/wix-style-react
import React from 'react'; import Star from 'wix-ui-icons-common/Star'; import Download from 'wix-ui-icons-common/Download'; import Duplicate from 'wix-ui-icons-common/Duplicate'; import Print from 'wix-ui-icons-common/Print'; import { classes } from '../TableActionCell.story.st.css'; import { TableActionCell } from 'wix-style-react'; const Example = () => ( <div className="rtl" dir="rtl"> <div className={classes.exampleRow}> <TableActionCell dataHook="story-primary-secondary-rtl" primaryAction={{ text: 'Edit', skin: 'inverted', onClick: () => window.alert('Primary action was triggered!'), }} secondaryActions={[ { text: 'Star', icon: <Star />, onClick: () => window.alert('Star action was triggered.'), }, { text: 'Download', icon: <Download />, onClick: () => window.alert('Download action was triggered.'), }, { text: 'Duplicate', icon: <Duplicate />, onClick: () => window.alert('Duplicate action was triggered.'), }, { text: 'Print', icon: <Print />, onClick: () => window.alert('Print action was triggered.'), }, ]} numOfVisibleSecondaryActions={1} /> </div> </div> ); export default Example;
src/svg-icons/action/favorite.js
matthewoates/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionFavorite = (props) => ( <SvgIcon {...props}> <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/> </SvgIcon> ); ActionFavorite = pure(ActionFavorite); ActionFavorite.displayName = 'ActionFavorite'; ActionFavorite.muiName = 'SvgIcon'; export default ActionFavorite;
pages/index.js
nickroberts404/meadowlab
import React from 'react' import { Link } from 'react-router' import { prefixLink } from 'gatsby-helpers' import Helmet from 'react-helmet' import { config } from 'config' import PhotoCollage from '../components/PhotoCollage' export default class Index extends React.Component { render () { return ( <div> <Helmet title={config.siteTitle} meta={[ {"name": "description", "content": "The home of software engineer and climber, Nick Roberts"}, {"name": "keywords", "content": "meadowlab"}, {"property": "og:title", "content": "meadowlab"}, {"property": "og:url", "content": "http://meadowlab.io"}, {"property": "og:description", "content": "The home of software engineer and climber, Nick Roberts"}, ]} /> <div className="page-header home-page-header"> <h2 className="page-header-title">Hi, I'm Nick!</h2> <div className="intro"> <p>I'm a software engineer from Austin that has a passion for creating modern web apps.</p> <p>When I'm not programming, you'll find me outdoors climbing, hiking, or playing my synthesizers.</p> <p>Find me on <a href="https://github.com/nickroberts404">GitHub</a>, <a href="https://www.linkedin.com/in/nickroberts404/">LinkedIn</a>, or send me an <a href="mailto:[email protected]">email</a>!</p> <p className="intro-emojis"><img alt="Outdoor and Piano Emojis" src="./img/emojis.png"/></p> </div> </div> <PhotoCollage photos={[ './img/mexico.jpg', './img/halfdome.jpg', './img/meadow.jpg', './img/jtree.jpg', './img/shadow.jpg' ]} /> </div> ) } } // I'm a software engineer from Austin, TX, that has a passion for creating modern web apps. When I'm not programming, you'll find me outdoors climbing or tickling my synthesizers.
src/svg-icons/device/access-time.js
lawrence-yu/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let DeviceAccessTime = (props) => ( <SvgIcon {...props}> <path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/> </SvgIcon> ); DeviceAccessTime = pure(DeviceAccessTime); DeviceAccessTime.displayName = 'DeviceAccessTime'; DeviceAccessTime.muiName = 'SvgIcon'; export default DeviceAccessTime;
examples/js/expandRow/manage-expanding.js
rolandsusans/react-bootstrap-table
/* eslint max-len: 0 */ import React from 'react'; import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table'; const products = []; function addProducts(quantity) { const startId = products.length; for (let i = 0; i < quantity; i++) { const id = startId + i; products.push({ id: id, name: 'Item name ' + id, price: 2100 + i, expand: [ { fieldA: 'test1', fieldB: (i + 1) * 99, fieldC: (i + 1) * Math.random() * 100, fieldD: '123eedd' + i }, { fieldA: 'test2', fieldB: i * 99, fieldC: i * Math.random() * 100, fieldD: '123eedd' + i } ] }); } } addProducts(5); class BSTable extends React.Component { render() { if (this.props.data) { return ( <BootstrapTable data={ this.props.data }> <TableHeaderColumn dataField='fieldA' isKey={ true }>Field A</TableHeaderColumn> <TableHeaderColumn dataField='fieldB'>Field B</TableHeaderColumn> <TableHeaderColumn dataField='fieldC'>Field C</TableHeaderColumn> <TableHeaderColumn dataField='fieldD'>Field D</TableHeaderColumn> </BootstrapTable>); } else { return (<p>?</p>); } } } export default class ExpandRow extends React.Component { constructor(props) { super(props); this.state = { // Default expanding row expanding: [ 2 ] }; } isExpandableRow() { return true; } expandComponent(row) { return ( <BSTable data={ row.expand } /> ); } render() { const options = { expandRowBgColor: 'rgb(66, 134, 244)', expanding: this.state.expanding }; return ( <BootstrapTable data={ products } options={ options } expandableRow={ this.isExpandableRow } expandComponent={ this.expandComponent } search> <TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn> <TableHeaderColumn dataField='name' expandable={ false }>Product Name</TableHeaderColumn> <TableHeaderColumn dataField='price' expandable={ false }>Product Price</TableHeaderColumn> </BootstrapTable> ); } }
src/parser/priest/shadow/modules/spells/ShadowWordPain.js
sMteX/WoWAnalyzer
import React from 'react'; import Analyzer from 'parser/core/Analyzer'; import Enemies from 'parser/shared/modules/Enemies'; import SPELLS from 'common/SPELLS'; import SpellLink from 'common/SpellLink'; import SpellIcon from 'common/SpellIcon'; import { formatPercentage } from 'common/format'; import SmallStatisticBox, { STATISTIC_ORDER } from 'interface/others/SmallStatisticBox'; import AbilityTracker from 'parser/priest/shadow/modules/core/AbilityTracker'; const MS_BUFFER = 100; /* Shadow word pain can be created by: Hard casting Misery Dark Void Shadow Word pain can be refreshed by: Hard casting Misery Dark Void Void Bolt */ class ShadowWordPain extends Analyzer { static dependencies = { enemies: Enemies, abilityTracker: AbilityTracker, }; castedShadowWordPains = 0; appliedShadowWordPains = 0; refreshedShadowWordPains = 0; // Dark Void lastDarkVoidCastTimestamp = 0; darkVoidShadowWordPainApplications = 0; darkVoidShadowWordPainRefreshes = 0; get uptime() { return this.enemies.getBuffUptime(SPELLS.SHADOW_WORD_PAIN.id) / this.owner.fightDuration; } get damage() { const spell = this.abilityTracker.getAbility(SPELLS.SHADOW_WORD_PAIN.id); return spell.damageEffective + spell.damageAbsorbed; } on_byPlayer_cast(event) { const spellId = event.ability.guid; if (spellId === SPELLS.SHADOW_WORD_PAIN.id) { this.castedShadowWordPains += 1; } if (spellId === SPELLS.DARK_VOID_TALENT.id) { this.lastCastTimestamp = event.timestamp; } } on_byPlayer_applydebuff(event) { const spellId = event.ability.guid; if (spellId !== SPELLS.SHADOW_WORD_PAIN.id) { return; } this.appliedShadowWordPains += 1; if (this.lastCastTimestamp !== 0 && event.timestamp < this.lastCastTimestamp + MS_BUFFER) { this.darkVoidShadowWordPainApplications += 1; } } on_byPlayer_refreshdebuff(event) { const spellId = event.ability.guid; if (spellId !== SPELLS.SHADOW_WORD_PAIN.id) { return; } this.refreshedShadowWordPains += 1; if (this.lastCastTimestamp !== 0 && event.timestamp < this.lastCastTimestamp + MS_BUFFER) { this.darkVoidShadowWordPainRefreshes += 1; } } get suggestionThresholds() { return { actual: this.uptime, isLessThan: { minor: 0.95, average: 0.90, major: 0.8, }, style: 'percentage', }; } suggestions(when) { const { isLessThan: { minor, average, major, }, } = this.suggestionThresholds; when(this.uptime).isLessThan(minor) .addSuggestion((suggest, actual, recommended) => { return suggest(<span>Your <SpellLink id={SPELLS.SHADOW_WORD_PAIN.id} /> uptime can be improved. Try to pay more attention to your <SpellLink id={SPELLS.SHADOW_WORD_PAIN.id} /> on the boss.</span>) .icon(SPELLS.SHADOW_WORD_PAIN.icon) .actual(`${formatPercentage(actual)}% Shadow Word: Pain uptime`) .recommended(`>${formatPercentage(recommended)}% is recommended`) .regular(average).major(major); }); } statistic() { return ( <SmallStatisticBox position={STATISTIC_ORDER.CORE(4)} icon={<SpellIcon id={SPELLS.SHADOW_WORD_PAIN.id} />} value={`${formatPercentage(this.uptime)} %`} label="Shadow Word: Pain uptime" /> ); } } export default ShadowWordPain;
site/pages/ExamplePage.js
tomulin1/react-dnd
import React from 'react'; import Header from '../components/Header'; import PageBody from '../components/PageBody'; import SideBar from '../components/SideBar'; import { ExamplePages } from '../Constants'; export default class ExamplesPage { render() { return ( <div> <Header/> <PageBody hasSidebar> <SideBar groups={ExamplePages} example={this.props.example} /> {this.props.children} </PageBody> </div> ); } }
client/node_modules/react-router/es6/RouteContext.js
Discounty/Discounty
'use strict'; import React from 'react'; var object = React.PropTypes.object; /** * The RouteContext mixin provides a convenient way for route * components to set the route in context. This is needed for * routes that render elements that want to use the Lifecycle * mixin to prevent transitions. */ var RouteContext = { propTypes: { route: object.isRequired }, childContextTypes: { route: object.isRequired }, getChildContext: function getChildContext() { return { route: this.props.route }; } }; export default RouteContext;
app/javascript/mastodon/features/compose/components/autosuggest_account.js
8796n/mastodon
import React from 'react'; import Avatar from '../../../components/avatar'; import DisplayName from '../../../components/display_name'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; class AutosuggestAccount extends ImmutablePureComponent { static propTypes = { account: ImmutablePropTypes.map.isRequired }; render () { const { account } = this.props; return ( <div className='autosuggest-account'> <div className='autosuggest-account-icon'><Avatar src={account.get('avatar')} staticSrc={account.get('avatar_static')} size={18} /></div> <DisplayName account={account} /> </div> ); } } export default AutosuggestAccount;
client/src/javascript/components/modals/torrent-details-modal/TorrentFiles.js
stephdewit/flood
import _ from 'lodash'; import {Button, Checkbox, Form, FormRow, FormRowItem, Select, SelectItem} from 'flood-ui-kit'; import classnames from 'classnames'; import {FormattedMessage, injectIntl} from 'react-intl'; import React from 'react'; import ConfigStore from '../../../stores/ConfigStore'; import Disk from '../../icons/Disk'; import DirectoryTree from '../../general/filesystem/DirectoryTree'; import TorrentActions from '../../../actions/TorrentActions'; const TORRENT_PROPS_TO_CHECK = ['bytesDone']; const METHODS_TO_BIND = ['handleItemSelect', 'handlePriorityChange', 'handleSelectAllClick']; class TorrentFiles extends React.Component { constructor() { super(); this.hasSelectionChanged = false; this.hasPriorityChanged = false; this.state = { allSelected: false, selectedItems: {}, selectedFiles: [], }; METHODS_TO_BIND.forEach(method => { this[method] = this[method].bind(this); }); } shouldComponentUpdate(nextProps) { if (this.hasSelectionChanged) { this.hasSelectionChanged = false; return true; } // If we know that the user changed a file's priority, we deeply check the // file tree to render when the priority change is detected. if (this.hasPriorityChanged) { const shouldUpdate = !_.isEqual(nextProps.fileTree, this.props.fileTree); // Reset the flag so we don't deeply check the next file tree. if (shouldUpdate) { this.hasPriorityChanged = false; } return shouldUpdate; } // Update when the previous props weren't defined and the next are. if ((!this.props.torrent && nextProps.torrent) || (!this.props.fileTree && nextProps.fileTree)) { return true; } // Check specific properties to re-render when the torrent is active. if (nextProps.torrent) { return TORRENT_PROPS_TO_CHECK.some(property => this.props.torrent[property] !== nextProps.torrent[property]); } return true; } getSelectedFiles(selectionTree, selectedFiles = []) { if (selectionTree.files) { selectedFiles = [ ...selectedFiles, ...Object.keys(selectionTree.files).reduce((previousValue, filename) => { const file = selectionTree.files[filename]; if (file.isSelected) { previousValue.push(file.index); } return previousValue; }, []), ]; } if (selectionTree.directories) { Object.keys(selectionTree.directories).forEach(directory => { selectedFiles = [...selectedFiles, ...this.getSelectedFiles(selectionTree.directories[directory])]; }); } return selectedFiles; } handleDownloadButtonClick = event => { event.preventDefault(); const baseURI = ConfigStore.getBaseURI(); const link = document.createElement('a'); link.download = `${this.props.torrent.name}.tar`; link.href = `${baseURI}api/download?hash=${this.props.torrent.hash}&files=${this.state.selectedFiles.join(',')}`; link.style.display = 'none'; document.body.appendChild(link); // Fix for Firefox 58+ link.click(); }; handleFormChange = ({event}) => { if (event.target.name === 'file-priority') { this.handlePriorityChange(); TorrentActions.setFilePriority(this.props.hash, this.state.selectedFiles, event.target.value); } }; handleItemSelect(selectedItem) { this.hasSelectionChanged = true; this.setState(state => { const selectedItems = this.mergeSelection(selectedItem, state.selectedItems, 0, this.props.fileTree); const selectedFiles = this.getSelectedFiles(selectedItems); return { selectedItems, allSelected: false, selectedFiles, }; }); } handlePriorityChange() { this.hasPriorityChanged = true; } handleSelectAllClick() { this.hasSelectionChanged = true; this.setState((state, props) => { const selectedItems = this.selectAll(state.selectedItems, props.fileTree, state.allSelected); const selectedFiles = this.getSelectedFiles(selectedItems); return { selectedItems, allSelected: !state.allSelected, selectedFiles, }; }); } isLoaded() { return this.props.fileTree != null; } mergeSelection(item, tree = {}, depth = 0, fileTree = {}) { const {path} = item; const pathSegment = path[depth]; const selectionSubTree = item.type === 'file' ? 'files' : 'directories'; if (!tree[selectionSubTree]) { tree[selectionSubTree] = {}; } if (!tree[selectionSubTree][pathSegment]) { tree[selectionSubTree][pathSegment] = {}; } // If we are not at the clicked depth, then recurse over the path segments. if (depth++ < path.length - 1) { if (!tree.directories) { tree.directories = {[pathSegment]: {}}; } else if (!tree.directories[pathSegment]) { tree.directories[pathSegment] = {}; } // Deselect all parent directories if the item in question is being // de-selected. if (item.isSelected) { delete tree.isSelected; } tree.directories[pathSegment] = this.mergeSelection( item, tree.directories[pathSegment], depth, fileTree.directories[pathSegment], ); } else if (item.isSelected) { delete tree.isSelected; delete tree[selectionSubTree][pathSegment]; } else { let value; // If a directory was checked, recursively check all its children. if (item.type === 'directory') { value = this.selectAll(tree[selectionSubTree][pathSegment], fileTree[selectionSubTree][pathSegment]); } else { value = {...item, isSelected: true}; } tree[selectionSubTree][pathSegment] = value; } return tree; } selectAll(selectionTree = {}, fileTree = {}, deselect = false) { if (fileTree.files) { fileTree.files.forEach(file => { if (!selectionTree.files) { selectionTree.files = {}; } if (!deselect) { selectionTree.files[file.filename] = {...file, isSelected: true}; } else { delete selectionTree.files[file.filename]; } }); } if (fileTree.directories) { Object.keys(fileTree.directories).forEach(directory => { if (!selectionTree.directories) { selectionTree.directories = {}; } if (deselect && selectionTree.directories[directory]) { delete selectionTree.directories[directory].isSelected; } selectionTree.directories[directory] = this.selectAll( selectionTree.directories[directory], fileTree.directories[directory], deselect, ); }); } selectionTree.isSelected = !deselect; return selectionTree; } render() { const {fileTree, torrent} = this.props; let directoryHeadingIconContent = null; let fileDetailContent = null; if (this.isLoaded()) { directoryHeadingIconContent = ( <div className="file__checkbox directory-tree__checkbox"> <div className="directory-tree__checkbox__item directory-tree__checkbox__item--checkbox"> <FormRow> <Checkbox checked={this.state.allSelected} onChange={this.handleSelectAllClick} useProps /> </FormRow> </div> <div className="directory-tree__checkbox__item directory-tree__checkbox__item--icon"> <Disk /> </div> </div> ); fileDetailContent = ( <DirectoryTree depth={0} onItemSelect={this.handleItemSelect} onPriorityChange={this.handlePriorityChange} hash={this.props.torrent.hash} selectedItems={this.state.selectedItems} tree={fileTree} /> ); } else { directoryHeadingIconContent = <Disk />; fileDetailContent = ( <div className="directory-tree__node directory-tree__node--file"> <FormattedMessage id="torrents.details.files.loading" defaultMessage="Loading file detail..." /> </div> ); } const directoryHeadingClasses = classnames( 'directory-tree__node', 'directory-tree__parent-directory torrent-details__section__heading', { 'directory-tree__node--selected': this.state.allSelected, }, ); const directoryHeading = ( <div className={directoryHeadingClasses}> <div className="file__label"> {directoryHeadingIconContent} <div className="file__name">{torrent.directory}</div> </div> </div> ); const wrapperClasses = classnames('inverse directory-tree__wrapper', { 'directory-tree__wrapper--toolbar-visible': this.state.selectedFiles.length > 0, }); return ( <Form className={wrapperClasses} onChange={this.handleFormChange}> <div className="directory-tree__selection-toolbar"> <FormRow align="center"> <FormRowItem width="one-quarter" grow={false} shrink={false}> <FormattedMessage id="torrents.details.selected.files" defaultMessage="{count, plural, =1 {{countElement} selected file} other {{countElement} selected files}}" values={{ count: this.state.selectedFiles.length, countElement: ( <span className="directory-tree__selection-toolbar__item-count"> {this.state.selectedFiles.length} </span> ), }} /> </FormRowItem> <Button onClick={this.handleDownloadButtonClick} grow={false} shrink={false}> <FormattedMessage id="torrents.details.files.download.file" defaultMessage="{count, plural, =1 {Download File} other {Download Files}}" values={{ count: this.state.selectedFiles.length, }} /> </Button> <Select id="file-priority" persistentPlaceholder shrink={false}> <SelectItem placeholder> <FormattedMessage id="torrents.details.selected.files.set.priority" defaultMessage="Set Priority" /> </SelectItem> <SelectItem id={0}> {this.props.intl.formatMessage({ id: 'priority.dont.download', defaultMessage: "Don't Download", })} </SelectItem> <SelectItem id={1}> {this.props.intl.formatMessage({ id: 'priority.normal', defaultMessage: 'Normal', })} </SelectItem> <SelectItem id={2}> {this.props.intl.formatMessage({ id: 'priority.high', defaultMessage: 'High', })} </SelectItem> </Select> </FormRow> </div> <div className="directory-tree torrent-details__section torrent-details__section--file-tree modal__content--nested-scroll__content"> {directoryHeading} {fileDetailContent} </div> </Form> ); } } export default injectIntl(TorrentFiles);
src/svg-icons/image/camera.js
IsenrichO/mui-with-arrows
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageCamera = (props) => ( <SvgIcon {...props}> <path d="M9.4 10.5l4.77-8.26C13.47 2.09 12.75 2 12 2c-2.4 0-4.6.85-6.32 2.25l3.66 6.35.06-.1zM21.54 9c-.92-2.92-3.15-5.26-6-6.34L11.88 9h9.66zm.26 1h-7.49l.29.5 4.76 8.25C21 16.97 22 14.61 22 12c0-.69-.07-1.35-.2-2zM8.54 12l-3.9-6.75C3.01 7.03 2 9.39 2 12c0 .69.07 1.35.2 2h7.49l-1.15-2zm-6.08 3c.92 2.92 3.15 5.26 6 6.34L12.12 15H2.46zm11.27 0l-3.9 6.76c.7.15 1.42.24 2.17.24 2.4 0 4.6-.85 6.32-2.25l-3.66-6.35-.93 1.6z"/> </SvgIcon> ); ImageCamera = pure(ImageCamera); ImageCamera.displayName = 'ImageCamera'; ImageCamera.muiName = 'SvgIcon'; export default ImageCamera;
docs/src/app/components/pages/components/CircularProgress/ExampleDeterminate.js
w01fgang/material-ui
import React from 'react'; import CircularProgress from 'material-ui/CircularProgress'; export default class CircularProgressExampleDeterminate extends React.Component { constructor(props) { super(props); this.state = { completed: 0, }; } componentDidMount() { this.timer = setTimeout(() => this.progress(5), 1000); } componentWillUnmount() { clearTimeout(this.timer); } progress(completed) { if (completed > 100) { this.setState({completed: 100}); } else { this.setState({completed}); const diff = Math.random() * 10; this.timer = setTimeout(() => this.progress(completed + diff), 1000); } } render() { return ( <div> <CircularProgress mode="determinate" value={this.state.completed} /> <CircularProgress mode="determinate" value={this.state.completed} size={60} thickness={7} /> <CircularProgress mode="determinate" value={this.state.completed} size={80} thickness={5} /> </div> ); } }
admin/client/App/shared/Popout/PopoutHeader.js
frontyard/keystone
/** * Render a header for a popout */ import React from 'react'; import Transition from 'react-addons-css-transition-group'; const PopoutHeader = React.createClass({ displayName: 'PopoutHeader', propTypes: { leftAction: React.PropTypes.func, leftIcon: React.PropTypes.string, title: React.PropTypes.string.isRequired, transitionDirection: React.PropTypes.oneOf(['next', 'prev']), }, render () { // If we have a left action and a left icon, render a header button var headerButton = (this.props.leftAction && this.props.leftIcon) ? ( <button key={'button_' + this.props.transitionDirection} type="button" className={'Popout__header__button octicon octicon-' + this.props.leftIcon} onClick={this.props.leftAction} /> ) : null; // If we have a title, render it var headerTitle = this.props.title ? ( <span key={'title_' + this.props.transitionDirection} className="Popout__header__label" > {this.props.title} </span> ) : null; return ( <div className="Popout__header"> <Transition transitionName="Popout__header__button" transitionEnterTimeout={200} transitionLeaveTimeout={200} > {headerButton} </Transition> <Transition transitionName={'Popout__pane-' + this.props.transitionDirection} transitionEnterTimeout={360} transitionLeaveTimeout={360} > {headerTitle} </Transition> </div> ); }, }); module.exports = PopoutHeader;
src/components/typography/caption.js
mattmischuk/m1x
// @flow import React from 'react' import type { Node } from 'react' import styled from 'styled-components' import cx from 'classnames' import { myTheme } from '../../styles' const { fontSize } = myTheme const StyledCaption = styled.h6` font-size: ${fontSize.seven}; text-transform: uppercase; ` const styles = { base: 'mb0' } type Props = { children: Node, className: string, } const Caption = ({ children, className }: Props) => ( <StyledCaption className={cx(styles.base, className)}> {children} </StyledCaption> ) export default Caption
src/components/ProjectPostEditor.js
Hylozoic/hylo-redux
/* eslint-disable camelcase */ import React from 'react' import { connect } from 'react-redux' import Icon from './Icon' import DatetimePicker from 'react-datetime' import { debounce } from 'lodash' import { get, map, pick, filter } from 'lodash/fp' import { getPost, getVideo } from '../models/post' const { array, func, object } = React.PropTypes const random = () => Math.random().toString().slice(2, 8) const getSimplePost = state => id => pick(['id', 'name', 'description', 'is_project_request'], getPost(id, state)) @connect((state, { postEdit }) => { if (postEdit.requests) return {requests: postEdit.requests} const children = map(getSimplePost(state), postEdit.children) const requests = filter(p => p.is_project_request, children) return {requests} }, null, null, {withRef: true}) export default class ProjectPostEditor extends React.Component { static propTypes = { postEdit: object, post: object, update: func.isRequired, requests: array } static contextTypes = {dispatch: func} componentDidMount () { // we update the store as soon as the component is mounted in order to load // data from the existing requests into the postEdit. otherwise, if we // didn't change them and then saved the post, they would be removed. const { update, requests } = this.props update({requests}) } addRequest = () => { const { update, requests } = this.props update({requests: [...requests, {id: `new-${random()}`}]}) } updateRequest = index => (key, value) => { const updatedRequest = {...this.props.requests[index], [key]: value} const requests = this.props.requests.slice() requests.splice(index, 1, updatedRequest) this.props.update({requests}) } render () { const { postEdit, update, requests } = this.props const { ends_at, type } = postEdit const endsAt = ends_at ? new Date(ends_at) : null const videoUrl = get('url', getVideo(postEdit)) || '' if (type !== 'project') setTimeout(() => update({type: 'project'})) return <div className='project-editor'> <h3> Requests <span className='soft normal'>&nbsp;&mdash; what you need to make it happen</span> </h3> <div className='requests'> {requests.map((p, i) => <ProjectRequestEditor post={p} key={p.id} update={this.updateRequest(i)} />)} <a className='add-request' onClick={this.addRequest}>+ Add request</a> </div> <div className='more-fields'> <div className='video'> <Icon name='VideoCamera' /> <input type='text' placeholder='youtube or vimeo url' value={videoUrl} onChange={event => update({video: event.target.value})} /> </div> <div className='deadline'> <Icon name='Calendar' /> <DatetimePicker inputProps={{placeholder: 'deadline'}} value={endsAt} onChange={m => update({ends_at: m.toISOString()})} /> </div> <div className='location'> <Icon name='Pin-1' /> <input type='text' placeholder='location' defaultValue={postEdit.location} onChange={event => update({location: event.target.value})} /> </div> </div> </div> } } import AutosizingTextarea from './AutosizingTextarea' import RichTextEditor from './RichTextEditor' import cx from 'classnames' class ProjectRequestEditor extends React.Component { static propTypes = { post: object, update: func } constructor (props) { super(props) this.state = pick(['name', 'description'], props.post) } goToDetails = () => { this.setState({showDetails: true}) this.refs.details.focus() } delayedUpdate = debounce(function (attr, value) { return this.props.update(attr, value) }, 100) render () { const { post: { id } } = this.props const { name, description } = this.state const handleChange = attr => event => { const { value } = event.target this.setState({[attr]: value}) this.delayedUpdate(attr, value) } const showDetails = this.state.showDetails || !!description const editorClass = cx('details', {empty: !showDetails}) const onBlur = () => { // we have to update description here because RichTextEditor doesn't always // send onChange events this.props.update('description', this.refs.details.getContent()) this.setState({showDetails: false}) } return <div> <div className='title-wrapper'> <AutosizingTextarea type='text' ref='title' className='title' value={name} placeholder='What do you need help with?' onChange={handleChange('name')} /> </div> <RichTextEditor className={editorClass} ref='details' name={`post-${id}`} content={description} onChange={handleChange('description')} onBlur={onBlur} /> {!showDetails && <div className='details-placeholder' onClick={this.goToDetails}> More details </div>} </div> } }
app/containers/HomePage/index.js
Illyism/sample-dashboard
/* * HomePage * * This is the first thing users see of our App, at the '/' 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 neccessity for you then you can refactor it and remove * the linting exception. */ import React from 'react'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; import TextField from 'material-ui/TextField'; import FlatButton from 'material-ui/FlatButton'; import TextWidget from 'components/TextWidget'; import styles from './styles.css'; import { selectGrid, } from './selectors'; import { addWidget, deleteWidget } from './actions'; /* eslint-disable react/prefer-stateless-function */ export class HomePage extends React.Component { constructor() { super(); this.state = { value: '', }; } addCard = () => { this.props.addWidget(this.state.value); this.setState({ value: '', }); this.refs.input.focus(); } deleteCard = (key) => { this.props.deleteWidget(key); } handleChange = (event) => { this.setState({ value: event.target.value, }); }; renderGrid() { return this.props.grid.map((x, i) => <div className={`${styles.gridCell}`}> <TextWidget key={i} text={x.text} html={x.html} onDelete={() => this.deleteCard(i)} /> </div> ).toArray(); } render() { return ( <div className={`${styles.home}`}> <div className={`${styles.input}`}> <TextField ref="input" hintText="Write something..." fullWidth onChange={this.handleChange} value={this.state.value} multiLine /> <FlatButton label="Add" primary onClick={this.addCard} /> </div> <div className={`${styles.grid}`}> {this.renderGrid()} </div> </div> ); } } HomePage.propTypes = { addWidget: React.PropTypes.func, deleteWidget: React.PropTypes.func, grid: React.PropTypes.object, }; function mapDispatchToProps(dispatch) { return { addWidget: (text) => dispatch(addWidget(text)), deleteWidget: (key) => dispatch(deleteWidget(key)), dispatch, }; } export default connect(createSelector( selectGrid(), (grid) => ({ grid }) ), mapDispatchToProps)(HomePage);
src/index.js
nsipplswezey/iifym
import React from 'react'; import { render } from 'react-dom'; import { App } from './App'; render(<App />, document.getElementById('root'));
src/svg-icons/device/nfc.js
owencm/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let DeviceNfc = (props) => ( <SvgIcon {...props}> <path d="M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 18H4V4h16v16zM18 6h-5c-1.1 0-2 .9-2 2v2.28c-.6.35-1 .98-1 1.72 0 1.1.9 2 2 2s2-.9 2-2c0-.74-.4-1.38-1-1.72V8h3v8H8V8h2V6H6v12h12V6z"/> </SvgIcon> ); DeviceNfc = pure(DeviceNfc); DeviceNfc.displayName = 'DeviceNfc'; DeviceNfc.muiName = 'SvgIcon'; export default DeviceNfc;
client/source/js/models/t_groups_m.js
Vladimir37/Planshark
import React from 'react'; import ReactDOM from 'react-dom'; import $ from 'jquery'; import {submitting, getData} from '../submitting.js'; import {Waiting, Error, Empty, Menu, Forbidden} from './templates.js'; import toast from '../toaster.js'; import {colorpick} from '../picker.js'; //responses var actions_r = ['Success!', 'Server error' , 'Required fields are empty', 'Incorrect color']; //RegExp var re_color = new RegExp("^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"); //refresh groups list var refresh; var Creating = React.createClass({ getInitialState() { return null }, componentDidMount() { setTimeout(colorpick, 100); }, submit(elem) { var ajax_data = getData(elem.target); if(!ajax_data) { toast(actions_r[2]); } else if(!re_color.test(ajax_data.color)) { toast(actions_r[3]); $(elem.target).parent().find('input[name="color"]').val(''); } else { submitting(ajax_data, '/api/task_manage/create', 'POST', function(data) { var response_status = +data; if(isNaN(response_status)) { response_status = 1; } if(response_status == 0) { toast(actions_r[0]); $(elem.target).parent().find('input[type="text"]').val(''); refresh(); } else { toast(actions_r[response_status]); } }, function(err) { toast(actions_r[1]); }); } }, switching() { $('.creatingFormBody').slideToggle(); }, render() { return <section className="creatingForm"> <article className="creatingFormHead" onClick={this.switching}>Creating task group</article> <article className="creatingFormBody"> <input type="text" name="name" placeholder="Name" data-req="true" /> <input type="text" name="color" placeholder="Color" className="color_field" data-req="true" /> <button className="sub" onClick={this.submit}>Create</button> </article> </section>; } }); var TasksGroup = React.createClass({ getInitialState() { var data = this.props.data; return { id: data.id, name: data.name, color: data.color, tasks: data.tasks, tasks_count: data.tasks.length, created: data.createdAt } }, expand(elem) { var target = $(elem.target).closest('.task'); target.find('.task_additional').slideToggle(); }, actions(type) { return function(elem) { var target = $(elem.target).closest('.task'); target.find('.task_action:not(.task_' + type + ')').hide(); target.find('.task_' + type).slideToggle(); } }, submitting(type) { var self = this; return function(elem) { var target = elem.target; var ajax_data = {}; ajax_data = getData(target); ajax_data.id = self.state.id; if(ajax_data) { submitting(ajax_data, '/api/task_manage/' + type, 'POST', function (data) { var response_status = +data; if (isNaN(response_status)) { response_status = 1; } toast(actions_r[response_status]); refresh(); }, function (err) { toast(actions_r[1]); }); } else if(!re_color.test(ajax_data.color)) { toast(actions_r[3]); $(elem.target).parent().find('input[name="color"]').val(''); } else { toast(actions_r[2]); } } }, selectBoxes(elem) { var target = $(elem.target); var elemParent = target.closest('.select_box'); elemParent.find('label').removeClass('active_elem'); target.parent().addClass('active_elem'); }, render() { var self = this; var group_classes = 'task task_group_color task_group_color_' + this.state.id; //all tasks in groups var tasks_list = []; this.state.tasks.forEach(function(task) { tasks_list.push(<article className="item_list">{task.name}</article>); }); //all groups var groups_list = []; groups_list.push(<label className='active_elem'>No group<input type="radio" name="t_group" defaultChecked onChange={self.selectBoxes} value=''/></label>); this.props.all_groups.forEach(function(group) { if(group.id != self.state.id) { groups_list.push(<label>{group.name}<input type="radio" name="t_group" onChange={self.selectBoxes} value={group.id}/></label>); } }); var group_list_block = <article className="select_box"> {groups_list} </article>; return <article className={group_classes}> <article className="task_top"> <article className="task_head"> <span className="task_name">{this.state.name}</span><br/> <span className="task_group">Tasks: {this.state.tasks_count}</span> </article> <article className="task_expand" onClick={this.expand}></article> </article> <article className="task_additional"> <h3>Tasks</h3> <article className="select_box"> {tasks_list} </article> <article className="task_bottom"> <button className="solve_but" onClick={this.actions('edit')}>Edit</button> <button onClick={this.actions('delete')}>Delete</button> </article> <article className="task_action task_edit hidden"> <form> <input type="text" name="name" placeholder="Name" data-req="true" defaultValue={this.state.name} /><br/> <input type="text" name="color" placeholder="Color" defaultValue={this.state.color} className="color_field" data-req="true" /><br/> </form> <button onClick={this.submitting('edit')}>Edit</button> </article> <article className="task_action task_delete hidden"> <form> <h3>Move all tasks in {this.state.name} to other group?</h3> {group_list_block} Are you sure you want to delete "{this.state.name}" tasks group? </form> <button onClick={this.submitting('deleting')}>Delete</button> </article> </article> </article>; } }); var TasksGroupsList = React.createClass({ getInitialState() { return { received: false, error: false, status: null, groups: null } }, receive() { var self = this; submitting(null, '/api/account/status', 'GET', function(status) { if (typeof status == 'string') { status = JSON.parse(status); } submitting(null, '/api/manage_data/tasks_group', 'GET', function (data) { if (typeof data == 'string') { data = JSON.parse(data); } if(data.status == 0) { data.body.reverse(); self.setState({ received: true, error: false, status, groups: data.body }); } else { self.setState({ error: true }); } }, function (err) { self.setState({ error: true }); }); }, function(err) { self.setState({ error: true }); }); }, render() { var self = this; refresh = this.receive; //first load if(!this.state.received && !this.state.error) { this.receive(); return <Waiting />; } else if(!this.state.received && this.state.error) { return <Error />; } else if(!Boolean(this.state.t_manage || !this.state.room)) { return <Forbidden />; } //render else { var groups = []; if(!this.state.groups.length) { groups = <Empty />; } else { this.state.groups.forEach(function(group) { groups.push(<TasksGroup key={group.id + new Date().getTime()} data={group} all_groups={self.state.groups} />); }); } return <article className="task_group_page_inner"> <Menu active="t_groups" data={this.state.status} /> <Creating /> {groups} </article>; } } }); export default TasksGroupsList;
src/routing/routes.js
dopry/netlify-cms
import React from 'react'; import { Route, IndexRoute } from 'react-router'; import App from '../containers/App'; import DashboardPage from '../containers/DashboardPage'; import CollectionPage from '../containers/CollectionPage'; import EntryPage from '../containers/EntryPage'; import SearchPage from '../containers/SearchPage'; import NotFoundPage from '../containers/NotFoundPage'; export default ( <Route path="/" component={App}> <IndexRoute component={DashboardPage} /> <Route path="/collections/:name" component={CollectionPage} /> <Route path="/collections/:name/entries/new" component={EntryPage} newRecord /> <Route path="/collections/:name/entries/:slug" component={EntryPage} /> <Route path="/search/:searchTerm" component={SearchPage} /> <Route path="*" component={NotFoundPage} /> </Route> );
test/integration/scss-fixtures/multi-page/pages/_app.js
azukaru/next.js
import React from 'react' import App from 'next/app' import '../styles/global1.scss' import '../styles/global2.scss' class MyApp extends App { render() { const { Component, pageProps } = this.props return <Component {...pageProps} /> } } export default MyApp
packages/playground/src/createDevModeAttachmentMiddleware.js
billba/botchat
import React from 'react'; import DebugAdaptiveCardAttachment from './DebugAdaptiveCardAttachment'; import JSONDebugView from './JSONDebugView'; export default function () { return () => next => ({ activity, attachment }) => attachment.contentType === 'application/vnd.microsoft.card.adaptive' ? ( <DebugAdaptiveCardAttachment activity={activity} attachment={attachment}> <JSONDebugView debug={attachment}>{next({ activity, attachment })}</JSONDebugView> </DebugAdaptiveCardAttachment> ) : ( <JSONDebugView debug={attachment}>{next({ activity, attachment })}</JSONDebugView> ); }
src/components/operations/operations-by-series.js
FranckCo/Operation-Explorer
import React from 'react'; import { sparqlConnect } from 'sparql-connect'; import OperationList from './operation-list'; import Spinner from 'components/shared/spinner' import D, { getLang } from 'i18n' /** * Builds the query that retrieves the series of a given family. */ const queryBuilder = series => ` PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> SELECT ?operation ?label FROM <http://rdf.insee.fr/graphes/operations> WHERE { <${series}> dcterms:hasPart ?operation . ?operation skos:prefLabel ?label . FILTER(lang(?label) = '${getLang()}') } ORDER BY ?operation ` const connector = sparqlConnect(queryBuilder, { queryName: 'operationsBySeries', params: ['series'] }) function OperationsBySeries({ operationsBySeries, title }) { if (operationsBySeries.length === 0) { return <div>{D.serieHoldsNoOperation}</div> } return <OperationList operations={operationsBySeries} title={title} /> } export default connector(OperationsBySeries, { loading: () => <Spinner text={D.loadingOperations}/> })
actor-apps/app-web/src/app/components/ActivitySection.react.js
jamesbond12/actor-platform
import React from 'react'; import classNames from 'classnames'; import { ActivityTypes } from 'constants/ActorAppConstants'; import ActivityStore from 'stores/ActivityStore'; import UserProfile from 'components/activity/UserProfile.react'; import GroupProfile from 'components/activity/GroupProfile.react'; const getStateFromStores = () => { return { activity: ActivityStore.getActivity(), isOpen: ActivityStore.isOpen() }; }; class ActivitySection extends React.Component { constructor(props) { super(props); this.state = getStateFromStores(); ActivityStore.addChangeListener(this.onChange); } componentWillUnmount() { ActivityStore.removeChangeListener(this.onChange); } render() { const { activity, isOpen } = this.state; if (activity !== null) { const activityClassName = classNames('activity', { 'activity--shown': isOpen }); let activityBody; switch (activity.type) { case ActivityTypes.USER_PROFILE: activityBody = <UserProfile user={activity.user}/>; break; case ActivityTypes.GROUP_PROFILE: activityBody = <GroupProfile group={activity.group}/>; break; default: } return ( <section className={activityClassName}> {activityBody} </section> ); } else { return null; } } onChange = () => { this.setState(getStateFromStores()); }; } export default ActivitySection;
packages/fyndiq-icons/src/bubbles.js
fyndiq/fyndiq-ui
import React from 'react' import SvgWrapper from './svg-wrapper' const Bubbles = ({ className, color }) => ( <SvgWrapper className={className} viewBox="0 0 37 32"> <path d="m22.92 0.81055a4.6385 4.6385 0 1 0 0.001953 9.2773 4.6385 4.6385 0 0 0 -0.001953 -9.2773zm0 1.2656a3.376 3.376 0 0 1 3.373 3.373 3.376 3.376 0 0 1 -3.373 3.373 3.375 3.375 0 0 1 -3.373 -3.373 3.376 3.376 0 0 1 3.373 -3.373zm-9.0332 4.2637a4.639 4.639 0 1 0 0 9.2773 4.639 4.639 0 0 0 0 -9.2773zm0 1.2656a3.376 3.376 0 0 1 3.373 3.373 3.375 3.375 0 0 1 -3.373 3.3711 3.376 3.376 0 0 1 -3.373 -3.3711 3.376 3.376 0 0 1 3.373 -3.373zm9.0605 4.0293a4.6385 4.6385 0 0 0 0.001953 9.2773 4.6385 4.6385 0 0 0 -0.001953 -9.2773zm0 1.2656a3.376 3.376 0 0 1 3.373 3.373 3.376 3.376 0 0 1 -3.373 3.373 3.375 3.375 0 0 1 -3.373 -3.373 3.376 3.376 0 0 1 3.373 -3.373zm-9.0605 3.9395a4.639 4.639 0 1 0 0 9.2754 4.639 4.639 0 0 0 0 -9.2754zm18.213 0.10352a4.635 4.635 0 0 0 -3.8262 7.25 4.628 4.628 0 0 0 3.8359 2.0273 4.6385 4.6385 0 0 0 -0.009766 -9.2773zm-18.213 1.1602a3.376 3.376 0 0 1 3.373 3.373 3.375 3.375 0 0 1 -3.373 3.373 3.376 3.376 0 0 1 -3.373 -3.373 3.376 3.376 0 0 1 3.373 -3.373zm18.203 0.10547a3.341 3.341 0 0 1 0.009765 0c1.119 0 2.162 0.55066 2.791 1.4727 0.507 0.744 0.69534 1.6413 0.52734 2.5273a3.345 3.345 0 0 1 -1.4141 2.1602 3.37 3.37 0 0 1 -4.6855 -0.88672 3.34 3.34 0 0 1 -0.52734 -2.5273 3.342 3.342 0 0 1 1.4141 -2.1602 3.341 3.341 0 0 1 1.8848 -0.58594zm-27.303 3.8672a4.638 4.638 0 0 0 0 9.2754 4.638 4.638 0 0 0 0 -9.2754zm18.176 0.1582a4.639 4.639 0 1 0 0 9.2773 4.639 4.639 0 0 0 0 -9.2773zm-18.176 1.1074a3.375 3.375 0 0 1 3.3711 3.3711 3.376 3.376 0 0 1 -3.3711 3.373 3.376 3.376 0 0 1 -3.373 -3.373 3.376 3.376 0 0 1 3.373 -3.3711zm18.176 0.16016a3.376 3.376 0 0 1 3.3691 3.3711 3.375 3.375 0 0 1 -3.3691 3.3711 3.376 3.376 0 0 1 -3.373 -3.3711 3.376 3.376 0 0 1 3.373 -3.3711z" fill={color} fillRule="evenodd" stroke="none" /> </SvgWrapper> ) Bubbles.propTypes = SvgWrapper.propTypes Bubbles.defaultProps = SvgWrapper.defaultProps export default Bubbles
packages/rmw-shell/src/providers/Firebase/Paths/with.js
TarikHuber/react-most-wanted
import Context from './Context' import React from 'react' const withContainer = (Component) => { const ChildComponent = (props) => { return ( <Context.Consumer> {(value) => { return <Component {...value} {...props} /> }} </Context.Consumer> ) } return ChildComponent } export default withContainer