path
stringlengths
5
195
repo_name
stringlengths
5
79
content
stringlengths
25
1.01M
app/components/ContentBlock/index.js
rapicastillo/beautifulrising-client
/** * * ContentBlock * */ import React from 'react'; import styled, { ThemeProvider } from 'styled-components'; import { injectIntl } from 'react-intl'; const LatinContentTheme = ` font-size: 14px; line-height: 22px; text-align: left; `; const ArabicContentTheme = ` font-size: 13px; line-height: 24px; text-align: right; `; export default styled.div` ${p=>p.theme.isArabic ? ArabicContentTheme : LatinContentTheme }; font-family: Avenir, Kaff, sans-serif; `;;
src/reducers/tweet.js
philly-d/chirp-for-twitter
import React from 'react' import { combineReducers } from 'redux' import twitterText from 'twitter-text' import _ from 'underscore' import { getAutocompleteTerm } from './autocomplete' import { CompositeDecorator, ContentState, Editor, EditorState, getDefaultKeyBinding, KeyBindingUtil, SelectionState, Modifier, Entity, RichUtils, AtomicBlockUtils } from 'draft-js' import { SET_ACTIVE_TWEET, ACTIVATE_EDITOR_STATE, CLOSE_APP, SEND_TWEET_SUCCESS, SEND_TWEET_FAILURE, SEND_TWEET_REQUEST, TWEET_SENT, SET_EDITOR_STATE, RECEIVE_SCREENSHOT, UPDATE_SCREENSHOT, REMOVE_SCREENSHOT, SELECT_AUTOCOMPLETE_ITEM } from '../actions' const DEFAULT_EDITOR_ID = 'DEFAULT_EDITOR_ID' function emptyEditorState (editorState) { let contentState = editorState.getCurrentContent() const firstBlock = contentState.getFirstBlock() const lastBlock = contentState.getLastBlock() const allSelected = new SelectionState({ anchorKey: firstBlock.getKey(), anchorOffset: 0, focusKey: lastBlock.getKey(), focusOffset: lastBlock.getLength(), hasFocus: true }) contentState = Modifier.removeRange(contentState, allSelected, 'backward') return EditorState.push(editorState, contentState, 'remove-range') // return EditorState.forceSelection(contentState, contentState.getSelectionAfter()) } // Match tweet entities (mentions, hashtags, cashtags) function entityStrategy (contentBlock, callback) { const text = contentBlock.getText(), matches = twitterText.extractEntitiesWithIndices(text) matches.forEach(function(match){ if (!match.url) // Ignore urls -- different strategy callback(match.indices[0], match.indices[1]) }) } function entitySpan (props) { return <span className='twc-editor-entity' {...props}>{props.children}</span> } // Match urls in tweet content function linkStrategy (contentBlock, callback) { const text = contentBlock.getText(), matches = twitterText.extractUrlsWithIndices(text) matches.forEach(function(match){ callback(match.indices[0], match.indices[1]) }) } function linkSpan (props) { return <span className='twc-editor-link' {...props}>{props.children}</span> } // Default tweet decorators for editor states const entityDecorator = { strategy: entityStrategy, component: entitySpan, } const linkDecorator = { strategy: linkStrategy, component: linkSpan } const tweetDecorator = new CompositeDecorator([entityDecorator, linkDecorator]) // Default empty editor state with tweet decorator function createEmptyEditor() { return EditorState.createEmpty(tweetDecorator) } // Focus at end of editorState function focusEnd (editorState, force) { if (force) { return EditorState.moveFocusToEnd(editorState) } else { return EditorState.moveSelectionToEnd(editorState) } } // Default reply tweet text includes the screen names // of tweet creator + any users mentioned in it function setDefaultReplyText (editorState, tweet) { const mentions = _.uniq([tweet.user.screen_name].concat(tweet.mentions).map(function(i){ return '@' + i })), newText = mentions.join(' ') + ' ', newContent = ContentState.createFromText(newText), newState = EditorState.createWithContent(newContent, tweetDecorator) return focusEnd(newState, true) } // Default new tweet text is the URL + a @get_chirp attribution, // with focus at the very beginning of the tweet so user can // add a comment before the link/screenshot content. function createDefaultEditor (forceFocus) { const contentState = ContentState.createFromText('\n' + document.URL + ' via @Get_Chirp'), { selectionBefore } = contentState, editorState = EditorState.createWithContent(contentState, tweetDecorator) if (forceFocus) { return EditorState.forceSelection(editorState, selectionBefore) } else { return EditorState.acceptSelection(editorState, selectionBefore) } } // Replace user's in-progress @mention with the selected // @mention from autocomplete. function insertAutocompleteItem (editorState, action) { const { indices } = getAutocompleteTerm(editorState) if (!indices) return editorState const { item } = action, nextFocus = indices[0] + item.screen_name.length + 2, nextContent = Modifier.replaceText( editorState.getCurrentContent(), editorState.getSelection().merge({ anchorOffset: indices[0], focusOffset: indices[1] }), `@${item.screen_name} ` ), nextEditor = EditorState.push( editorState, nextContent, 'insert-characters') return EditorState.forceSelection( nextEditor, nextEditor.getSelection().merge({ anchorOffset: nextFocus, focusOffset: nextFocus }) ) } function tweetDraft(state, action) { if (typeof state === 'undefined') state = createEmptyEditor() // Editor is immutable so we can perform changes directly on state let editorState = state switch (action.type) { case ACTIVATE_EDITOR_STATE: const { tweet, forceFocus } = action, currText = editorState.getCurrentContent().getPlainText() if (tweet) { if (forceFocus) { if (currText) { editorState = focusEnd(editorState, true) } else { editorState = setDefaultReplyText(editorState, tweet) } } } else { if (!currText) { editorState = createDefaultEditor(focus) } else if (focus) { editorState = focusEnd(editorState, true) } } return editorState case CLOSE_APP: case SEND_TWEET_SUCCESS: return createEmptyEditor() case SELECT_AUTOCOMPLETE_ITEM: return insertAutocompleteItem(state, action) case SET_EDITOR_STATE: return action.editorState default: return state } } function drafts(state={}, action) { let tweetId switch (action.type) { case CLOSE_APP: tweetId = DEFAULT_EDITOR_ID return { ...state, [tweetId]: tweetDraft(state[tweetId], action) } case SEND_TWEET_SUCCESS: const { request } = action const { inReplyTo } = request tweetId = inReplyTo || DEFAULT_EDITOR_ID return { ...state, [tweetId]: tweetDraft(state[tweetId], action) } case SELECT_AUTOCOMPLETE_ITEM: case SET_EDITOR_STATE: tweetId = action.replyToId || DEFAULT_EDITOR_ID return { ...state, [tweetId]: tweetDraft(state[tweetId], action) } case ACTIVATE_EDITOR_STATE: const { tweet } = action tweetId = tweet ? tweet.id : DEFAULT_EDITOR_ID return { ...state, [tweetId]: tweetDraft(state[tweetId], action) } default: return state } } export const getEditorState = (state, props) => { const id = props.replyTo ? props.replyTo.id : DEFAULT_EDITOR_ID let editor = state.drafts[id] return editor } export default drafts
web/src/components/Calendar/DateContentRow.js
AcrylicInc/totalblu
import cn from 'classnames'; import getHeight from 'dom-helpers/query/height'; import qsa from 'dom-helpers/query/querySelectorAll'; import PropTypes from 'prop-types'; import React from 'react'; import { findDOMNode } from 'react-dom'; import dates from './utils/dates'; import { accessor, elementType } from './utils/propTypes'; import { segStyle, eventSegments, endOfRange, eventLevels } from './utils/eventLevels'; import BackgroundCells from './BackgroundCells'; import EventRow from './components/Events/EventRow'; import EventEndingRow from './components/Events/EventEndingRow'; let isSegmentInSlot = (seg, slot) => seg.left <= slot && seg.right >= slot; const propTypes = { events: PropTypes.array.isRequired, range: PropTypes.array.isRequired, rtl: PropTypes.bool, renderForMeasure: PropTypes.bool, renderHeader: PropTypes.func, container: PropTypes.func, selected: PropTypes.object, selectable: PropTypes.oneOf([true, false, 'ignoreEvents']), onShowMore: PropTypes.func, onSelectSlot: PropTypes.func, onSelectEnd: PropTypes.func, onSelectStart: PropTypes.func, startAccessor: accessor.isRequired, endAccessor: accessor.isRequired, dateCellWrapper: elementType, eventComponent: elementType, eventWrapperComponent: elementType.isRequired, minRows: PropTypes.number.isRequired, maxRows: PropTypes.number.isRequired, }; const defaultProps = { minRows: 0, maxRows: Infinity, } class DateContentRow extends React.Component { constructor(...args) { super(...args); } handleSelectSlot = (slot) => { const { range, onSelectSlot } = this.props; onSelectSlot( range.slice(slot.start, slot.end + 1), slot, ) } handleShowMore = (slot) => { const { range, onShowMore } = this.props; let row = qsa(findDOMNode(this), '.rbc-row-bg')[0] let cell; if (row) cell = row.children[slot-1] let events = this.segments .filter(seg => isSegmentInSlot(seg, slot)) .map(seg => seg.event) onShowMore(events, range[slot-1], cell, slot) } createHeadingRef = r => { this.headingRow = r; } createEventRef = r => { this.eventRow = r; } getContainer = () => { const { container } = this.props; return container ? container() : findDOMNode(this) } getRowLimit() { let eventHeight = getHeight(this.eventRow); let headingHeight = this.headingRow ? getHeight(this.headingRow) : 0 let eventSpace = getHeight(findDOMNode(this)) - headingHeight; return Math.max(Math.floor(eventSpace / eventHeight), 1) } renderHeadingCell = (date, index) => { let { renderHeader, range } = this.props; return renderHeader({ date, key: `header_${index}`, style: segStyle(1, range.length), className: cn( 'rbc-date-cell', dates.eq(date, new Date(), 'day') && 'rbc-now', // FIXME use props.now ) }) } renderDummy = () => { let { className, range, renderHeader } = this.props; return ( <div className={className}> <div className='rbc-row-content'> {renderHeader && ( <div className='rbc-row' ref={this.createHeadingRef}> {range.map(this.renderHeadingCell)} </div> )} <div className='rbc-row' ref={this.createEventRef}> <div className='rbc-row-segment' style={segStyle(1, range.length)}> <div className='rbc-event'> <div className='rbc-event-content'>&nbsp;</div> </div> </div> </div> </div> </div> ) } render() { const { rtl, events, range, className, selectable, renderForMeasure, startAccessor, endAccessor, renderHeader, minRows, maxRows, dateCellWrapper, eventComponent, eventWrapperComponent, onSelectStart, onSelectEnd, ...props } = this.props; if (renderForMeasure) return this.renderDummy(); let { first, last } = endOfRange(range); let segments = this.segments = events.map(evt => eventSegments(evt, first, last, { startAccessor, endAccessor })) let { levels, extra } = eventLevels(segments, Math.max(maxRows - 1, 1)); while (levels.length < minRows ) levels.push([]) return ( <div className={className}> <BackgroundCells rtl={rtl} range={range} selectable={selectable} container={this.getContainer} onSelectStart={onSelectStart} onSelectEnd={onSelectEnd} onSelectSlot={this.handleSelectSlot} cellWrapperComponent={dateCellWrapper} /> <div className='rbc-row-content'> {renderHeader && ( <div className='rbc-row' ref={this.createHeadingRef}> {range.map(this.renderHeadingCell)} </div> )} {levels.map((segs, idx) => <EventRow {...props} key={idx} start={first} end={last} segments={segs} slots={range.length} eventComponent={eventComponent} eventWrapperComponent={eventWrapperComponent} startAccessor={startAccessor} endAccessor={endAccessor} /> )} {!!extra.length && ( <EventEndingRow {...props} start={first} end={last} segments={extra} onShowMore={this.handleShowMore} eventComponent={eventComponent} eventWrapperComponent={eventWrapperComponent} /> )} </div> </div> ); } } DateContentRow.propTypes = propTypes; DateContentRow.defaultProps = defaultProps; export default DateContentRow
examples/with-shallow-routing/pages/index.js
callumlocke/next.js
import React from 'react' import Link from 'next/link' import Router from 'next/router' import { format } from 'url' let counter = 1 export default class Index extends React.Component { static getInitialProps ({ res }) { if (res) { return { initialPropsCounter: 1 } } counter++ return { initialPropsCounter: counter } } reload () { const { pathname, query } = Router Router.push(format({ pathname, query })) } incrementStateCounter () { const { url } = this.props const currentCounter = url.query.counter ? parseInt(url.query.counter) : 0 const href = `/?counter=${currentCounter + 1}` Router.push(href, href, { shallow: true }) } render () { const { initialPropsCounter, url } = this.props return ( <div> <h2>This is the Home Page</h2> <Link href='/about'><a>About</a></Link> <button onClick={() => this.reload()}>Reload</button> <button onClick={() => this.incrementStateCounter()}>Change State Counter</button> <p>"getInitialProps" ran for "{initialPropsCounter}" times.</p> <p>Counter: "{url.query.counter || 0}".</p> </div> ) } }
src/components/itemHolder/index.js
ShinyLeee/React-PhotoSwipe
/* eslint-disable no-param-reassign */ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import AnimationBox from './components/animationBox'; import EnhancedWrapper from './styled'; import { PAN_FRICTION_LEVEL, ZOOM_FRICTION_LEVEL, BOUNCE_BACK_DURATION, DIRECTION_VERT, DIRECTION_UP, DIRECTION_DOWN, OUT_TYPE_ZOOM, OUT_TYPE_SWIPE_UP, OUT_TYPE_SWIPE_DOWN, } from '../../utils/constant'; import { getEmptyPoint, isDomElement } from '../../utils'; import { animate } from '../../utils/animation'; export default class ItemHolder extends Component { constructor(props) { super(props); this.state = { animating: false, // is in / out animating? loaded: false, loadError: false, }; const fitDimension = this.getItemDimension(); this.longSide = Math.max(fitDimension.width, fitDimension.height); this.shortSide = Math.min(fitDimension.width, fitDimension.height); this.initVariable(); this.handleTap = this.handleTap.bind(this); this.handleDoubleTap = this.handleDoubleTap.bind(this); this.handlePanStart = this.handlePanStart.bind(this); this.handlePan = this.handlePan.bind(this); this.handlePanEnd = this.handlePanEnd.bind(this); this.handlePinchStart = this.handlePinchStart.bind(this); this.handlePinch = this.handlePinch.bind(this); this.handlePinchEnd = this.handlePinchEnd.bind(this); this.handleImageLoad = this.handleImageLoad.bind(this); } componentDidMount() { if (this.props.open && this.isCurrentSlide) { this.requestInAnimation(true); } } componentWillReceiveProps(nextProps) { if (this.props.currIndex !== nextProps.currIndex) { if (this.isZoom && this.isCurrentSlide) { this.resetVariable(); } } if (this.props.closing !== nextProps.closing) { if (nextProps.closing && this.isCurrentSlide) { const initCenterPos = this.getAnimWrapperCenterPos(); const start = { x: initCenterPos.x, y: initCenterPos.y, croppedScale: nextProps.cropped && 1, scale: 1, opacity: 1, }; const outType = nextProps.sourceElement !== undefined ? OUT_TYPE_ZOOM : OUT_TYPE_SWIPE_DOWN; this.requestOutAnimation(start, outType); } } } shouldComponentUpdate(nextProps, nextState) { return nextProps.open !== this.props.open || nextState.animating !== this.state.animating || nextState.loadError !== this.state.loadError || nextProps.itemIndex !== this.props.itemIndex || nextProps.currIndex !== this.props.currIndex || nextProps.horizOffset !== this.props.horizOffset || nextProps.errorBox !== this.props.errorBox; } componentDidUpdate(prevProps) { if (prevProps.open !== this.props.open) { if (this.props.open && this.isCurrentSlide) { this.requestInAnimation(false); } } } getItemDimension(isZoom) { const { item } = this.props; const fitRatio = this.fitRatio; return { width: isZoom ? item.width : Math.round(fitRatio * item.width), height: isZoom ? item.height : Math.round(fitRatio * item.height), }; } getItemBounds(scale) { const { viewportSize } = this.props; const itemDimension = this.getItemDimension(this.isZoom); const currCenterPos = this.getAnimWrapperCenterPos(scale, this.isZoom); const realItemWidth = itemDimension.width * scale; const realItemHeight = itemDimension.height * scale; const xMovingRange = realItemWidth > viewportSize.width ? Math.floor((realItemWidth - viewportSize.width) / 2) : 0; const yMovingRange = realItemHeight > viewportSize.height ? Math.floor((realItemHeight - viewportSize.height) / 2) : 0; const xBounds = { left: currCenterPos.x + xMovingRange, right: currCenterPos.x - xMovingRange, }; const yBounds = { top: currCenterPos.y + yMovingRange, bottom: currCenterPos.y - yMovingRange, }; return { x: xBounds, y: yBounds, }; } // The position where animationWrapper always in the center getAnimWrapperCenterPos(scale = 1, isZoom = false) { const { viewportSize } = this.props; const dimension = this.getItemDimension(isZoom); return { x: Math.round((viewportSize.width - (dimension.width * scale)) / 2), y: Math.round((viewportSize.height - (dimension.height * scale)) / 2), }; } get isCurrentSlide() { return this.props.itemIndex === this.props.currIndex; } get fitRatio() { const { item, viewportSize } = this.props; const hRatio = viewportSize.width / item.width; const vRatio = viewportSize.height / item.height; return hRatio < vRatio ? hRatio : vRatio; } get canItemPerformZoom() { return !(this.fitRatio > 1 || !this.state.loaded || this.state.loadError); } applyOverlayOpacity(opacity) { this.props.overlay.style.opacity = opacity; } applyAnimationBoxTransform(x, y, scale) { this.animationBox.style.transform = `translate3d(${x}px, ${y}px, 0px) scale(${scale})`; } applyCroppedBoxTransform(s1, s2) { this.croppedBox.style.transform = `translateZ(0) scale(${s1})`; this.visibleBox.style.transform = `translateZ(0) scale(${s2}`; } applyImageSize(isZoom) { const dimension = this.getItemDimension(isZoom); if (this.image) { this.image.style.width = `${dimension.width}px`; this.image.style.height = `${dimension.height}px`; } } calculateBoundsStatus(currPos, scale) { const bounds = this.getItemBounds(scale); const left = currPos.x - bounds.x.left; const right = currPos.x - bounds.x.right; const top = currPos.y - bounds.y.top; const bottom = currPos.y - bounds.y.bottom; return { bounds, boundsDiff: { left, right, top, bottom }, outOfBounds: { left: left > 0, right: right < 0, top: top > 0, bottom: bottom < 0, }, }; } calculatePinchDelta(initCenter, currCenter, scale) { const { viewportSize } = this.props; const screenCenter = { x: Math.round(viewportSize.width * 0.5), y: Math.round(viewportSize.height * 0.5), }; const distance = { x: screenCenter.x - initCenter.x, y: screenCenter.y - initCenter.y, }; const offset = { x: currCenter.x - initCenter.x, y: currCenter.y - initCenter.y, }; const ratio = scale > 1 ? scale - 1 : 1 - scale; return { x: Math.round((distance.x * ratio) + offset.x), y: Math.round((distance.y * ratio) + offset.y), }; } calculatePinchPosition(scale, pinchDelta) { const currCenterPos = this.getAnimWrapperCenterPos(scale); return { x: Math.round(currCenterPos.x + this.preservedOffset.x + pinchDelta.x), y: Math.round(currCenterPos.y + this.preservedOffset.y + pinchDelta.y), }; } covertScale(scale, toZoomScale) { const fitRatio = this.fitRatio; return toZoomScale ? scale * fitRatio : scale * (1 / fitRatio); } initVariable() { this.resetVariable(false, true); } resetVariable(isOut = false, isInit = false) { const initCenterPos = this.getAnimWrapperCenterPos(); this.isZoom = false; this.initBoundsDiff = undefined; this.outOfBounds = { x: false, y: false }; this.isPanToNext = false; this.containerDelta = undefined; this.scaleRatio = undefined; this.currScale = 1; // real scale that manipulate item style this.currPos = this.getAnimWrapperCenterPos(); // Previous position for zoom gesture this.preservedOffset = getEmptyPoint(); // Composed by panning and pinch delta this.maxZoomPos = getEmptyPoint(); // Bounce back position if exceed maxZoomScale this.maxEventScale = 0; this.maxPivotScale = this.covertScale(this.props.maxZoomScale, false); if (!isInit) { this.applyImageSize(false); this.applyAnimationBoxTransform(initCenterPos.x, initCenterPos.y, 1); } if (isOut) { if (this.state.loadError) { // Allow reload item everytime if loadError this.setState({ loaded: false, loadError: false }); } this.props.afterZoomOut(); } } requestInAnimation(isInit) { const { currIndex, cropped, sourceElement, showHideDuration } = this.props; let start = 0; let end = 1; if (sourceElement !== undefined) { const initCenterPos = this.getAnimWrapperCenterPos(); const thumbRect = sourceElement.childNodes[currIndex].querySelector('img').getBoundingClientRect(); const shortRectSide = Math.min(thumbRect.width, thumbRect.height); start = { x: thumbRect.left, y: thumbRect.top, scale: shortRectSide / this.shortSide, croppedScale: cropped && (shortRectSide / this.longSide), opacity: 0, }; end = { x: initCenterPos.x, y: initCenterPos.y, croppedScale: cropped && 1, scale: 1, opacity: 1, }; } this.setState( { animating: true }, animate({ name: 'itemHolder__In', start, end, duration: showHideDuration, easingType: 'easeOutCubic', beforeUpdate: () => this.props.beforeZoomIn(isInit), onUpdate: (pos) => { if (sourceElement !== undefined) { this.applyOverlayOpacity(pos.opacity); this.applyAnimationBoxTransform(pos.x, pos.y, pos.scale); if (cropped) { const ratio = pos.croppedScale / pos.scale; const reverseRatio = 1 / ratio; this.applyCroppedBoxTransform(ratio, reverseRatio); } } else { this.applyOverlayOpacity(pos); } }, onComplete: () => this.setState({ animating: false }, this.props.afterZoomIn(isInit)), }), ); } requestOutAnimation(start, outType) { const { currIndex, cropped, sourceElement, showHideDuration } = this.props; let end; if (outType === OUT_TYPE_ZOOM) { const thumbRect = sourceElement.childNodes[currIndex].querySelector('img').getBoundingClientRect(); const shortRectSide = Math.min(thumbRect.width, thumbRect.height); end = { x: thumbRect.left, y: thumbRect.top, croppedScale: cropped && (shortRectSide / this.longSide), scale: shortRectSide / this.shortSide, opacity: 0, }; } else if (outType === OUT_TYPE_SWIPE_UP || outType === OUT_TYPE_SWIPE_DOWN) { const fitDimension = this.getItemDimension(); const initCenterPos = this.getAnimWrapperCenterPos(); end = { x: initCenterPos.x, y: outType === OUT_TYPE_SWIPE_UP ? -fitDimension.height : (initCenterPos.y * 2) + fitDimension.height, scale: 1, opacity: 0, }; } this.setState( { animating: true }, animate({ name: 'itemHolder__Out', start, end, duration: showHideDuration, easingType: 'easeOutCubic', beforeUpdate: () => { if (this.isZoom) { this.applyImageSize(false); } this.props.beforeZoomOut(); }, onUpdate: (pos) => { if (cropped) { const ratio = pos.croppedScale / pos.scale; const reverseRatio = 1 / ratio; this.applyCroppedBoxTransform(ratio, reverseRatio); } this.applyOverlayOpacity(pos.opacity); this.applyAnimationBoxTransform(pos.x, pos.y, pos.scale); }, onComplete: () => this.resetVariable(true), }), ); } requestZoomAnimation(start, end) { const nextCenterPos = this.getAnimWrapperCenterPos(end.scale, this.isZoom); const { bounds, boundsDiff, outOfBounds } = this.calculateBoundsStatus({ x: end.x, y: end.y }, end.scale); if ((boundsDiff.left === boundsDiff.right) || (outOfBounds.left && outOfBounds.right)) { end.x = nextCenterPos.x; this.preservedOffset.x = 0; } else if (outOfBounds.left && !outOfBounds.right) { end.x = bounds.x.left; this.preservedOffset.x = -nextCenterPos.x; } else if (!outOfBounds.left && outOfBounds.right) { end.x = bounds.x.right; this.preservedOffset.x = nextCenterPos.x; } if ((boundsDiff.top === boundsDiff.bottom) || (outOfBounds.top && outOfBounds.bottom)) { end.y = nextCenterPos.y; this.preservedOffset.y = 0; } else if (outOfBounds.top && !outOfBounds.bottom) { end.y = bounds.y.top; this.preservedOffset.y = -nextCenterPos.y; } else if (!outOfBounds.top && outOfBounds.bottom) { end.y = bounds.y.bottom; this.preservedOffset.y = nextCenterPos.y; } animate({ name: 'itemHolder__Zoom', start, end, duration: BOUNCE_BACK_DURATION, easingType: 'sineOut', onUpdate: pos => this.applyAnimationBoxTransform(pos.x, pos.y, pos.scale), onComplete: () => { if (!this.isZoom) { const zoomedScale = this.covertScale(end.scale, true); this.applyImageSize(true); this.applyAnimationBoxTransform(end.x, end.y, zoomedScale); this.currScale = zoomedScale; } else { this.applyAnimationBoxTransform(end.x, end.y, end.scale); this.currScale = end.scale; } this.isZoom = true; this.scaleRatio = undefined; this.currPos.x = end.x; this.currPos.y = end.y; this.maxZoomPos = getEmptyPoint(); }, }); } requestPanBackAnimation(currPos) { const currCenterPos = this.getAnimWrapperCenterPos(this.currScale, true); const { bounds, boundsDiff, outOfBounds } = this.calculateBoundsStatus(currPos, this.currScale); const start = Object.assign({}, currPos); const end = Object.assign({}, currPos); if (outOfBounds.left) { start.x = Math.round(bounds.x.left + (boundsDiff.left * PAN_FRICTION_LEVEL)); end.x = bounds.x.left; this.preservedOffset.x = bounds.x.left - currCenterPos.x; } else if (outOfBounds.right) { start.x = Math.round(bounds.x.right + (boundsDiff.right * PAN_FRICTION_LEVEL)); end.x = bounds.x.right; this.preservedOffset.x = bounds.x.right - currCenterPos.x; } if (outOfBounds.top) { start.y = Math.round(bounds.y.top + (boundsDiff.top * PAN_FRICTION_LEVEL)); end.y = bounds.y.top; this.preservedOffset.y = bounds.y.top - currCenterPos.y; } else if (outOfBounds.bottom) { start.y = Math.round(bounds.y.bottom + (boundsDiff.bottom * PAN_FRICTION_LEVEL)); end.y = bounds.y.bottom; this.preservedOffset.y = bounds.y.bottom - currCenterPos.y; } animate({ name: 'itemHolder__PanBack', start, end, duration: BOUNCE_BACK_DURATION, easingType: 'sineOut', onUpdate: pos => this.applyAnimationBoxTransform(pos.x, pos.y, this.currScale), onComplete: () => { this.initBoundsDiff = undefined; this.outOfBounds = { x: false, y: false }; this.isPanToNext = false; this.currPos.x = end.x; this.currPos.y = end.y; }, }); } requestResetAnimation(start, resetType) { const initCenterPos = this.getAnimWrapperCenterPos(); const initScale = this.isZoom ? this.covertScale(1, true) : 1; const end = Object.assign({}, initCenterPos, { scale: initScale, opacity: 1 }); animate({ name: 'itemHolder__Reset', start, end, duration: BOUNCE_BACK_DURATION, easingType: 'sineOut', onUpdate: (pos) => { this.applyOverlayOpacity(pos.opacity); this.applyAnimationBoxTransform(pos.x, pos.y, pos.scale); }, onComplete: () => { if (resetType !== 'pan') { this.resetVariable(); } this.props.afterReset(resetType); }, }); } handleTap(e) { this.props.onTap(e, this.isZoom); } handleDoubleTap(e) { if (!this.canItemPerformZoom) return; if (this.isZoom) { const currScale = Math.min(this.currScale, this.props.maxZoomScale); const start = Object.assign({}, this.currPos, { scale: currScale }); this.requestResetAnimation(start, 'doubleTap'); } else { const maxPivotScale = this.maxPivotScale; const initCenterPos = this.getAnimWrapperCenterPos(); const pinchDelta = this.calculatePinchDelta(e.position, e.position, maxPivotScale); this.maxZoomPos = this.calculatePinchPosition(maxPivotScale, pinchDelta); this.maxEventScale = maxPivotScale; this.preservedOffset.x = pinchDelta.x; this.preservedOffset.y = pinchDelta.y; const start = Object.assign({}, initCenterPos, { scale: 1 }); const end = Object.assign({}, this.maxZoomPos, { scale: maxPivotScale }); this.requestZoomAnimation(start, end); } this.props.onDoubleTap(e, this.isZoom); } handlePanStart(e) { const { allowPanToNext } = this.props; if (allowPanToNext) { const { boundsDiff } = this.calculateBoundsStatus(this.currPos, this.currScale); this.initBoundsDiff = boundsDiff; } this.props.onPanStart(e, this.isZoom); } handlePan(e) { const { allowPanToNext, viewportSize } = this.props; if (this.isZoom) { const currPos = { x: this.currPos.x + e.delta.accX, y: this.currPos.y + e.delta.accY, }; const { bounds, boundsDiff, outOfBounds } = this.calculateBoundsStatus(currPos, this.currScale); this.outOfBounds.x = outOfBounds.left || outOfBounds.right; this.outOfBounds.y = !this.isPanToNext && (outOfBounds.top || outOfBounds.bottom); const addFriction = () => { if (outOfBounds.left) { currPos.x = Math.round(bounds.x.left + (boundsDiff.left * PAN_FRICTION_LEVEL)); } else if (outOfBounds.right) { currPos.x = Math.round(bounds.x.right + (boundsDiff.right * PAN_FRICTION_LEVEL)); } if (outOfBounds.top) { currPos.y = Math.round(bounds.y.top + (boundsDiff.top * PAN_FRICTION_LEVEL)); } else if (outOfBounds.bottom) { currPos.y = Math.round(bounds.y.bottom + (boundsDiff.bottom * PAN_FRICTION_LEVEL)); } }; if (this.outOfBounds.x || this.outOfBounds.y || this.isPanToNext) { if (!allowPanToNext) addFriction(); else if (this.isPanToNext || !this.outOfBounds.y) { this.isPanToNext = true; if (outOfBounds.left) { currPos.x = bounds.x.left; e.delta.accX += this.initBoundsDiff.left; } else if (outOfBounds.right) { currPos.x = bounds.x.right; e.delta.accX += this.initBoundsDiff.right; } else { const isBackFromLeft = Math.abs(boundsDiff.left) < Math.abs(boundsDiff.right); const newXPos = isBackFromLeft ? e.delta.accX + this.initBoundsDiff.left : e.delta.accX + this.initBoundsDiff.right; currPos.x = newXPos; e.delta.accX = newXPos; } this.containerDelta = e.delta.accX; this.props.onPan(e, this.isZoom); return; } else if (this.outOfBounds.y) { addFriction(); } } this.applyAnimationBoxTransform(currPos.x, currPos.y, this.currScale); } else { if (e.direction === DIRECTION_VERT) { const absAccY = Math.abs(e.delta.accY); const opacity = Math.max(1 - (absAccY / viewportSize.height), 0); const initCenterPos = this.getAnimWrapperCenterPos(); this.applyOverlayOpacity(opacity); this.applyAnimationBoxTransform(initCenterPos.x, initCenterPos.y + e.delta.accY, 1); } this.props.onPan(e, this.isZoom); } } // TODO add scrolling animation to zoomed item after swipe handlePanEnd(e) { const { allowPanToNext, viewportSize, sourceElement, spacing, swipeVelocity } = this.props; if (this.isZoom) { this.currPos.x += e.delta.accX; this.currPos.y += e.delta.accY; this.preservedOffset.x += e.delta.accX; this.preservedOffset.y += e.delta.accY; if (this.isPanToNext || this.outOfBounds.x || this.outOfBounds.y) { if (!allowPanToNext || this.outOfBounds.y) { this.requestPanBackAnimation(this.currPos); } else if (this.isPanToNext || !this.outOfBounds.y) { const shouldPanToNext = (e.velocity > swipeVelocity) || (this.containerDelta > viewportSize.width * spacing); if (!shouldPanToNext) { this.requestPanBackAnimation(this.currPos); } e.delta.accX = this.containerDelta; this.props.onPanEnd(e, this.isZoom, shouldPanToNext); return; } } } else if (e.direction === DIRECTION_UP || e.direction === DIRECTION_DOWN) { const absVertDelta = Math.abs(e.delta.accY); const initCenterPos = this.getAnimWrapperCenterPos(); const start = { x: initCenterPos.x, y: initCenterPos.y + e.delta.accY, scale: 1, croppedScale: 1, opacity: Math.max(1 - (absVertDelta / viewportSize.height), 0), }; if (e.velocity > swipeVelocity || (absVertDelta > viewportSize.height * 0.5)) { const outType = sourceElement === undefined // eslint-disable-line no-nested-ternary ? e.direction === DIRECTION_UP ? OUT_TYPE_SWIPE_UP : OUT_TYPE_SWIPE_DOWN : OUT_TYPE_ZOOM; this.requestOutAnimation(start, outType); } else { this.requestResetAnimation(start, 'pan'); } } this.props.onPanEnd(e, this.isZoom); } handlePinchStart(e) { if (this.canItemPerformZoom) { this.props.onPinchStart(e, this.isZoom); } } handlePinch(e) { if (!this.canItemPerformZoom) return; if (this.scaleRatio === undefined) { this.scaleRatio = this.currScale / e.scale; } // real scale that manipulate item style const realScale = e.scale * this.scaleRatio; // pivot scale that always based on original item dimension const pivotScale = this.isZoom ? this.covertScale(realScale, false) : realScale; const maxPivotScale = this.maxPivotScale; if (pivotScale < maxPivotScale) { if (pivotScale < 1) { this.applyOverlayOpacity(pivotScale); } const pinchDelta = this.calculatePinchDelta(e.initPinchCenter, e.pinchCenter, e.scale); const nextPos = this.calculatePinchPosition(pivotScale, pinchDelta); this.applyAnimationBoxTransform(nextPos.x, nextPos.y, realScale); this.currScale = realScale; } else if (pivotScale > maxPivotScale) { if (this.maxZoomPos.x === null || this.maxZoomPos.y === null) { const pinchDelta = this.calculatePinchDelta(e.initPinchCenter, e.pinchCenter, e.scale); this.maxZoomPos = this.calculatePinchPosition(maxPivotScale, pinchDelta); this.maxEventScale = e.scale; } let slowScale = maxPivotScale + ((pivotScale - maxPivotScale) * ZOOM_FRICTION_LEVEL); const slowZoomScale = this.maxEventScale + ((e.scale - this.maxEventScale) * ZOOM_FRICTION_LEVEL); const pinchDelta = this.calculatePinchDelta(e.initPinchCenter, e.pinchCenter, slowZoomScale); const nextPos = this.calculatePinchPosition(slowScale, pinchDelta); if (this.isZoom) { slowScale = this.covertScale(slowScale, true); } this.applyAnimationBoxTransform(nextPos.x, nextPos.y, slowScale); this.currScale = slowScale; } } handlePinchEnd(e) { if (!this.canItemPerformZoom) return; const { sourceElement, pinchToCloseThreshold } = this.props; const currScale = this.currScale; const pivotScale = this.isZoom ? this.covertScale(currScale, false) : currScale; const maxPivotScale = this.maxPivotScale; if (pivotScale < maxPivotScale) { const pinchDelta = this.calculatePinchDelta(e.initPinchCenter, e.pinchCenter, e.scale); const currPos = this.calculatePinchPosition(pivotScale, pinchDelta); const start = Object.assign({}, currPos, { scale: currScale, opacity: pivotScale }); if (pivotScale < pinchToCloseThreshold && sourceElement !== undefined) { this.requestOutAnimation(start, OUT_TYPE_ZOOM); } else if (pivotScale < 1) { this.requestResetAnimation(start, 'pinch'); } else { const nextScale = currScale; const nextPos = Object.assign({}, currPos); this.preservedOffset.x += pinchDelta.x; this.preservedOffset.y += pinchDelta.y; const end = Object.assign({}, nextPos, { scale: nextScale }); this.requestZoomAnimation(start, end); } } else { const nextScale = this.isZoom ? this.props.maxZoomScale : maxPivotScale; const slowScale = this.isZoom ? this.covertScale(currScale, false) : currScale; const slowZoomScale = this.maxEventScale + ((e.scale - this.maxEventScale) * ZOOM_FRICTION_LEVEL); const pinchDelta = this.calculatePinchDelta(e.initPinchCenter, e.pinchCenter, slowZoomScale); const currPos = this.calculatePinchPosition(slowScale, pinchDelta); this.preservedOffset.x += pinchDelta.x; this.preservedOffset.y += pinchDelta.y; const start = Object.assign({}, currPos, { scale: currScale }); const end = Object.assign({}, this.maxZoomPos, { scale: nextScale }); this.requestZoomAnimation(start, end); } this.props.onPinchEnd(e, this.isZoom); } handleImageLoad(err) { setTimeout(() => { this.setState({ loaded: true, loadError: err }); this.props.onItemLoad(this.props.itemIndex); }, this.props.showHideDuration); } render() { const { open, item, horizOffset, errorBox } = this.props; return ( <EnhancedWrapper shouldBind={open && this.isCurrentSlide} style={{ transform: `translate3d(${horizOffset}px, 0px, 0px)` }} onTap={this.handleTap} onDoubleTap={this.handleDoubleTap} onPanStart={this.handlePanStart} onPan={this.handlePan} onPanEnd={this.handlePanEnd} onPinchStart={this.handlePinchStart} onPinch={this.handlePinch} onPinchEnd={this.handlePinchEnd} > <AnimationBox initPos={this.getAnimWrapperCenterPos()} animating={this.state.animating} item={item} fitDimension={this.getItemDimension()} loadError={this.state.loadError} errorBox={errorBox} rootRef={(el) => { this.animationBox = el; }} croppedBoxRef={(el) => { this.croppedBox = el; }} visibleBoxRef={(el) => { this.visibleBox = el; }} imageRef={(el) => { this.image = el; }} onImageLoad={this.handleImageLoad} /> </EnhancedWrapper> ); } } ItemHolder.displayName = 'React-Photo-Swipe__ItemHolder'; ItemHolder.defaultProps = { closing: false, }; ItemHolder.propTypes = { open: PropTypes.bool.isRequired, closing: PropTypes.bool.isRequired, item: PropTypes.object.isRequired, itemIndex: PropTypes.number.isRequired, currIndex: PropTypes.number.isRequired, horizOffset: PropTypes.number.isRequired, viewportSize: PropTypes.object.isRequired, cropped: PropTypes.bool.isRequired, sourceElement: isDomElement, overlay: isDomElement, allowPanToNext: PropTypes.bool.isRequired, errorBox: PropTypes.element.isRequired, spacing: PropTypes.number.isRequired, showHideDuration: PropTypes.number.isRequired, swipeVelocity: PropTypes.number.isRequired, pinchToCloseThreshold: PropTypes.number.isRequired, maxZoomScale: PropTypes.number.isRequired, onTap: PropTypes.func.isRequired, onDoubleTap: PropTypes.func.isRequired, onPanStart: PropTypes.func.isRequired, onPan: PropTypes.func.isRequired, onPanEnd: PropTypes.func.isRequired, onPinchStart: PropTypes.func.isRequired, onPinch: PropTypes.func, onPinchEnd: PropTypes.func.isRequired, beforeZoomIn: PropTypes.func.isRequired, afterZoomIn: PropTypes.func.isRequired, onItemLoad: PropTypes.func.isRequired, afterReset: PropTypes.func.isRequired, beforeZoomOut: PropTypes.func.isRequired, afterZoomOut: PropTypes.func.isRequired, };
app/containers/Signin.js
Block-and-Frame/block-and-frame
import React, { Component } from 'react'; import { browserHistory } from 'react-router'; import axios from 'axios'; import authHelpers from '../utils/authHelpers'; import SigninForm from '../components/auth/SigninForm'; class Signin extends Component { constructor(props) { super(props); this.state = { email: '', password: '', error: null, }; this.onEmailChange = this.onEmailChange.bind(this); this.onPasswordChange = this.onPasswordChange.bind(this); this.onSigninSubmit = this.onSigninSubmit.bind(this); this.preventDefaultSubmit = this.preventDefaultSubmit.bind(this); } onEmailChange(e) { this.setState({ email: e.target.value }); } onPasswordChange(e) { this.setState({ password: e.target.value }); } onSigninSubmit() { // submit the form this.handleSubmit(this.state.email, this.state.password); // hacky way to make only creator able to edit window.sessionStorage.email = this.state.email; // clear form this.setState({ email: '', password: '' }); } handleSubmit(email, password) { axios.post('/auth/signin', { email, password }) .then((res) => { this.setState({ error: null }); authHelpers.storeToken(res.data.token, res.data.id); browserHistory.push('/events'); }) .catch((err) => { this.setState({ error: err.data }); }); } preventDefaultSubmit(e) { e.preventDefault(); } render() { return ( <SigninForm errorMessage={this.state.error} email={this.state.email} password={this.state.password} onEmailChange={this.onEmailChange} onPasswordChange={this.onPasswordChange} onSigninSubmit={this.onSigninSubmit} preventDefaultSubmit={this.preventDefaultSubmit} /> ); } } export default Signin;
app/containers/Root.js
caiizilaz/exchange-rate
// @flow import React from 'react'; import { Provider } from 'react-redux'; import { ConnectedRouter } from 'react-router-redux'; import Routes from '../routes'; type RootType = { store: {}, history: {} }; export default function Root({ store, history }: RootType) { return ( <Provider store={store}> <ConnectedRouter history={history}> <Routes /> </ConnectedRouter> </Provider> ); }
components/ListItemProduct.js
NigelEarle/SSR-shopping
import React from 'react'; import Link from 'next/link'; const SingleProduct = ({ id, title, description, inventory, price }) => ( <div> <Link prefetch as={`/product/${id}`} href={`/product?id=${id}`}> <a> <div> <h3>{title}</h3> </div> </a> </Link> </div> ); export default SingleProduct;
src/Menu/MenuItem.js
boldr/boldr-ui
import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import BoldrComponent from '../util/BoldrComponent'; class MenuItem extends BoldrComponent { static propTypes = { icon: PropTypes.node, text: PropTypes.string, onClick: PropTypes.func, }; render() { return ( <li className={classNames('boldrui-menu__item')}> <button type="button" className="boldrui-menu__btn" onClick={this.props.onClick}> <span className="boldrui-menu__icon"> {this.props.icon} </span> <span className="boldrui-menu__text"> {this.props.text} </span> </button> </li> ); } } export default MenuItem;
src/components/DashboardBackground/DashboardBackground.js
Zoomdata/nhtsa-dashboard
import React from 'react'; import H2Header from '../H2Header/H2Header'; import GridContainer from '../GridContainer/GridContainer'; import CloseHood from '../CloseHood/CloseHood'; const DashboardBackground = () => { return ( <div className="dashboard-background"> <H2Header /> <GridContainer /> <CloseHood /> </div> ); }; export default DashboardBackground;
docs/components/Homepage/Platforms/index.js
jribeiro/storybook
import React from 'react'; import './style.css'; const Platform = () => <div id="platform" className="row"> <div className="col-md-12"> <h3 className="built-for">Built for</h3> <p className="platforms"> <a href="https://github.com/storybooks/storybook/tree/master/app/react" target="_blank" rel="noopener noreferrer" > React </a>{' '} &{' '} <a href="https://github.com/storybooks/storybook/tree/master/app/react-native" target="_blank" rel="noopener noreferrer" > React Native </a> </p> <hr /> </div> </div>; export default Platform;
packages/react-instantsearch-core/src/connectors/connectStateResults.js
algolia/react-instantsearch
import createConnector from '../core/createConnector'; import { getResults } from '../core/indexUtils'; /** * The `connectStateResults` connector provides a way to access the `searchState` and the `searchResults` * of InstantSearch. * For instance this connector allows you to create results/noResults or query/noQuery pages. * @name connectStateResults * @kind connector * @providedPropType {object} searchState - The search state of the instant search component. <br/><br/> See: [Search state structure](https://community.algolia.com/react-instantsearch/guide/Search_state.html) * @providedPropType {object} searchResults - The search results. <br/><br/> In case of multiple indices: if used under `<Index>`, results will be those of the corresponding index otherwise it'll be those of the root index See: [Search results structure](https://community.algolia.com/algoliasearch-helper-js/reference.html#searchresults) * @providedPropType {object} allSearchResults - In case of multiple indices you can retrieve all the results * @providedPropType {string} error - If the search failed, the error will be logged here. * @providedPropType {boolean} searching - If there is a search in progress. * @providedPropType {boolean} isSearchStalled - Flag that indicates if React InstantSearch has detected that searches are stalled. * @providedPropType {boolean} searchingForFacetValues - If there is a search in a list in progress. * @providedPropType {object} props - component props. * @example * import React from 'react'; * import algoliasearch from 'algoliasearch/lite'; * import { InstantSearch, SearchBox, Hits, connectStateResults } from 'react-instantsearch-dom'; * * const searchClient = algoliasearch( * 'latency', * '6be0576ff61c053d5f9a3225e2a90f76' * ); * * const Content = connectStateResults(({ searchState, searchResults }) => { * const hasResults = searchResults && searchResults.nbHits !== 0; * * return ( * <div> * <div hidden={!hasResults}> * <Hits /> * </div> * <div hidden={hasResults}> * <div>No results has been found for {searchState.query}</div> * </div> * </div> * ); * }); * * const App = () => ( * <InstantSearch * searchClient={searchClient} * indexName="instant_search" * > * <SearchBox /> * <Content /> * </InstantSearch> * ); */ export default createConnector({ displayName: 'AlgoliaStateResults', getProvidedProps(props, searchState, searchResults) { const results = getResults(searchResults, { ais: props.contextValue, multiIndexContext: props.indexContextValue, }); return { searchState, searchResults: results, allSearchResults: searchResults.results, searching: searchResults.searching, isSearchStalled: searchResults.isSearchStalled, error: searchResults.error, searchingForFacetValues: searchResults.searchingForFacetValues, props, }; }, });
20161216/cnode/index.ios.js
fengnovo/react-native
// import React from 'react'; // import { AppRegistry } from 'react-native'; // import Root from './app/app.js'; // AppRegistry.registerComponent('cnode', ()=>Root); require('./app/main');
app/components/Avatar/index.js
brentvatne/react-conf-app
// @flow import React from 'react'; import { Image, Platform, View } from 'react-native'; import theme from '../../theme'; type Props = { size?: number, source: string, style: Object | null | Array<Object | null>, }; export default class Avatar extends React.Component { render() { let { size, source, style, ...props } = this.props; size = size || 44; const styles = { wrapper: { backgroundColor: theme.color.sceneBg, borderRadius: size, overflow: 'hidden', height: size, width: size, }, image: { borderRadius: Platform.OS === 'android' ? size : 0, height: size, width: size, }, }; return ( <View style={[styles.wrapper, style]} {...props}> <Image source={{ uri: source }} style={styles.image} /> </View> ); } }
src/icons/IosInfiniteOutline.js
fbfeix/react-icons
import React from 'react'; import IconBase from './../components/IconBase/IconBase'; export default class IosInfiniteOutline extends React.Component { render() { if(this.props.bare) { return <g> <g> <path d="M451.229,188.098C432.682,169.967,407.95,160,381.585,160c-26.363,0-51.095,9.967-69.642,28.098l-42.229,41.187 l13.649,13.447l42.229-41.306c14.933-14.529,34.764-22.573,55.878-22.573c21.113,0,40.946,8.044,55.878,22.573 c30.797,30.139,30.797,79.13,0,109.148c-14.932,14.529-34.765,22.573-55.878,22.573c-21.114,0-40.945-8.044-55.878-22.573 L200.071,188.098C181.406,169.967,156.675,160,130.427,160c-26.363,0-51.095,9.967-69.643,28.098 C41.615,206.809,32.021,231.441,32,256c-0.021,24.611,9.573,49.149,28.784,67.902C79.332,342.032,104.063,352,130.427,352 c26.365,0,51.095-9.968,69.645-28.098l42.111-41.186l-13.647-13.329l-42.229,41.187c-14.932,14.529-34.764,22.573-55.879,22.573 c-21.113,0-40.944-8.044-55.876-22.573c-30.799-30.14-30.799-79.13,0-109.148c14.932-14.529,34.763-22.573,55.876-22.573 c21.115,0,40.947,8.044,55.879,22.573l125.52,122.477C330.49,342.032,355.222,352,381.47,352c26.363,0,51.095-9.968,69.643-28.098 C470.361,305.23,479.985,280.6,480,256C480.015,231.399,470.42,206.83,451.229,188.098z"></path> </g> </g>; } return <IconBase> <g> <path d="M451.229,188.098C432.682,169.967,407.95,160,381.585,160c-26.363,0-51.095,9.967-69.642,28.098l-42.229,41.187 l13.649,13.447l42.229-41.306c14.933-14.529,34.764-22.573,55.878-22.573c21.113,0,40.946,8.044,55.878,22.573 c30.797,30.139,30.797,79.13,0,109.148c-14.932,14.529-34.765,22.573-55.878,22.573c-21.114,0-40.945-8.044-55.878-22.573 L200.071,188.098C181.406,169.967,156.675,160,130.427,160c-26.363,0-51.095,9.967-69.643,28.098 C41.615,206.809,32.021,231.441,32,256c-0.021,24.611,9.573,49.149,28.784,67.902C79.332,342.032,104.063,352,130.427,352 c26.365,0,51.095-9.968,69.645-28.098l42.111-41.186l-13.647-13.329l-42.229,41.187c-14.932,14.529-34.764,22.573-55.879,22.573 c-21.113,0-40.944-8.044-55.876-22.573c-30.799-30.14-30.799-79.13,0-109.148c14.932-14.529,34.763-22.573,55.876-22.573 c21.115,0,40.947,8.044,55.879,22.573l125.52,122.477C330.49,342.032,355.222,352,381.47,352c26.363,0,51.095-9.968,69.643-28.098 C470.361,305.23,479.985,280.6,480,256C480.015,231.399,470.42,206.83,451.229,188.098z"></path> </g> </IconBase>; } };IosInfiniteOutline.defaultProps = {bare: false}
components/ui/SearchSelect.js
resource-watch/resource-watch
import React from 'react'; import PropTypes from 'prop-types'; import isEqual from 'lodash/isEqual'; // Components import Icon from 'components/ui/icon'; export default class SearchSelect extends React.Component { constructor(props) { super(props); this.state = { selectedItem: props.options ? props.options.find((item) => item.value === props.value) : null, closed: true, filteredOptions: props.options || [], selectedIndex: 0, value: props.value, }; // Bindings this.open = this.open.bind(this); this.close = this.close.bind(this); this.toggle = this.toggle.bind(this); this.selectItem = this.selectItem.bind(this); this.onType = this.onType.bind(this); this.onEnterSearch = this.onEnterSearch.bind(this); this.onScreenClick = this.onScreenClick.bind(this); this.resetSelectedIndex = this.resetSelectedIndex.bind(this); } UNSAFE_componentWillReceiveProps({ options, value }) { if (!isEqual(this.props.options, options)) { this.setState({ filteredOptions: options, selectedItem: options.find((item) => item.value === value), }); } if (this.props.value !== value) { this.setState({ selectedItem: this.props.options.find((item) => item.value === value) }); } } componentWillUnmount() { window.removeEventListener('click', this.onScreenClick); } // Event handler for event keyup on search input onType(evt) { console(evt); switch (evt.keyCode) { // key up case 38: { const index = this.state.selectedIndex > 0 ? this.state.selectedIndex - 1 : this.state.filteredOptions.length - 1; this.setSelectedIndex(index); break; } // key down case 40: { const index = (this.state.selectedIndex < this.state.filteredOptions.length - 1) ? this.state.selectedIndex + 1 : 0; this.setSelectedIndex(index); break; } // enter key case 13: { if (this.state.selectedIndex !== -1 && this.state.filteredOptions.length) { const selectedItem = this.state.filteredOptions[this.state.selectedIndex]; this.resetSelectedIndex(); this.selectItem(selectedItem); } break; } // esc key case 27: { this.close(); break; } // Typing text default: { const { value } = evt.currentTarget; const filteredOptions = this.props.options.filter((item) => item.label .toLowerCase().match(value.toLowerCase())); this.setState({ filteredOptions }, () => { if (this.props.onKeyPressed) this.props.onKeyPressed({ value }, [], 'name'); }); break; } } } // Event handler for enter event on search input onEnterSearch() { this.setState({ closed: false }); } onScreenClick(evt) { if (this.el.contains && !this.el.contains(evt.target)) { this.close(); window.removeEventListener('click', this.onScreenClick); } } setSelectedIndex(index) { this.setState({ selectedIndex: index }); } resetSelectedIndex() { this.setSelectedIndex(0); } // Event handler for mouseup event on options list item selectItem(item) { this.setState({ selectedItem: item }); this.close(); if (this.props.onValueChange) this.props.onValueChange(item); } toggle() { return this.state.closed ? this.open() : this.close(); } // Method than shows the option list open() { // Close select when clicking outside it window.addEventListener('click', this.onScreenClick); this.setState({ closed: false }, () => { if (this.input) this.input.focus(); }); } // Method that closes the options list close() { window.removeEventListener('click', this.onScreenClick); this.setState({ closed: true, filteredOptions: this.props.options, value: this.input.value, }, this.resetSelectedIndex); } render() { // Class names const cNames = ['c-custom-select -search']; if (this.props.className) cNames.push(this.props.className); if (this.state.closed) cNames.push('-closed'); const noResults = !!(this.props.options.length && !this.state.filteredOptions.length); return ( <div ref={(node) => { this.el = node; }} className={cNames.join(' ')}> <span className="custom-select-text" onClick={this.toggle}> <div> <span>{ this.state.value ? this.state.value : this.props.placeholder }</span> <button className="icon-btn" onClick={this.toggle}> <Icon name="icon-search" className="-small" /> </button> </div> <input ref={(node) => { this.input = node; }} className="custom-select-search" type="search" defaultValue={this.props.value} onBlur={this.close} onFocus={this.onEnterSearch} onChange={this.onType} /> </span> {noResults && <span className="no-results">No results</span>} {!this.state.closed && !this.props.hideList && ( <ul className="custom-select-options"> {this.state.filteredOptions.map((item, index) => { const cName = (index === this.state.selectedIndex) ? '-selected' : ''; return ( <li className={cName} key={item.id || item.label} onMouseEnter={() => { this.setSelectedIndex(index); }} onMouseDown={() => this.selectItem(item)} > <span className="label">{item.label}</span> </li> ); })} </ul> )} </div> ); } } SearchSelect.propTypes = { options: PropTypes.array, hideList: PropTypes.bool, value: PropTypes.string, className: PropTypes.string, placeholder: PropTypes.string, onValueChange: PropTypes.func, onKeyPressed: PropTypes.func, };
src/routes/register/Register.js
Frenzzy/react-starter-kit
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React from 'react'; import PropTypes from 'prop-types'; import withStyles from 'isomorphic-style-loader/lib/withStyles'; import s from './Register.css'; class Register extends React.Component { static propTypes = { title: PropTypes.string.isRequired, }; render() { return ( <div className={s.root}> <div className={s.container}> <h1>{this.props.title}</h1> <p>...</p> </div> </div> ); } } export default withStyles(s)(Register);
node_modules/semantic-ui-react/src/elements/Button/ButtonGroup.js
mowbell/clickdelivery-fed-test
import cx from 'classnames' import PropTypes from 'prop-types' import React from 'react' import { customPropTypes, getElementType, getUnhandledProps, META, SUI, useKeyOnly, useValueAndKey, useWidthProp, } from '../../lib' /** * Buttons can be grouped. */ function ButtonGroup(props) { const { attached, basic, children, className, color, compact, floated, fluid, icon, inverted, labeled, negative, positive, primary, secondary, size, toggle, vertical, widths, } = props const classes = cx( 'ui', color, size, useKeyOnly(basic, 'basic'), useKeyOnly(compact, 'compact'), useKeyOnly(fluid, 'fluid'), useKeyOnly(icon, 'icon'), useKeyOnly(inverted, 'inverted'), useKeyOnly(labeled, 'labeled'), useKeyOnly(negative, 'negative'), useKeyOnly(positive, 'positive'), useKeyOnly(primary, 'primary'), useKeyOnly(secondary, 'secondary'), useKeyOnly(toggle, 'toggle'), useKeyOnly(vertical, 'vertical'), useValueAndKey(attached, 'attached'), useValueAndKey(floated, 'floated'), useWidthProp(widths), 'buttons', className, ) const rest = getUnhandledProps(ButtonGroup, props) const ElementType = getElementType(ButtonGroup, props) return <ElementType {...rest} className={classes}>{children}</ElementType> } ButtonGroup._meta = { name: 'ButtonGroup', parent: 'Button', type: META.TYPES.ELEMENT, } ButtonGroup.propTypes = { /** An element type to render as (string or function). */ as: customPropTypes.as, /** A button can be attached to the top or bottom of other content. */ attached: PropTypes.oneOf(['left', 'right', 'top', 'bottom']), /** Groups can be less pronounced. */ basic: PropTypes.bool, /** Primary content. */ children: PropTypes.node, /** Additional classes. */ className: PropTypes.string, /** Groups can have a shared color. */ color: PropTypes.oneOf(SUI.COLORS), /** Groups can reduce their padding to fit into tighter spaces. */ compact: PropTypes.bool, /** Groups can be aligned to the left or right of its container. */ floated: PropTypes.oneOf(SUI.FLOATS), /** Groups can take the width of their container. */ fluid: PropTypes.bool, /** Groups can be formatted as icons. */ icon: PropTypes.bool, /** Groups can be formatted to appear on dark backgrounds. */ inverted: PropTypes.bool, /** Groups can be formatted as labeled icon buttons. */ labeled: PropTypes.bool, /** Groups can hint towards a negative consequence. */ negative: PropTypes.bool, /** Groups can hint towards a positive consequence. */ positive: PropTypes.bool, /** Groups can be formatted to show different levels of emphasis. */ primary: PropTypes.bool, /** Groups can be formatted to show different levels of emphasis. */ secondary: PropTypes.bool, /** Groups can have different sizes. */ size: PropTypes.oneOf(SUI.SIZES), /** Groups can be formatted to toggle on and off. */ toggle: PropTypes.bool, /** Groups can be formatted to appear vertically. */ vertical: PropTypes.bool, /** Groups can have their widths divided evenly. */ widths: PropTypes.oneOf(SUI.WIDTHS), } export default ButtonGroup
docs/src/app/layout/Main.js
GetAmbassador/react-ions
import React from 'react' const Main = props => { return ( <section role='main'> {props.children} </section> ) } export default Main
react/Pill/Pill.js
seek-oss/seek-style-guide
// @flow import styles from './Pill.less'; import React, { Component } from 'react'; import classnames from 'classnames'; import Text from '../Text/Text'; import CrossIcon from '../CrossIcon/CrossIcon'; import ScreenReaderOnly from '../ScreenReaderOnly/ScreenReaderOnly'; type Props = { children?: React$Node, buttonType?: string, text?: React$Node, onClose?: Function, className?: string }; export default class Pill extends Component<Props> { static displayName = 'Pill'; props: Props; handleClose = (event: Object) => { const { onClose } = this.props; if (onClose) { onClose(event); } }; renderStaticPill() { const { children, text, className, ...restProps } = this.props; const content = children || text; return ( <span className={classnames(className, styles.staticPill)} {...restProps}> <Text baseline={false} raw> {content} </Text> </span> ); } renderInteractivePill() { const { children, text, onClose, buttonType = 'button', className, ...restProps } = this.props; const content = children || text; return ( <span className={classnames(className, styles.interactivePill)} {...restProps} > <Text baseline={false} raw> {content} </Text> <button type={buttonType} className={styles.removeButton} onClick={onClose} > <ScreenReaderOnly>Remove item {content}</ScreenReaderOnly> <div className={styles.removeCircle}> <CrossIcon className={styles.removeIcon} svgClassName={styles.removeSvg} /> </div> </button> </span> ); } render() { const { onClose } = this.props; return onClose ? this.renderInteractivePill() : this.renderStaticPill(); } }
specs/helper.js
dminuoso/react-modal
// The following eslint overrides should be removed when refactoring can occur /* eslint react/no-render-return-value: "warn" */ import React from 'react'; import ReactDOM from 'react-dom'; import Modal from '../lib/components/Modal'; const divStack = []; export function renderModal (props, children, callback) { const myProps = { ariaHideApp: false, ...props }; const currentDiv = document.createElement('div'); divStack.push(currentDiv); document.body.appendChild(currentDiv); return ReactDOM.render( <Modal {...myProps}>{children}</Modal> , currentDiv, callback); } export const unmountModal = () => { const currentDiv = divStack.pop(); ReactDOM.unmountComponentAtNode(currentDiv); document.body.removeChild(currentDiv); }; export const emptyDOM = () => { while (divStack.length) { unmountModal(); } };
reactjs/src/cr_vars.js
astro44/FreeDraw
import React from 'react'; //import registerServiceWorker from './registerServiceWorker'; class var_Manager { constructor(){ if(! var_Manager.instance){ this._data = {}; var_Manager.instance = this; } return var_Manager.instance; } add(key, value) { this._data[key]=value //console.log(this._data) } get(key) { // get the value out for the given key return this._data[key] } // etc... } const varManager = new var_Manager(); Object.freeze(varManager); export default varManager;
src/components/player.js
romainberger/react-switch
import React from 'react' export default class Player extends React.Component { getUrl() { var url = `http://dailymotion.com/embed/video/${this.props.id}` if (this.props.autoplay) { url += '?autoplay=1' } if (this.props.start) { url += (this.props.autoplay ? '&' : '?') + `start=${this.props.start}` } return url } render() { return <iframe className={this.props.className} src={this.getUrl()} /> } }
packages/demo/stories/sticky-list.js
zzarcon/skatepark.js
import React from 'react'; import { storiesOf } from '@kadira/storybook'; import 'skateparkjs-sticky-list'; import options from './defaultStoryOptions'; storiesOf('Sticky List', module) .addWithInfo('Default options', () => { const data = [{ name: 'Cars', items: ['BWV', 'Mercedes', 'Ferrari', 'Audi', 'Porche', 'Lamborgini', 'Maserati', 'Aston Martin'] }, { name: 'Cities', items: ['Valencia', 'Barcelona', 'Linz', 'Sydney', 'Madrid', 'LA', 'New York', 'Chicago', 'Berlin', 'London'] }]; return <sk-sticky-list data={JSON.stringify(data)}></sk-sticky-list> }, options)
src/svg-icons/notification/airline-seat-legroom-extra.js
nathanmarks/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let NotificationAirlineSeatLegroomExtra = (props) => ( <SvgIcon {...props}> <path d="M4 12V3H2v9c0 2.76 2.24 5 5 5h6v-2H7c-1.66 0-3-1.34-3-3zm18.83 5.24c-.38-.72-1.29-.97-2.03-.63l-1.09.5-3.41-6.98c-.34-.68-1.03-1.12-1.79-1.12L11 9V3H5v8c0 1.66 1.34 3 3 3h7l3.41 7 3.72-1.7c.77-.36 1.1-1.3.7-2.06z"/> </SvgIcon> ); NotificationAirlineSeatLegroomExtra = pure(NotificationAirlineSeatLegroomExtra); NotificationAirlineSeatLegroomExtra.displayName = 'NotificationAirlineSeatLegroomExtra'; NotificationAirlineSeatLegroomExtra.muiName = 'SvgIcon'; export default NotificationAirlineSeatLegroomExtra;
app/javascript/mastodon/features/ui/index.js
pinfort/mastodon
import classNames from 'classnames'; import React from 'react'; import { HotKeys } from 'react-hotkeys'; import { defineMessages, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; import { Redirect, withRouter } from 'react-router-dom'; import PropTypes from 'prop-types'; import NotificationsContainer from './containers/notifications_container'; import LoadingBarContainer from './containers/loading_bar_container'; import ModalContainer from './containers/modal_container'; import { layoutFromWindow } from 'mastodon/is_mobile'; import { debounce } from 'lodash'; import { uploadCompose, resetCompose, changeComposeSpoilerness } from '../../actions/compose'; import { expandHomeTimeline } from '../../actions/timelines'; import { expandNotifications } from '../../actions/notifications'; import { fetchFilters } from '../../actions/filters'; import { clearHeight } from '../../actions/height_cache'; import { focusApp, unfocusApp, changeLayout } from 'mastodon/actions/app'; import { synchronouslySubmitMarkers, submitMarkers, fetchMarkers } from 'mastodon/actions/markers'; import { WrappedSwitch, WrappedRoute } from './util/react_router_helpers'; import UploadArea from './components/upload_area'; import ColumnsAreaContainer from './containers/columns_area_container'; import DocumentTitle from './components/document_title'; import PictureInPicture from 'mastodon/features/picture_in_picture'; import { Compose, Status, GettingStarted, KeyboardShortcuts, PublicTimeline, CommunityTimeline, AccountTimeline, AccountGallery, HomeTimeline, Followers, Following, Reblogs, Favourites, DirectTimeline, HashtagTimeline, Notifications, FollowRequests, GenericNotFound, FavouritedStatuses, BookmarkedStatuses, ListTimeline, Blocks, DomainBlocks, Mutes, PinnedStatuses, Lists, Search, Directory, AreaTimeline, AreaTimelineRedirect, FollowRecommendations, } from './util/async-components'; import { me } from '../../initial_state'; import { previewState as previewMediaState } from './components/media_modal'; import { previewState as previewVideoState } from './components/video_modal'; import { closeOnboarding, INTRODUCTION_VERSION } from 'mastodon/actions/onboarding'; // Dummy import, to make sure that <Status /> ends up in the application bundle. // Without this it ends up in ~8 very commonly used bundles. import '../../components/status'; const messages = defineMessages({ beforeUnload: { id: 'ui.beforeunload', defaultMessage: 'Your draft will be lost if you leave Mastodon.' }, }); const mapStateToProps = state => ({ layout: state.getIn(['meta', 'layout']), isComposing: state.getIn(['compose', 'is_composing']), hasComposingText: state.getIn(['compose', 'text']).trim().length !== 0, hasMediaAttachments: state.getIn(['compose', 'media_attachments']).size > 0, canUploadMore: !state.getIn(['compose', 'media_attachments']).some(x => ['audio', 'video'].includes(x.get('type'))) && state.getIn(['compose', 'media_attachments']).size < 4, dropdownMenuIsOpen: state.getIn(['dropdown_menu', 'openId']) !== null, firstLaunch: state.getIn(['settings', 'introductionVersion'], 0) < INTRODUCTION_VERSION, }); const keyMap = { help: '?', new: 'n', search: 's', forceNew: 'option+n', toggleComposeSpoilers: 'option+x', focusColumn: ['1', '2', '3', '4', '5', '6', '7', '8', '9'], reply: 'r', favourite: 'f', boost: 'b', mention: 'm', open: ['enter', 'o'], openProfile: 'p', moveDown: ['down', 'j'], moveUp: ['up', 'k'], back: 'backspace', goToHome: 'g h', goToNotifications: 'g n', goToLocal: 'g l', goToFederated: 'g t', goToDirect: 'g d', goToStart: 'g s', goToFavourites: 'g f', goToPinned: 'g p', goToProfile: 'g u', goToBlocked: 'g b', goToMuted: 'g m', goToRequests: 'g r', toggleHidden: 'x', toggleSensitive: 'h', openMedia: 'e', }; class SwitchingColumnsArea extends React.PureComponent { static propTypes = { children: PropTypes.node, location: PropTypes.object, mobile: PropTypes.bool, }; componentWillMount () { if (this.props.mobile) { document.body.classList.toggle('layout-single-column', true); document.body.classList.toggle('layout-multiple-columns', false); } else { document.body.classList.toggle('layout-single-column', false); document.body.classList.toggle('layout-multiple-columns', true); } } componentDidUpdate (prevProps) { if (![this.props.location.pathname, '/'].includes(prevProps.location.pathname)) { this.node.handleChildrenContentChange(); } if (prevProps.mobile !== this.props.mobile) { document.body.classList.toggle('layout-single-column', this.props.mobile); document.body.classList.toggle('layout-multiple-columns', !this.props.mobile); } } shouldUpdateScroll (_, { location }) { return location.state !== previewMediaState && location.state !== previewVideoState; } setRef = c => { if (c) { this.node = c.getWrappedInstance(); } } render () { const { children, mobile } = this.props; const redirect = mobile ? <Redirect from='/' to='/timelines/home' exact /> : <Redirect from='/' to='/getting-started' exact />; return ( <ColumnsAreaContainer ref={this.setRef} singleColumn={mobile}> <WrappedSwitch> {redirect} <WrappedRoute path='/getting-started' component={GettingStarted} content={children} /> <WrappedRoute path='/keyboard-shortcuts' component={KeyboardShortcuts} content={children} /> <WrappedRoute path='/timelines/home' component={HomeTimeline} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/timelines/public' exact component={PublicTimeline} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/timelines/public/local' exact component={CommunityTimeline} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/timelines/direct' component={DirectTimeline} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/timelines/tag/:id' component={HashtagTimeline} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/timelines/list/:id' component={ListTimeline} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/timelines/area/:id' component={AreaTimeline} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/timelines/area' component={AreaTimelineRedirect} content={children} /> <WrappedRoute path='/notifications' component={Notifications} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/favourites' component={FavouritedStatuses} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/bookmarks' component={BookmarkedStatuses} content={children} /> <WrappedRoute path='/pinned' component={PinnedStatuses} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/start' component={FollowRecommendations} content={children} /> <WrappedRoute path='/search' component={Search} content={children} /> <WrappedRoute path='/directory' component={Directory} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/statuses/new' component={Compose} content={children} /> <WrappedRoute path='/statuses/:statusId' exact component={Status} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/statuses/:statusId/reblogs' component={Reblogs} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/statuses/:statusId/favourites' component={Favourites} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/accounts/:accountId' exact component={AccountTimeline} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/accounts/:accountId/with_replies' component={AccountTimeline} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll, withReplies: true }} /> <WrappedRoute path='/accounts/:accountId/followers' component={Followers} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/accounts/:accountId/following' component={Following} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/accounts/:accountId/media' component={AccountGallery} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/follow_requests' component={FollowRequests} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/blocks' component={Blocks} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/domain_blocks' component={DomainBlocks} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/mutes' component={Mutes} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute path='/lists' component={Lists} content={children} componentParams={{ shouldUpdateScroll: this.shouldUpdateScroll }} /> <WrappedRoute component={GenericNotFound} content={children} /> </WrappedSwitch> </ColumnsAreaContainer> ); } } export default @connect(mapStateToProps) @injectIntl @withRouter class UI extends React.PureComponent { static contextTypes = { router: PropTypes.object.isRequired, }; static propTypes = { dispatch: PropTypes.func.isRequired, children: PropTypes.node, isComposing: PropTypes.bool, hasComposingText: PropTypes.bool, hasMediaAttachments: PropTypes.bool, canUploadMore: PropTypes.bool, location: PropTypes.object, intl: PropTypes.object.isRequired, dropdownMenuIsOpen: PropTypes.bool, layout: PropTypes.string.isRequired, firstLaunch: PropTypes.bool, }; state = { draggingOver: false, }; handleBeforeUnload = e => { const { intl, dispatch, isComposing, hasComposingText, hasMediaAttachments } = this.props; dispatch(synchronouslySubmitMarkers()); if (isComposing && (hasComposingText || hasMediaAttachments)) { e.preventDefault(); // Setting returnValue to any string causes confirmation dialog. // Many browsers no longer display this text to users, // but we set user-friendly message for other browsers, e.g. Edge. e.returnValue = intl.formatMessage(messages.beforeUnload); } } handleWindowFocus = () => { this.props.dispatch(focusApp()); this.props.dispatch(submitMarkers({ immediate: true })); } handleWindowBlur = () => { this.props.dispatch(unfocusApp()); } handleDragEnter = (e) => { e.preventDefault(); if (!this.dragTargets) { this.dragTargets = []; } if (this.dragTargets.indexOf(e.target) === -1) { this.dragTargets.push(e.target); } if (e.dataTransfer && Array.from(e.dataTransfer.types).includes('Files') && this.props.canUploadMore) { this.setState({ draggingOver: true }); } } handleDragOver = (e) => { if (this.dataTransferIsText(e.dataTransfer)) return false; e.preventDefault(); e.stopPropagation(); try { e.dataTransfer.dropEffect = 'copy'; } catch (err) { } return false; } handleDrop = (e) => { if (this.dataTransferIsText(e.dataTransfer)) return; e.preventDefault(); this.setState({ draggingOver: false }); this.dragTargets = []; if (e.dataTransfer && e.dataTransfer.files.length >= 1 && this.props.canUploadMore) { this.props.dispatch(uploadCompose(e.dataTransfer.files)); } } handleDragLeave = (e) => { e.preventDefault(); e.stopPropagation(); this.dragTargets = this.dragTargets.filter(el => el !== e.target && this.node.contains(el)); if (this.dragTargets.length > 0) { return; } this.setState({ draggingOver: false }); } dataTransferIsText = (dataTransfer) => { return (dataTransfer && Array.from(dataTransfer.types).filter((type) => type === 'text/plain').length === 1); } closeUploadModal = () => { this.setState({ draggingOver: false }); } handleServiceWorkerPostMessage = ({ data }) => { if (data.type === 'navigate') { this.context.router.history.push(data.path); } else { console.warn('Unknown message type:', data.type); } } handleLayoutChange = debounce(() => { this.props.dispatch(clearHeight()); // The cached heights are no longer accurate, invalidate }, 500, { trailing: true, }); handleResize = () => { const layout = layoutFromWindow(); if (layout !== this.props.layout) { this.handleLayoutChange.cancel(); this.props.dispatch(changeLayout(layout)); } else { this.handleLayoutChange(); } } componentDidMount () { window.addEventListener('focus', this.handleWindowFocus, false); window.addEventListener('blur', this.handleWindowBlur, false); window.addEventListener('beforeunload', this.handleBeforeUnload, false); window.addEventListener('resize', this.handleResize, { passive: true }); document.addEventListener('dragenter', this.handleDragEnter, false); document.addEventListener('dragover', this.handleDragOver, false); document.addEventListener('drop', this.handleDrop, false); document.addEventListener('dragleave', this.handleDragLeave, false); document.addEventListener('dragend', this.handleDragEnd, false); if ('serviceWorker' in navigator) { navigator.serviceWorker.addEventListener('message', this.handleServiceWorkerPostMessage); } // On first launch, redirect to the follow recommendations page if (this.props.firstLaunch) { this.context.router.history.replace('/start'); this.props.dispatch(closeOnboarding()); } this.props.dispatch(fetchMarkers()); this.props.dispatch(expandHomeTimeline()); this.props.dispatch(expandNotifications()); setTimeout(() => this.props.dispatch(fetchFilters()), 500); this.hotkeys.__mousetrap__.stopCallback = (e, element) => { return ['TEXTAREA', 'SELECT', 'INPUT'].includes(element.tagName); }; } componentWillUnmount () { window.removeEventListener('focus', this.handleWindowFocus); window.removeEventListener('blur', this.handleWindowBlur); window.removeEventListener('beforeunload', this.handleBeforeUnload); window.removeEventListener('resize', this.handleResize); document.removeEventListener('dragenter', this.handleDragEnter); document.removeEventListener('dragover', this.handleDragOver); document.removeEventListener('drop', this.handleDrop); document.removeEventListener('dragleave', this.handleDragLeave); document.removeEventListener('dragend', this.handleDragEnd); } setRef = c => { this.node = c; } handleHotkeyNew = e => { e.preventDefault(); const element = this.node.querySelector('.compose-form__autosuggest-wrapper textarea'); if (element) { element.focus(); } } handleHotkeySearch = e => { e.preventDefault(); const element = this.node.querySelector('.search__input'); if (element) { element.focus(); } } handleHotkeyForceNew = e => { this.handleHotkeyNew(e); this.props.dispatch(resetCompose()); } handleHotkeyToggleComposeSpoilers = e => { e.preventDefault(); this.props.dispatch(changeComposeSpoilerness()); } handleHotkeyFocusColumn = e => { const index = (e.key * 1) + 1; // First child is drawer, skip that const column = this.node.querySelector(`.column:nth-child(${index})`); if (!column) return; const container = column.querySelector('.scrollable'); if (container) { const status = container.querySelector('.focusable'); if (status) { if (container.scrollTop > status.offsetTop) { status.scrollIntoView(true); } status.focus(); } } } handleHotkeyBack = () => { if (window.history && window.history.length === 1) { this.context.router.history.push('/'); } else { this.context.router.history.goBack(); } } setHotkeysRef = c => { this.hotkeys = c; } handleHotkeyToggleHelp = () => { if (this.props.location.pathname === '/keyboard-shortcuts') { this.context.router.history.goBack(); } else { this.context.router.history.push('/keyboard-shortcuts'); } } handleHotkeyGoToHome = () => { this.context.router.history.push('/timelines/home'); } handleHotkeyGoToNotifications = () => { this.context.router.history.push('/notifications'); } handleHotkeyGoToLocal = () => { this.context.router.history.push('/timelines/public/local'); } handleHotkeyGoToFederated = () => { this.context.router.history.push('/timelines/public'); } handleHotkeyGoToDirect = () => { this.context.router.history.push('/timelines/direct'); } handleHotkeyGoToStart = () => { this.context.router.history.push('/getting-started'); } handleHotkeyGoToFavourites = () => { this.context.router.history.push('/favourites'); } handleHotkeyGoToPinned = () => { this.context.router.history.push('/pinned'); } handleHotkeyGoToProfile = () => { this.context.router.history.push(`/accounts/${me}`); } handleHotkeyGoToBlocked = () => { this.context.router.history.push('/blocks'); } handleHotkeyGoToMuted = () => { this.context.router.history.push('/mutes'); } handleHotkeyGoToRequests = () => { this.context.router.history.push('/follow_requests'); } render () { const { draggingOver } = this.state; const { children, isComposing, location, dropdownMenuIsOpen, layout } = this.props; const handlers = { help: this.handleHotkeyToggleHelp, new: this.handleHotkeyNew, search: this.handleHotkeySearch, forceNew: this.handleHotkeyForceNew, toggleComposeSpoilers: this.handleHotkeyToggleComposeSpoilers, focusColumn: this.handleHotkeyFocusColumn, back: this.handleHotkeyBack, goToHome: this.handleHotkeyGoToHome, goToNotifications: this.handleHotkeyGoToNotifications, goToLocal: this.handleHotkeyGoToLocal, goToFederated: this.handleHotkeyGoToFederated, goToDirect: this.handleHotkeyGoToDirect, goToStart: this.handleHotkeyGoToStart, goToFavourites: this.handleHotkeyGoToFavourites, goToPinned: this.handleHotkeyGoToPinned, goToProfile: this.handleHotkeyGoToProfile, goToBlocked: this.handleHotkeyGoToBlocked, goToMuted: this.handleHotkeyGoToMuted, goToRequests: this.handleHotkeyGoToRequests, }; return ( <HotKeys keyMap={keyMap} handlers={handlers} ref={this.setHotkeysRef} attach={window} focused> <div className={classNames('ui', { 'is-composing': isComposing })} ref={this.setRef} style={{ pointerEvents: dropdownMenuIsOpen ? 'none' : null }}> <SwitchingColumnsArea location={location} mobile={layout === 'mobile' || layout === 'single-column'}> {children} </SwitchingColumnsArea> {layout !== 'mobile' && <PictureInPicture />} <NotificationsContainer /> <LoadingBarContainer className='loading-bar' /> <ModalContainer /> <UploadArea active={draggingOver} onClose={this.closeUploadModal} /> <DocumentTitle /> </div> </HotKeys> ); } }
TODO/app/containers/AddTodo.js
kosl90/Redux-Study
import React from 'react' import { connect } from 'react-redux' import { addTodo } from '../actions' let AddTodo = ({ dispatch }) => { let input return ( <div> <form onSubmit={e => { e.preventDefault() if (!input.value.trim()) { return } dispatch(addTodo(input.value)) input.value = '' }}> <input ref={node => { input = node }} /> <button type="submit"> Add Todo </button> </form> </div> ) } AddTodo = connect()(AddTodo) export default AddTodo
src/compose.js
kadirahq/react-komposer
import React from 'react'; import shallowEqual from 'shallowequal'; import pick from 'lodash.pick'; import { mayBeStubbed } from 'react-stubber'; import { inheritStatics } from './utils'; export default function compose(dataLoader, options = {}) { return function (Child) { const { errorHandler = (err) => { throw err; }, loadingHandler = () => null, env = {}, pure = false, propsToWatch = null, // Watch all the props. shouldSubscribe = null, shouldUpdate = null, } = options; class Container extends React.Component { constructor(props, ...args) { super(props, ...args); this.state = {}; this.propsCache = {}; this._subscribe(props); } componentDidMount() { this._mounted = true; } componentWillReceiveProps(props) { this._subscribe(props); } shouldComponentUpdate(nextProps, nextState) { if (shouldUpdate) { return shouldUpdate(this.props, nextProps); } if (!pure) { return true; } return ( !shallowEqual(this.props, nextProps) || this.state.error !== nextState.error || !shallowEqual(this.state.data, nextState.data) ); } componentWillUnmount() { this._unmounted = true; this._unsubscribe(); } _shouldSubscribe(props) { const firstRun = !this._cachedWatchingProps; const nextProps = pick(props, propsToWatch); const currentProps = this._cachedWatchingProps || {}; this._cachedWatchingProps = nextProps; if (firstRun) return true; if (typeof shouldSubscribe === 'function') { return shouldSubscribe(currentProps, nextProps); } if (propsToWatch === null) return true; if (propsToWatch.length === 0) return false; return !shallowEqual(currentProps, nextProps); } _subscribe(props) { if (!this._shouldSubscribe(props)) return; const onData = (error, data) => { if (this._unmounted) { throw new Error(`Trying to set data after component(${Container.displayName}) has unmounted.`); } const payload = { error, data }; if (!this._mounted) { this.state = { ...this.state, ...payload, }; return; } this.setState(payload); }; // We need to do this before subscribing again. this._unsubscribe(); this._stop = dataLoader(props, onData, env); } _unsubscribe() { if (this._stop) { this._stop(); } } render() { const props = this.props; const { data, error } = this.state; if (error) { return errorHandler(error); } if (!data) { return loadingHandler(); } const finalProps = { ...props, ...data, }; const setChildRef = (c) => { this.child = c; }; return ( <Child ref={setChildRef} {...finalProps} /> ); } } Container.__komposerData = { dataLoader, options, }; inheritStatics(Container, Child); return mayBeStubbed(Container); }; }
src/index.js
vkarpov15/shidoshi
import { Provider } from 'react-redux'; import ReactDOM from 'react-dom'; import React from 'react'; import { Router, Route, IndexRoute, hashHistory } from 'react-router'; import App from './components/App'; import Article from './components/Article'; import Editor from './components/Editor'; import Home from './components/Home'; import Login from './components/Login'; import Profile from './components/Profile'; import ProfileFavorites from './components/ProfileFavorites'; import Register from './components/Register'; import Settings from './components/Settings'; import store from './store'; ReactDOM.render(( <Provider store={store}> <Router history={hashHistory}> <Route path="/" component={App}> <IndexRoute component={Home} /> <Route path="login" component={Login} /> <Route path="register" component={Register} /> <Route path="settings" component={Settings} /> <Route path="article/:id" component={Article} /> <Route path="@:username" component={Profile} /> <Route path="@:username/favorites" component={ProfileFavorites} /> <Route path="editor" component={Editor} /> <Route path="editor/:slug" component={Editor} /> </Route> </Router> </Provider> ), document.getElementById('main'));
app/javascript/mastodon/features/community_timeline/index.js
riku6460/chikuwagoddon
import React from 'react'; import { connect } from 'react-redux'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; import StatusListContainer from '../ui/containers/status_list_container'; import Column from '../../components/column'; import ColumnHeader from '../../components/column_header'; import { expandCommunityTimeline } from '../../actions/timelines'; import { addColumn, removeColumn, moveColumn } from '../../actions/columns'; import ColumnSettingsContainer from './containers/column_settings_container'; import { connectCommunityStream } from '../../actions/streaming'; const messages = defineMessages({ title: { id: 'column.community', defaultMessage: 'Local timeline' }, }); const mapStateToProps = (state, { onlyMedia, columnId }) => { const uuid = columnId; const columns = state.getIn(['settings', 'columns']); const index = columns.findIndex(c => c.get('uuid') === uuid); return { hasUnread: state.getIn(['timelines', `community${onlyMedia ? ':media' : ''}`, 'unread']) > 0, onlyMedia: (columnId && index >= 0) ? columns.get(index).getIn(['params', 'other', 'onlyMedia']) : state.getIn(['settings', 'community', 'other', 'onlyMedia']), }; }; export default @connect(mapStateToProps) @injectIntl class CommunityTimeline extends React.PureComponent { static contextTypes = { router: PropTypes.object, }; static defaultProps = { onlyMedia: false, }; static propTypes = { dispatch: PropTypes.func.isRequired, shouldUpdateScroll: PropTypes.func, columnId: PropTypes.string, intl: PropTypes.object.isRequired, hasUnread: PropTypes.bool, multiColumn: PropTypes.bool, onlyMedia: PropTypes.bool, }; handlePin = () => { const { columnId, dispatch, onlyMedia } = this.props; if (columnId) { dispatch(removeColumn(columnId)); } else { dispatch(addColumn('COMMUNITY', { other: { onlyMedia } })); } } handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); } handleHeaderClick = () => { this.column.scrollTop(); } componentDidMount () { const { dispatch, onlyMedia } = this.props; dispatch(expandCommunityTimeline({ onlyMedia })); this.disconnect = dispatch(connectCommunityStream({ onlyMedia })); } componentDidUpdate (prevProps) { if (prevProps.onlyMedia !== this.props.onlyMedia) { const { dispatch, onlyMedia } = this.props; this.disconnect(); dispatch(expandCommunityTimeline({ onlyMedia })); this.disconnect = dispatch(connectCommunityStream({ onlyMedia })); } } componentWillUnmount () { if (this.disconnect) { this.disconnect(); this.disconnect = null; } } setRef = c => { this.column = c; } handleLoadMore = maxId => { const { dispatch, onlyMedia } = this.props; dispatch(expandCommunityTimeline({ maxId, onlyMedia })); } render () { const { intl, shouldUpdateScroll, hasUnread, columnId, multiColumn, onlyMedia } = this.props; const pinned = !!columnId; return ( <Column ref={this.setRef} label={intl.formatMessage(messages.title)}> <ColumnHeader icon='users' active={hasUnread} title={intl.formatMessage(messages.title)} onPin={this.handlePin} onMove={this.handleMove} onClick={this.handleHeaderClick} pinned={pinned} multiColumn={multiColumn} > <ColumnSettingsContainer columnId={columnId} /> </ColumnHeader> <StatusListContainer trackScroll={!pinned} scrollKey={`community_timeline-${columnId}`} timelineId={`community${onlyMedia ? ':media' : ''}`} onLoadMore={this.handleLoadMore} emptyMessage={<FormattedMessage id='empty_column.community' defaultMessage='The local timeline is empty. Write something publicly to get the ball rolling!' />} shouldUpdateScroll={shouldUpdateScroll} /> </Column> ); } }
src/admin/components/SchemaForm/BooleanField.js
u-wave/web
import React from 'react'; import PropTypes from 'prop-types'; import FormControlLabel from '@mui/material/FormControlLabel'; import FormHelperText from '@mui/material/FormHelperText'; import Checkbox from '@mui/material/Checkbox'; function BooleanField({ schema, value, onChange }) { return ( <> <FormControlLabel control={( <Checkbox checked={value} onChange={(event) => onChange(event.target.checked)} /> )} label={schema.title} /> {schema.description && <FormHelperText>{schema.description}</FormHelperText>} </> ); } BooleanField.propTypes = { schema: PropTypes.object.isRequired, value: PropTypes.bool, onChange: PropTypes.func.isRequired, }; export default BooleanField;
classic/src/scenes/mailboxes/src/Scenes/CommandPaletteScene/CommandPaletteSearchItemCommandSuggestion.js
wavebox/waveboxapp
import React from 'react' import PropTypes from 'prop-types' import shallowCompare from 'react-addons-shallow-compare' import CommandPaletteSearchItem from './CommandPaletteSearchItem' import { withStyles } from '@material-ui/core/styles' import grey from '@material-ui/core/colors/grey' const styles = { helper: { color: grey[600] } } @withStyles(styles) class CommandPaletteSearchItemCommandSuggestion extends React.Component { /* **************************************************************************/ // Class /* **************************************************************************/ static propTypes = { item: PropTypes.shape({ modifier: PropTypes.string.isRequired, keyword: PropTypes.string.isRequired, helper: PropTypes.string, description: PropTypes.string }).isRequired, onPrefillSearch: PropTypes.func.isRequired, onRequestClose: PropTypes.func.isRequired } /* **************************************************************************/ // UI Events /* **************************************************************************/ /** * Handles the click event * @param evt: the event that fired */ handleClick = (evt) => { const { item, onPrefillSearch, onClick } = this.props onPrefillSearch(evt, item) if (onClick) { onClick(evt) } } /* **************************************************************************/ // Rendering /* **************************************************************************/ shouldComponentUpdate (nextProps, nextState) { return shallowCompare(this, nextProps, nextState) } render () { const { classes, item, onClick, onPrefillSearch, onRequestClose, ...passProps } = this.props return ( <CommandPaletteSearchItem primaryText={( <React.Fragment> {`${item.modifier}${item.keyword}`} {item.helper ? ( <span className={classes.helper}> {item.helper}</span> ) : undefined} </React.Fragment> )} secondaryText={item.description} onClick={this.handleClick} {...passProps} /> ) } } export default CommandPaletteSearchItemCommandSuggestion
src/test/account.js
jperez10/RobinHoodAutoTrader
import React, { Component } from 'react'; class Account extends Component { render() { //console.log("pineapple") console.log("this.props.Account",this.props.Account); if(this.props.Account === undefined){ return ( <div className="account"> Please update Account <button onClick={() => this.props.updateAccount()} >UPDATE</button> </div> ); } return ( <div className="account"> <button onClick={() => this.props.updateAccount()} >UPDATE</button> <div>Account #:</div> <div>Profolio Value: </div> </div> ); } } // you export so you can have access to this component in your other files export default Account;
app/views/calculator.js
7kfpun/BitcoinReactNative
import React from 'react'; import { ListView, NetInfo, Platform, StyleSheet, Text, TouchableHighlight, TouchableOpacity, View, } from 'react-native'; // 3rd party libraries import { Actions } from 'react-native-router-flux'; import { ifIphoneX } from 'react-native-iphone-x-helper'; import GoogleAnalytics from 'react-native-google-analytics-bridge'; import Icon from 'react-native-vector-icons/MaterialIcons'; import NavigationBar from 'react-native-navbar'; import store from 'react-native-simple-store'; import timer from 'react-native-timer'; import * as StoreReview from 'react-native-store-review'; import Big from 'big.js'; import moment from 'moment'; // Flux import CurrencyStore from '../stores/currency-store'; import AdmobCell from '../components/admob-cell'; import Rating from '../components/rating'; import currencies from '../utils/currencies'; import bitcoin from '../utils/bitcoin'; const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#EFEFF4', ...ifIphoneX({ marginBottom: 80, }, { marginBottom: 50, }), }, navigatorBarIOS: { backgroundColor: '#455A64', borderBottomWidth: StyleSheet.hairlineWidth, borderBottomColor: '#37474F', ...ifIphoneX({ height: 70, paddingTop: 15, }, {}), }, navigatorLeftButton: { paddingTop: 10, paddingLeft: 10, paddingRight: 50, }, navigatorRightButton: { paddingTop: 10, paddingLeft: 50, paddingRight: 10, }, toolbar: { height: 56, backgroundColor: '#202020', }, cell: { flex: 1, backgroundColor: '#EFEFF4', justifyContent: 'center', alignItems: 'center', }, cellText: { fontSize: 22, color: 'gray', }, }); export default class CalculatorView extends React.Component { constructor(props) { super(props); this.dataSource = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }); this.state = Object.assign({ dataSource: this.dataSource.cloneWithRows(currencies), key: Math.random(), value: '0', isDecimalPonit: false, rateFloat: null, isConnected: true, currency: 'usd', calculateCount: 0, }, CurrencyStore.getState()); } componentDidMount() { NetInfo.fetch().then((isConnected) => { this.setState({ isConnected }); }); const that = this; function handleFirstConnectivityChange(isConnected) { that.setState({ isConnected }); } NetInfo.isConnected.addEventListener('change', handleFirstConnectivityChange); store.get('currency').then((currency) => { if (currency) { that.setState({ currency }); } that.checkBitcoin(currency); }); timer.clearTimeout(this); timer.setInterval(this, 'checkBitcoin', () => that.checkBitcoin(this.state.currency), 15000); } componentWillUnmount() { timer.clearInterval(this); } onCurrencyStoreChange(state) { this.setState({ currencies: state.currencies, }); } onActionSelected(position) { if (position === 0) { // index of 'Settings' Actions.tab0more(); } } setNumber(value) { if (this.state.value.includes('.') && value === 0) { this.setState({ value: `${this.state.value}${value}`, }); } else if (this.state.isDecimalPonit && !this.state.value.includes('.') && value === 0) { this.setState({ value: `${this.state.value}.${value}`, }); } else if (this.state.isDecimalPonit && !this.state.value.includes('.')) { this.setState({ value: (new Big(`${this.state.value}.${value}0`)).toFixed(), }); } else { this.setState({ value: (new Big(`${this.state.value}${value}`)).toFixed(), }); } this.setState({ isDecimalPonit: false }); this.checkBitcoin(this.state.currency); } checkBitcoin(currency) { if (!currency) { currency = 'usd'; } const that = this; bitcoin(currency).then((bitcoinData) => { console.log(bitcoinData); that.setState({ rateFloat: bitcoinData.bpi && bitcoinData.bpi[currency.toUpperCase()] && bitcoinData.bpi[currency.toUpperCase()].rate_float, updatedISO: bitcoinData.time && moment(bitcoinData.time.updatedISO).fromNow(), }); }); } renderToolbar() { if (Platform.OS === 'ios') { return ( <NavigationBar statusBar={{ tintColor: '#455A64', style: 'light-content', }} style={styles.navigatorBarIOS} title={{ title: this.props.title, tintColor: 'white' }} leftButton={ <TouchableOpacity onPress={Actions.tab0more}> <Icon style={styles.navigatorLeftButton} name="info-outline" size={26} color="white" /> </TouchableOpacity> } /> ); } else if (Platform.OS === 'android') { return ( <Icon.ToolbarAndroid style={styles.toolbar} title={this.props.title} titleColor="white" actions={[ { title: 'Settings', iconName: 'info-outline', iconSize: 26, show: 'always' }, ]} onActionSelected={position => this.onActionSelected(position)} /> ); } } render() { GoogleAnalytics.trackScreenView('calculator'); let price = '-'; if (this.state.isConnected && this.state.rateFloat) { price = (new Big(this.state.value)).times(this.state.rateFloat).toFixed(); } let fontSize; if (price.length < 11) { fontSize = 50; } else if (price.length < 30) { fontSize = 35; } else if (price.length < 60) { fontSize = 30; } else { fontSize = 25; } return ( <View style={styles.container}> {this.renderToolbar()} <View style={{ flex: 4, alignItems: 'flex-end', justifyContent: 'space-around', padding: 14 }}> <Text style={{ fontSize, textAlign: 'right' }}>{price}</Text> {price.length < 25 && <Text style={{ fontSize: price.length < 15 ? 18 : 14 }}>{this.state.currency.toUpperCase()}</Text>} {price.length < 25 && <Text style={{ fontSize: price.length < 15 ? 18 : 14 }}>{`${this.state.value.toString()}${this.state.isDecimalPonit && !this.state.value.toString().includes('.') ? '.' : ''}`}</Text>} {price.length < 25 && <Text style={{ fontSize: price.length < 15 ? 18 : 14 }}>{'BTC'}</Text>} </View> <View style={{ flex: 1 }}> <ListView horizontal dataSource={this.state.dataSource} renderRow={({ currency }) => (<TouchableHighlight underlayColor="#EFEFF4" onPress={() => { this.setState({ currency }); this.checkBitcoin(currency); store.save('currency', currency); }} > <View style={{ flex: 1, height: 30, width: 50, justifyContent: 'center', alignItems: 'center', backgroundColor: 'gray' }}> <Text style={{ color: 'white' }}>{currency}</Text> </View> </TouchableHighlight>)} /> </View> <View style={{ flex: 6 }}> <View style={{ flex: 1, flexDirection: 'row' }}> <TouchableHighlight style={styles.cell} underlayColor="#EFEFF4" onPress={() => this.setNumber(7)}> <View> <Text style={styles.cellText}>7</Text> </View> </TouchableHighlight> <TouchableHighlight style={styles.cell} underlayColor="#EFEFF4" onPress={() => this.setNumber(8)}> <View> <Text style={styles.cellText}>8</Text> </View> </TouchableHighlight> <TouchableHighlight style={styles.cell} underlayColor="#EFEFF4" onPress={() => this.setNumber(9)}> <View> <Text style={styles.cellText}>9</Text> </View> </TouchableHighlight> </View> <View style={{ flex: 1, flexDirection: 'row' }}> <TouchableHighlight style={styles.cell} underlayColor="#EFEFF4" onPress={() => this.setNumber(4)}> <View> <Text style={styles.cellText}>4</Text> </View> </TouchableHighlight> <TouchableHighlight style={styles.cell} underlayColor="#EFEFF4" onPress={() => this.setNumber(5)}> <View> <Text style={styles.cellText}>5</Text> </View> </TouchableHighlight> <TouchableHighlight style={styles.cell} underlayColor="#EFEFF4" onPress={() => this.setNumber(6)}> <View> <Text style={styles.cellText}>6</Text> </View> </TouchableHighlight> </View> <View style={{ flex: 1, flexDirection: 'row' }}> <TouchableHighlight style={styles.cell} underlayColor="#EFEFF4" onPress={() => this.setNumber(1)}> <View> <Text style={styles.cellText}>1</Text> </View> </TouchableHighlight> <TouchableHighlight style={styles.cell} underlayColor="#EFEFF4" onPress={() => this.setNumber(2)}> <View> <Text style={styles.cellText}>2</Text> </View> </TouchableHighlight> <TouchableHighlight style={styles.cell} underlayColor="#EFEFF4" onPress={() => this.setNumber(3)}> <View> <Text style={styles.cellText}>3</Text> </View> </TouchableHighlight> </View> <View style={{ flex: 1, flexDirection: 'row' }}> <TouchableHighlight style={styles.cell} underlayColor="#EFEFF4" onPress={() => { this.setState({ value: '0', calculateCount: this.state.calculateCount + 1, }); }} > <View> <Text style={styles.cellText}>AC</Text> </View> </TouchableHighlight> <TouchableHighlight style={styles.cell} underlayColor="#EFEFF4" onPress={() => this.setNumber(0)}> <View> <Text style={styles.cellText}>0</Text> </View> </TouchableHighlight> <TouchableHighlight style={styles.cell} underlayColor="#EFEFF4" onPress={() => this.setState({ isDecimalPonit: true })}> <View> <Text style={styles.cellText}>.</Text> </View> </TouchableHighlight> </View> </View> {this.state.calculateCount > 8 && StoreReview.isAvailable && <Rating />} <AdmobCell /> </View> ); } } CalculatorView.propTypes = { title: React.PropTypes.string, }; CalculatorView.defaultProps = { title: '', };
web/src/content/work/Books.js
ajmalafif/ajmalafif.com
import React from 'react' import tw, { css, theme } from 'twin.macro' export const Books = () => { return ( <div className="books"> <div tw="mt-8 md:mt-16 w-full flex flex-row overflow-hidden space-x-4 md:space-x-16"> <div tw=" m-0 px-6 py-4 md:p-8 md:pb-4 rounded w-40 h-48 md:h-72 md:w-56 border shadow-inner flex flex-wrap content-between" css={{ backgroundColor: `${theme`colors.accent`}`, fontWeight: '400 !important', position: 'relative', '&:after': { content: '" "', position: 'absolute', top: 0, left: 10, bottom: 0, width: 4, background: 'rgba(0,0,0,0.09)', }, }} > <h4 css={{ color: 'var(--text-cta) !important', margin: '0 !important', }} > Nudging Responsibly </h4> <div> <small tw="font-sans text-cta opacity-30">2019</small> </div> </div> <div tw="m-0 px-6 py-4 md:p-8 md:pb-4 rounded w-40 h-48 md:h-72 md:w-56 border shadow-inner flex flex-wrap content-between" css={{ backgroundColor: `${theme`colors.accent`}`, fontWeight: '400 !important', position: 'relative', '&:after': { content: '" "', position: 'absolute', top: 0, left: 12, bottom: 0, width: 4, background: 'rgba(0,0,0,0.09)', }, }} > <h4 css={{ color: 'var(--text-cta) !important', margin: '0 !important', }} > Ethical Framework </h4> <div> <small tw="font-sans text-cta opacity-30">2019</small> </div> </div> <div tw=" m-0 px-6 py-4 md:p-8 md:pb-4 rounded w-40 h-48 md:h-72 md:w-56 border shadow-inner flex flex-wrap content-between" css={{ backgroundColor: `${theme`colors.accent`}`, fontWeight: '400 !important', position: 'relative', '&:after': { content: '" "', position: 'absolute', top: 0, left: 10, bottom: 0, width: 4, background: 'rgba(0,0,0,0.09)', }, }} > <h4 css={{ color: 'var(--text-cta) !important', margin: '0 !important', }} > Gamification Playbook </h4> <div> <small tw="font-sans text-cta opacity-30">2020</small> </div> </div> </div> </div> ) } export default Books
client/intl/ismorphicIntlProvider.js
jkettmann/universal-react-relay-starter-kit
import React from 'react' import { IntlProvider, addLocaleData } from 'react-intl' import en from 'react-intl/locale-data/en' import de from 'react-intl/locale-data/de' import localeData from './locales/data.json' addLocaleData([...en, ...de]) const withIntl = (children, locale) => { const messages = localeData[locale] || localeData.en // When an error like found RedirectionException is thrown, children is undefined. // This causes an error during SSR, so render an empty div as default return ( <IntlProvider locale={locale} messages={messages}> {children || <div />} </IntlProvider> ) } export default withIntl
src/svg-icons/maps/rate-review.js
tan-jerene/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let MapsRateReview = (props) => ( <SvgIcon {...props}> <path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 14v-2.47l6.88-6.88c.2-.2.51-.2.71 0l1.77 1.77c.2.2.2.51 0 .71L8.47 14H6zm12 0h-7.5l2-2H18v2z"/> </SvgIcon> ); MapsRateReview = pure(MapsRateReview); MapsRateReview.displayName = 'MapsRateReview'; MapsRateReview.muiName = 'SvgIcon'; export default MapsRateReview;
app/javascript/mastodon/components/common_counter.js
im-in-space/mastodon
// @ts-check import React from 'react'; import { FormattedMessage } from 'react-intl'; /** * Returns custom renderer for one of the common counter types * * @param {"statuses" | "following" | "followers"} counterType * Type of the counter * @param {boolean} isBold Whether display number must be displayed in bold * @returns {(displayNumber: JSX.Element, pluralReady: number) => JSX.Element} * Renderer function * @throws If counterType is not covered by this function */ export function counterRenderer(counterType, isBold = true) { /** * @type {(displayNumber: JSX.Element) => JSX.Element} */ const renderCounter = isBold ? (displayNumber) => <strong>{displayNumber}</strong> : (displayNumber) => displayNumber; switch (counterType) { case 'statuses': { return (displayNumber, pluralReady) => ( <FormattedMessage id='account.statuses_counter' defaultMessage='{count, plural, one {{counter} Post} other {{counter} Posts}}' values={{ count: pluralReady, counter: renderCounter(displayNumber), }} /> ); } case 'following': { return (displayNumber, pluralReady) => ( <FormattedMessage id='account.following_counter' defaultMessage='{count, plural, one {{counter} Following} other {{counter} Following}}' values={{ count: pluralReady, counter: renderCounter(displayNumber), }} /> ); } case 'followers': { return (displayNumber, pluralReady) => ( <FormattedMessage id='account.followers_counter' defaultMessage='{count, plural, one {{counter} Follower} other {{counter} Followers}}' values={{ count: pluralReady, counter: renderCounter(displayNumber), }} /> ); } default: throw Error(`Incorrect counter name: ${counterType}. Ensure it accepted by commonCounter function`); } }
cypress/app/src/components/ValidationTest.js
darrikonn/react-chloroform
import React from 'react'; import { Button, Form, Input, Select, TextArea, } from 'react-chloroform'; function ValidationTest() { const attachCypressOrConsoleLog = model => { if (window.Cypress) { window.model = model; } else { console.log(model); } }; return ( <div> <Form initialState={{ 'human.*': 'Rest should be set', 'human.*.interests.0': 'First item should be set', dog: 'barfoo', }} onSubmit={attachCypressOrConsoleLog} validators={{ // validate top level validation 'human.0.interests.*': val => [val === 'BAR', `${val} is not a valid human interest`], 'human.*.interests.*': val => [val !== 'FOOBAR', 'FOOBAR is not a valid value'], }} > {/* list of list objects validation */} <div> <div> <Input model="human.0.interests.0" validator={val => [ val !== null && val !== undefined && val !== '', 'This field is required', ]} // isRequired /> <Input model="human.0.interests.1" /> </div> <div> <Input model="human.1.interests.0" validator={val => [val !== 'FOO', `${val} is not a valid human interest`]} /> <Input model="human.1.interests.1" /> </div> </div> {/* scalar validation */} <div> <Select model="dog" options={[ {name: 'foobar', value: 'foobar'}, {name: 'barfoo', value: 'barfoo'}, ]} validator={val => [val !== 'barfoo', 'Value cannot be barfoo']} /> </div> {/* no validation */} <div> <TextArea model="ape" /> </div> {/* submit / reset */} <div> <Button type="submit" text="Submit" /> <Button type="reset" text="Reset" /> </div> </Form> </div> ); } export default ValidationTest;
client/modules/core/components/top_nav_bar/top_nav_bar.js
bompi88/grand-view
// ////////////////////////////////////////////////////////////////////////////// // TopNavbar SCSS Styles // ////////////////////////////////////////////////////////////////////////////// // // Copyright 2015 Concept // // Licensed under the Apache License, Version 2.0 (the 'License'); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an 'AS IS' BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ////////////////////////////////////////////////////////////////////////////// /* globals _require */ import React from 'react'; import { FlowRouter } from 'meteor/kadira:flow-router'; import NavBarButton from './nav_bar_button'; const { shell } = _require('electron'); export default class TopNavBar extends React.Component { openConcept() { shell.openExternal('http://www.ntnu.no/concept/'); } gotoHome(e) { e.preventDefault(); FlowRouter.go('Index'); } renderButton(button) { return ( <NavBarButton key={button.route} route={button.route} name={button.label} hasDot={button.hasDot} dotTooltip={button.dotTooltip} /> ); } renderButtons() { const { buttons } = this.props; return buttons.map(button => this.renderButton(button)); } render() { const { text } = this.props; return ( <div className="navbar navbar-default navbar-fixed-top animated fadeInDown" role="navigation"> <div className="container-fluid"> <span className="navbar-brand navbar-right" rel="home" onClick={this.openConcept} > <img src="/images/concept_logo.png" alt={text.conceptLogo} /> </span> <div className="navbar-header"> <button type="button" className="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse" aria-expanded="false" aria-controls="navbar" > <span className="sr-only">{text.toggleNavigation}</span> <span className="icon-bar" /> <span className="icon-bar" /> <span className="icon-bar" /> </button> <a className="navbar-brand" rel="home" href="#" onClick={this.gotoHome} title={text.gotoHome} >{text.grandview}</a> </div> <div className="navbar-collapse collapse"> <ul className="nav navbar-nav"> {this.renderButtons()} </ul> </div> </div> </div> ); } }
src/routes/MetaCoin/components/HeaderComponent.js
trixyrabbit/Exile
import React from 'react' export const Header = () => { return ( <div> <h2>MetaCoin Example Webpack react-redux Example!</h2> </div> ) } Header.propTypes = { } export default Header
app/app.js
SergejKasper/churchfathers
/** * app.js * * This is the entry file for the application, only setup and boilerplate * code. */ // Needed for redux-saga es6 generator support import 'babel-polyfill'; // Import all the third party stuff import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { applyRouterMiddleware, Router, browserHistory } from 'react-router'; import { syncHistoryWithStore } from 'react-router-redux'; import { useScroll } from 'react-router-scroll'; import 'sanitize.css/sanitize.css'; // Import root app import App from 'containers/App'; // Import selector for `syncHistoryWithStore` import { makeSelectLocationState } from 'containers/App/selectors'; // Import Language Provider import LanguageProvider from 'containers/LanguageProvider'; // Load the favicon, the manifest.json file and the .htaccess file /* eslint-disable import/no-unresolved, import/extensions */ import '!file-loader?name=[name].[ext]!./favicon.ico'; import '!file-loader?name=[name].[ext]!./manifest.json'; import 'file-loader?name=[name].[ext]!./.htaccess'; /* eslint-enable import/no-unresolved, import/extensions */ import configureStore from './store'; // Import i18n messages import { translationMessages } from './i18n'; // Import CSS reset and Global Styles import './global-styles'; // Import root routes import createRoutes from './routes'; // Create redux store with history // this uses the singleton browserHistory provided by react-router // Optionally, this could be changed to leverage a created history // e.g. `const browserHistory = useRouterHistory(createBrowserHistory)();` const initialState = {}; const store = configureStore(initialState, browserHistory); // Sync history and store, as the react-router-redux reducer // is under the non-default key ("routing"), selectLocationState // must be provided for resolving how to retrieve the "route" in the state const history = syncHistoryWithStore(browserHistory, store, { selectLocationState: makeSelectLocationState(), }); // Set up the router, wrapping all Routes in the App component const rootRoute = { component: App, childRoutes: createRoutes(store), }; const render = (messages) => { ReactDOM.render( <Provider store={store}> <LanguageProvider messages={messages}> <Router history={history} routes={rootRoute} render={ // Scroll to top when going to a new page, imitating default browser // behaviour applyRouterMiddleware(useScroll()) } /> </LanguageProvider> </Provider>, document.getElementById('app') ); }; // Hot reloadable translation json files if (module.hot) { // modules.hot.accept does not accept dynamic dependencies, // have to be constants at compile-time module.hot.accept('./i18n', () => { render(translationMessages); }); } // Chunked polyfill for browsers without Intl support if (!window.Intl) { (new Promise((resolve) => { resolve(import('intl')); })) .then(() => Promise.all([ import('intl/locale-data/jsonp/en.js'), ])) .then(() => render(translationMessages)) .catch((err) => { throw err; }); } else { render(translationMessages); } // Install ServiceWorker and AppCache in the end since // it's not most important operation and if main code fails, // we do not want it installed if (process.env.NODE_ENV === 'production') { require('offline-plugin/runtime').install(); // eslint-disable-line global-require }
src/components/svg/Logo.js
ryanabragg/VanguardLARP
import React from 'react'; import PropTypes from 'prop-types'; const Logo = (props) => { return ( <svg width={props.width} height={props.height} viewBox="0 0 648 360" xmlns="http://www.w3.org/2000/svg"> <path id="compass" fill={props.colorCompass} d="m 201.279,15.5 c 21.06,-0.791 41.549,2.187 61.91,9.451 -0.107,0.155 -0.212,0.301 -0.321,0.452 0.899,-0.129 1.817,-0.201 2.749,-0.201 h 16.343 c -0.627,-0.294 -1.251,-0.588 -1.879,-0.876 -1.362,-0.62 -1.975,-1.383 -1.618,-3.003 0.692,-3.145 1.194,-6.338 1.767,-9.521 0.705,-3.938 1.408,-7.869 2.108,-11.801 -1.441,0.885 -2.359,1.993 -3.205,3.153 -3.357,4.632 -6.721,9.271 -10.041,13.939 -1.036,1.454 -2.128,2.028 -3.938,1.252 -2.038,-0.868 -4.187,-1.47 -6.31,-2.112 -22.741,-6.885 -45.9,-9.172 -69.562,-6.636 -13.937,1.494 -27.485,4.551 -40.634,9.29 -5.203,1.881 -10.258,3.992 -15.18,6.315 h 17.994 c 16.18,-5.896 32.736,-9.06 49.817,-9.702 z m 145.173,74.429 c 5.822,8.729 9.936,16.733 12.478,23.001 -5.736,0.971 -11.159,1.942 -16.611,2.798 -3.161,0.491 -6.904,1.998 -9.375,0.855 -0.601,-0.275 -1.115,-0.747 -1.576,-1.334 -1.085,2.374 -2.196,4.92 -3.333,7.653 2.032,-0.306 4.06,-0.607 6.089,-0.913 0.085,0.306 0.17,0.619 0.262,0.934 -2.606,1.183 -5.204,2.402 -7.814,3.581 -1.253,3.141 -2.529,6.504 -3.833,10.112 0.697,-0.125 1.409,-0.183 2.108,-0.183 3.542,0 6.829,1.579 9.255,4.45 1.085,1.291 2.43,3.464 2.695,6.537 1.137,-2.058 2.813,-4.054 5.03,-5.979 0.154,-0.138 0.318,-0.264 0.475,-0.402 -0.698,-2.269 -1.445,-4.522 -2.268,-6.762 -0.786,-2.126 -0.145,-3.212 1.438,-4.397 5.466,-4.098 10.887,-8.273 16.317,-12.434 2.31,-1.768 2.908,-1.744 3.887,1.08 1.182,3.375 2.389,6.745 3.556,10.132 0.134,-0.007 0.264,-0.026 0.397,-0.026 h 2.076 c 1.162,0 2.312,0.259 3.362,0.759 0.762,0.364 1.472,0.762 2.16,1.176 -1.062,-3.427 -2.221,-6.834 -3.496,-10.218 -4.73,-12.572 -10.729,-24.411 -18.115,-35.362 -1.423,1.054 -3.16,2.622 -5.164,4.942 z m -122.536,33.419 c -0.704,-0.235 -1.412,-0.444 -2.134,-0.638 0.594,1.64 1.208,3.341 1.852,5.104 4.166,1.252 8.19,2.988 11.982,5.181 2.979,-1.616 5.295,-2.773 7.06,-3.537 2.337,-1.005 5.238,-1.691 8.869,-2.099 0.381,-0.042 0.766,-0.059 1.151,-0.043 3.636,0.123 6.443,0.553 8.684,1.352 2.092,-2.289 4.155,-4.56 6.208,-6.808 0.871,-2.514 1.639,-4.755 2.325,-6.75 -3.062,3.349 -6.127,6.695 -9.187,10.046 -0.099,0.119 -0.325,0.119 -1.159,0.391 0.11,-1.204 0.219,-2.066 0.272,-2.919 0.526,-8.707 4.179,-16.03 9.516,-22.78 2.643,-3.346 5.106,-6.826 7.508,-10.352 0.022,-0.724 0.035,-1.506 0.035,-2.37 v -2.859 c -4.198,6.021 -8.292,11.891 -12.371,17.749 -0.196,-0.084 -0.393,-0.164 -0.595,-0.249 1.384,-7.522 2.771,-15.051 4.215,-22.895 -6.552,-2.648 -11.692,-7.211 -14.881,-13.396 -0.139,-0.132 -0.271,-0.268 -0.407,-0.407 -7.971,18.609 -15.948,37.216 -23.817,55.872 -1.167,2.763 -2.342,3.342 -5.126,2.407 z m 1.848,-42.62 h -2.877 c -0.61,0.846 -1.219,1.69 -1.835,2.538 -0.317,-0.109 -0.641,-0.2 -0.962,-0.302 0.052,-0.746 0.098,-1.488 0.147,-2.236 h -2.712 c -0.234,2.471 -0.48,4.941 -0.734,7.413 -0.137,1.328 -1.279,2.594 -2.105,3.779 -0.747,1.065 -1.506,2.117 -2.261,3.17 0.644,2.102 1.394,4.474 2.277,7.177 5.122,-7.325 10.241,-14.651 15.353,-21.979 -1.379,0.285 -2.819,0.44 -4.291,0.44 z m 146.927,123.356 c -1.488,10.903 -3.839,21.635 -7.865,32.53 -3.897,-2.573 -7.429,-4.896 -10.938,-7.23 -3.08,-2.052 -6.107,-4.174 -9.219,-6.165 -1.539,-0.988 -1.973,-2.01 -1.437,-3.889 1.98,-7.03 3.361,-14.12 4.182,-21.259 -2.021,2.626 -4.036,5.169 -6.015,7.602 -3.872,4.739 -7.162,8.724 -9.77,11.839 -0.323,0.392 -0.653,0.783 -0.996,1.17 11.946,7.966 23.861,15.912 35.782,23.852 -0.139,0.287 -0.277,0.583 -0.414,0.885 -2.511,-0.885 -5.05,-1.673 -7.509,-2.661 -11.812,-4.746 -23.612,-9.498 -35.417,-14.249 -0.552,0.521 -1.109,1.036 -1.688,1.564 -4.511,4.146 -8.021,6.707 -11.036,8.068 -2.556,1.143 -5.083,1.927 -7.521,2.326 4.851,0.885 9.751,1.764 14.747,2.672 -2.667,4.311 -5.124,8.276 -7.817,12.622 -7.724,-5.436 -15.204,-10.697 -22.664,-15.944 -0.337,0.958 -0.676,1.909 -1.016,2.856 6.52,4.596 13.048,9.192 19.563,13.804 0.733,0.516 1.388,1.123 2.327,1.906 -2.792,3.371 -5.46,6.595 -8.284,10.017 -5.785,-5.261 -11.499,-10.462 -17.184,-15.65 -0.381,1.075 -0.759,2.133 -1.135,3.176 5.382,4.904 10.755,9.806 16.182,14.746 -3.921,3.618 -7.546,6.945 -11.401,10.477 -3.36,-4.124 -6.5,-7.922 -9.58,-11.741 -0.382,1.065 -0.76,2.122 -1.131,3.166 2.739,3.403 5.515,6.848 8.346,10.355 -5.239,3.396 -10.272,6.655 -15.692,10.164 -3.894,10.831 -7.154,19.84 -9.79,27.035 3.795,5.068 7.745,10.039 11.628,15.05 0.494,0.631 0.931,1.306 1.613,2.258 -21.124,8.85 -42.855,12.913 -65.35,12.7 -19.596,-0.188 -38.663,-3.549 -57.415,-10.942 4.187,-5.828 7.971,-11.276 11.921,-16.59 3.724,-5.006 3.792,-4.912 9.902,-3.28 10.616,2.861 21.361,4.526 32.216,4.929 -0.833,-1.638 -1.687,-3.518 -2.599,-5.737 -1.18,-2.869 -2.46,-6.333 -3.87,-10.432 -0.065,0 -0.129,-0.006 -0.195,-0.021 -2.292,-0.146 -1.504,-1.975 -1.378,-3.183 0.04,-0.366 0.081,-0.736 0.122,-1.106 -0.697,-2.12 -1.422,-4.383 -2.181,-6.793 -0.38,3.466 -0.762,6.959 -1.154,10.527 -5.667,-1.134 -11.168,-2.233 -17.324,-3.471 4.799,-6.694 9.388,-13.096 13.918,-19.418 -0.642,-1.684 -1.375,-3.61 -2.203,-5.821 -14.341,20.103 -28.566,40.044 -42.795,59.986 -0.282,-0.15 -0.565,-0.291 -0.846,-0.436 11.351,-28.285 22.703,-56.592 34.118,-85.058 -3.339,-8.998 -7.373,-19.894 -12.25,-33.114 -8.716,-10.354 -13.217,-23.145 -13.278,-36.027 -1.086,-2.958 -2.209,-6.004 -3.354,-9.118 -0.349,1.936 -0.681,3.882 -1.045,5.816 -0.129,0.687 -0.227,1.385 -0.423,2.56 -31.489,-20.463 -62.617,-40.674 -93.749,-60.902 0.151,-0.29 0.301,-0.574 0.447,-0.862 2.112,0.797 4.237,1.549 6.327,2.394 27.304,11.064 54.608,22.143 81.904,33.223 -4.049,-11.008 -8.419,-22.902 -13.135,-35.746 -4.131,-0.836 -8.09,-2.341 -11.572,-5.67 -2.492,-2.396 -5.613,-4.134 -8.839,-6.45 3.272,-3.592 6.331,-6.937 9.437,-10.356 1.358,1.236 2.728,2.485 4.092,3.727 -0.761,-2.065 -1.529,-4.161 -2.306,-6.275 -0.055,-0.048 -0.109,-0.101 -0.162,-0.149 0.027,-0.026 0.053,-0.054 0.082,-0.075 -0.994,-2.697 -1.993,-5.427 -3.011,-8.199 -1.292,-2.826 -2.708,-4.452 -5.917,-5.059 -2.72,2.68 -5.329,5.49 -7.822,8.438 -5.752,6.816 -10.529,14.461 -15.593,21.846 -1.107,1.628 -1.998,2.426 -4.136,2.084 -7.01,-1.122 -14.068,-1.997 -21.102,-2.977 -0.901,-0.116 -1.78,-0.329 -3.567,-0.674 3.536,-6.169 6.584,-11.955 10.078,-17.464 4.85,-7.65 10.287,-14.855 16.323,-21.57 -1.242,-1.395 -2.391,-2.926 -3.416,-4.577 -0.06,-0.098 -0.116,-0.194 -0.17,-0.284 -0.23,-0.245 -0.438,-0.498 -0.652,-0.755 -11.284,12.361 -20.56,26.167 -27.845,41.344 -0.89,1.856 -1.848,2.643 -4.02,2.272 -4.902,-0.852 -9.855,-1.46 -14.79,-2.139 -2.948,-0.402 -5.905,-0.762 -8.854,-1.132 0.187,0.89 0.491,1.241 0.853,1.484 6.319,4.178 12.635,8.355 18.984,12.481 1.146,0.75 1.694,1.447 1.157,2.928 -5.627,15.252 -8.933,30.99 -10.063,47.236 -1.023,14.715 -0.213,29.312 2.453,43.798 3.046,16.535 8.418,32.289 16.101,47.291 8.814,17.198 20.13,32.489 34.042,45.873 12.209,11.749 25.833,21.531 40.88,29.334 2.255,1.156 5.558,2.002 6.342,3.853 0.887,2.091 -0.506,5.149 -0.951,7.788 -0.69,4.176 -1.408,8.343 -2.119,12.515 3.693,-4.46 7.021,-9.005 10.246,-13.615 2.396,-3.418 2.326,-3.435 6.174,-2.012 19.861,7.38 40.431,10.844 61.57,10.588 24.134,-0.275 47.247,-5.379 69.318,-15.264 18.861,-8.45 35.617,-19.974 50.297,-34.415 15.369,-15.137 27.607,-32.565 36.359,-52.318 1.248,-2.819 2.616,-3.104 5.209,-2.561 5.917,1.238 11.896,2.234 17.838,3.322 0.06,-0.144 0.119,-0.306 0.164,-0.452 -0.572,-0.522 -1.095,-1.135 -1.736,-1.572 -4.526,-3.027 -9.01,-6.123 -13.635,-9.007 -2.035,-1.26 -2.59,-2.462 -1.883,-4.91 2.372,-8.249 4.865,-16.508 6.489,-24.918 0.79,-4.081 1.389,-8.173 1.833,-12.278 h -6.918 c -0.128,1.163 -0.265,2.328 -0.424,3.495 z M 105.879,109.937 c 3.517,2.444 6.844,4.759 10.17,7.081 -0.058,0.2 -0.117,0.404 -0.17,0.606 -4.459,-0.641 -8.913,-1.278 -13.798,-1.971 1.448,-2.176 2.498,-3.76 3.798,-5.716 z m 45.7,127.502 c -9.835,10.273 -19.729,20.485 -29.496,30.817 -1.695,1.787 -2.776,1.946 -4.357,0.025 -2.632,-3.202 -5.426,-6.263 -8.441,-9.723 3.414,-2.693 6.626,-5.267 9.872,-7.777 5.977,-4.649 11.939,-9.304 17.99,-13.85 1.031,-0.768 2.455,-1.249 3.757,-1.403 4.079,-0.515 8.18,-0.811 13.067,-1.249 -1.117,1.482 -1.671,2.406 -2.392,3.16 z m 0.794,4.249 c -1.777,6.973 -0.98,14.538 -6.145,20.727 -4.539,5.463 -8.464,11.441 -12.67,17.177 -0.317,0.438 -0.721,0.805 -1.342,1.481 -3.304,-3.016 -6.479,-5.899 -10.016,-9.132 9.703,-10.147 19.502,-20.404 29.299,-30.663 0.29,0.141 0.585,0.274 0.874,0.41 z m -44.857,14.451 c -3.5,-5.552 -6.812,-10.795 -10.504,-16.639 12.159,-1.074 23.59,-2.073 35.016,-3.071 0.06,0.226 0.113,0.446 0.167,0.673 -8.084,6.234 -16.168,12.472 -24.679,19.037 z m 42.568,-50.835 c 5.017,7.379 9.702,14.252 14.592,21.446 -26.982,2.698 -54.107,5.413 -81.232,8.134 -0.105,-0.364 -0.221,-0.721 -0.322,-1.077 22.492,-9.576 44.981,-19.152 66.962,-28.503 z m -66.947,-6.1 c 0.362,-5.224 0.683,-9.826 1.039,-14.887 13.274,-0.239 27.574,-0.5 42.558,-0.782 -0.786,1.044 -1.015,1.522 -1.38,1.816 -2.477,1.937 -5.139,3.655 -7.43,5.784 -3.032,2.812 -6.623,3.678 -10.535,4.225 -7.657,1.071 -15.273,2.405 -24.252,3.844 z m 24.082,-0.262 c -6.412,4.953 -12.832,9.914 -19.852,15.326 -0.946,-4.401 -1.77,-8.237 -2.672,-12.426 7.598,-1.208 14.91,-2.375 22.219,-3.537 0.104,0.208 0.202,0.425 0.305,0.637 z M 87.341,148.823 c 9.46,6.31 18.509,12.333 27.543,18.364 -0.054,0.213 -0.117,0.417 -0.177,0.629 -10.024,-1.203 -20.041,-2.413 -30.456,-3.678 1.027,-5.087 1.987,-9.844 3.09,-15.315 z m -3.661,18.169 c 9.415,1.141 18.289,2.221 27.171,3.304 0.457,0.059 0.912,0.136 1.376,0.171 9.978,0.879 12.054,1.753 20.869,8.987 -1.378,0.527 -2.447,1.268 -3.534,1.302 -14.787,0.341 -29.581,0.617 -44.37,0.803 -0.759,0.011 -2.207,-0.975 -2.203,-1.478 0.078,-4.23 0.41,-8.456 0.691,-13.089 z m -41.185,33.844 c -3.979,-32.747 3.625,-63.599 9.37,-76 7.005,4.685 13.85,9.208 20.603,13.873 0.548,0.377 0.853,1.767 0.641,2.508 -4.745,16.401 -6.658,33.089 -5.47,50.134 0.711,10.174 2.283,20.182 5.392,29.899 0.814,2.557 0.604,4.052 -1.771,5.731 -5.568,3.95 -10.848,8.3 -16.263,12.486 -0.643,0.492 -1.36,0.889 -2.527,1.651 -5.273,-13.146 -8.31,-26.544 -9.975,-40.282 z m 98.255,107.818 c -1.496,7.596 -2.737,15.253 -4.11,23.104 -28.55,-8.333 -77.343,-60.386 -83.054,-88.599 4.583,-0.466 9.138,-0.938 13.69,-1.365 3.588,-0.344 7.19,-0.537 10.762,-0.965 1.861,-0.233 2.567,0.646 3.278,2.142 5.835,12.386 13.546,23.54 22.724,33.653 10.021,11.031 21.591,20.186 34.62,27.428 2.083,1.161 2.544,2.307 2.09,4.602 z m -5.967,-25.845 c 4.34,-5.943 8.46,-11.592 12.583,-17.241 0.195,0.09 0.394,0.168 0.589,0.258 -1.309,7.452 -2.618,14.919 -4.042,23.011 -3.287,-2.174 -6.014,-3.969 -9.13,-6.028 z m 137.154,52.644 c -0.421,-3.202 -0.755,-5.884 -1.127,-8.551 -0.715,-5.222 -1.39,-10.438 -2.235,-15.633 -0.32,-1.968 0.275,-2.89 2.087,-3.788 12.799,-6.274 24.388,-14.377 34.566,-24.333 11.022,-10.8 20.509,-22.854 27.408,-36.76 1.041,-2.101 2.17,-2.506 4.319,-2.079 6.792,1.36 13.623,2.531 20.44,3.784 0.778,0.139 1.545,0.408 2.829,0.76 -18.629,39.899 -47.541,68.661 -88.287,86.6 z" /> <path id="text" fill={props.colorText} d="m 289.792,189.791 c -0.634,-0.245 -1.238,-0.528 -1.805,-0.871 -0.751,-0.445 -1.755,-1.207 -2.639,-2.377 -12.075,33.934 -18.435,51.378 -19.066,52.335 -16.407,48.536 -25.173,72.812 -26.294,72.812 h -2.023 l -3.373,-0.68 c 2.025,3.15 4.27,4.722 6.744,4.722 h 3.369 c 5.641,-14.836 20.669,-56.822 45.087,-125.941 z m -78.793,94.985 c 6.512,21.146 10.851,31.725 13.015,31.725 h 4.071 l 1.624,-0.816 c 18.976,-54.576 29.011,-82.504 30.095,-83.765 8.189,-24.223 15.48,-45.414 21.875,-63.588 -1.439,0.752 -3.046,1.39 -4.849,1.925 -1.999,0.603 -3.789,1.021 -5.396,1.267 -6.56,18.718 -14.505,41.288 -23.833,67.708 h -1.624 l -26.843,-74.831 c -18.432,-47.713 -27.65,-75.912 -27.65,-84.587 l 0.814,-4.062 c 2.345,-9.76 9.12,-14.637 20.33,-14.637 h 14.644 c 1.084,0 1.625,-0.543 1.625,-1.63 v -4.071 c 0,-3.252 -1.625,-5.96 -4.884,-8.131 H 223.2 l 0.814,4.071 v 4.061 l -4.065,0.816 H 206.935 C 193.379,57.588 186.6,63.554 186.6,74.126 v 4.879 c 0,6.234 19.521,61.538 58.562,165.926 l -0.809,3.252 h -0.815 l -30.91,-87.027 C 193.107,111.72 183.342,82.441 183.342,73.313 c 0,-13.557 6.783,-20.336 20.341,-20.336 h 15.451 c 1.086,0 1.628,-0.544 1.628,-1.622 v -6.511 c -0.813,0 -1.897,-0.542 -3.252,-1.629 H 93.881 v 6.511 l 1.625,2.438 c 13.466,0 23.229,3.527 29.278,10.576 v 0.816 l -9.759,-6.51 C 104.629,56.502 98.946,55.691 97.952,54.607 v 0.81 c 2.346,3.796 5.603,5.701 9.761,5.701 12.915,0 21.865,5.69 26.833,17.075 49.889,135.912 75.373,204.776 76.453,206.583 z m -1.629,-16.263 v -1.627 c 16.007,-16.719 24.406,-25.119 25.22,-25.212 h 0.809 v 0.816 c -16.625,17.344 -25.299,26.023 -26.029,26.023 z m 2.445,4.876 h -0.816 v -0.801 c 16.542,-17.176 25.213,-25.849 26.03,-26.027 v 1.62 c -16.178,16.806 -24.58,25.208 -25.214,25.208 z m 10.572,30.912 v -2.44 c 2.99,-3.787 4.886,-5.697 5.698,-5.697 0,2.615 -1.905,5.341 -5.698,8.137 z m -0.808,-5.696 -1.63,-0.815 11.389,-12.198 h 0.808 c -0.363,1.811 -3.886,6.152 -10.567,13.013 z m -1.63,-4.879 c -0.903,0 -1.447,-0.544 -1.623,-1.622 10.656,-11.393 16.353,-17.084 17.072,-17.084 v 0.816 c 0,1.627 -5.147,7.59 -15.449,17.89 z m -3.25,-4.874 v -1.627 l 21.954,-22.781 h 0.82 c 0,2.263 -7.596,10.397 -22.774,24.408 z m -1.626,-4.887 v -1.621 c 17.344,-17.993 26.562,-27.203 27.651,-27.655 0,2.344 -9.215,12.111 -27.651,29.276 z m -0.815,-5.687 -1.629,-0.815 25.216,-26.028 1.627,0.816 -25.214,26.027 z m 19.517,-40.674 c -16.628,17.351 -25.304,26.023 -26.024,26.023 v -1.622 l 24.395,-25.207 1.629,0.806 z m -2.437,-4.064 c -16.181,16.807 -24.588,25.219 -25.216,25.219 0,-0.551 -0.268,-1.36 -0.81,-2.443 l 26.026,-25.214 v 2.438 z m -3.253,-10.571 c -16.628,17.351 -25.308,26.023 -26.027,26.023 v -2.432 l 24.396,-25.219 c 1.088,0.001 1.631,0.54 1.631,1.628 z m -5.698,-16.268 v 0.81 c -16.178,16.812 -24.58,25.224 -25.213,25.224 h -0.812 v -0.814 c 16,-16.72 24.402,-25.132 25.218,-25.219 h 0.807 z m -1.624,-4.07 c -16.625,17.356 -25.302,26.029 -26.027,26.029 v -2.438 l 24.399,-25.212 c 1.086,0.001 1.628,0.538 1.628,1.621 z M 187.415,111.54 c -16.628,17.352 -25.301,26.025 -26.027,26.025 0,-0.541 -0.274,-1.351 -0.815,-2.439 16.809,-16.179 25.216,-24.586 25.216,-25.212 1.084,-0.001 1.626,0.536 1.626,1.626 z M 188.228,48.097 145.12,91.2 h -0.814 v -0.804 c 26.661,-27.294 40.762,-41.395 42.295,-42.299 h 1.627 z m -11.387,17.077 v 1.631 c -19.34,20.062 -29.37,30.094 -30.089,30.094 V 95.272 C 166.086,75.204 176.118,65.174 176.841,65.174 z M 166.269,48.097 h 1.624 C 149.099,67.617 139.338,77.38 138.616,77.38 v -1.629 c 17.353,-17.981 26.57,-27.204 27.653,-27.654 z m 6.508,0 h 2.437 c -21.688,22.414 -33.077,33.799 -34.164,34.155 0,-0.54 -0.266,-1.351 -0.807,-2.439 L 172.777,48.097 z M 142.679,85.513 C 166.904,60.571 179.37,48.097 180.094,48.097 h 1.628 C 156.874,73.668 143.856,86.68 142.679,87.138 v -1.625 z m 18.709,-37.416 c -15.637,16.269 -23.765,24.401 -24.399,24.401 h -0.812 v -1.631 c 14.547,-15.179 22.135,-22.77 22.771,-22.77 h 2.44 z m -22.772,0 h 1.628 c -6.777,7.591 -10.578,11.387 -11.391,11.387 h -0.812 v -0.817 c 6.237,-7.044 9.76,-10.57 10.575,-10.57 z m -20.336,2.442 c -1.08,-0.544 -1.897,-0.815 -2.441,-0.815 0,-0.903 0.544,-1.446 1.63,-1.626 h 2.439 l -1.628,2.441 z m 4.071,2.436 -1.625,-0.813 c 1.983,-2.708 3.336,-4.064 4.059,-4.064 h 1.63 c -0.001,0.272 -1.359,1.896 -4.064,4.877 z m 1.627,2.439 c 4.151,-4.875 6.594,-7.316 7.315,-7.316 h 2.446 c -4.701,5.425 -7.412,8.132 -8.135,8.132 l -1.626,-0.816 z m 6.501,6.508 14.641,-13.825 h 2.441 c -10.122,10.844 -15.541,16.269 -16.269,16.269 0,-0.542 -0.265,-1.357 -0.813,-2.444 z m 3.259,5.695 v -0.812 c 11.744,-12.471 17.979,-18.708 18.705,-18.708 h 1.623 c -12.284,13.017 -18.796,19.52 -19.52,19.52 h -0.808 z m 14.64,32.534 C 165.726,82.17 174.942,72.948 176.032,72.498 v 1.626 c -17.355,17.984 -26.574,27.204 -27.654,27.653 v -1.626 z m 1.628,6.512 v -0.816 c 17.075,-17.713 26.026,-26.66 26.835,-26.843 v 1.631 c -16.628,17.347 -25.304,26.029 -26.026,26.029 h -0.809 z m 1.624,4.877 v -0.817 c 17.08,-17.707 26.026,-26.654 26.842,-26.837 v 1.628 c -16.627,17.349 -25.311,26.026 -26.029,26.026 h -0.813 z m 1.627,3.25 c 16.811,-16.169 25.215,-24.58 25.215,-25.211 1.08,0 1.622,0.539 1.622,1.622 -16.628,17.356 -25.303,26.032 -26.028,26.032 0,-0.545 -0.266,-1.357 -0.809,-2.443 z m 2.437,7.32 v -1.628 c 16.542,-17.166 25.213,-25.845 26.028,-26.025 v 1.625 c -16.626,17.355 -25.304,26.028 -26.028,26.028 z m 1.623,4.876 v -1.623 c 16.542,-17.17 25.222,-25.842 26.025,-26.026 v 2.439 c -16.174,16.811 -24.574,25.209 -25.212,25.209 h -0.813 z m 26.844,-21.959 1.629,0.819 -25.216,26.027 -1.625,-0.814 25.212,-26.032 z m -21.142,35.791 c 16.534,-17.171 25.209,-25.843 26.027,-26.028 v 1.633 c -16.632,17.347 -25.31,26.024 -26.027,26.024 v -1.629 z m 1.621,4.883 c 16.541,-17.173 25.214,-25.844 26.028,-26.029 0,0.539 0.272,1.354 0.816,2.438 -16.725,16 -25.125,24.4 -25.216,25.215 -0.903,0 -1.443,-0.546 -1.628,-1.624 z m 1.629,5.688 25.216,-26.025 1.623,0.816 -25.215,26.023 -1.624,-0.814 z m 2.441,4.071 c 15.993,-16.722 24.397,-25.127 25.208,-25.214 h 0.817 v 1.627 c -16.627,17.35 -25.304,26.026 -26.026,26.026 v -2.439 z m 1.62,6.506 v -0.812 c 16.542,-17.174 25.221,-25.845 26.031,-26.028 v 1.624 c -16.178,16.811 -24.581,25.216 -25.217,25.216 h -0.814 z m 1.631,4.063 c 16.541,-17.164 25.212,-25.842 26.028,-26.028 0,0.539 0.273,1.357 0.812,2.446 -16.718,15.998 -25.124,24.398 -25.216,25.211 -0.902,0 -1.445,-0.541 -1.624,-1.629 z m 2.44,4.883 24.4,-25.211 1.628,0.809 c -16.627,17.351 -25.305,26.023 -26.029,26.023 v -1.621 z m 1.631,6.506 v -1.627 c 15.996,-16.714 24.398,-25.121 25.211,-25.214 h 0.814 v 1.626 c -16.179,16.81 -24.587,25.215 -25.217,25.215 h -0.808 z m 1.624,4.881 v -0.811 c 16.537,-17.171 25.21,-25.847 26.028,-26.028 v 1.627 c -16.179,16.812 -24.583,25.212 -25.212,25.212 h -0.816 z m 1.628,3.248 26.028,-25.21 c 0,0.545 0.273,1.36 0.81,2.439 l -26.028,25.215 c 0,-0.545 -0.266,-1.356 -0.81,-2.444 z m 2.438,5.702 c 15.994,-16.724 24.4,-25.125 25.213,-25.22 h 0.816 v 0.816 c -16.628,17.353 -25.306,26.025 -26.029,26.025 v -1.621 z m 1.621,6.508 v -1.633 c 16.007,-16.715 24.409,-25.122 25.221,-25.212 h 0.806 v 1.621 c -16.175,16.816 -24.577,25.224 -25.209,25.224 h -0.818 z m 27.656,-21.966 v 1.627 l -24.398,25.213 -1.627,-0.811 c 16.544,-17.171 25.213,-25.849 26.025,-26.029 z m -24.398,30.094 c 16.81,-16.17 25.215,-24.577 25.215,-25.21 1.085,0 1.627,0.539 1.627,1.625 -16.625,17.352 -25.309,26.029 -26.027,26.029 -0.001,-0.546 -0.274,-1.355 -0.815,-2.444 z m 2.445,5.696 c 15.995,-16.72 24.396,-25.125 25.212,-25.211 h 0.814 v 0.809 c -16.633,17.352 -25.312,26.03 -26.027,26.03 v -1.628 z m 1.622,4.88 c 16.535,-17.17 25.213,-25.848 26.03,-26.027 v 2.437 l -24.399,25.218 c -0.909,-0.001 -1.443,-0.545 -1.631,-1.628 z m 27.658,-20.337 v 1.633 l -24.408,25.212 -1.619,-0.815 c 16.537,-17.172 25.212,-25.85 26.027,-26.03 z m 5.688,14.647 v 2.438 l -24.398,25.211 c -0.906,0 -1.449,-0.549 -1.627,-1.621 16.54,-17.176 25.211,-25.855 26.025,-26.028 z m -23.584,30.903 24.4,-25.213 1.624,0.815 c -16.623,17.347 -25.306,26.025 -26.024,26.025 v -1.627 z m 3.254,11.393 v -0.816 c 16.537,-17.171 25.214,-25.844 26.025,-26.028 v 1.622 c -16.178,16.805 -24.58,25.223 -25.212,25.223 h -0.813 z M 622.179,183.73 c 0.005,-0.475 0.054,-0.834 0.142,-1.089 0.087,-0.246 0.218,-0.421 0.407,-0.509 0.196,-0.088 0.436,-0.117 0.735,-0.088 0.293,0.033 0.511,0.531 0.663,1.498 0.62,-0.122 1.153,-0.299 1.605,-0.521 0.457,-0.229 0.887,-0.445 1.284,-0.66 0.402,-0.21 0.887,-0.434 1.431,-0.67 0.544,-0.234 1.05,-0.492 1.528,-0.781 0.468,-0.284 0.827,-0.564 1.066,-0.841 0.229,-0.277 0.414,-0.554 0.528,-0.843 0.124,-0.283 0.315,-0.455 0.604,-0.525 0.331,0.005 0.576,0.076 0.723,0.204 0.158,0.127 0.25,0.427 0.295,0.9 -0.018,0.213 -0.072,0.414 -0.164,0.615 -0.087,0.196 -0.271,0.435 -0.571,0.712 -0.306,0.278 -0.62,0.502 -0.958,0.673 -0.337,0.175 -0.708,0.389 -1.115,0.64 -0.413,0.25 -0.827,0.587 -1.234,1.006 -0.409,0.421 -0.702,0.835 -0.882,1.226 -0.179,0.392 -0.364,0.757 -0.561,1.078 -0.196,0.319 -0.489,0.582 -0.876,0.783 -0.397,0.201 -0.996,0.331 -1.818,0.386 -0.549,-0.022 -0.979,-0.088 -1.283,-0.212 -0.31,-0.131 -0.642,-0.501 -0.974,-1.121 -0.337,-0.62 -0.525,-1.24 -0.575,-1.861 z m 3.091,1.54 c 0.423,-0.065 0.805,-0.212 1.158,-0.439 0.342,-0.224 0.707,-0.561 1.061,-1.008 0.364,-0.447 0.522,-0.752 0.484,-0.908 -0.876,0.629 -1.561,1.051 -2.062,1.257 -0.495,0.212 -0.996,0.396 -1.503,0.555 0.148,0.429 0.437,0.608 0.862,0.543 z m -17.206,-1.497 c 0.294,-0.135 0.745,-0.464 1.351,-0.985 0.608,-0.528 1.322,-0.995 2.144,-1.415 0.811,-0.424 1.457,-0.739 1.92,-0.952 0.469,-0.218 0.975,-0.34 1.519,-0.369 0.489,0.179 0.783,0.466 0.881,0.875 0.093,0.407 0.055,0.844 -0.12,1.306 -0.169,0.469 -0.788,1.252 -1.844,2.362 1.682,-0.997 2.846,-1.677 3.487,-2.052 0.638,-0.376 1.153,-0.609 1.551,-0.691 0.392,-0.092 0.729,0.027 1.012,0.359 0.277,0.332 0.277,0.816 0,1.448 -0.283,0.642 -0.375,1.116 -0.283,1.427 0.104,0.31 0.806,0.276 2.133,-0.094 1.317,-0.37 2.312,-0.706 2.977,-1.018 -0.044,0.577 -0.196,0.985 -0.457,1.229 -0.255,0.245 -1.055,0.582 -2.405,1.018 -1.36,0.441 -2.366,0.561 -3.024,0.381 -0.67,-0.186 -1.094,-0.474 -1.273,-0.864 -0.18,-0.392 -0.191,-0.812 -0.06,-1.258 0.136,-0.439 -0.262,-0.336 -1.165,0.31 -0.908,0.654 -1.708,1.165 -2.388,1.53 -0.669,0.369 -1.182,0.631 -1.518,0.777 -0.457,0 -0.816,-0.075 -1.078,-0.233 -0.261,-0.152 -0.402,-0.431 -0.43,-0.827 -0.037,-0.402 0.164,-0.768 0.588,-1.11 0.413,-0.343 0.827,-0.69 1.213,-1.066 0.387,-0.364 0.637,-0.741 0.725,-1.127 0.081,-0.384 -0.137,-0.506 -0.675,-0.364 -0.544,0.141 -1.284,0.533 -2.215,1.186 -0.941,0.654 -1.567,1.058 -1.865,1.221 -0.306,0.156 -0.72,0.261 -1.247,0.311 0.068,-0.742 0.249,-1.178 0.546,-1.315 z m -8.874,0.735 c 0.235,0.354 0.529,0.539 0.871,0.55 0.349,0.017 0.676,-0.081 0.996,-0.282 0.305,-0.208 0.669,-0.403 1.094,-0.594 0.414,-0.18 0.826,-0.413 1.235,-0.686 0.393,-0.271 0.586,-0.619 0.586,-1.029 0,-0.414 -0.151,-0.734 -0.461,-0.963 -0.305,-0.229 -0.441,-0.522 -0.397,-0.877 0.065,-0.353 0.229,-0.598 0.5,-0.729 0.272,-0.133 0.729,-0.212 1.361,-0.22 0.658,0.127 1.071,0.459 1.213,0.996 0.152,0.53 0.141,1.025 -0.022,1.482 -0.18,0.461 0.038,0.871 0.626,1.244 0.593,0.368 1.115,0.488 1.583,0.363 0.457,-0.127 0.729,0.016 0.79,0.435 -0.083,0.44 -0.201,0.707 -0.365,0.794 -0.174,0.094 -0.517,0.174 -1.033,0.245 -0.517,0.076 -1.144,-0.081 -1.861,-0.479 -0.729,-0.387 -1.234,-0.468 -1.556,-0.234 -0.306,0.239 -0.773,0.544 -1.398,0.925 -0.61,0.377 -1.225,0.675 -1.816,0.897 -0.6,0.218 -1.284,0.333 -2.052,0.333 -0.713,-0.24 -1.214,-0.605 -1.514,-1.095 -0.293,-0.499 -0.445,-1.043 -0.445,-1.632 0.082,-0.414 0.38,-0.871 0.924,-1.361 0.539,-0.494 1.062,-0.908 1.552,-1.246 0.489,-0.326 1.001,-0.571 1.507,-0.729 0.512,-0.155 0.876,-0.13 1.088,0.065 0.206,0.202 0.36,0.446 0.419,0.735 0.065,0.288 0.038,0.517 -0.081,0.695 -0.132,0.175 -0.315,0.295 -0.561,0.354 -0.245,0.057 -0.581,0.135 -1.012,0.234 -0.419,0.098 -0.888,0.331 -1.388,0.707 -0.49,0.383 -0.61,0.743 -0.383,1.102 z m -11.332,-2 c 0.55,-0.711 1.169,-1.228 1.876,-1.543 0.708,-0.315 1.274,-0.642 1.698,-0.991 0.436,-0.348 0.85,-0.464 1.234,-0.353 0.393,0.109 0.578,0.359 0.572,0.74 0,0.386 -0.229,0.709 -0.658,0.979 -0.435,0.262 -0.762,0.551 -0.979,0.852 -0.212,0.302 -0.387,0.637 -0.517,1.008 -0.142,0.367 -0.142,0.732 -0.012,1.107 0.132,0.37 0.359,0.609 0.718,0.725 0.36,0.109 0.909,0.162 1.666,0.151 0.745,-0.01 1.41,-0.087 1.98,-0.233 0.564,-0.146 1.066,-0.354 1.49,-0.609 0.435,-0.262 0.789,-0.35 1.094,-0.271 l 0.131,0.526 c -0.196,0.311 -0.474,0.571 -0.832,0.784 -0.365,0.218 -0.72,0.397 -1.077,0.544 -0.354,0.146 -0.865,0.299 -1.513,0.447 -0.665,0.146 -1.404,0.271 -2.252,0.374 l -0.926,0.044 c -0.762,-0.088 -1.306,-0.234 -1.648,-0.431 -0.338,-0.201 -0.609,-0.467 -0.827,-0.811 -0.212,-0.343 -0.326,-0.68 -0.337,-1.022 -0.028,-0.337 0.026,-0.669 0.113,-1.008 0.099,-0.338 -0.005,-0.326 -0.304,0.026 -0.3,0.355 -0.713,0.683 -1.235,0.981 -0.522,0.306 -0.963,0.544 -1.322,0.734 -0.359,0.175 -0.61,-0.103 -0.74,-0.854 1.188,-0.549 2.063,-1.187 2.607,-1.896 z m 10.757,-8.714 -0.393,-0.111 c -0.402,-0.458 -0.713,-0.79 -0.914,-0.998 0.19,-0.412 0.561,-0.782 1.104,-1.107 l 0.425,-0.024 c 0.353,0.167 0.539,0.379 0.555,0.645 0.011,0.266 0.207,0.514 0.55,0.753 l -0.153,0.378 c -0.357,0.224 -0.745,0.376 -1.174,0.464 z m -20.392,10.377 c 0.142,-0.397 0.354,-0.817 0.604,-1.257 0.272,-0.447 0.86,-1.09 1.79,-1.933 0.925,-0.844 1.616,-1.594 2.058,-2.259 -0.681,0.087 -1.133,0.134 -1.36,0.145 -0.229,0.008 -0.364,-0.128 -0.408,-0.41 -0.043,-0.284 0.021,-0.485 0.2,-0.621 0.175,-0.133 0.522,-0.233 1.041,-0.296 0.516,-0.065 1.049,-0.155 1.615,-0.256 0.984,-0.93 1.796,-1.673 2.427,-2.238 0.625,-0.562 1.294,-1.169 2.013,-1.818 0.724,-0.648 1.393,-1.19 2.04,-1.624 0.647,-0.443 1.202,-0.667 1.671,-0.68 0.287,0.367 0.022,0.91 -0.778,1.63 -0.815,0.715 -1.454,1.31 -1.92,1.782 -0.474,0.47 -0.932,0.928 -1.366,1.363 -0.436,0.435 -0.936,0.957 -1.49,1.562 0.723,-0.087 1.806,-0.212 3.236,-0.375 1.441,-0.161 2.922,-0.316 4.429,-0.455 1.502,-0.142 3.025,-0.264 4.554,-0.368 1.523,-0.103 3.02,-0.168 4.494,-0.201 1.47,-0.021 2.998,-0.021 4.588,0.014 1.582,0.039 2.877,0.106 3.867,0.199 1.001,0.098 1.796,0.408 2.389,0.925 -0.61,0.19 -1.159,0.25 -1.66,0.188 -0.499,-0.073 -1.043,-0.119 -1.621,-0.157 -0.576,-0.035 -1.267,-0.044 -2.072,-0.024 -0.794,0.024 -1.779,0.052 -2.916,0.092 -1.148,0.036 -2.372,0.06 -3.673,0.076 -1.295,0.016 -2.618,0.076 -3.95,0.188 -1.344,0.115 -2.61,0.231 -3.819,0.351 -1.202,0.13 -2.448,0.245 -3.754,0.349 -1.289,0.101 -2.214,0.173 -2.77,0.211 -0.539,0.036 -0.995,0.077 -1.349,0.12 -0.359,0.043 -0.647,0.122 -0.871,0.229 -0.233,0.114 -0.479,0.278 -0.729,0.503 -0.261,0.223 -0.582,0.528 -0.968,0.92 -0.387,0.389 -0.844,0.902 -1.367,1.531 -0.521,0.62 -0.983,1.161 -1.397,1.616 -0.402,0.446 -0.69,0.871 -0.87,1.258 -0.186,0.392 -0.196,0.745 -0.064,1.045 0.135,0.305 0.381,0.484 0.75,0.555 0.376,0.065 1.071,-0.081 2.134,-0.446 1.038,-0.359 1.795,-0.68 2.229,-0.963 0.452,-0.283 0.784,-0.457 1.013,-0.533 0.224,-0.076 0.402,-0.027 0.532,0.147 0.121,0.168 -0.054,0.462 -0.544,0.87 -0.489,0.414 -0.925,0.734 -1.306,0.958 -0.386,0.218 -0.82,0.43 -1.322,0.619 -0.494,0.186 -1.05,0.332 -1.67,0.42 -0.402,0.059 -0.773,0.087 -1.133,0.087 -0.222,0 -0.439,-0.005 -0.641,-0.016 -0.561,-0.06 -1.001,-0.191 -1.316,-0.393 -0.321,-0.196 -0.523,-0.462 -0.632,-0.784 -0.12,-0.298 -0.179,-0.56 -0.179,-0.799 0,-0.017 0.005,-0.038 0.021,-0.07 -0.003,-0.249 0.068,-0.575 0.22,-0.977 z m -1.807,-4.044 c 0.066,0.142 0.049,0.293 -0.043,0.445 -0.104,0.155 -0.233,0.311 -0.419,0.462 -0.191,0.158 -0.293,0.349 -0.326,0.577 -0.027,0.234 -0.175,0.364 -0.414,0.399 -0.261,0.036 -0.533,0.004 -0.821,-0.094 -0.299,-0.109 -0.55,-0.143 -0.772,-0.115 -0.212,0.027 -0.462,0.201 -0.735,0.52 -0.282,0.319 -0.527,0.621 -0.739,0.911 -0.223,0.283 -0.376,0.573 -0.468,0.861 -0.098,0.288 -0.071,0.555 0.064,0.79 0.142,0.232 0.343,0.385 0.594,0.462 0.267,0.07 0.647,0.087 1.148,0.032 0.5,-0.05 1.006,-0.152 1.523,-0.311 0.521,-0.152 1.027,-0.315 1.517,-0.495 0.502,-0.179 0.86,-0.332 1.078,-0.457 0.218,-0.126 0.43,-0.017 0.62,0.321 -0.055,0.326 -0.19,0.549 -0.407,0.669 -0.224,0.114 -0.512,0.262 -0.894,0.44 -0.374,0.18 -0.771,0.333 -1.197,0.468 -0.412,0.126 -0.887,0.261 -1.397,0.387 -0.522,0.12 -1.088,0.218 -1.682,0.278 h -0.468 c -0.282,-0.033 -0.555,-0.071 -0.826,-0.126 -0.262,-0.055 -0.527,-0.179 -0.794,-0.386 -0.262,-0.207 -0.491,-0.528 -0.681,-0.952 l -0.049,-0.426 c 0.026,-0.407 0.146,-0.837 0.369,-1.278 0.229,-0.447 0.512,-0.874 0.865,-1.291 0.354,-0.412 0.757,-0.764 1.203,-1.062 0.445,-0.291 0.837,-0.508 1.18,-0.65 0.343,-0.142 0.576,-0.267 0.691,-0.381 0.109,-0.109 0.315,-0.218 0.614,-0.332 0.306,-0.11 0.583,-0.165 0.833,-0.165 0.213,0.017 0.381,0.063 0.521,0.153 0.138,0.095 0.242,0.205 0.312,0.346 z m -21.877,3.449 c 1.115,-1.053 1.964,-1.866 2.568,-2.448 0.609,-0.587 1.061,-0.99 1.37,-1.208 0.301,-0.226 0.567,-0.364 0.807,-0.424 0.261,0.046 0.457,0.098 0.577,0.158 0.113,0.06 0.26,0.195 0.424,0.42 0.174,0.221 0.137,0.58 -0.109,1.083 -0.239,0.504 -0.631,0.924 -1.159,1.266 -0.533,0.336 -0.983,0.637 -1.365,0.896 -0.38,0.26 -0.707,0.514 -1.007,0.764 -0.293,0.256 -0.43,0.483 -0.402,0.696 0.033,0.218 0.213,0.326 0.539,0.326 0.343,0 0.772,-0.098 1.299,-0.293 0.529,-0.191 1.214,-0.507 2.03,-0.941 0.815,-0.438 1.567,-0.796 2.236,-1.084 0.675,-0.288 1.214,-0.539 1.605,-0.753 0.397,-0.217 0.701,-0.494 0.893,-0.831 0.19,-0.337 0.413,-0.568 0.663,-0.686 0.255,-0.117 0.446,-0.06 0.604,0.178 0.158,0.234 0.195,0.607 0.12,1.118 -0.081,0.509 -0.277,0.897 -0.565,1.164 -0.283,0.267 -0.572,0.534 -0.866,0.796 -0.298,0.268 -0.462,0.496 -0.517,0.686 -0.043,0.196 0.012,0.426 0.147,0.697 0.142,0.277 0.724,0.31 1.725,0.103 1.012,-0.206 1.753,-0.419 2.21,-0.631 0.461,-0.218 1.061,-0.392 1.815,-0.544 l 0.377,0.44 c -0.131,0.326 -0.519,0.648 -1.154,0.969 -0.631,0.315 -1.495,0.609 -2.601,0.877 -1.104,0.265 -2.045,0.396 -2.824,0.396 -0.794,0 -1.364,-0.093 -1.682,-0.277 -0.33,-0.185 -0.521,-0.44 -0.576,-0.777 -0.043,-0.332 0.233,-0.921 0.839,-1.758 -0.958,0.527 -1.796,0.952 -2.487,1.263 -0.708,0.31 -1.408,0.61 -2.094,0.897 -0.702,0.288 -1.432,0.463 -2.199,0.539 -0.206,0.021 -0.407,0.027 -0.604,0.027 -0.494,0 -0.909,-0.071 -1.234,-0.208 -0.452,-0.185 -0.691,-0.505 -0.713,-0.946 -0.017,0 -0.022,-0.011 -0.022,-0.026 -10e-4,-0.426 0.445,-1.067 1.332,-1.924 z m -2.535,-4.189 c 0.408,-0.604 0.762,-1.066 1.066,-1.382 0.299,-0.321 0.707,-0.735 1.196,-1.251 0.512,-0.517 1.035,-1.037 1.579,-1.553 0.544,-0.516 1.061,-0.909 1.539,-1.173 0.484,-0.266 0.838,-0.415 1.077,-0.446 0.343,0.072 0.566,0.167 0.675,0.28 0.103,0.11 0.207,0.313 0.282,0.608 -0.156,0.488 -0.457,1.002 -0.925,1.538 -0.461,0.542 -0.963,1.088 -1.496,1.643 -0.526,0.55 -0.974,0.955 -1.344,1.203 -0.375,0.252 -0.75,0.462 -1.12,0.63 -0.381,0.171 -0.789,0.496 -1.236,0.977 -0.435,0.483 -0.918,0.998 -1.42,1.55 -0.5,0.555 -0.848,1.016 -1.06,1.389 -0.207,0.368 -0.431,0.684 -0.681,0.95 -0.234,0.267 -0.358,0.5 -0.358,0.696 0,0.207 0.129,0.332 0.385,0.392 0.262,0.061 0.544,-0.043 0.866,-0.298 0.321,-0.263 0.768,-0.442 1.35,-0.546 0.587,-0.103 1.028,-0.249 1.327,-0.445 0.305,-0.19 0.489,-0.163 0.555,0.087 0.07,0.234 0.114,0.436 0.141,0.587 0.038,0.158 -0.168,0.354 -0.625,0.588 -0.457,0.24 -0.87,0.407 -1.251,0.507 -0.387,0.092 -0.729,0.201 -1.033,0.315 -0.301,0.119 -0.724,0.238 -1.279,0.369 -0.544,0.12 -1.022,0.142 -1.447,0.061 -0.413,-0.082 -0.675,-0.262 -0.74,-0.55 -0.076,-0.287 -0.146,-0.669 -0.218,-1.143 -0.331,0.25 -0.696,0.505 -1.099,0.768 -0.414,0.256 -0.794,0.483 -1.153,0.674 -0.359,0.191 -0.74,0.402 -1.131,0.631 -0.393,0.224 -0.703,0.408 -0.941,0.545 -0.24,0.13 -0.715,0.213 -1.442,0.239 -0.507,-0.06 -0.897,-0.272 -1.147,-0.636 -0.163,-0.268 -0.251,-0.55 -0.251,-0.845 0.109,-0.521 0.331,-0.979 0.648,-1.376 0.331,-0.397 0.679,-0.826 1.065,-1.295 0.381,-0.469 0.778,-0.888 1.182,-1.264 0.402,-0.377 0.81,-0.743 1.207,-1.1 0.396,-0.353 0.844,-0.663 1.338,-0.93 0.501,-0.26 0.986,-0.457 1.464,-0.577 0.479,-0.12 0.876,-0.154 1.176,-0.12 0.298,0.039 0.57,0.163 0.788,0.389 0.229,0.221 0.343,0.452 0.37,0.689 0.021,0.234 0.055,0.484 0.104,0.75 0.054,0.268 0.205,0.279 0.466,0.033 0.256,-0.244 0.479,-0.512 0.665,-0.805 0.184,-0.291 0.484,-0.743 0.886,-1.353 z m -8.907,6.633 c 0.137,0.143 0.55,0.045 1.225,-0.293 0.681,-0.348 1.334,-0.712 1.959,-1.109 0.614,-0.397 1.066,-0.8 1.35,-1.196 0.282,-0.399 0.457,-0.808 0.528,-1.229 0.081,-0.421 0.037,-0.703 -0.121,-0.852 -0.151,-0.146 -0.402,-0.141 -0.745,0.033 -0.343,0.164 -0.761,0.474 -1.257,0.902 -0.506,0.436 -0.969,0.877 -1.393,1.322 -0.413,0.443 -0.815,0.927 -1.186,1.438 -0.382,0.518 -0.501,0.844 -0.36,0.984 z m -10.674,-1.512 c 0.233,0.354 0.527,0.539 0.87,0.55 0.343,0.017 0.675,-0.081 0.985,-0.282 0.304,-0.208 0.68,-0.403 1.099,-0.594 0.418,-0.18 0.827,-0.413 1.229,-0.686 0.402,-0.271 0.599,-0.619 0.599,-1.029 0,-0.414 -0.151,-0.734 -0.468,-0.963 -0.311,-0.229 -0.44,-0.522 -0.382,-0.877 0.045,-0.353 0.213,-0.598 0.479,-0.729 0.278,-0.133 0.734,-0.212 1.36,-0.22 0.675,0.127 1.071,0.459 1.224,0.996 0.147,0.53 0.142,1.025 -0.026,1.482 -0.175,0.461 0.032,0.871 0.631,1.244 0.588,0.368 1.115,0.488 1.577,0.363 0.463,-0.127 0.729,0.016 0.784,0.435 -0.071,0.44 -0.19,0.707 -0.365,0.794 -0.163,0.094 -0.506,0.174 -1.027,0.245 -0.517,0.076 -1.138,-0.081 -1.861,-0.479 -0.718,-0.387 -1.24,-0.468 -1.556,-0.234 -0.3,0.239 -0.768,0.544 -1.393,0.925 -0.62,0.377 -1.225,0.675 -1.828,0.897 -0.594,0.218 -1.279,0.333 -2.051,0.333 -0.702,-0.24 -1.203,-0.605 -1.502,-1.095 -0.294,-0.499 -0.447,-1.043 -0.447,-1.632 0.076,-0.414 0.387,-0.871 0.926,-1.361 0.539,-0.494 1.055,-0.908 1.544,-1.246 0.497,-0.326 1.002,-0.571 1.519,-0.729 0.506,-0.155 0.86,-0.13 1.071,0.065 0.219,0.202 0.36,0.446 0.436,0.735 0.055,0.288 0.027,0.517 -0.103,0.695 -0.114,0.175 -0.305,0.295 -0.544,0.354 -0.245,0.057 -0.582,0.135 -1.007,0.234 -0.436,0.098 -0.897,0.331 -1.387,0.707 -0.505,0.383 -0.625,0.743 -0.386,1.102 z m -11.969,-0.113 c 0.973,-0.539 1.984,-1.375 3.024,-2.493 1.051,-1.116 1.85,-1.779 2.426,-1.992 0.576,-0.215 1.208,-0.321 1.905,-0.321 0.266,0.013 0.494,0.071 0.685,0.177 0.196,0.101 0.316,0.278 0.359,0.517 0.038,0.248 0.033,0.52 -0.026,0.813 -0.055,0.293 -0.229,0.652 -0.528,1.071 -0.294,0.425 -0.648,0.776 -1.057,1.066 -0.396,0.283 -0.684,0.546 -0.843,0.785 -0.152,0.234 -0.167,0.469 -0.026,0.696 0.131,0.229 0.646,0.256 1.539,0.065 0.898,-0.186 1.556,-0.348 1.986,-0.506 0.43,-0.158 0.881,-0.349 1.371,-0.565 l 0.267,0.995 c -1.082,0.5 -2.04,0.931 -2.879,1.284 -0.848,0.358 -1.729,0.588 -2.66,0.712 -0.626,0 -1.094,-0.027 -1.426,-0.075 -0.32,-0.055 -0.62,-0.191 -0.892,-0.414 -0.272,-0.223 -0.435,-0.494 -0.506,-0.815 -0.076,-0.327 -0.028,-0.643 0.163,-0.958 0.18,-0.311 0.44,-0.604 0.795,-0.883 0.357,-0.283 0.728,-0.51 1.136,-0.681 0.397,-0.168 0.74,-0.407 1.029,-0.718 0.283,-0.305 0.354,-0.55 0.207,-0.707 -0.148,-0.163 -0.366,-0.213 -0.648,-0.146 -0.277,0.07 -0.941,0.625 -1.991,1.675 -1.05,1.052 -2.095,1.798 -3.145,2.238 l -0.265,-0.82 z m -14.272,-5.263 c 0.779,-0.743 1.442,-1.355 2.014,-1.828 0.571,-0.471 1.219,-0.969 1.959,-1.483 0.734,-0.514 1.609,-1.106 2.595,-1.773 1.001,-0.663 1.779,-1.12 2.334,-1.37 0.55,-0.255 1.066,-0.636 1.534,-1.143 0.479,-0.508 0.914,-0.903 1.295,-1.187 0.396,-0.281 0.724,-0.502 0.985,-0.663 0.251,-0.162 0.538,-0.396 0.837,-0.697 0.301,-0.303 0.539,-0.504 0.697,-0.613 0.163,-0.098 0.402,-0.189 0.707,-0.26 0.381,0.07 0.654,0.176 0.806,0.316 0.146,0.143 0.293,0.333 0.446,0.569 0.163,0.234 0.37,0.434 0.653,0.597 0.271,0.164 0.706,0.232 1.315,0.211 0.62,-0.023 1.153,0.034 1.615,0.166 0.451,0.13 0.898,0.319 1.334,0.572 0.424,0.252 0.729,0.557 0.925,0.909 0.163,0.343 0.239,0.689 0.239,1.041 v 0.065 c -0.011,0.39 -0.147,0.857 -0.397,1.412 -0.256,0.55 -0.733,1.255 -1.44,2.101 -0.708,0.849 -1.671,1.861 -2.891,3.025 -1.219,1.167 -2.279,2.166 -3.176,2.992 -0.904,0.827 -1.639,1.418 -2.193,1.765 -0.565,0.343 -1.084,0.49 -1.567,0.44 -0.479,-0.055 -0.864,-0.185 -1.175,-0.397 -0.299,-0.211 -0.506,-0.485 -0.631,-0.801 -0.115,-0.318 -0.164,-0.635 -0.158,-0.952 0.017,-0.318 0.082,-0.608 0.18,-0.876 0.104,-0.268 0.271,-0.489 0.5,-0.674 0.234,-0.186 0.491,-0.284 0.789,-0.3 0.3,-0.014 0.626,0.163 0.969,0.533 0.359,0.37 0.724,0.555 1.105,0.555 0.374,0 0.863,-0.215 1.457,-0.642 0.604,-0.43 1.273,-1.028 2.029,-1.798 0.751,-0.77 1.464,-1.537 2.127,-2.315 0.67,-0.772 1.12,-1.39 1.371,-1.85 0.263,-0.459 0.469,-0.961 0.643,-1.514 0.185,-0.558 0.185,-0.937 0,-1.147 -0.174,-0.204 -0.512,-0.337 -1.012,-0.396 -0.513,-0.061 -0.865,-0.118 -1.072,-0.188 -0.201,-0.068 -0.43,-0.037 -0.68,0.086 -0.261,0.128 -0.544,0.272 -0.876,0.433 -0.338,0.164 -0.724,0.532 -1.159,1.1 -0.452,0.566 -0.902,1.091 -1.376,1.582 -0.474,0.485 -0.941,0.969 -1.415,1.442 -0.458,0.471 -0.925,0.958 -1.388,1.461 -0.468,0.502 -0.936,1 -1.409,1.494 -0.479,0.495 -1.056,1.071 -1.752,1.727 -0.691,0.655 -1.376,1.26 -2.04,1.795 -0.657,0.541 -1.365,1.125 -2.122,1.751 -0.762,0.631 -1.61,1.257 -2.585,1.882 -0.962,0.632 -1.875,1.213 -2.72,1.752 -0.849,0.538 -1.616,0.985 -2.297,1.339 -0.68,0.358 -1.299,0.561 -1.859,0.62 -0.534,-0.044 -0.865,-0.152 -1.007,-0.316 -0.147,-0.173 -0.218,-0.489 -0.239,-0.946 0,-0.386 0.055,-0.745 0.158,-1.071 0.103,-0.331 0.223,-0.658 0.353,-0.975 0.142,-0.319 0.502,-0.871 1.105,-1.658 0.598,-0.795 1.137,-1.465 1.626,-2.021 0.479,-0.558 1.072,-1.153 1.758,-1.796 0.69,-0.642 1.414,-1.339 2.176,-2.083 z m -1.398,3.669 c -1.234,1.359 -2.041,2.24 -2.417,2.648 -0.374,0.403 -0.805,0.871 -1.294,1.393 -0.484,0.523 -0.681,0.904 -0.594,1.137 0.099,0.241 0.35,0.312 0.763,0.213 0.396,-0.092 0.962,-0.414 1.692,-0.963 0.739,-0.544 1.648,-1.181 2.736,-1.915 1.083,-0.729 2.23,-1.557 3.416,-2.471 1.204,-0.915 2.379,-1.932 3.526,-3.047 1.154,-1.116 1.926,-1.911 2.328,-2.389 0.397,-0.484 0.877,-1.05 1.453,-1.708 0.566,-0.659 1.033,-1.156 1.388,-1.509 0.363,-0.343 0.526,-0.606 0.472,-0.772 -0.037,-0.166 -0.238,-0.148 -0.586,0.068 -0.359,0.216 -0.773,0.477 -1.252,0.795 -0.468,0.318 -1.077,0.852 -1.827,1.608 -0.763,0.756 -1.465,1.488 -2.128,2.204 -0.669,0.717 -1.464,1.523 -2.384,2.425 -0.924,0.902 -1.778,1.638 -2.535,2.215 -0.767,0.573 -1.24,1.002 -1.409,1.274 -0.168,0.271 -0.331,0.354 -0.483,0.245 -0.153,-0.108 -0.245,-0.321 -0.268,-0.614 -0.027,-0.293 0.278,-0.645 0.909,-1.037 0.626,-0.404 1.502,-1.113 2.616,-2.14 1.133,-1.026 1.698,-1.676 1.709,-1.948 0.022,-0.274 -0.142,-0.356 -0.484,-0.242 -0.338,0.108 -0.681,0.257 -1.007,0.451 -0.331,0.194 -0.832,0.577 -1.49,1.163 -0.673,0.587 -1.62,1.558 -2.85,2.916 z m -24.309,-0.043 c 0.196,-0.413 0.501,-0.84 0.936,-1.287 0.441,-0.446 0.871,-0.827 1.307,-1.154 0.439,-0.32 0.882,-0.549 1.338,-0.663 l 0.512,-0.023 c 0.462,0.017 0.858,0.137 1.196,0.376 0.343,0.237 0.484,0.65 0.436,1.25 -0.055,0.6 -0.353,1.117 -0.892,1.552 -0.539,0.435 -1.148,0.751 -1.823,0.942 -0.68,0.195 -1.044,0.364 -1.099,0.522 -0.055,0.158 0.055,0.32 0.332,0.506 0.272,0.19 0.882,0.306 1.845,0.36 0.946,0.053 1.724,0 2.327,-0.159 0.61,-0.158 1.1,-0.326 1.469,-0.501 0.382,-0.174 0.681,-0.293 0.893,-0.354 0.213,-0.059 0.392,0.055 0.522,0.332 -0.381,0.55 -0.805,0.952 -1.261,1.208 -0.459,0.261 -1.034,0.495 -1.721,0.703 -0.681,0.2 -1.522,0.33 -2.508,0.374 h -0.608 c -1.072,-0.103 -1.796,-0.251 -2.177,-0.435 -0.371,-0.181 -0.664,-0.402 -0.877,-0.653 -0.206,-0.251 -0.358,-0.625 -0.44,-1.132 -0.001,-0.765 0.096,-1.353 0.293,-1.764 z m 1.653,0.306 c 0.903,-0.296 1.508,-0.576 1.808,-0.844 0.304,-0.266 0.435,-0.508 0.385,-0.732 -0.037,-0.219 -0.293,-0.208 -0.75,0.025 -0.457,0.237 -0.767,0.475 -0.937,0.719 -0.173,0.247 -0.337,0.526 -0.506,0.832 z m -17.508,0.753 c 0.707,-0.306 1.497,-0.826 2.367,-1.558 0.859,-0.723 1.97,-1.475 3.323,-2.236 1.355,-0.762 2.362,-1.496 3.031,-2.188 0.681,-0.69 1.104,-1.087 1.284,-1.186 0.19,-0.093 0.343,-0.142 0.463,-0.142 0.113,0 0.25,0.049 0.419,0.142 0.162,0.098 0.196,0.375 0.108,0.824 -0.104,0.448 -0.501,1.066 -1.202,1.853 -0.686,0.795 -1.354,1.425 -1.998,1.901 -0.641,0.471 -1.512,1.295 -2.6,2.48 1.485,-0.648 2.693,-1.193 3.607,-1.629 0.914,-0.435 1.735,-0.768 2.481,-0.984 0.739,-0.223 1.371,-0.378 1.897,-0.457 0.518,-0.082 0.909,0.016 1.148,0.288 0.245,0.272 0.283,0.696 0.108,1.265 -0.168,0.566 -0.494,1.086 -0.957,1.551 -0.474,0.467 -0.778,0.825 -0.909,1.081 -0.135,0.263 0.109,0.388 0.724,0.376 0.62,-0.012 1.117,-0.093 1.502,-0.25 0.382,-0.159 0.762,-0.387 1.121,-0.703 0.364,-0.32 0.632,-0.26 0.811,0.159 -0.082,0.718 -0.43,1.271 -1.028,1.659 -0.615,0.387 -1.393,0.636 -2.334,0.74 -0.941,0.109 -1.676,0.125 -2.182,0.049 -0.512,-0.071 -0.859,-0.32 -1.061,-0.729 -0.201,-0.419 -0.152,-0.837 0.142,-1.263 0.288,-0.429 0.603,-0.832 0.919,-1.223 0.315,-0.383 0.643,-0.715 1.001,-0.997 0.349,-0.278 0.419,-0.447 0.218,-0.496 -0.201,-0.048 -0.561,0.011 -1.066,0.185 -0.527,0.18 -1.322,0.501 -2.389,0.969 -1.071,0.465 -2.089,0.98 -3.046,1.552 -0.964,0.566 -2.105,1.371 -3.439,2.416 -1.344,1.034 -2.394,1.926 -3.166,2.666 -0.768,0.74 -1.709,1.638 -2.824,2.704 -1.11,1.061 -2.122,1.893 -3.014,2.491 -0.893,0.599 -1.475,1.008 -1.736,1.23 -0.255,0.189 -0.521,0.288 -0.806,0.288 h -0.082 c -0.326,-0.017 -0.526,-0.18 -0.604,-0.489 v -0.087 c 0,-0.3 0.295,-0.665 0.887,-1.109 0.665,-0.484 1.491,-1.192 2.466,-2.101 0.974,-0.921 2.284,-2.067 3.933,-3.444 1.649,-1.383 2.896,-2.448 3.744,-3.205 0.849,-0.756 1.556,-1.408 2.122,-1.958 0.57,-0.556 1.495,-1.452 2.785,-2.689 -1.388,0.631 -2.552,1.279 -3.482,1.948 -0.93,0.659 -1.734,1.231 -2.41,1.704 -0.685,0.474 -1.12,0.401 -1.321,-0.213 -0.015,-0.478 0.337,-0.875 1.045,-1.185 z m -12.236,-1.335 c 0.784,-0.744 1.496,-1.303 2.166,-1.664 0.664,-0.363 1.18,-0.626 1.556,-0.79 0.381,-0.163 0.903,-0.28 1.567,-0.35 0.871,0.03 1.457,0.141 1.763,0.34 0.299,0.201 0.494,0.43 0.598,0.686 0.093,0.26 0.131,0.549 0.109,0.875 -0.022,0.326 0.12,0.451 0.419,0.375 0.311,-0.074 0.463,0.074 0.473,0.436 0.022,0.361 -0.125,0.737 -0.424,1.126 -0.31,0.398 -0.544,0.665 -0.719,0.823 -0.184,0.157 -0.238,0.332 -0.163,0.521 0.076,0.191 0.277,0.332 0.615,0.421 0.327,0.086 0.74,0.069 1.225,-0.062 0.479,-0.13 0.897,-0.315 1.256,-0.554 0.355,-0.24 0.675,-0.371 0.964,-0.388 0.283,-0.021 0.474,0.093 0.561,0.327 -0.005,0.435 -0.164,0.794 -0.474,1.07 -0.321,0.272 -0.767,0.497 -1.349,0.676 -0.577,0.169 -1.04,0.267 -1.393,0.282 -0.36,0.012 -0.572,0.018 -0.644,0.018 -0.837,0 -1.468,-0.119 -1.909,-0.37 -0.484,-0.268 -0.849,-0.615 -1.083,-1.045 -0.609,0.163 -1.147,0.375 -1.632,0.643 -0.474,0.261 -0.941,0.467 -1.397,0.592 -0.452,0.137 -0.947,0.208 -1.497,0.208 -0.37,0 -0.762,-0.181 -1.164,-0.523 -0.402,-0.348 -0.604,-1 -0.604,-1.958 0.01,-0.39 0.407,-0.964 1.18,-1.715 z m 2.122,0.319 c -0.549,0.455 -0.898,0.864 -1.045,1.229 -0.146,0.358 -0.103,0.643 0.137,0.832 0.233,0.191 0.608,0.207 1.127,0.044 0.516,-0.162 1.055,-0.392 1.604,-0.669 0.556,-0.293 1.062,-0.6 1.502,-0.916 0.441,-0.314 0.701,-0.614 0.772,-0.887 0.077,-0.271 0.05,-0.555 -0.076,-0.854 -0.124,-0.294 -0.425,-0.422 -0.887,-0.376 -0.462,0.044 -0.974,0.207 -1.507,0.487 -0.539,0.282 -1.083,0.654 -1.627,1.11 z m -13.46,0.294 c 0.435,-0.688 1.452,-1.616 3.051,-2.788 1.602,-1.175 2.711,-2.062 3.33,-2.661 0.615,-0.604 0.653,-1.192 0.109,-1.755 -0.549,-0.562 -0.925,-1.15 -1.138,-1.751 -0.223,-0.605 -0.31,-1.127 -0.282,-1.554 0.039,-0.425 0.196,-0.847 0.489,-1.253 0.3,-0.404 0.675,-0.72 1.138,-0.939 0.463,-0.225 1.115,-0.36 1.959,-0.42 0.843,-0.059 2.546,0.318 5.114,1.14 1.436,-0.822 2.557,-1.41 3.367,-1.774 0.812,-0.359 1.519,-0.818 2.117,-1.372 0.592,-0.554 1.021,-0.877 1.289,-0.978 0.256,-0.102 0.495,-0.153 0.702,-0.153 0.32,0 0.718,0.1 1.186,0.297 0.469,0.19 0.777,0.429 0.953,0.714 0.174,0.278 0.256,0.588 0.256,0.926 0,0.341 -0.104,0.746 -0.289,1.212 -0.195,0.462 -0.544,0.979 -1.056,1.549 -0.505,0.566 -1.143,0.978 -1.905,1.229 -0.761,0.249 -1.512,0.385 -2.268,0.4 -0.751,0.013 -1.959,-0.09 -3.635,-0.313 -1.033,0.667 -1.92,1.299 -2.666,1.901 -0.74,0.604 -1.202,1.088 -1.376,1.45 -0.186,0.368 -0.202,0.634 -0.061,0.803 0.152,0.174 0.393,0.236 0.719,0.199 0.314,-0.036 0.615,-0.118 0.881,-0.253 0.273,-0.13 0.484,-0.152 0.653,-0.054 0.169,0.098 0.256,0.255 0.256,0.479 0,0.22 -0.142,0.486 -0.435,0.808 -0.289,0.318 -0.644,0.541 -1.078,0.672 -0.424,0.132 -0.838,0.182 -1.234,0.152 -0.397,-0.036 -0.729,-0.185 -0.996,-0.455 -0.268,-0.269 -0.436,-0.486 -0.506,-0.644 -0.06,-0.153 -0.251,-0.049 -0.571,0.321 -0.31,0.375 -0.854,0.816 -1.6,1.341 -0.756,0.511 -1.578,1.197 -2.459,2.059 -0.882,0.854 -1.442,1.643 -1.688,2.368 -0.239,0.724 0.022,1.12 0.783,1.181 0.763,0.06 1.915,-0.087 3.444,-0.441 1.534,-0.358 3.053,-0.811 4.549,-1.336 -0.452,0.929 -1.099,1.57 -1.953,1.913 -0.86,0.349 -1.971,0.761 -3.347,1.234 -1.37,0.479 -2.676,0.719 -3.912,0.719 -0.939,-0.021 -1.588,-0.239 -1.958,-0.658 -0.37,-0.408 -0.566,-0.806 -0.588,-1.18 0.003,-0.878 0.22,-1.657 0.656,-2.335 z m 9.313,-8.322 c 0.437,-0.602 1.339,-1.416 2.716,-2.453 -1.552,-0.268 -2.656,-0.44 -3.302,-0.528 -0.638,-0.082 -1.128,0.1 -1.442,0.551 -0.321,0.459 -0.393,0.909 -0.196,1.347 0.191,0.449 0.506,0.887 0.936,1.33 0.419,0.439 0.854,0.357 1.288,-0.247 z m 6.851,-3.085 c 0.892,0.067 1.627,0.056 2.209,-0.031 0.582,-0.091 1.143,-0.29 1.66,-0.607 0.516,-0.312 0.842,-0.642 0.956,-0.986 0.132,-0.343 0.012,-0.577 -0.342,-0.7 -0.349,-0.128 -0.838,0.051 -1.437,0.526 -0.608,0.486 -1.191,0.831 -1.741,1.033 -0.548,0.209 -0.989,0.462 -1.305,0.765 z m -21.19,7.699 c 0.407,-0.604 0.761,-1.066 1.06,-1.382 0.306,-0.321 0.702,-0.735 1.208,-1.251 0.5,-0.517 1.027,-1.037 1.573,-1.553 0.549,-0.517 1.061,-0.909 1.539,-1.173 0.484,-0.266 0.843,-0.415 1.072,-0.446 0.343,0.072 0.565,0.167 0.68,0.28 0.108,0.11 0.207,0.313 0.272,0.608 -0.143,0.488 -0.452,1.002 -0.914,1.538 -0.464,0.542 -0.969,1.088 -1.497,1.643 -0.533,0.55 -0.979,0.955 -1.355,1.203 -0.363,0.252 -0.739,0.462 -1.114,0.63 -0.381,0.171 -0.789,0.496 -1.229,0.977 -0.447,0.483 -0.914,0.998 -1.415,1.55 -0.505,0.555 -0.86,1.016 -1.066,1.389 -0.213,0.368 -0.435,0.684 -0.68,0.95 -0.239,0.267 -0.365,0.5 -0.365,0.696 0,0.207 0.137,0.332 0.393,0.392 0.25,0.061 0.544,-0.043 0.858,-0.298 0.316,-0.263 0.769,-0.442 1.351,-0.546 0.587,-0.103 1.033,-0.249 1.333,-0.445 0.299,-0.19 0.49,-0.163 0.55,0.087 0.07,0.234 0.119,0.436 0.146,0.587 0.033,0.158 -0.18,0.354 -0.631,0.588 -0.447,0.24 -0.866,0.407 -1.247,0.507 -0.386,0.092 -0.733,0.201 -1.033,0.315 -0.299,0.119 -0.729,0.238 -1.268,0.369 -0.549,0.12 -1.039,0.142 -1.458,0.061 -0.425,-0.082 -0.664,-0.262 -0.74,-0.55 -0.071,-0.287 -0.152,-0.669 -0.223,-1.143 -0.333,0.25 -0.69,0.505 -1.1,0.768 -0.402,0.256 -0.788,0.483 -1.147,0.674 -0.364,0.19 -0.74,0.402 -1.133,0.631 -0.39,0.224 -0.7,0.408 -0.94,0.545 -0.234,0.13 -0.718,0.213 -1.441,0.239 -0.512,-0.06 -0.898,-0.272 -1.153,-0.636 -0.164,-0.268 -0.239,-0.55 -0.239,-0.845 0.097,-0.521 0.311,-0.979 0.636,-1.376 0.332,-0.397 0.686,-0.826 1.066,-1.295 0.387,-0.469 0.778,-0.888 1.192,-1.264 0.402,-0.377 0.799,-0.743 1.202,-1.1 0.402,-0.353 0.849,-0.663 1.339,-0.93 0.494,-0.26 0.983,-0.457 1.463,-0.577 0.483,-0.12 0.871,-0.154 1.175,-0.12 0.305,0.039 0.566,0.163 0.778,0.389 0.229,0.221 0.354,0.452 0.37,0.689 0.027,0.234 0.064,0.484 0.114,0.75 0.049,0.268 0.207,0.279 0.468,0.033 0.256,-0.244 0.479,-0.512 0.664,-0.805 0.182,-0.291 0.476,-0.743 0.886,-1.353 z m -8.913,6.633 c 0.146,0.143 0.554,0.045 1.229,-0.293 0.68,-0.348 1.333,-0.712 1.952,-1.109 0.621,-0.397 1.071,-0.8 1.355,-1.196 0.277,-0.399 0.451,-0.808 0.526,-1.229 0.076,-0.421 0.034,-0.703 -0.125,-0.852 -0.151,-0.146 -0.401,-0.141 -0.733,0.033 -0.348,0.164 -0.762,0.474 -1.268,0.902 -0.501,0.436 -0.963,0.877 -1.388,1.322 -0.419,0.443 -0.816,0.927 -1.192,1.438 -0.378,0.518 -0.492,0.844 -0.356,0.984 z m -10.022,-3.262 c 0.19,-0.413 0.511,-0.84 0.941,-1.287 0.435,-0.446 0.875,-0.827 1.312,-1.154 0.435,-0.32 0.875,-0.549 1.326,-0.663 l 0.523,-0.023 c 0.457,0.017 0.854,0.137 1.19,0.376 0.337,0.237 0.491,0.65 0.437,1.25 -0.055,0.6 -0.349,1.117 -0.887,1.552 -0.539,0.435 -1.149,0.751 -1.829,0.942 -0.681,0.195 -1.05,0.364 -1.093,0.522 -0.05,0.158 0.055,0.32 0.332,0.506 0.267,0.19 0.88,0.306 1.833,0.36 0.958,0.053 1.735,0 2.339,-0.159 0.61,-0.158 1.095,-0.326 1.476,-0.501 0.374,-0.174 0.669,-0.293 0.881,-0.354 0.218,-0.059 0.392,0.055 0.526,0.332 -0.385,0.55 -0.809,0.952 -1.261,1.208 -0.458,0.261 -1.033,0.495 -1.719,0.703 -0.692,0.2 -1.53,0.33 -2.515,0.374 H 420.3 c -1.083,-0.103 -1.812,-0.251 -2.181,-0.435 -0.382,-0.181 -0.676,-0.402 -0.877,-0.653 -0.206,-0.251 -0.353,-0.625 -0.445,-1.132 0,-0.765 0.098,-1.353 0.288,-1.764 z m 1.659,0.306 c 0.902,-0.296 1.507,-0.576 1.812,-0.844 0.305,-0.266 0.43,-0.508 0.386,-0.732 -0.043,-0.219 -0.293,-0.208 -0.756,0.025 -0.45,0.237 -0.772,0.475 -0.941,0.719 -0.17,0.247 -0.332,0.526 -0.501,0.832 z m -6.545,-11.121 c 0.435,-0.325 0.913,-0.715 1.426,-1.172 0.499,-0.459 1.137,-0.938 1.888,-1.44 0.751,-0.504 1.507,-0.949 2.258,-1.34 0.756,-0.392 1.371,-0.666 1.855,-0.818 0.479,-0.156 1.175,-0.266 2.089,-0.324 0.816,0.295 1.306,0.686 1.474,1.165 0.17,0.481 0.234,0.991 0.186,1.537 -0.037,0.548 -0.201,0.982 -0.473,1.3 -0.272,0.312 -0.638,0.739 -1.083,1.26 -0.451,0.525 -1.055,1.027 -1.823,1.51 -0.757,0.479 -1.681,0.934 -2.763,1.369 -1.089,0.436 -1.829,1.05 -2.216,1.847 -0.396,0.803 -0.767,1.693 -1.114,2.674 -0.343,0.979 -0.626,2.002 -0.849,3.057 -0.224,1.06 -0.436,2.013 -0.658,2.862 -0.213,0.847 -0.403,1.811 -0.583,2.888 -0.179,1.078 -0.202,2.16 -0.065,3.248 0.136,1.083 0.468,2.096 1.012,3.042 0.533,0.945 1.122,1.686 1.747,2.214 0.626,0.534 1.393,0.822 2.284,0.855 0.887,0.037 1.818,-0.071 2.775,-0.321 0.963,-0.251 1.807,-0.725 2.535,-1.415 0.734,-0.697 0.952,-1.388 0.659,-2.073 -0.3,-0.685 -0.288,-1.214 0.033,-1.583 0.314,-0.369 0.75,-0.364 1.306,0.021 0.549,0.386 0.826,1.176 0.826,2.366 -0.725,1.388 -1.376,2.319 -1.954,2.775 -0.586,0.457 -1.245,0.832 -1.964,1.121 -0.723,0.282 -1.822,0.582 -3.302,0.893 l -1.883,-0.017 c -0.837,-0.256 -1.551,-0.582 -2.128,-0.99 -0.57,-0.413 -1.103,-0.893 -1.594,-1.453 -0.49,-0.562 -0.93,-1.137 -1.316,-1.725 -0.393,-0.593 -0.681,-1.458 -0.864,-2.606 -0.186,-1.143 -0.234,-2.42 -0.159,-3.829 0.087,-1.415 0.343,-3.068 0.779,-4.968 0.435,-1.896 1.011,-3.511 1.729,-4.85 0.712,-1.338 0.876,-2.296 0.489,-2.88 -0.396,-0.585 -0.229,-1.053 0.49,-1.418 0.729,-0.359 1.322,-0.67 1.791,-0.917 0.461,-0.251 0.941,-0.45 1.425,-0.601 0.495,-0.148 1.061,-0.447 1.725,-0.895 0.669,-0.449 1.273,-0.981 1.806,-1.588 0.544,-0.605 0.714,-1.05 0.512,-1.34 -0.195,-0.288 -0.419,-0.453 -0.653,-0.498 -0.239,-0.045 -0.674,0.084 -1.316,0.377 -0.642,0.296 -1.387,0.68 -2.226,1.154 -0.843,0.471 -1.702,1.019 -2.567,1.637 -0.876,0.625 -1.584,1.162 -2.121,1.63 -0.545,0.465 -1.16,1.155 -1.867,2.074 -0.712,0.912 -1.431,1.804 -2.155,2.677 -0.723,0.871 -1.457,1.818 -2.213,2.846 -0.752,1.026 -1.365,1.823 -1.823,2.396 -0.469,0.565 -0.995,1.114 -1.583,1.648 -0.594,0.533 -1.072,0.914 -1.431,1.143 -0.364,0.233 -0.784,0.338 -1.251,0.332 -0.479,-0.005 -0.876,-0.266 -1.203,-0.762 l 0.021,-1.197 c 0.523,-0.267 0.946,-0.439 1.278,-0.511 0.333,-0.076 0.74,-0.288 1.22,-0.642 0.479,-0.355 0.913,-0.811 1.315,-1.357 0.402,-0.544 0.832,-1.202 1.296,-1.98 0.462,-0.773 0.512,-1.052 0.142,-0.828 -0.365,0.221 -0.898,0.583 -1.589,1.083 -0.697,0.503 -1.366,0.865 -2.009,1.085 -0.641,0.227 -0.723,0.035 -0.243,-0.555 0.483,-0.591 1.103,-1.184 1.859,-1.782 0.762,-0.595 1.513,-1.24 2.247,-1.926 0.74,-0.688 1.59,-1.469 2.547,-2.339 0.947,-0.872 1.821,-1.823 2.616,-2.858 0.795,-1.035 1.41,-1.84 1.834,-2.424 0.419,-0.585 0.729,-1.053 0.941,-1.41 0.201,-0.354 0.473,-0.582 0.806,-0.687 0.326,-0.102 0.625,-0.073 0.87,0.094 0.256,0.157 0.402,0.417 0.468,0.771 0.06,0.354 -0.157,0.83 -0.663,1.432 -0.502,0.598 -0.839,0.998 -1.008,1.214 -0.174,0.215 -0.294,0.473 -0.375,0.766 -0.075,0.297 0.094,0.28 0.528,-0.044 z m -41.148,11.754 c 0.381,-0.303 0.963,-0.72 1.735,-1.252 0.779,-0.527 1.601,-1.057 2.459,-1.573 0.868,-0.518 1.66,-0.903 2.383,-1.147 0.414,-0.137 0.765,-0.203 1.062,-0.203 0.241,0 0.435,0.033 0.604,0.109 0.38,0.191 0.636,0.443 0.762,0.751 0.125,0.313 0.049,0.699 -0.246,1.164 -0.288,0.465 -0.74,0.916 -1.349,1.355 -0.615,0.432 -1.17,0.801 -1.662,1.105 -0.492,0.299 -0.743,0.56 -0.743,0.768 0,0.201 0.213,0.391 0.646,0.549 0.422,0.164 1.08,0.175 1.967,0.033 0.887,-0.137 1.648,-0.359 2.296,-0.664 0.645,-0.306 1.17,-0.522 1.58,-0.652 0.42,-0.131 0.661,0 0.734,0.396 0.074,0.402 -0.014,0.887 -0.267,1.453 -0.247,0.571 -0.736,1.1 -1.449,1.584 -0.72,0.489 -1.557,1.048 -2.517,1.68 -0.96,0.643 -1.902,1.219 -2.821,1.757 -0.927,0.528 -1.684,1.165 -2.27,1.91 -0.592,0.751 -0.662,0.996 -0.212,0.746 0.447,-0.25 1.031,-0.593 1.747,-1.008 0.718,-0.424 1.534,-0.945 2.448,-1.577 0.913,-0.625 2.378,-1.703 4.388,-3.231 2.008,-1.529 3.516,-2.547 4.508,-3.058 0.996,-0.512 1.616,-0.74 1.878,-0.696 0.151,0.032 0.239,0.126 0.239,0.289 0,0.086 -0.022,0.194 -0.065,0.331 -0.3,0.25 -0.844,0.631 -1.642,1.131 -0.796,0.502 -1.884,1.229 -3.268,2.193 -1.381,0.958 -2.728,1.947 -4.03,2.981 -1.306,1.022 -2.595,1.893 -3.868,2.611 -1.269,0.712 -2.372,1.377 -3.3,1.98 -0.4,0.163 -0.748,0.245 -1.045,0.245 -0.18,0 -0.329,-0.033 -0.46,-0.093 -0.369,-0.157 -0.381,-0.631 -0.026,-1.414 0.358,-0.778 0.838,-1.492 1.432,-2.128 0.598,-0.631 1.239,-1.207 1.93,-1.725 0.686,-0.517 1.388,-0.975 2.114,-1.376 0.724,-0.397 1.407,-0.822 2.06,-1.263 0.647,-0.44 1.063,-0.826 1.24,-1.153 0.18,-0.321 0.033,-0.43 -0.431,-0.321 -0.468,0.114 -1.09,0.229 -1.87,0.338 -0.784,0.109 -1.47,0.152 -2.041,0.13 -0.576,-0.021 -1.082,-0.185 -1.507,-0.473 -0.431,-0.3 -0.582,-0.697 -0.457,-1.187 0.131,-0.501 0.405,-0.951 0.832,-1.365 0.424,-0.413 0.952,-0.812 1.578,-1.198 0.614,-0.381 1.038,-0.681 1.263,-0.897 0.218,-0.213 0.343,-0.4 0.374,-0.564 0.028,-0.16 -0.246,-0.105 -0.832,0.166 -0.578,0.275 -1.224,0.621 -1.917,1.051 -0.694,0.432 -1.462,1.03 -2.315,1.797 -0.85,0.767 -2.089,1.284 -3.728,1.551 0.288,-0.724 0.62,-1.154 0.969,-1.284 0.357,-0.129 0.726,-0.347 1.11,-0.652 z m -12.389,-0.021 c 0.283,-0.42 0.884,-1.059 1.801,-1.916 0.915,-0.861 1.779,-1.551 2.601,-2.074 0.815,-0.522 1.61,-1.251 2.384,-2.181 0.767,-0.934 1.428,-1.67 1.99,-2.226 0.561,-0.555 1.144,-0.999 1.739,-1.319 0.602,-0.324 1.109,-0.504 1.543,-0.532 0.456,0.089 0.722,0.347 0.793,0.774 -0.144,0.429 -0.462,0.919 -0.952,1.463 -0.487,0.547 -0.981,1.012 -1.484,1.393 -0.502,0.387 -1.028,0.772 -1.585,1.165 -0.552,0.394 -1.158,0.837 -1.8,1.333 -0.653,0.492 -1.281,0.933 -1.888,1.328 -0.604,0.392 -1.377,0.995 -2.318,1.806 -0.933,0.811 -1.417,1.355 -1.45,1.64 -0.027,0.283 0.079,0.511 0.325,0.686 0.243,0.179 0.581,0.239 1.022,0.168 0.435,-0.065 0.908,-0.223 1.426,-0.468 0.516,-0.244 0.987,-0.462 1.408,-0.646 0.416,-0.196 0.809,-0.409 1.169,-0.627 0.363,-0.225 0.403,-0.431 0.112,-0.621 -0.285,-0.19 -0.416,-0.451 -0.383,-0.775 0.027,-0.323 0.207,-0.64 0.53,-0.938 0.321,-0.306 0.672,-0.528 1.036,-0.67 0.37,-0.137 0.705,-0.185 0.998,-0.142 0.297,0.049 0.591,0.153 0.879,0.31 0.286,0.161 0.458,0.387 0.506,0.674 0.049,0.294 0.033,0.61 -0.064,0.952 -0.099,0.348 -0.24,0.594 -0.431,0.735 -0.19,0.136 -0.217,0.29 -0.065,0.462 0.146,0.168 0.388,0.306 0.73,0.414 0.339,0.104 0.676,0.137 1.017,0.1 0.343,-0.033 0.675,-0.071 1.013,-0.088 0.328,-0.027 0.533,0.186 0.604,0.625 -0.719,0.506 -1.322,0.789 -1.804,0.844 -0.479,0.055 -0.95,0.022 -1.396,-0.108 -0.452,-0.13 -0.811,-0.365 -1.072,-0.702 -0.267,-0.332 -0.524,-0.445 -0.767,-0.343 -0.242,0.108 -0.502,0.262 -0.783,0.468 -0.283,0.212 -0.744,0.463 -1.377,0.767 -0.631,0.3 -1.274,0.567 -1.912,0.795 -0.646,0.229 -1.329,0.419 -2.054,0.565 l -0.909,0.022 c -0.985,-0.267 -1.513,-0.811 -1.572,-1.643 0.016,-0.562 0.163,-1.051 0.44,-1.47 z m 8.912,-1.242 c 0.189,-0.185 0.244,-0.375 0.163,-0.576 -0.082,-0.201 -0.259,-0.281 -0.531,-0.245 -0.271,0.038 -0.442,0.163 -0.497,0.364 -0.06,0.207 0.021,0.381 0.238,0.523 0.225,0.142 0.437,0.119 0.627,-0.066 z m 253.032,-74.007 c -1.007,0.128 -2.536,0.756 -4.575,1.885 -2.047,1.132 -4.223,2.797 -6.546,4.996 -2.329,2.203 -4.554,4.401 -6.697,6.596 -2.138,2.202 -3.841,3.978 -5.13,5.331 -1.291,1.352 -2.803,3.317 -4.527,5.887 -1.73,2.582 -2.993,4.498 -3.776,5.752 -0.784,1.258 -1.726,2.406 -2.818,3.439 -1.109,1.035 -1.769,0.99 -1.986,-0.137 -0.217,-1.132 -0.364,-2.198 -0.468,-3.208 -0.098,-1.005 -0.614,-1.983 -1.556,-2.921 -0.946,-0.944 -2.062,-1.49 -3.346,-1.651 -1.285,-0.158 -2.954,0.016 -5.005,0.52 -2.041,0.506 -4.109,1.322 -6.215,2.451 -2.105,1.137 -3.998,2.449 -5.706,3.957 -1.692,1.509 -3.406,3.067 -5.126,4.667 -1.735,1.602 -3.411,3.394 -5.055,5.381 -0.06,0.071 -0.119,0.144 -0.179,0.216 -2.003,0.906 -3.896,1.677 -5.659,2.321 -1.822,0.661 -4.641,1.384 -8.438,2.167 -3.804,0.785 -5.979,0.693 -6.557,-0.28 -0.565,-0.975 -0.517,-1.961 0.142,-2.969 0.664,-1.008 1.855,-2.119 3.591,-3.35 1.724,-1.22 3.216,-2.728 4.473,-4.522 1.256,-1.793 2.018,-3.315 2.263,-4.567 0.251,-1.264 0.277,-2.407 0.098,-3.445 -0.185,-1.039 -0.696,-1.774 -1.519,-2.213 -0.81,-0.443 -1.789,-0.692 -2.915,-0.755 -2.955,0 -5.659,0.458 -8.112,1.367 -2.448,0.909 -5.887,3.741 -10.315,8.479 -4.429,4.746 -8.722,8.285 -12.867,10.608 l 0.288,0.879 c -0.142,0.088 -0.282,0.178 -0.43,0.275 -1.508,1.021 -3.287,1.809 -5.349,2.357 -2.062,0.55 -3.792,0.64 -5.206,0.26 -1.415,-0.376 -2.28,-0.975 -2.596,-1.79 -0.31,-0.816 -0.099,-1.558 0.658,-2.218 0.762,-0.654 1.778,-1.82 3.068,-3.482 1.284,-1.667 1.898,-3.275 1.834,-4.811 -0.055,-1.542 -0.73,-2.15 -2.02,-1.836 -1.293,0.312 -1.887,-0.216 -1.795,-1.608 0.092,-1.38 -0.07,-2.618 -0.468,-3.721 -0.414,-1.098 -1.262,-2.073 -2.552,-2.92 -1.289,-0.851 -3.787,-1.333 -7.491,-1.464 -2.824,0.317 -5.043,0.821 -6.649,1.512 -1.594,0.688 -3.814,1.808 -6.643,3.344 -2.823,1.541 -5.893,3.905 -9.189,7.096 -3.188,3.083 -4.854,5.442 -5.017,7.102 -2.562,0.571 -4.69,1.245 -6.344,2.015 -1.942,0.913 -5.071,1.808 -9.38,2.688 -4.304,0.884 -6.752,0.744 -7.345,-0.422 -0.599,-1.164 -0.806,-2.154 -0.62,-2.971 0.189,-0.816 0.913,-1.794 2.165,-2.921 1.267,-1.134 2.504,-2.261 3.728,-3.391 1.229,-1.133 2.012,-2.785 2.35,-4.949 0.354,-2.169 0.196,-3.754 -0.463,-4.764 -0.657,-1.007 -1.518,-1.255 -2.595,-0.757 -1.066,0.504 -2.008,1.48 -2.828,2.927 -0.816,1.443 -2.068,2.619 -3.767,3.535 -1.697,0.907 -3.976,1.98 -6.833,3.202 -2.861,1.226 -6.034,2.77 -9.526,4.62 -3.482,1.854 -6.355,3.188 -8.617,4.006 -2.265,0.821 -4.104,1.222 -5.518,1.222 -1.415,0 -2.183,-0.453 -2.312,-1.364 -0.119,-0.911 0.44,-1.898 1.703,-2.964 1.257,-1.071 2.682,-2.158 4.287,-3.257 1.599,-1.101 3.53,-2.369 5.8,-3.817 2.258,-1.447 3.906,-3.234 4.939,-5.371 1.04,-2.136 1.198,-3.681 0.479,-4.62 -0.728,-0.944 -1.338,-1.54 -1.844,-1.791 -0.5,-0.25 -1.316,-0.471 -2.454,-0.663 -0.995,0.255 -2.143,0.852 -3.433,1.791 -1.29,0.945 -3.221,2.658 -5.794,5.141 -2.221,2.135 -5.24,5.014 -9.049,8.626 -1.67,0 -3.28,0.38 -4.81,1.126 -3.079,1.511 -6.063,2.638 -8.954,3.394 -2.894,0.756 -4.653,0.77 -5.279,0.051 -0.631,-0.725 -0.549,-1.823 0.229,-3.301 0.795,-1.476 1.231,-3.061 1.323,-4.764 0.092,-1.698 -0.343,-3.482 -1.323,-5.37 -0.969,-1.887 -2.714,-3.424 -5.228,-4.615 h -2.073 c -4.338,2.195 -7.866,3.985 -10.604,5.371 -2.731,1.379 -5.419,3.217 -8.063,5.512 -2.634,2.292 -3.999,4.43 -4.098,6.409 -0.026,0.641 0.02,1.268 0.129,1.87 -2.026,0.683 -4.355,1.396 -7.01,2.134 -5.628,1.574 -8.637,1.7 -9.052,0.381 -0.4,-1.317 -0.012,-3.332 1.184,-6.034 1.19,-2.699 1.19,-4.76 0,-6.17 -1.195,-1.417 -2.629,-1.936 -4.293,-1.555 -1.665,0.369 -3.867,1.363 -6.595,2.965 -2.736,1.6 -7.686,4.513 -14.847,8.72 4.521,-4.712 7.148,-8.063 7.869,-10.04 0.726,-1.98 0.876,-3.836 0.471,-5.562 -0.408,-1.724 -1.646,-2.967 -3.721,-3.724 -2.325,0.129 -4.474,0.641 -6.458,1.557 -1.979,0.916 -4.709,2.259 -8.197,4.056 -3.493,1.784 -6.521,3.8 -9.1,6.028 -2.579,2.234 -4.497,3.627 -5.752,4.196 -0.871,0.389 -1.51,1.417 -1.926,3.052 -0.397,0.212 -0.806,0.454 -1.231,0.74 -1.51,1.021 -3.287,1.809 -5.347,2.357 -2.062,0.55 -3.793,0.64 -5.21,0.26 -1.411,-0.376 -2.276,-0.975 -2.589,-1.79 -0.316,-0.816 -0.093,-1.558 0.659,-2.218 0.753,-0.654 1.778,-1.82 3.061,-3.482 1.288,-1.667 1.904,-3.275 1.839,-4.811 -0.06,-1.542 -0.735,-2.15 -2.024,-1.836 -1.29,0.312 -1.884,-0.216 -1.79,-1.608 0.091,-1.38 -0.061,-2.618 -0.472,-3.721 -0.408,-1.098 -1.258,-2.073 -2.547,-2.92 -1.29,-0.851 -3.786,-1.333 -7.492,-1.464 -2.83,0.317 -5.042,0.821 -6.644,1.512 -1.605,0.688 -3.818,1.808 -6.648,3.344 -2.826,1.541 -5.889,3.905 -9.19,7.096 -3.297,3.188 -4.983,5.615 -5.039,7.279 0,4.083 0.854,6.866 2.565,8.341 1.712,1.483 3.371,2.218 4.973,2.218 2.326,0 4.445,-0.286 6.363,-0.849 1.919,-0.567 3.897,-1.415 5.94,-2.544 2.04,-1.132 4.351,-2.044 6.931,-2.735 1.001,1.822 2.541,3.3 4.614,4.427 1.886,1.071 4.586,1.606 8.11,1.606 0.311,0 1.223,-0.027 2.729,-0.097 1.503,-0.061 3.495,-0.459 5.959,-1.201 2.465,-0.733 4.369,-1.698 5.708,-2.872 1.208,-1.068 1.877,-2.415 2.016,-4.034 1.383,-0.789 3.895,-2.447 7.572,-4.994 3.994,-2.761 7.137,-4.448 9.427,-5.042 2.295,-0.596 3.251,-0.075 2.875,1.559 -0.376,1.628 -1.399,3.234 -3.063,4.804 -1.665,1.572 -3.394,3.078 -5.181,4.525 -1.794,1.442 -2.63,3.019 -2.5,4.712 0.124,1.702 0.733,2.872 1.836,3.536 1.099,0.662 2.627,0.987 4.575,0.987 1.445,-0.627 3.613,-1.732 6.504,-3.294 2.889,-1.575 6.265,-3.746 10.131,-6.509 3.866,-2.767 5.514,-3.206 4.944,-1.319 -0.562,1.887 -0.47,3.662 0.286,5.329 0.757,1.664 2.546,2.888 5.376,3.671 2.824,0.789 7.113,0.256 12.865,-1.603 4.031,-1.294 6.909,-2.393 8.656,-3.292 1.24,1.235 2.977,1.893 5.196,1.974 2.551,0.097 5.798,0.21 9.761,0.332 -4.151,1.506 -8.03,3.236 -11.638,5.185 -3.619,1.953 -7.929,4.323 -12.92,7.119 -4.993,2.793 -9.501,5.59 -13.525,8.386 -4.021,2.801 -7.855,5.597 -11.501,8.389 -3.644,2.802 -8.888,7.965 -15.741,15.501 -3.142,4.407 -5.086,8.492 -5.846,12.258 0.379,3.209 1.211,5.744 2.502,7.594 1.287,1.851 3.786,3.314 7.489,4.381 h 2.078 c 1.95,-0.251 4,-0.865 6.173,-1.844 2.169,-0.97 5.152,-3.194 8.954,-6.688 3.8,-3.482 6.975,-6.752 9.518,-9.805 2.547,-3.046 5.783,-6.97 9.71,-11.779 3.933,-4.808 7.9,-9.978 11.924,-15.51 4.024,-5.533 7.683,-9.867 10.977,-13.005 3.309,-3.145 6.089,-5.406 8.347,-6.786 2.264,-1.386 5.244,-2.764 8.961,-4.151 3.593,-1.339 6.654,-2.413 9.19,-3.224 -0.351,0.715 -0.519,1.355 -0.519,1.901 0,0.067 0.027,0.101 0.087,0.101 0.068,1.885 1.077,3.23 3.018,4.051 1.385,0.563 3.143,0.849 5.28,0.849 0.816,0 1.671,-0.034 2.546,-0.094 3.271,-0.312 6.383,-1.082 9.331,-2.307 2.954,-1.224 5.925,-2.499 8.911,-3.82 2.982,-1.317 6.523,-3.113 10.6,-5.374 -2.574,3.58 -3.754,6.082 -3.532,7.495 0.218,1.415 1.023,2.517 2.406,3.297 1.376,0.79 3.765,1.181 7.154,1.181 3.335,0 7.339,-0.569 12.024,-1.698 4.679,-1.129 8.373,-2.373 11.077,-3.722 0.876,-0.438 1.632,-0.881 2.279,-1.325 0.413,1.862 1.132,3.251 2.171,4.148 1.713,1.483 3.374,2.218 4.973,2.218 2.329,0 4.445,-0.286 6.36,-0.849 1.916,-0.567 3.9,-1.415 5.946,-2.544 2.036,-1.132 4.343,-2.044 6.927,-2.735 1.001,1.822 2.546,3.3 4.613,4.427 1.888,1.071 4.593,1.606 8.112,1.606 0.315,0 1.219,-0.027 2.731,-0.097 1.513,-0.061 3.492,-0.459 5.968,-1.201 2.466,-0.733 4.358,-1.698 5.696,-2.872 1.334,-1.182 2.014,-2.694 2.052,-4.553 -0.032,-0.056 -0.05,-0.105 -0.077,-0.163 2.743,-1.769 5.48,-4.021 8.222,-6.76 4.467,-4.465 7.297,-6.833 8.489,-7.118 1.189,-0.286 2.109,-0.077 2.741,0.612 0.625,0.691 0.321,1.699 -0.903,3.012 -1.219,1.321 -2.688,2.346 -4.386,3.063 -1.698,0.723 -3.285,1.683 -4.804,2.877 -1.514,1.195 -2.639,2.451 -3.396,3.77 -0.757,1.32 -0.99,2.672 -0.708,4.054 0.283,1.383 1.008,2.545 2.178,3.49 1.164,0.945 2.427,1.52 3.813,1.745 1.388,0.219 3.39,0.328 6.028,0.328 3.96,-0.501 7.731,-1.511 11.307,-3.017 1.637,-0.685 3.377,-1.441 5.211,-2.264 -0.62,1.166 -1.071,2.422 -1.344,3.77 0,1.263 0.354,2.454 1.04,3.582 1.065,1.579 2.709,2.483 4.907,2.74 3.073,-0.132 5.119,-0.473 6.12,-1.042 1.008,-0.566 2.346,-1.337 4.011,-2.312 1.665,-0.975 3.265,-1.864 4.804,-2.682 1.54,-0.82 3.177,-1.775 4.901,-2.875 1.731,-1.104 3.287,-2.184 4.68,-3.255 0.305,2.008 0.615,3.635 0.931,4.859 0.314,1.225 1.365,2.006 3.155,2.352 1.79,0.35 3.853,0.252 6.181,-0.284 2.312,-0.529 4.129,-1.052 5.408,-1.549 1.295,-0.51 2.754,-0.958 4.391,-1.371 1.633,-0.403 3.406,-1.117 5.332,-2.117 1.91,-1.006 2.807,-1.84 2.688,-2.496 -0.133,-0.67 -0.338,-1.508 -0.622,-2.548 -0.287,-1.039 -1.07,-1.148 -2.355,-0.331 -1.289,0.815 -3.177,1.445 -5.657,1.884 -2.481,0.439 -4.397,1.209 -5.746,2.307 -1.355,1.103 -2.579,1.524 -3.678,1.272 -1.104,-0.249 -1.648,-0.796 -1.648,-1.646 0,-0.852 0.527,-1.836 1.556,-2.969 1.034,-1.129 1.991,-2.482 2.873,-4.059 0.876,-1.564 2.383,-3.534 4.521,-5.894 2.139,-2.352 4.152,-4.554 6.039,-6.59 1.889,-2.048 3.635,-3.426 5.225,-4.148 1.616,-0.723 3.193,-1.622 4.76,-2.685 1.577,-1.073 3.493,-2.782 5.745,-5.143 2.275,-2.355 4.396,-4.678 6.372,-6.974 1.975,-2.288 3.285,-4.477 3.916,-6.552 -0.31,-1.256 -0.712,-2.122 -1.18,-2.588 -0.476,-0.47 -1.434,-0.864 -2.876,-1.178 z m -366.015,41.427 c -1.883,1.352 -4.006,2.639 -6.363,3.868 -2.356,1.223 -4.636,2.177 -6.834,2.876 -2.2,0.689 -3.8,0.624 -4.804,-0.191 -1.008,-0.816 -1.196,-1.994 -0.573,-3.535 0.631,-1.538 2.111,-3.283 4.431,-5.234 2.327,-1.947 4.637,-3.519 6.931,-4.71 2.295,-1.194 4.43,-1.884 6.408,-2.073 1.983,-0.188 3.237,0.348 3.773,1.597 0.535,1.261 0.644,2.472 0.328,3.629 -0.314,1.169 -1.412,2.422 -3.297,3.773 z m 83.607,37.897 c -4.836,6.312 -8.981,11.622 -12.442,15.931 -3.457,4.304 -7.004,8.149 -10.652,11.551 -3.644,3.395 -6.452,5.701 -8.435,6.921 -1.976,1.224 -3.958,2.034 -5.941,2.403 -1.978,0.382 -3.135,-0.429 -3.487,-2.403 -0.344,-1.976 0.115,-4.212 1.375,-6.692 1.254,-2.476 3.01,-5.038 5.274,-7.683 2.262,-2.639 5.609,-6.213 10.039,-10.746 4.431,-4.526 8.86,-8.389 13.291,-11.588 4.432,-3.212 8.813,-6.117 13.151,-8.726 4.33,-2.606 8.443,-5.037 12.344,-7.307 -4.837,5.911 -9.68,12.022 -14.517,18.339 z m 27.953,-34.787 c -1.352,1.728 -3.201,2.861 -5.565,3.393 -2.354,0.537 -4.274,0.255 -5.743,-0.843 -1.48,-1.101 -1.668,-2.599 -0.569,-4.479 1.103,-1.888 2.522,-3.55 4.288,-4.998 1.76,-1.447 3.632,-2.481 5.607,-3.109 1.982,-0.629 3.145,0.453 3.486,3.252 0.355,2.796 -0.157,5.062 -1.504,6.784 z m 121.832,-6.883 c -0.312,1.169 -1.416,2.422 -3.304,3.773 -1.882,1.352 -4.004,2.639 -6.365,3.868 -2.351,1.223 -4.63,2.177 -6.828,2.876 -2.198,0.689 -3.803,0.624 -4.809,-0.191 -1.008,-0.816 -1.191,-1.994 -0.561,-3.535 0.62,-1.538 2.105,-3.283 4.428,-5.234 2.323,-1.947 4.631,-3.519 6.933,-4.71 2.279,-1.194 4.423,-1.884 6.403,-2.073 1.979,-0.188 3.237,0.348 3.77,1.597 0.529,1.26 0.637,2.471 0.333,3.629 z m 88.792,-1.035 c -0.315,1.794 -1.066,3.536 -2.263,5.23 -1.192,1.699 -3.107,3.394 -5.746,5.095 -2.644,1.692 -5.407,3.264 -8.303,4.71 -2.888,1.447 -4.636,1.874 -5.229,1.271 -0.592,-0.596 -0.093,-1.995 1.508,-4.192 1.6,-2.198 3.296,-4.245 5.087,-6.126 1.795,-1.888 3.76,-3.761 5.897,-5.608 2.138,-1.852 3.929,-3.142 5.375,-3.862 1.442,-0.725 2.498,-0.773 3.15,-0.144 0.666,0.627 0.835,1.836 0.524,3.626 z M 358.222,55.414 c -10.849,2.536 -18.442,6.058 -22.774,10.578 -10.304,7.771 -19.525,21.596 -27.659,41.477 -2.775,7.86 -5.417,15.337 -7.941,22.454 2.249,-0.906 4.645,-1.478 7.149,-1.715 12.505,-34.282 25.777,-55.026 39.835,-62.215 10.846,-3.611 16.27,-5.78 16.27,-6.507 v -4.071 c 0,-3.252 -1.629,-5.96 -4.88,-8.131 h -0.816 l 0.816,1.628 v 6.502 z m -82.966,-1.626 c 4.881,0.363 9.76,3.075 14.639,8.134 h -0.811 c -6.603,-4.335 -12.565,-6.508 -17.896,-6.508 1.897,4.34 6.232,6.508 13.013,6.508 8.678,2.353 13.013,9.133 13.013,20.331 v 4.071 c 0,8.133 -0.805,13.828 -2.435,17.081 0,0.734 -4.02,12.674 -12.061,35.816 2.3,-1.685 4.826,-3.234 7.557,-4.635 1.579,-0.811 3.025,-1.543 4.341,-2.195 8.012,-21.635 13.763,-35.64 17.242,-41.994 5.422,-13.561 14.637,-24.679 27.655,-33.353 10.301,-2.799 15.452,-4.695 15.452,-5.69 v -5.702 c 0,-1.259 -1.628,-2.069 -4.879,-2.439 h -82.961 v 6.511 c 10e-4,1.715 2.711,3.074 8.131,4.064 z m 26.84,32.536 v -1.628 l 5.692,-6.506 h 0.814 c -1.539,3.798 -3.706,6.505 -6.506,8.134 z m 35.789,-38.227 h 2.441 v 0.813 c -0.906,0 -2.265,0.543 -4.069,1.628 l 1.628,-2.441 z m -4.068,0 c -20.425,21.143 -30.997,31.716 -31.721,31.716 0,-0.54 -0.268,-1.357 -0.812,-2.433 l 30.093,-29.283 h 2.44 z m -7.321,0 C 310.317,64.901 301.911,73.31 301.284,73.31 h -0.819 v -0.812 c 15.64,-16.269 23.777,-24.401 24.409,-24.401 h 1.622 z m -6.508,0 c -12.831,13.551 -19.608,20.33 -20.327,20.33 h -0.815 V 66.804 C 310.591,54.333 316.825,48.096 317.55,48.096 h 2.438 z m -8.945,0 h 1.629 l -14.641,15.456 -1.623,-0.816 c 9.032,-9.762 13.909,-14.64 14.635,-14.64 z m -7.323,0 h 2.45 c -6.782,7.591 -10.574,11.387 -11.39,11.387 l -1.627,-0.817 c 6.235,-7.044 9.76,-10.57 10.567,-10.57 z m -6.506,0 h 1.631 c -4.159,4.877 -6.601,7.316 -7.323,7.316 h -0.82 v -0.81 c 3.621,-4.338 5.793,-6.506 6.512,-6.506 z m -7.318,0 h 2.44 l -4.065,4.877 c -0.903,0 -1.444,-0.544 -1.624,-1.622 1.351,-2.173 2.438,-3.255 3.249,-3.255 z m -7.318,0 h 2.438 c 0,1.082 -0.542,1.626 -1.625,1.626 h -0.813 v -1.626 z" /> </svg> ); }; Logo.defaultProps = { colorCompass: '#ffcc00', colorText: '#660729', width: undefined, height: undefined }; Logo.propTypes = { colorCompass: PropTypes.string, colorText: PropTypes.string, width: PropTypes.string, height: PropTypes.string }; export default Logo;
src/higherOrders/Transition.js
lenxeon/react-ui
import React from 'react' import PropTypes from '../utils/proptypes' function childrenToItems (children) { if (!children) { return {} } let items = {} if (!Array.isArray(children)) { children = [children] } children.forEach((child) => { items[child.key] = child }) return items } function itemsToChildren (items) { return Object.keys(items).map((key) => { return items[key] }) } export default function (Component) { class Transition extends React.Component { constructor (props) { super(props) this.state = { items: childrenToItems(props.children) } } render () { return <Component {...this.props}>{itemsToChildren(this.state.items)}</Component> } } Transition.propTypes = { children: PropTypes.element_array } return Transition }
node_modules/react-bootstrap/es/PagerItem.js
caughtclean/but-thats-wrong-blog
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 SafeAnchor from './SafeAnchor'; import createChainedFunction from './utils/createChainedFunction'; var propTypes = { disabled: React.PropTypes.bool, previous: React.PropTypes.bool, next: React.PropTypes.bool, onClick: React.PropTypes.func, onSelect: React.PropTypes.func, eventKey: React.PropTypes.any }; var defaultProps = { disabled: false, previous: false, next: false }; var PagerItem = function (_React$Component) { _inherits(PagerItem, _React$Component); function PagerItem(props, context) { _classCallCheck(this, PagerItem); var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context)); _this.handleSelect = _this.handleSelect.bind(_this); return _this; } PagerItem.prototype.handleSelect = function handleSelect(e) { var _props = this.props, disabled = _props.disabled, onSelect = _props.onSelect, eventKey = _props.eventKey; if (onSelect || disabled) { e.preventDefault(); } if (disabled) { return; } if (onSelect) { onSelect(eventKey, e); } }; PagerItem.prototype.render = function render() { var _props2 = this.props, disabled = _props2.disabled, previous = _props2.previous, next = _props2.next, onClick = _props2.onClick, className = _props2.className, style = _props2.style, props = _objectWithoutProperties(_props2, ['disabled', 'previous', 'next', 'onClick', 'className', 'style']); delete props.onSelect; delete props.eventKey; return React.createElement( 'li', { className: classNames(className, { disabled: disabled, previous: previous, next: next }), style: style }, React.createElement(SafeAnchor, _extends({}, props, { disabled: disabled, onClick: createChainedFunction(onClick, this.handleSelect) })) ); }; return PagerItem; }(React.Component); PagerItem.propTypes = propTypes; PagerItem.defaultProps = defaultProps; export default PagerItem;
src/helpers/Html.js
hasibsahibzada/quran.com-frontend
/* eslint-disable global-require, quotes, max-len */ import PropTypes from 'prop-types'; import React from 'react'; import ReactDOM from 'react-dom/server'; import Helmet from 'react-helmet'; import serialize from 'serialize-javascript'; const Html = ({ store, component, assets }) => { const content = component ? ReactDOM.renderToString(component) : ''; const head = Helmet.rewind(); return ( <html lang="en"> <head> {head.base.toComponent()} {head.title.toComponent()} {head.meta.toComponent()} {head.link.toComponent()} {head.script.toComponent()} {head.style.toComponent()} {Object.keys(assets.styles).map((style, i) => <link href={assets.styles[style]} key={i} rel="stylesheet" type="text/css" /> )} {Object.keys(assets.styles).length === 0 ? <style dangerouslySetInnerHTML={{ __html: require('../../src/styles/bootstrap.config') }} /> : null} </head> <body> <div id="app" dangerouslySetInnerHTML={{ __html: content }} /> <style dangerouslySetInnerHTML={{ __html: '.async-hide { opacity: 0 !important}' }} /> <script dangerouslySetInnerHTML={{ __html: `(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date; h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')}; (a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c; })(window,document.documentElement,'async-hide','dataLayer',4000, {'GTM-PNMFTW3':true});` }} /> <script dangerouslySetInnerHTML={{ __html: `(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-8496014-1', 'auto'); ga('require', 'GTM-PNMFTW3'); ` }} charSet="UTF-8" /> <script dangerouslySetInnerHTML={{ __html: `if ('serviceWorker' in navigator) {navigator.serviceWorker.register('/quran-service-worker.js', {scope: './'}).then(function(registration) {}).catch(function(error) {});}` }} charSet="UTF-8" /> <script dangerouslySetInnerHTML={{ __html: `window.reduxData=${serialize(store.getState())};` }} charSet="UTF-8" /> {process.env.NODE_ENV === 'production' && <script dangerouslySetInnerHTML={{ __html: `/*<![CDATA[*/window.zEmbed||function(e,t){var n,o,d,i,s,a=[],r=document.createElement("iframe");window.zEmbed=function(){a.push(arguments)},window.zE=window.zE||window.zEmbed,r.src="javascript:false",r.title="",r.role="presentation",(r.frameElement||r).style.cssText="display: none",d=document.getElementsByTagName("script"),d=d[d.length-1],d.parentNode.insertBefore(r,d),i=r.contentWindow,s=i.document;try{o=s}catch(c){n=document.domain,r.src='javascript:var d=document.open();d.domain="'+n+'";void(0);',o=s}o.open()._l=function(){var o=this.createElement("script");n&&(this.domain=n),o.id="js-iframe-async",o.src=e,this.t=+new Date,this.zendeskHost=t,this.zEQueue=a,this.body.appendChild(o)},o.write('<body onload="document._l();">'),o.close()}("https://assets.zendesk.com/embeddable_framework/main.js","quran.zendesk.com");/*]]>*/` }} />} {process.env.NODE_ENV === 'production' && <script dangerouslySetInnerHTML={{ __html: ` (function(e,b){if(!b.__SV){var a,f,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");for(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,e,d])};b.__SV=1.2;a=e.createElement("script");a.type="text/javascript";a.async=!0;a.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\\/\\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";f=e.getElementsByTagName("script")[0];f.parentNode.insertBefore(a,f)}})(document,window.mixpanel||[]);mixpanel.init("d3f9b2f15c4bf0509e85845b56921034"); ` }} />} {process.env.NODE_ENV === 'production' && <script src="https://cdn.ravenjs.com/3.0.4/raven.min.js" />} {Object.keys(assets.javascript) .filter(script => !assets.javascript[script].includes('-chunk')) .map((script, i) => <script src={assets.javascript[script]} key={i} /> )} </body> </html> ); }; Html.propTypes = { store: PropTypes.object, // eslint-disable-line assets: PropTypes.object, // eslint-disable-line component: PropTypes.element }; export default Html;
src/Component/React/ReactAdapter/index.js
Kitware/paraviewweb
import React from 'react'; import ReactDOM from 'react-dom'; export default class ReactContainer { constructor(reactClass, reactProps) { this.props = reactProps; this.reactClass = reactClass; this.container = null; this.component = null; } setContainer(el) { if (this.container && this.container !== el) { ReactDOM.unmountComponentAtNode(this.container); this.component = null; } this.container = el; if (this.container) { const View = this.reactClass; this.component = ReactDOM.render( <View {...this.props} />, this.container ); } } resize() { this.render(); } render() { if (this.component) { this.component.forceUpdate(); } else if (this.container) { const View = this.reactClass; ReactDOM.render(<View {...this.props} />, this.container); } } destroy() { this.setContainer(null); this.reactClass = null; this.props = null; this.component = null; } }
core/src/app.js
syon/gaiyas
/* @type */ import React from 'react' import ReactDOM from 'react-dom' import { Provider } from 'react-redux' import { fetchPosts, makeRanking } from './actions' import Main from './components/Main.jsx' import configureStore from './store/configureStore' import './css/app.css' const defaultUrl = new URL(location.href); // Stop to load automatically if insertElement has data-lazy attribute when it has following param // ?chrome-extension-gaiyas=<URL> // Instead of it, wait for `postMessage({ type: 'gaiyas::fetch', url: <url> }, '*')` const isPopupEmbed = defaultUrl.searchParams.has('chrome-extension-gaiyas'); // Wait for starting if insertElement is not found // <div id='chrome-extension-gaiyas' /> // It should wait for `postMessage({ type: 'gaiyas::fetch', url: <url> }, '*')` const insertElement = document.getElementById('chrome-extension-gaiyas'); const store = configureStore const startLoad = (url) => { store.dispatch(fetchPosts(url)).then(() => { // console.log('store.dispatch(fetchPosts())', store.getState()) const state = store.getState() if (!state.waiting.isWaiting) { store.dispatch(makeRanking(state.hatebu.hatena)) } else { // console.log('Waiting...', store.getState()) } }) }; if (isPopupEmbed || !insertElement) { // wait for message to start manually window.addEventListener('message', function(event) { const insertElement = document.getElementById('chrome-extension-gaiyas'); if (event.data.type === 'gaiyas::fetch' && insertElement) { // popup.js send url or ?chrome-extension-gaiyas=<url> const url = event.data.url || defaultUrl.searchParams.get('chrome-extension-gaiyas'); startLoad(url); ReactDOM.render( <Provider store={store}> <Main manual={isPopupEmbed}/> </Provider>, insertElement, ) } }); } else { // start to load automatically startLoad(defaultUrl.toString()); ReactDOM.render( <Provider store={store}> <Main manual={isPopupEmbed}/> </Provider>, insertElement, ); }
app/src/common/hoc/withBackButton.js
BlackBoxVision/react-native-redux-todo
import React from 'react'; import PropTypes from 'prop-types'; import { BackAndroid, Platform } from 'react-native'; import connect from 'react-redux/lib/connect/connect'; export default function withBackButton() { return ReactComponent => { const mapStateToProps = state => ({ index: state.navigate.index }); @connect(mapStateToProps) class BackButtonComponent extends React.Component { static propTypes = { index: PropTypes.number.isRequired }; constructor(props, context) { super(props, context); } componentDidMount() { Platform.OS === 'android' && BackAndroid.addEventListener('hardwareBackPress', this.handleBackPress); } componentWillUnmount() { Platform.OS === 'android' && BackAndroid.removeEventListener('hardwareBackPress', this.handleBackPress); } render() { return <ReactComponent {...this.context} {...this.props} />; } handleBackPress = () => { if (this.props.index) { this.props.navigation.goBack(); return true; } else { return false; } }; } return BackButtonComponent; }; }
src/components/organisms/Hero/index.js
DimensionLab/narc
import React from 'react' import styled from 'styled-components' import { palette, size } from 'styled-theme' import { Block, Paragraph, IconLink, IconButton, LogoImage, PreformattedText, Heading, Tooltip, } from 'components' const Wrapper = styled(Block)` display: flex; justify-content: center; padding: 2rem; box-sizing: border-box; @media screen and (max-width: 640px) { padding-left: 0.25rem; padding-right: 0.25rem; } ` const InnerWrapper = styled.div` display: flex; width: 100%; max-width: ${size('maxWidth')}; @media screen and (max-width: 640px) { flex-wrap: wrap; } ` const Section = styled.section` display: flex; flex-direction: column; align-items: center; padding: 2rem; box-sizing: border-box; &:first-child { flex: none; } @media screen and (max-width: 640px) { padding: 0.25rem; width: 100%; } ` const Text = styled(Paragraph)` color: ${palette('grayscale', 3, true)}; font-weight: 300; font-size: 1.35rem; line-height: 1.35em; width: 100%; letter-spacing: 0.05em; @media screen and (max-width: 640px) { text-align: center; font-size: 1rem; } ` const ButtonGroup = styled.div` margin-top: 2rem; display: flex; > :not(:first-child) { margin-left: 0.5rem; } ` const Instructions = styled.div` width: 100%; margin-top: 2rem; @media screen and (max-width: 640px) { margin-top: 1rem; } ` const Hero = (props) => { return ( <Wrapper opaque reverse {...props}> <InnerWrapper> <Section> <LogoImage height={265} /> <ButtonGroup> <Tooltip reverse data-title="Just a fancy tooltip 😄"> <IconButton icon="github" href="https://github.com/diegohaz/arc">GitHub</IconButton> </Tooltip> <Tooltip reverse data-title="Another tooltip aligned differently" align="end" position="bottom"> <IconButton icon="docs" href="https://github.com/diegohaz/arc/wiki">Docs</IconButton> </Tooltip> </ButtonGroup> </Section> <Section> <Text> <strong>ARc</strong> is a <IconLink reverse icon="react" href="https://facebook.github.io/react/">React</IconLink> starter kit based on the <IconLink reverse icon="atomic-design" href="http://bradfrost.com/blog/post/atomic-web-design/">Atomic Design</IconLink> methodology. It&apos;s <strong>progressive</strong>, which means that you can start with the basic boilerplate and try the other features when you are comfortable. </Text> <Instructions> <Heading level={2} reverse>Install</Heading> <PreformattedText block reverse wrapped> git clone -b master https://github.com/diegohaz/arc my-app </PreformattedText> <IconLink icon="docs" right reverse href="https://github.com/diegohaz/arc/wiki/Setup" > Learn more </IconLink> </Instructions> </Section> </InnerWrapper> </Wrapper> ) } export default Hero
src/index.js
Gab-Metzger/react-boilerplate
import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; ReactDOM.render(<App />, document.getElementById('root'));
src/components/shared/GoBack.js
juandjara/open-crono
import React from 'react' import { browserHistory } from 'react-router' import Button from 'react-toolbox/lib/button/Button'; const NotFound = () => { return ( <Button primary onClick={() => browserHistory.goBack()} label="Volver atr&aacute;s" /> ) } export default NotFound
src/components/CatalogList/CatalogList.js
pustovitDmytro/maysternya
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React from 'react'; import cx from 'classnames'; import withStyles from 'isomorphic-style-loader/lib/withStyles'; import s from './CatalogList.css'; const items =[ { id: 1, src: "img/1.jpg", text: "Портрети", alt: "portret" }, { id: 2, src: "img/2.jpg", text: "Скульптури", alt: "skulpture" }, { id: 3, src: "img/3.jpg", text: "Каміни", alt: "kamin" }, { id: 4, src: "img/4.jpg", text: "Столешні", alt: "stoleshnya" }, ]; class CatalogList extends React.Component { render() { return ( <div className={s.bigmenu}> { items.map(elem => <div className="s.item"> <img src="{elem.src}"/> </div> ) } </div> ); } } export default withStyles(s)(CatalogList);
src/components/NavsFigure.js
yuhaogo/study-mk-photos
import React from 'react'; class NavsFigure extends React.Component{ handleClick=(e)=>{ const {isCenter}=this.props.arrange; if(isCenter){ this.props.inverse(); }else{ this.props.center(); } e.stopPropagation(); e.preventDefault(); } render(){ const {isCenter,inverse}=this.props.arrange; var navsClassName='small-dot'; navsClassName+=isCenter?' is-center tmfont tm-icon-refresh2':''; navsClassName+=inverse?' is-inverse tmfont tm-icon-refresh2':''; return( <div className={navsClassName} onClick={this.handleClick}></div> ) } } export default NavsFigure;
src/js/ui/chunk-row.js
SpaceHexagon/pylon
import React from 'react'; import ChunkMenu from './chunk-menu.js'; export default class ChunkRow extends React.Component { constructor() { super(); this.state = {filterText: ''} } render () { return ( <div className={"chunk-row "+this.props.offset}> {this.props.chunks.map(function (chunk, i) { return <ChunkMenu key={i} cells={chunk.cells} coords={chunk.coords} />; })} </div> ); } } ChunkRow.defaultProps = { chunks: [], offset: "" }
src/interface/Portal.js
ronaldpereira/WoWAnalyzer
import React from 'react'; import ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; import PortalTarget from './PortalTarget'; class Portal extends React.PureComponent { static propTypes = { children: PropTypes.node.isRequired, }; state = { elem: null, }; componentDidMount() { this.setState({ elem: PortalTarget.newElement(), }); } componentWillUnmount() { PortalTarget.remove(this.state.elem); } render() { if (!this.state.elem) { return null; } return ReactDOM.createPortal( this.props.children, this.state.elem, ); } } export default Portal;
src/svg-icons/maps/flight.js
frnk94/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let MapsFlight = (props) => ( <SvgIcon {...props}> <path d="M10.18 9"/><path d="M21 16v-2l-8-5V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5l8 2.5z"/> </SvgIcon> ); MapsFlight = pure(MapsFlight); MapsFlight.displayName = 'MapsFlight'; MapsFlight.muiName = 'SvgIcon'; export default MapsFlight;
src/screen/ScreenPreviewer.js
RoyalIcing/gateau
import R from 'ramda' import React from 'react' import seeds, { Seed } from 'react-seeds' import Frame from 'react-frame-component' import Button from '../ui/Button' import Choice from '../ui/Choice' import * as stylers from '../stylers' import destinations from '../destinations' const catchRenderErrors = false const iframeStyler = seeds({ height: 600, border: 'none' }) function DestinationChoice({ destinationID, destinationDevice, destinations, onChange, onPhoneDestination, onFullDestination }) { const items = R.pipe( R.toPairs, R.map(R.converge(R.merge, [ R.pipe( R.prop(0), R.objOf('value') ), R.pipe( R.prop(1), R.pick(['title']) ) ])) )(destinations) return ( <Seed row width='100%'> <Choice value={ destinationID } items={ items } width='100%' minHeight={ 32 } grow={ 1 } border='none' //maxWidth='20em' onChange={ onChange } styler={ stylers.masterButton } /> <Button onClick={ onPhoneDestination } children='Phone' selected={ destinationDevice == 'phone' } styler={ stylers.masterButton } /> <Button onClick={ onFullDestination } children='Full' selected={ destinationDevice == 'full' } styler={ stylers.masterButton } /> </Seed> ) } export default function PreviewSection({ contentTree, ingredients, destinationID, destinationDevice, onChangeDestination, onPhoneDestination, onFullDestination }) { const { head: renderHead, Preview } = destinations[destinationID] return ( <Seed column alignItems='center' { ...stylers.previewColumn({ destinationDevice }) } > <Seed key={ destinationID } column grow={ 1 } width='100%' > { !!contentTree ? ( false ? ( R.tryCatch( (contentTree) => ( <Preview ingredients={ ingredients } contentTree={ contentTree } /> ), (error, contentTree) => console.error('Invalid tree', error, contentTree) )(contentTree) ) : ( <Frame head={ renderHead() } { ...iframeStyler } > <Preview ingredients={ ingredients } contentTree={ contentTree } /> </Frame> ) ) : null } </Seed> <DestinationChoice destinationID={ destinationID } destinationDevice={ destinationDevice } destinations={ destinations } onChange={ onChangeDestination } onPhoneDestination={ onPhoneDestination } onFullDestination={ onFullDestination } /> </Seed> ) }
src/routes/contact/index.js
mcfa77y/isla_de_pescua
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-2016 Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React from 'react'; import Contact from './Contact'; export const path = '/contact'; export const action = async (state) => { const title = 'Contact Us'; state.context.onSetTitle(title); return <Contact title={title} />; };
webclient/home/index.js
souravDutta123/Cognitive-Assistant
import Introduction from './introduction.js'; import Navbar from './navBar.js'; import React from 'react'; import Paper from 'material-ui/Paper'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; const styles = { }; export {Introduction,Navbar} ;
cms/cms.js
GeniusWigga/irmua
import React from 'react' import CMS from 'netlify-cms' // CMS.registerPreviewStyle('/styles.css') // CMS.registerPreviewTemplate('blog', BlogPostPreview)
src/renderer/components/Frame/FrameControls.js
MovieCast/moviecast-desktop
import { remote } from 'electron'; import React, { Component } from 'react'; import classNames from 'classnames'; import PropTypes from 'prop-types'; import { withStyles } from '@material-ui/core/styles'; import Typography from '@material-ui/core/Typography'; import Minimize from './Controls/Minimize'; import Maximize from './Controls/Maximize'; import Close from './Controls/Close'; const styles = theme => ({ root: { WebkitAppRegion: 'drag', height: 23, width: '100%', backgroundColor: theme.palette.primary[800], display: 'flex', alignItems: 'center', paddingLeft: 10, flex: '0 0 auto' }, resizeBar: { WebkitAppRegion: 'no-drag', position: 'absolute', height: 3, width: '100%', top: 0, left: 0 }, title: { flexGrow: 1, }, controls: { height: '100%', display: 'flex' }, controlButton: { WebkitAppRegion: 'no-drag', height: '100%', width: 45, '&.svg': { display: 'block' }, '&:hover': { backgroundColor: 'rgba(255,255,255, 0.1)' }, '&:last-of-type': { '&:hover': { backgroundColor: '#dd3333' } } }, }); class FrameControls extends Component { render() { const { classes, electron, minimize, maximize, close } = this.props; return ( <div className={classes.root}> <div className={classes.resizeBar} /> <Typography className={classes.title}>{this.props.title}</Typography> <div className={classes.controls}> <div role="presentation" onClick={minimize} className={classes.controlButton}> <Minimize /> </div> <div role="presentation" onClick={maximize} className={classes.controlButton}> <Maximize isMaximized={electron.maximized} /> </div> <div role="presentation" onClick={close} className={classes.controlButton}> <Close /> </div> </div> </div> ); } } /* eslint-disable react/forbid-prop-types */ FrameControls.propTypes = { classes: PropTypes.object.isRequired, transparent: PropTypes.bool, visible: PropTypes.bool }; /* eslint-enable react/forbid-prop-types */ FrameControls.defaultProps = { transparent: false, visible: true }; export default withStyles(styles)(FrameControls);
ui/js/layout.js
beni55/spigo
'use strict'; import React from 'react'; import Header from 'header'; export default React.createClass({ render () { return ( <section id="app"> <Header /> {this.props.children} </section> ); } });
app/components/Github/Repos.js
joshuar500/repository-notes
import React from 'react'; class Repos extends React.Component { render(){ var repos = this.props.repos.map(function(repo, index){ // funny way to do if then statement with && return ( <li className="list-group-item" key={index}> {repo.html_url && <h4><a href="repo.html_url">{repo.name}</a></h4>} {repo.description && <p>{repo.description}</p>} </li> ) }) return ( <div> <h3>User Repos</h3> <ul className="list-group"> {repos} </ul> </div> ) } } Repos.propTypes = { username: React.PropTypes.string.isRequired, repos: React.PropTypes.array.isRequired } export default Repos;
templates/rubix/demo/src/routes/Messengerjs.js
jeffthemaximum/Teachers-Dont-Pay-Jeff
import React from 'react'; import { Row, Col, Grid, Panel, Table, Button, PanelBody, PanelHeader, PanelContainer, } from '@sketchpixy/rubix'; export default class Messengerjs extends React.Component { componentDidMount() { // configuring default options for Messenger Messenger.options = { theme: 'flat' }; } basicNotification() { Messenger().post('Absolutely basic notification'); } errorNotification() { Messenger().post({ id: 'error', type: 'error', singleton: true, message: 'Whoops! we encountered an error!', showCloseButton: true }); } infoNotification() { Messenger().post({ id: 'info', type: 'info', singleton: true, message: 'Just send us a mail at <a href="mailto:[email protected]">[email protected]</a> if you have any queries!', showCloseButton: true }); } successNotification() { Messenger().post({ id: 'success', type: 'success', singleton: false, message: 'Congratulations! You are now a registered Rubixian!', showCloseButton: true }); } updatingNotification() { var msg = Messenger().post({ id: 'info2', type: 'info', singleton: false, message: 'Please wait while we process your request', showCloseButton: true }); setTimeout(function() { msg.update({ type: 'error', message: 'Whoops! we encountered an error!' }); }, 5000); } actionNotification() { var msg; msg = Messenger().post({ message: 'Launching thermonuclear war...', type: 'info', actions: { cancel: { label: 'cancel launch', action:() => { return msg.update({ message: 'Thermonuclear war averted', type: 'success', actions: false }); } } } }); } actionRetryNotification() { var msg; msg = Messenger().post({ message: "This is your last chance. After this, there is no turning back. You take the blue pill—the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill—you stay in Wonderland, and I show you how deep the rabbit hole goes. Remember, all I'm offering is the truth—nothing more.", singleton: false, id: 'neo', hideAfter: 10000000000, actions: { blue: { label: 'take blue pill', action: () => { return msg.update({ message: 'Welcome to the Matrix!', type: 'success', hideAfter: 5, actions: false }); } }, red: { label: 'take red pill', action: () => { return msg.update({ message: 'We will wait for a newer and better version of yourself! Until then goodbye and good luck Neo!', type: 'error', hideAfter: 5, actions: false }); } } } }); } notificationDirection(dir1, dir2) { var classes = 'messenger-fixed'; if(typeof dir1 === 'string') classes += ' messenger-on-'+dir1+' '; if(typeof dir2 === 'string') classes += ' messenger-on-'+dir2+' '; classes = classes.trim(); Messenger({ extraClasses: classes }).post({ singleton: false, showCloseButton: true, id: 'messenger-layout', message: classes }); } render() { return ( <Row> <Col sm={12}> <PanelContainer> <PanelHeader className='bg-blue fg-white'> <Grid> <Row> <Col xs={12}> <h3>HubSpot Messenger : Powerful Growl-like notification system</h3> </Col> </Row> </Grid> </PanelHeader> <PanelBody> <Grid> <Row> <Col xs={12}> <Table bordered striped> <thead> <tr> <th>Type</th> <th className='text-right'>Call to action</th> </tr> </thead> <tbody> <tr> <td> <div>Basic notification</div> <ul> <li>Timeout after 10 seconds (default)</li> <li>Fixed at bottom-right (default)</li> </ul> </td> <td className='text-right'> <Button outlined onClick={::this.basicNotification}> Trigger basic </Button> </td> </tr> <tr> <td> <div>Info and Error notification</div> <ul> <li>Includes a close button</li> <li>Singleton (triggered only once)</li> </ul> </td> <td className='text-right'> <Button bsStyle='info' outlined onClick={::this.infoNotification}> Trigger info </Button>{' '} <Button bsStyle='danger' outlined onClick={::this.errorNotification}> Trigger error </Button> </td> </tr> <tr> <td> <div>Success notification</div> <ul> <li>Includes a close button</li> <li>Triggers only 1 notification at a time</li> </ul> </td> <td className='text-right'> <Button bsStyle='success' outlined onClick={::this.successNotification}> Trigger success </Button> </td> </tr> <tr> <td> <div>Updating notification</div> <ul> <li>Changes notification message after specified duration (5 seconds)</li> <li>Changes state from info to error</li> <li>Triggers only 1 notification at a time</li> </ul> </td> <td className='text-right'> <Button bsStyle='darkgreen45' outlined onClick={::this.updatingNotification}> Trigger notification </Button> </td> </tr> <tr> <td> <div>Taking actions</div> </td> <td className='text-right'> <Button bsStyle='purple' outlined onClick={::this.actionNotification}> Trigger launch </Button> </td> </tr> <tr> <td> <div>Taking actions [custom buttons]</div> </td> <td className='text-right'> <Button bsStyle='desaturateddarkblue' outlined onClick={::this.actionRetryNotification}> Make a choice Neo! </Button> </td> </tr> </tbody> </Table> </Col> </Row> </Grid> </PanelBody> </PanelContainer> <PanelContainer> <PanelHeader className='bg-darkgreen45 fg-white'> <Grid> <Row> <Col xs={12}> <h3>Notification layout</h3> </Col> </Row> </Grid> </PanelHeader> <PanelBody> <Grid> <Row> <Col xs={12}> <Table bordered> <tbody> <tr> <td> <Button bsStyle='green' outlined onClick={this.notificationDirection.bind(this, 'top', 'left')}> Top Left </Button> </td> <td className='text-center'> <Button bsStyle='green' outlined onClick={this.notificationDirection.bind(this, 'top')}> Top </Button> </td> <td className='text-right'> <Button bsStyle='green' outlined onClick={this.notificationDirection.bind(this, 'top', 'right')}> Top Right </Button> </td> </tr> <tr> <td> <Button bsStyle='green' outlined onClick={this.notificationDirection.bind(this, 'bottom', 'left')}> Bottom Left </Button> </td> <td className='text-center'> <Button bsStyle='green' outlined onClick={this.notificationDirection.bind(this, 'bottom')}> Bottom </Button> </td> <td className='text-right'> <Button bsStyle='green' outlined onClick={this.notificationDirection.bind(this, 'bottom', 'right')}> Bottom Right </Button> </td> </tr> </tbody> </Table> </Col> </Row> </Grid> </PanelBody> </PanelContainer> </Col> </Row> ); } }
public/js/cat_source/es6/components/segments/Segment.js
Ostico/MateCat
/** /** * React Component for the editarea. */ import SegmentCommentsContainer from './SegmentCommentsContainer' import SegmentsCommentsIcon from './SegmentsCommentsIcon' import React from 'react' import SegmentStore from '../../stores/SegmentStore' import SegmentActions from '../../actions/SegmentActions' import SegmentConstants from '../../constants/SegmentConstants' import SegmentHeader from './SegmentHeader' import SegmentFooter from './SegmentFooter' import IssuesContainer from './footer-tab-issues/SegmentFooterTabIssues' import ReviewExtendedPanel from '../review_extended/ReviewExtendedPanel' import TagUtils from '../../utils/tagUtils' import SegmentUtils from '../../utils/segmentUtils' import SegmentFilter from '../header/cattol/segment_filter/segment_filter' import Speech2Text from '../../utils/speech2text' import CommentsStore from '../../stores/CommentsStore' import Immutable from 'immutable' class Segment extends React.Component { constructor(props) { super(props) this.segmentStatus = { approved: 'APPROVED', translated: 'TRANSLATED', draft: 'DRAFT', new: 'NEW', rejected: 'REJECTED', } this.reviewExtendedFooter = 'extended-footer' this.createSegmentClasses = this.createSegmentClasses.bind(this) this.hightlightEditarea = this.hightlightEditarea.bind(this) this.addClass = this.addClass.bind(this) this.removeClass = this.removeClass.bind(this) this.setAsAutopropagated = this.setAsAutopropagated.bind(this) this.setSegmentStatus = this.setSegmentStatus.bind(this) this.handleChangeBulk = this.handleChangeBulk.bind(this) this.openSegment = this.openSegment.bind(this) this.openSegmentFromAction = this.openSegmentFromAction.bind(this) this.checkIfCanOpenSegment = this.checkIfCanOpenSegment.bind(this) this.handleKeyDown = this.handleKeyDown.bind(this) this.forceUpdateSegment = this.forceUpdateSegment.bind(this) let readonly = UI.isReadonlySegment(this.props.segment) this.secondPassLocked = this.props.segment.status.toUpperCase() === this.segmentStatus.approved && this.props.segment.revision_number === 2 && config.revisionNumber !== 2 this.state = { segment_classes: [], autopropagated: this.props.segment.autopropagated_from != 0, unlocked: SegmentUtils.isUnlockedSegment(this.props.segment), readonly: readonly, inBulk: false, tagProjectionEnabled: this.props.enableTagProjection && (this.props.segment.status.toLowerCase() === 'draft' || this.props.segment.status.toLowerCase() === 'new') && !TagUtils.checkXliffTagsInText(this.props.segment.translation) && TagUtils.removeAllTags(this.props.segment.segment) !== '', selectedTextObj: null, showActions: false, } this.timeoutScroll } openSegment() { if (!this.$section.length) return if (!this.checkIfCanOpenSegment()) { if (UI.projectStats && UI.projectStats.TRANSLATED_PERC_FORMATTED === 0) { alertNoTranslatedSegments() } else { alertNotTranslatedYet(this.props.segment.sid) } } else { if (this.props.segment.translation.length !== 0) { UI.segmentQA(this.$section) } // TODO Remove this block /**************************/ //From EditAreaClick if (UI.warningStopped) { UI.warningStopped = false UI.checkWarnings(false) } // start old cache UI.cacheObjects(this.$section) //end old cache UI.evalNextSegment() $('html').trigger('open') // used by ui.review to open tab Revise in the footer next-unapproved //Used by Segment Filter, Comments, Footer, Review extended setTimeout(() => $(document).trigger('segmentOpened', { segmentId: this.props.segment.original_sid, }), ) /************/ UI.editStart = new Date() SegmentActions.getGlossaryForSegment( this.props.segment.sid, this.props.fid, this.props.segment.segment, ) // window.location.hash = this.props.segment.sid; history.replaceState( null, null, document.location.pathname + '#' + this.props.segment.sid, ) } } openSegmentFromAction(sid) { sid = sid + '' // clearTimeout(this.openSegmentTimeOut); if ( (sid === this.props.segment.sid || (this.props.segment.original_sid === sid && this.props.segment.firstOfSplit)) && !this.props.segment.opened ) { this.openSegment() // this.openSegmentTimeOut = setTimeout( () => { // this.openSegment(); // }); } } createSegmentClasses() { let classes = [] let splitGroup = this.props.segment.split_group || [] let readonly = this.state.readonly if (readonly) { classes.push('readonly') } if ( (this.props.segment.ice_locked === '1' && !readonly) || this.secondPassLocked ) { if (this.props.segment.unlocked) { classes.push('ice-unlocked') } else { classes.push('readonly') classes.push('ice-locked') } } if (this.props.segment.status) { classes.push('status-' + this.props.segment.status.toLowerCase()) } else { classes.push('status-new') } if (this.props.segment.sid == splitGroup[0]) { classes.push('splitStart') } else if (this.props.segment.sid == splitGroup[splitGroup.length - 1]) { classes.push('splitEnd') } else if (splitGroup.length) { classes.push('splitInner') } if (this.state.tagProjectionEnabled && !this.props.segment.tagged) { classes.push('enableTP') this.dataAttrTagged = 'nottagged' } else { this.dataAttrTagged = 'tagged' } if (this.props.segment.edit_area_locked) { classes.push('editAreaLocked') } if (this.props.segment.inBulk) { classes.push('segment-selected-inBulk') } if (this.props.segment.muted) { classes.push('muted') } if ( this.props.segment.status.toUpperCase() === this.segmentStatus.approved && this.props.segment.revision_number ) { classes.push('approved-step-' + this.props.segment.revision_number) } if (this.props.segment.opened && this.checkIfCanOpenSegment()) { classes.push('editor') classes.push('opened') classes.push('shadow-1') } if ( this.props.segment.modified || this.props.segment.autopropagated_from !== '0' ) { classes.push('modified') } if (this.props.sideOpen) { classes.push('slide-right') } if (this.props.segment.openSplit) { classes.push('split-action') } if (this.props.segment.selected) { classes.push('segment-selected') } return classes } hightlightEditarea(sid) { if (this.props.segment.sid == sid) { /* TODO REMOVE THIS CODE * The segment must know about his classes */ let classes = this.state.segment_classes.slice() if (!!classes.indexOf('modified')) { classes.push('modified') this.setState({ segment_classes: classes, }) } } } addClass(sid, newClass) { if ( this.props.segment.sid == sid || sid === -1 || sid.split('-')[0] == this.props.segment.sid ) { let self = this let classes = this.state.segment_classes.slice() if (newClass.indexOf(' ') > 0) { let self = this let classesSplit = newClass.split(' ') _.forEach(classesSplit, function (item) { if (classes.indexOf(item) < 0) { classes.push(item) } }) } else { if (classes.indexOf(newClass) < 0) { classes.push(newClass) } } this.setState({ segment_classes: classes, }) } } removeClass(sid, className) { if ( this.props.segment.sid == sid || sid === -1 || sid.indexOf(this.props.segment.sid) !== -1 ) { let classes = this.state.segment_classes.slice() let removeFn = function (item) { let index = classes.indexOf(item) if (index > -1) { classes.splice(index, 1) } } if (className.indexOf(' ') > 0) { let self = this let classesSplit = className.split(' ') _.forEach(classesSplit, function (item) { removeFn(item) }) } else { removeFn(className) } this.setState({ segment_classes: classes, }) } } setAsAutopropagated(sid, propagation) { if (this.props.segment.sid == sid) { this.setState({ autopropagated: propagation, }) } } setSegmentStatus(sid, status) { if (this.props.segment.sid == sid) { let classes = this.state.segment_classes.slice(0) let index = classes.findIndex(function (item) { return item.indexOf('status-') > -1 }) if (index >= 0) { classes.splice(index, 1) } this.setState({ segment_classes: classes, status: status, }) } } checkSegmentStatus(classes) { if (classes.length === 0) return classes // TODO: remove this //To fix a problem: sometimes the section segment has two different status let statusMatches = classes.join(' ').match(/status-/g) if (statusMatches && statusMatches.length > 1) { let index = classes.findIndex(function (item) { return item.indexOf('status-new') > -1 }) if (index >= 0) { classes.splice(index, 1) } } return classes } isSplitted() { return !_.isUndefined(this.props.segment.split_group) } isFirstOfSplit() { return ( !_.isUndefined(this.props.segment.split_group) && this.props.segment.split_group.indexOf(this.props.segment.sid) === 0 ) } getTranslationIssues() { if ( ((this.props.sideOpen && (!this.props.segment.opened || !this.props.segment.openIssues)) || !this.props.sideOpen) && !(this.props.segment.readonly === 'true') && (!this.isSplitted() || (this.isSplitted() && this.isFirstOfSplit())) ) { return ( <TranslationIssuesSideButton sid={this.props.segment.sid.split('-')[0]} reviewType={this.props.reviewType} segment={this.props.segment} open={this.props.segment.openIssues} /> ) } return null } lockUnlockSegment(event) { event.preventDefault() event.stopPropagation() if ( !this.props.segment.unlocked && config.revisionNumber !== 2 && this.props.segment.revision_number === 2 ) { var props = { text: 'You are about to edit a segment that has been approved in the 2nd pass review. The project owner and 2nd pass reviser will be notified.', successText: 'Ok', successCallback: function () { APP.ModalWindow.onCloseModal() }, } APP.ModalWindow.showModalComponent( ConfirmMessageModal, props, 'Modify locked and approved segment ', ) } SegmentActions.setSegmentLocked( this.props.segment, this.props.fid, !this.props.segment.unlocked, ) } checkSegmentClasses() { let classes = this.state.segment_classes.slice() classes = _.union(classes, this.createSegmentClasses()) classes = this.checkSegmentStatus(classes) if (classes.indexOf('muted') > -1 && classes.indexOf('editor') > -1) { let indexEditor = classes.indexOf('editor') classes.splice(indexEditor, 1) let indexOpened = classes.indexOf('opened') classes.splice(indexOpened, 1) } return classes } handleChangeBulk(event) { event.stopPropagation() if (event.shiftKey) { this.props.setBulkSelection(this.props.segment.sid, this.props.fid) } else { SegmentActions.toggleSegmentOnBulk(this.props.segment.sid, this.props.fid) this.props.setLastSelectedSegment(this.props.segment.sid, this.props.fid) } } openRevisionPanel = (data) => { if ( parseInt(data.sid) === parseInt(this.props.segment.sid) && (this.props.segment.ice_locked == 0 || (this.props.segment.ice_locked == 1 && this.props.segment.unlocked)) ) { this.setState({ selectedTextObj: data.selection, }) } else { this.setState({ selectedTextObj: null, }) } } removeSelection = () => { var selection = document.getSelection() if (this.section.contains(selection.anchorNode)) { selection.removeAllRanges() } this.setState({ selectedTextObj: null, }) } checkIfCanOpenSegment() { return ( (this.props.isReview && !(this.props.segment.status == 'NEW') && !(this.props.segment.status == 'DRAFT')) || !this.props.isReview ) } onClickEvent(event) { if ( this.state.readonly || (!this.props.segment.unlocked && this.props.segment.ice_locked === '1') ) { UI.handleClickOnReadOnly($(event.currentTarget).closest('section')) } else if (this.props.segment.muted) { return } else if (!this.props.segment.opened) { this.openSegment() SegmentActions.setOpenSegment(this.props.segment.sid, this.props.fid) } } handleKeyDown(event) { if (event.code === 'Escape') { if ( this.props.segment.opened && !this.props.segment.openComments && !this.props.segment.openIssues && !UI.body.hasClass('search-open') && !UI.tagMenuOpen ) { if (!this.props.segment.openSplit) { SegmentActions.closeSegment(this.props.segment.sid) } else { SegmentActions.closeSplitSegment() } } else if (this.props.segment.openComments) { SegmentActions.closeSegmentComment() localStorage.setItem(MBC.localStorageCommentsClosed, true) } else if (this.props.segment.openIssues) { SegmentActions.closeIssuesPanel() } } } forceUpdateSegment(sid) { if (this.props.segment.sid === sid) { this.forceUpdate() } } allowHTML(string) { return {__html: string} } componentDidMount() { this.$section = $(this.section) document.addEventListener('keydown', this.handleKeyDown) SegmentStore.addListener(SegmentConstants.ADD_SEGMENT_CLASS, this.addClass) SegmentStore.addListener( SegmentConstants.REMOVE_SEGMENT_CLASS, this.removeClass, ) SegmentStore.addListener( SegmentConstants.SET_SEGMENT_PROPAGATION, this.setAsAutopropagated, ) SegmentStore.addListener( SegmentConstants.SET_SEGMENT_STATUS, this.setSegmentStatus, ) SegmentStore.addListener( SegmentConstants.OPEN_SEGMENT, this.openSegmentFromAction, ) SegmentStore.addListener( SegmentConstants.FORCE_UPDATE_SEGMENT, this.forceUpdateSegment, ) //Review SegmentStore.addListener( SegmentConstants.OPEN_ISSUES_PANEL, this.openRevisionPanel, ) if (this.props.segment.opened) { setTimeout(() => { this.openSegment() Speech2Text.enabled() && Speech2Text.enableMicrophone(this.$section) }) setTimeout(() => { UI.setCurrentSegment() }, 0) } } componentWillUnmount() { document.removeEventListener('keydown', this.handleKeyDown) SegmentStore.removeListener( SegmentConstants.ADD_SEGMENT_CLASS, this.addClass, ) SegmentStore.removeListener( SegmentConstants.REMOVE_SEGMENT_CLASS, this.removeClass, ) SegmentStore.removeListener( SegmentConstants.SET_SEGMENT_PROPAGATION, this.setAsAutopropagated, ) SegmentStore.removeListener( SegmentConstants.SET_SEGMENT_STATUS, this.setSegmentStatus, ) SegmentStore.removeListener( SegmentConstants.OPEN_SEGMENT, this.openSegmentFromAction, ) SegmentStore.removeListener( SegmentConstants.FORCE_UPDATE_SEGMENT, this.forceUpdateSegment, ) //Review SegmentStore.removeListener( SegmentConstants.OPEN_ISSUES_PANEL, this.openRevisionPanel, ) } shouldComponentUpdate(nextProps, nextState) { return ( !nextProps.segImmutable.equals(this.props.segImmutable) || !Immutable.fromJS(nextState.segment_classes).equals( Immutable.fromJS(this.state.segment_classes), ) || nextState.autopropagated !== this.state.autopropagated || nextState.readonly !== this.state.readonly || nextState.selectedTextObj !== this.state.selectedTextObj || nextProps.sideOpen !== this.props.sideOpen || nextState.showActions !== this.state.showActions ) } getSnapshotBeforeUpdate(prevProps, prevState) { if (!prevProps.segment.opened && this.props.segment.opened) { this.timeoutScroll = setTimeout(() => { SegmentActions.scrollToSegment(this.props.segment.sid) }, 200) setTimeout(() => { UI.setCurrentSegment() }, 0) setTimeout(() => { if ( this.props.segment.opened && !config.isReview && !SegmentStore.segmentHasIssues(this.props.segment.sid) ) { SegmentActions.closeSegmentIssuePanel(this.props.segment.sid) } if (this.props.segment.opened && !this.props.segment.openComments) { SegmentActions.closeSegmentComment(this.props.segment.sid) } Speech2Text.enabled() && Speech2Text.enableMicrophone(this.$section) }) } else if (prevProps.segment.opened && !this.props.segment.opened) { clearTimeout(this.timeoutScroll) setTimeout(() => { SegmentActions.saveSegmentBeforeClose(this.props.segment) }) } return null } componentDidUpdate() {} render() { let job_marker = '' let timeToEdit = '' let readonly = this.state.readonly let showLockIcon = this.props.segment.ice_locked === '1' || this.secondPassLocked let segment_classes = this.checkSegmentClasses() let split_group = this.props.segment.split_group || [] let autoPropagable = this.props.segment.repetitions_in_chunk !== '1' let originalId = this.props.segment.sid.split('-')[0] if (this.props.timeToEdit) { this.segment_edit_min = this.props.segment.parsed_time_to_edit[1] this.segment_edit_sec = this.props.segment.parsed_time_to_edit[2] } if (this.props.timeToEdit) { timeToEdit = <span className="edit-min">{this.segment_edit_min}</span> + 'm' + <span className="edit-sec">{this.segment_edit_sec}</span> + 's' } let translationIssues = this.getTranslationIssues() let locked = !this.props.segment.unlocked && (this.props.segment.ice_locked === '1' || this.secondPassLocked) const segmentHasIssues = SegmentStore.segmentHasIssues( this.props.segment.sid, ) return ( <section ref={(section) => (this.section = section)} id={'segment-' + this.props.segment.sid} className={segment_classes.join(' ')} data-hash={this.props.segment.segment_hash} data-autopropagated={this.state.autopropagated} data-propagable={autoPropagable} data-version={this.props.segment.version} data-split-group={split_group} data-split-original-id={originalId} data-tagmode="crunched" data-tagprojection={this.dataAttrTagged} onClick={this.onClickEvent.bind(this)} data-fid={this.props.segment.id_file} data-modified={this.props.segment.modified} > <div className="sid" title={this.props.segment.sid}> <div className="txt">{this.props.segment.sid}</div> {showLockIcon ? ( !readonly ? ( this.props.segment.unlocked ? ( <div className="ice-locked-icon" onClick={this.lockUnlockSegment.bind(this)} > <button className="unlock-button unlocked icon-unlocked3" /> </div> ) : ( <div className="ice-locked-icon" onClick={this.lockUnlockSegment.bind(this)} > <button className="icon-lock unlock-button locked" /> </div> ) ) : null ) : null} <div className="txt segment-add-inBulk"> <input type="checkbox" ref={(node) => (this.bulk = node)} checked={this.props.segment.inBulk} onClick={this.handleChangeBulk} /> </div> {this.props.segment.ice_locked !== '1' && config.splitSegmentEnabled && this.props.segment.opened ? ( !this.props.segment.openSplit ? ( <div className="actions"> <button className="split" title="Click to split segment" onClick={() => SegmentActions.openSplitSegment(this.props.segment.sid) } > <i className="icon-split" /> </button> <p className="split-shortcut">CTRL + S</p> </div> ) : ( <div className="actions"> <button className="split cancel" title="Click to close split segment" onClick={() => SegmentActions.closeSplitSegment()} > <i className="icon-split" /> </button> {/*<p className="split-shortcut">CTRL + W</p>*/} </div> ) ) : null} </div> {job_marker} <div className="body"> <SegmentHeader sid={this.props.segment.sid} autopropagated={this.state.autopropagated} segmentOpened={this.props.segment.opened} repetition={autoPropagable} /> <SegmentBody segment={this.props.segment} segImmutable={this.props.segImmutable} readonly={this.state.readonly} tagModesEnabled={this.props.tagModesEnabled} speech2textEnabledFn={this.props.speech2textEnabledFn} enableTagProjection={ this.props.enableTagProjection && !this.props.segment.tagged } locked={locked} removeSelection={this.removeSelection.bind(this)} openSegment={this.openSegment} isReview={this.props.isReview} isReviewExtended={this.props.isReviewExtended} reviewType={this.props.reviewType} isReviewImproved={this.props.isReviewImproved} /> <div className="timetoedit" data-raw-time-to-edit={this.props.segment.time_to_edit} > {timeToEdit} </div> {SegmentFilter && SegmentFilter.enabled() ? ( <div className="edit-distance"> Edit Distance: {this.props.segment.edit_distance} </div> ) : null} {config.isReview && this.props.reviewType === this.reviewExtendedFooter ? ( <IssuesContainer segment={this.props.segment} sid={this.props.segment.sid} /> ) : null} {this.props.segment.opened ? ( <SegmentFooter segment={this.props.segment} sid={this.props.segment.sid} fid={this.props.fid} /> ) : null} </div> {/*//!-- TODO: place this element here only if it's not a split --*/} <div className="segment-side-buttons"> {config.comments_enabled && (!this.props.segment.openComments || !this.props.segment.opened) ? ( <SegmentsCommentsIcon {...this.props} /> ) : null} <div data-mount="translation-issues-button" className="translation-issues-button" data-sid={this.props.segment.sid} > {translationIssues} </div> </div> <div className="segment-side-container"> {config.comments_enabled && this.props.segment.openComments && this.props.segment.opened ? ( <SegmentCommentsContainer {...this.props} /> ) : null} {this.props.isReviewExtended && this.props.segment.openIssues && this.props.segment.opened && (config.isReview || (!config.isReview && segmentHasIssues)) ? ( <div className="review-balloon-container"> {!this.props.segment.versions ? null : ( <ReviewExtendedPanel reviewType={this.props.reviewType} segment={this.props.segment} sid={this.props.segment.sid} isReview={config.isReview} selectionObj={this.state.selectedTextObj} removeSelection={this.removeSelection.bind(this)} /> )} </div> ) : null} </div> </section> ) } } export default Segment
src/js/pages/AnswerQuestionPage.js
nekuno/client
import PropTypes from 'prop-types'; import React, { Component } from 'react'; import selectn from 'selectn'; import TopNavBar from "../components/TopNavBar/TopNavBar"; import AnswerQuestion from '../components/questions/AnswerQuestion'; import AuthenticatedComponent from '../components/AuthenticatedComponent'; import translate from '../i18n/Translate'; import tutorial from '../components/tutorial/Tutorial'; import connectToStores from '../utils/connectToStores'; import * as QuestionActionCreators from '../actions/QuestionActionCreators'; import RouterActionCreators from '../actions/RouterActionCreators'; import UserStore from '../stores/UserStore'; import QuestionStore from '../stores/QuestionStore'; import Joyride from 'react-joyride'; import '../../scss/pages/answer/answer-next-question.scss'; import RegisterQuestionsFinishedPopup from "../components/questions/RegisterQuestionsFinishedPopup"; function parseId(user) { return user.id; } /** * Requests data from server (or store) for current props. */ function requestData(props) { const {user, params} = props; const questionId = params.hasOwnProperty('questionId') ? parseInt(params.questionId) : null; const currentUserId = parseId(user); QuestionActionCreators.requestQuestion(currentUserId, questionId); } /** * Retrieves state from stores for current props. */ function getState(props) { const {user, params} = props; const currentUserId = parseId(user); const currentUser = UserStore.get(currentUserId); const question = QuestionStore.getQuestion(); const questionId = parseInt(params.questionId); const from = params.from; const userAnswer = questionId ? QuestionStore.getUserAnswer(currentUserId, questionId) : {}; const errors = QuestionStore.getErrors(); const noMoreQuestions = QuestionStore.noMoreQuestions(); const isLoadingOwnQuestions = QuestionStore.isLoadingOwnQuestions(); const goToQuestionStats = QuestionStore.mustGoToQuestionStats(); return { currentUser, question, from, userAnswer, user, errors, noMoreQuestions, isLoadingOwnQuestions, goToQuestionStats }; } @AuthenticatedComponent @translate('AnswerQuestionPage') @tutorial() @connectToStores([UserStore, QuestionStore], getState) export default class AnswerQuestionPage extends Component { static propTypes = { // Injected by React Router: params : PropTypes.shape({ questionId: PropTypes.string, from : PropTypes.string }), // Injected by @AuthenticatedComponent user : PropTypes.object.isRequired, // Injected by @translate: strings : PropTypes.object, // Injected by @tutorial: steps : PropTypes.array, startTutorial : PropTypes.func, endTutorialHandler : PropTypes.func, tutorialLocale : PropTypes.object, joyrideRunning : PropTypes.bool, // Injected by @connectToStores: question : PropTypes.object, userAnswer : PropTypes.object, errors : PropTypes.string, isLoadingOwnQuestions : PropTypes.bool, noMoreQuestions : PropTypes.bool, goToQuestionStats : PropTypes.bool }; constructor(props) { super(props); this.skipQuestionHandler = this.skipQuestionHandler.bind(this); this.forceStartTutorial = this.forceStartTutorial.bind(this); } componentDidMount() { const questionId = this.props.params.questionId; if(!this.props.question || this.props.question.questionId !== questionId) { window.setTimeout(() => requestData(this.props), 0); } } componentDidUpdate() { const {goToQuestionStats, question, from} = this.props; if (goToQuestionStats) { setTimeout(() => { RouterActionCreators.replaceRoute(`/question-stats/${from}`); }, 0); } } componentWillUnmount() { this.joyride.reset(); } skipQuestionHandler() { const {user, question, params} = this.props; let userId = parseId(user); let questionId = question.questionId; QuestionActionCreators.skipQuestion(userId, questionId); if (user.slug === params.from) { window.setTimeout(RouterActionCreators.replaceRoute(`/questions`), 0); } else { window.setTimeout(RouterActionCreators.replaceRoute(`/users/${params.from}/other-questions`), 0); } } forceStartTutorial() { this.joyride.reset(true); } render() { const {user, strings, errors, noMoreQuestions, isLoadingOwnQuestions, userAnswer, question, steps, tutorialLocale, endTutorialHandler, joyrideRunning} = this.props; const userId = parseId(user); const ownPicture = user.photo ? user.photo.thumbnail.small : 'img/no-img/small.jpg'; const isRegisterQuestion = selectn('isRegisterQuestion', question); return ( <div className="answer-next-question-page"> <TopNavBar background={'FFFFFF'} iconLeft={'arrow-left'} textCenter={strings.topNavBarText} textSize={'small'} //onLeftLinkClickHandler={this.topNavBarLeftLinkClick} /> {/*{isJustRegistered ?*/} {/*<TopNavBar centerText={navBarTitle}/>*/} {/*:*/} {/*<TopNavBar leftIcon={'left-arrow'} centerText={navBarTitle} rightText={isRegisterQuestion ? '' : strings.skip} onRightLinkClickHandler={isRegisterQuestion ? null : this.skipQuestionHandler}/>*/} {/*}*/} <div className="answer-next-question-page-wrapper"> <Joyride ref={c => this.joyride = c} steps={steps} locale={tutorialLocale} callback={endTutorialHandler} type="continuous" run={joyrideRunning} autoStart={true}/> <div className=""> <div id="page-content" className="answer-question-content"> <AnswerQuestion question={question} userAnswer={userAnswer} userId={userId} errors={errors} noMoreQuestions={noMoreQuestions} ownPicture={ownPicture} startTutorial={this.forceStartTutorial} isLoadingOwnQuestions={isLoadingOwnQuestions}/> </div> </div> <RegisterQuestionsFinishedPopup onContinue={this.onContinue} onClose={this.onClosePopup} contentRef={this.props.popupContentRef}/> </div> <div className="skip-nav-bar" onClick={this.skipQuestionHandler}> <div className="text">Omitir <span className="icon icon-arrow-right"/></div> </div> </div> ); } } AnswerQuestionPage.defaultProps = { strings: { topNavBarText : 'Personality test', question : 'Question', skip : 'Skip', tutorialFirstStepTitle : 'Your answer', tutorialFirstStep : 'This is your answer to the above question.', tutorialSecondStepTitle: 'Others answers', tutorialSecondStep : 'Here you choose what other person should answer to be compatible with you; you can choose more than one answer.', tutorialThirdStepTitle : 'Importance', tutorialThirdStep : 'This will be the question`s importance when making compatibility calculations.' }, steps: [ { titleRef: 'tutorialFirstStepTitle', textRef: 'tutorialFirstStep', selector: '#joyride-1-your-answer', position: 'bottom', }, { titleRef: 'tutorialSecondStepTitle', textRef: 'tutorialSecondStep', selector: '#joyride-2-others-answers', position: 'bottom', }, { titleRef: 'tutorialThirdStepTitle', textRef: 'tutorialThirdStep', selector: '#joyride-3-answer-importance', position: 'top', } ] };
actor-apps/app-web/src/app/components/modals/AppCacheUpdate.react.js
akingyin1987/actor-platform
import React from 'react'; import Modal from 'react-modal'; //import pureRender from 'pure-render-decorator'; import { Styles, FlatButton } from 'material-ui'; import AppCacheStore from 'stores/AppCacheStore'; import AppCacheActionCreators from 'actions/AppCacheActionCreators'; import { KeyCodes } from 'constants/ActorAppConstants'; import ActorTheme from 'constants/ActorTheme'; const ThemeManager = new Styles.ThemeManager(); const appElement = document.getElementById('actor-web-app'); Modal.setAppElement(appElement); const getStateFromStores = () => { return { isShown: AppCacheStore.isModalOpen() }; }; class AddContact extends React.Component { static childContextTypes = { muiTheme: React.PropTypes.object }; getChildContext() { return { muiTheme: ThemeManager.getCurrentTheme() }; } constructor(props) { super(props); this.state = getStateFromStores(); AppCacheStore.addChangeListener(this.onChange); document.addEventListener('keydown', this.onKeyDown, false); ThemeManager.setTheme(ActorTheme); } componentWillUnmount() { AppCacheStore.removeChangeListener(this.onChange); document.removeEventListener('keydown', this.onKeyDown, false); } render() { return ( <Modal className="modal-new modal-new--update" closeTimeoutMS={150} isOpen={this.state.isShown} style={{width: 400}}> <div className="modal-new__body"> <h1>Update available</h1> <h3>New version of Actor Web App available.</h3> <p>It's already downloaded to your browser, you just need to reload tab.</p> </div> <footer className="modal-new__footer text-right"> <FlatButton hoverColor="rgba(74,144,226,.12)" label="Cancel" onClick={this.onClose} secondary={true} /> <FlatButton hoverColor="rgba(74,144,226,.12)" label="Reload" onClick={this.onConfirm} secondary={true} /> </footer> </Modal> ); } onClose = () => { AppCacheActionCreators.closeModal(); } onConfirm = () => { AppCacheActionCreators.confirmUpdate(); } onChange = () => { this.setState(getStateFromStores()); } onKeyDown = (event) => { if (event.keyCode === KeyCodes.ESC) { event.preventDefault(); this.onClose(); } } } export default AddContact;
packages/react-scripts/fixtures/kitchensink/src/features/syntax/ClassProperties.js
mangomint/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, { Component } from 'react'; import PropTypes from 'prop-types'; export default class extends Component { static propTypes = { onReady: PropTypes.func.isRequired, }; users = [ { id: 1, name: '1' }, { id: 2, name: '2' }, { id: 3, name: '3' }, { id: 4, name: '4' }, ]; componentDidMount() { this.props.onReady(); } render() { return ( <div id="feature-class-properties"> {this.users.map(user => ( <div key={user.id}>{user.name}</div> ))} </div> ); } }
admin/client/App/shared/AlertMessages.js
w01fgang/keystone
import React from 'react'; import { Alert } from '../elemental'; import { upcase } from '../../utils/string'; /** * This renders alerts for API success and error responses. * Error format: { * error: 'validation errors' // The unique error type identifier * detail: { ... } // Optional details specific to that error type * } * Success format: { * success: 'item updated', // The unique success type identifier * details: { ... } // Optional details specific to that success type * } * Eventually success and error responses should be handled individually * based on their type. For example: validation errors should be displayed next * to each invalid field and signin errors should promt the user to sign in. */ var AlertMessages = React.createClass({ displayName: 'AlertMessages', propTypes: { alerts: React.PropTypes.shape({ error: React.PropTypes.Object, success: React.PropTypes.Object, }), }, getDefaultProps () { return { alerts: {}, }; }, renderValidationErrors () { let errors = this.props.alerts.error.detail; if (errors.name === 'ValidationError') { errors = errors.errors; } let errorCount = Object.keys(errors).length; let alertContent; let messages = Object.keys(errors).map((path) => { if (errorCount > 1) { return ( <li key={path}> {upcase(errors[path].error || errors[path].message)} </li> ); } else { return ( <div key={path}> {upcase(errors[path].error || errors[path].message)} </div> ); } }); if (errorCount > 1) { alertContent = ( <div> <h4>There were {errorCount} errors creating the new item:</h4> <ul>{messages}</ul> </div> ); } else { alertContent = messages; } return <Alert color="danger">{alertContent}</Alert>; }, render () { let { error, success } = this.props.alerts; if (error) { // Render error alerts switch (error.error) { case 'validation errors': return this.renderValidationErrors(); case 'error': if (error.detail.name === 'ValidationError') { return this.renderValidationErrors(); } else { return <Alert color="danger">{upcase(error.error)}</Alert>; } default: return <Alert color="danger">{upcase(error.error)}</Alert>; } } if (success) { // Render success alerts return <Alert color="success">{upcase(success.success)}</Alert>; } return null; // No alerts, render nothing }, }); module.exports = AlertMessages;
fixtures/dom/src/components/FixtureSet.js
yangshun/react
import React from 'react'; import PropTypes from 'prop-types'; const propTypes = { title: PropTypes.node.isRequired, description: PropTypes.node.isRequired, }; class FixtureSet extends React.Component { render() { const {title, description, children} = this.props; return ( <div> <h1>{title}</h1> {description && <p>{description}</p>} {children} </div> ); } } FixtureSet.propTypes = propTypes; export default FixtureSet;
src/library/validations/components/Select.js
zdizzle6717/universal-react-movie-app
'use strict'; import React from 'react'; import ReactDOM from 'react-dom'; import defaultValidations from '../constants/defaultValidations' import classNames from 'classnames'; import FormActions from '../actions/FormActions'; import FormStore from '../stores/FormStore'; export default class Select extends React.Component { constructor() { super(); this.state = { 'name': null, 'value': null, 'formName': null, 'valid': true, 'initial': true, 'touched': false, 'pristine': true, 'focused': false, 'blurred': false }; this.handleMouseDown = this.handleMouseDown.bind(this); this.handleFocus = this.handleFocus.bind(this); this.handleBlur = this.handleBlur.bind(this); this.validateInit = this.validateInit.bind(this); this.validateInput = this.validateInput.bind(this); } componentDidMount() { this.validateInit(this.props); } // Accounts for initial data check and conditionally required inputs componentWillReceiveProps(nextProps) { if (this.state.initial && this.state.pristine && nextProps.value || this.props.required !== nextProps.required) { this.validateInit(nextProps, true); } } // This will update validation in the case that an input is conditionally visible componentWillUnmount() { if (!this.props.preserveState) { let input = { 'name': this.props.name, 'formName': this.state.formName } setTimeout(() => { FormActions.removeInput(input); }); } } validateInit(props, propsHaveLoaded = false) { let elem = ReactDOM.findDOMNode(this); let formName = elem.closest('.form').getAttribute('name'); let existingInput = propsHaveLoaded ? false : FormStore.getInput(formName, props.name); if (existingInput) { this.setState(existingInput); return; } let validity = props.required ? (props.value ? true : false) : true; let input = { 'name': props.name, 'value': props.value, 'formName': formName, 'valid': validity }; this.setState(input); if (propsHaveLoaded) { input.initial = false; this.setState({ initial: false }) } input = Object.assign(this.state, input); setTimeout(() => { FormActions.addInput(input); }); } validateInput(e) { e.preventDefault(); let validity = this.props.required ? (e.target.value ? true : false) : true; let input = { 'name': e.target.name, 'value': e.target.value, 'valid': validity, 'initial': false, 'pristine': false } input = Object.assign(this.state, input); this.setState(input); FormActions.addInput(input); this.props.handleInputChange(e); } handleMouseDown() { let input = Object.assign(this.state, {'touched': true}); this.setState(input); FormActions.addInput(input); } handleFocus() { let input = Object.assign(this.state, {'focused': true, 'blurred': false}); this.setState(input); FormActions.addInput(input); } handleBlur() { let input = Object.assign(this.state, {'focused': false, 'blurred': true}); this.setState(input); FormActions.addInput(input); } render() { let validationClasses = classNames({ 'valid': this.state.valid, 'invalid': !this.state.valid, 'touched': this.state.touched, 'untouched': !this.state.touched, 'pristine': this.state.pristine, 'focused': this.state.focused, 'blurred': this.state.blurred, 'dirty': !this.state.pristine }); return ( <div className="validate-error-element"> <select className={validationClasses} type={this.props.type} name={this.props.name} value={this.props.value} onChange={this.validateInput} onMouseDown={this.handleMouseDown} onFocus={this.handleFocus} onBlur={this.handleBlur} disabled={this.props.disabled}> {this.props.children} </select> </div> ) } } Select.propTypes = { 'name': React.PropTypes.string.isRequired, 'value': React.PropTypes.string, 'handleInputChange': React.PropTypes.func.isRequired, 'preserveState': React.PropTypes.bool, 'required': React.PropTypes.bool, 'disabled': React.PropTypes.bool } Select.defaultProps = { 'preserveState': false };
client/analytics/components/pages/overview/assetReport/AssetSummary.js
Haaarp/geo
import React from 'react'; import {connect} from 'react-redux'; import FormWrap from 'konux/common/components/FormWrap'; import Block from './../../../partials/Block'; import SingleInfoIndicatorContainer from './../../../partials/indicators/SingleInfoIndicatorContainer'; import { translate } from 'react-i18next'; class AssetSummary extends React.Component { render() { let {t} = this.props; return( <Block> <FormWrap className="summary-wrapper"> <SingleInfoIndicatorContainer title={t('speed')} value={this.props.speed.toFixed(2)} unitOfMeasure="KM/H"/> <SingleInfoIndicatorContainer title={t('load')} value={this.props.load.toFixed(2)} unitOfMeasure="kTons"/> <SingleInfoIndicatorContainer title={t('amount')} value={parseInt(this.props.amount)} unitOfMeasure={t('trains')}/> </FormWrap> </Block> ); } } const stateMap = (state, props, ownProps) => { return { load: props.assetKpiStats && props.assetKpiStats.load ? props.assetKpiStats.load : 0, speed: props.assetKpiStats && props.assetKpiStats.speed ? props.assetKpiStats.speed : 0, amount: props.assetKpiStats && props.assetKpiStats.amount ? props.assetKpiStats.amount : 0 }; }; const ConnectedAssetSummary = connect(stateMap, null)(AssetSummary); export default translate(['common'])(ConnectedAssetSummary);
src/utils/typography.js
mattdell/coinmarketwatch
/* eslint-disable */ import ReactDOM from 'react-dom/server'; import React from 'react'; import Typography from 'typography'; import CodePlugin from 'typography-plugin-code'; import { MOBILE_MEDIA_QUERY } from 'typography-breakpoint-constants'; const options = { baseFontSize: '18px', baseLineHeight: 1.45, scaleRatio: 2.25, plugins: [new CodePlugin()], overrideStyles: ({ rhythm, scale }, options) => ({ [MOBILE_MEDIA_QUERY]: { // Make baseFontSize on mobile 16px. html: { fontSize: `${16 / 16 * 100}%`, }, }, }), }; const typography = new Typography(options); // Hot reload typography in development. if (process.env.NODE_ENV !== 'production') { typography.injectStyles(); } export default typography;
src/pages/resume/components/preface.js
dan9186/danielhess.me
import React from 'react' import styled from 'styled-components' import { Section } from '../../../components/grid' export const Preface = ({ preface }) => ( <Section> <Content>{preface}</Content> </Section> ) const Content = styled.div` display: flex; flex-flow: row wrap; margin-top: ${({ theme }) => theme.spacing(2)}; margin-bottom: ${({ theme }) => theme.spacing(0)}; padding-left: ${({ theme }) => theme.spacing(2)}; `
src/components/Publish/components/type_tabs/index.js
dloa/alexandria-librarian
import React from 'react'; import ExtraDrop from '../drop_zones/extra'; import MusicTab from './music'; export default React.createClass({ getTab(){ switch (this.props.selectedType) { case 'music': return <MusicTab/>; break; } }, render() { return ( <div className="tab-pane fade in active"> {this.getTab()} </div> ); } });
src/svg-icons/editor/border-right.js
owencm/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let EditorBorderRight = (props) => ( <SvgIcon {...props}> <path d="M7 21h2v-2H7v2zM3 5h2V3H3v2zm4 0h2V3H7v2zm0 8h2v-2H7v2zm-4 8h2v-2H3v2zm8 0h2v-2h-2v2zm-8-8h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm8 8h2v-2h-2v2zm4-4h2v-2h-2v2zm4-10v18h2V3h-2zm-4 18h2v-2h-2v2zm0-16h2V3h-2v2zm-4 8h2v-2h-2v2zm0-8h2V3h-2v2zm0 4h2V7h-2v2z"/> </SvgIcon> ); EditorBorderRight = pure(EditorBorderRight); EditorBorderRight.displayName = 'EditorBorderRight'; EditorBorderRight.muiName = 'SvgIcon'; export default EditorBorderRight;
node_modules/react-bootstrap/es/MediaList.js
Technaesthetic/ua-tools
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);
components/spinner/spinner.js
Travix-International/travix-ui-kit
import classnames from 'classnames'; import PropTypes from 'prop-types'; import React from 'react'; import { getClassNamesWithMods, warnAboutDeprecatedProp } from '../_helpers'; /** * General Spinner component. */ function Spinner(props) { warnAboutDeprecatedProp(props.mods, 'mods', 'className'); const { className, size } = props; const mods = props.mods ? props.mods.slice() : []; mods.push(`size_${size}`); const classes = classnames(getClassNamesWithMods('ui-spinner', mods), className); /* eslint-disable max-len */ return ( <div className={classes}> <svg version="1.1" viewBox="0 0 80 80" x="0px" xlinkHref="http://www.w3.org/1999/xlink" xmlSpace="preserve" xmlns="http://www.w3.org/2000/svg" y="0px" > <g> <g> <circle clipRule="evenodd" cx="40" cy="40" fillRule="evenodd" r="34.3" /> <path className="ui-spinner_darker" clipRule="evenodd" d="M39.9,33.1c0.5-5.4-1.5-10.4-5.2-14.9c6.1-2.1,7.6-1.5,8.6,3.8c0.5,2.9,0.4,6,0.1,9c-0.1,0.9-0.3,1.8-0.7,2.7c-0.8-0.3-1.8-0.6-2.7-0.6H39.9z" fillRule="evenodd" /> <path className="ui-spinner_dark" clipRule="evenodd" d="M46.6,41.9c5.3,2,10.6,2.1,16-0.3c0.8,5.6-0.3,7-5.4,6.9c-4.6,0-8.5-1.6-12-4.1C45.9,43.7,46.3,42.8,46.6,41.9z" fillRule="evenodd" /> <path className="ui-spinner_dark" clipRule="evenodd" d="M44.3,45.4c3.1,4.5,7.2,7.7,13.2,8.9c-3.2,5.1-5.1,5.5-9.2,2.1c-3.2-2.6-5.3-5.9-6.5-9.8C42.7,46.4,43.5,46,44.3,45.4z" fillRule="evenodd" /> <path className="ui-spinner_dark" clipRule="evenodd" d="M40.1,46.9c-0.1,5.6,1.3,10.4,5.3,14.5c-5.6,2.6-7.2,2-8.6-3.3c-0.5-1.8-0.8-3.7-0.6-5.6c0.2-2,0.6-4.1,1.1-6.2c0.8,0.3,1.7,0.5,2.7,0.5H40.1z" fillRule="evenodd" /> <path className="ui-spinner_dark" clipRule="evenodd" d="M36,45.5c-3.5,4.3-5,9.2-4.7,14.8c-5.7-1.2-6.8-2.7-4.9-7.3c1.1-2.5,2.6-4.8,4.4-6.8c0.9-1,2-1.9,3.3-2.8C34.6,44.3,35.2,45,36,45.5z" fillRule="evenodd" /> <path className="ui-spinner_dark" clipRule="evenodd" d="M33.5,42.1c-5.6,1.5-9.8,4.5-12.8,9.5c-4-4.2-3.9-6.4,0.6-9.1c1.6-1,3.4-1.9,5.2-2.2c2.2-0.4,4.4-0.6,6.6-0.8l0,0.5C33.1,40.7,33.2,41.5,33.5,42.1z" fillRule="evenodd" /> <path className="ui-spinner_darker" clipRule="evenodd" d="M33.5,37.9c-3.7-1.5-7.1-1.4-16,0c-1-4.9,0.3-6.5,5-6.6c4.7,0,8.8,1.6,12.4,4.1C34.2,36.2,33.8,37,33.5,37.9z" fillRule="evenodd" /> <path className="ui-spinner_darker" clipRule="evenodd" d="M35.8,34.6c-3-4.7-7.3-7.8-13.2-9c3.4-5.2,5.2-5.5,9.5-1.9c3.2,2.6,5.2,5.9,6.5,9.6C37.5,33.5,36.6,34,35.8,34.6z" fillRule="evenodd" /> <path className="ui-spinner_dark" clipRule="evenodd" d="M48,34.8c-0.5,0.7-1.4,1.1-2.1,1.6c-0.5-0.8-1.1-1.5-1.8-2c3.5-4.4,5.2-9.2,4.6-14.9c5.7,0.8,7.1,2.7,5.1,7.1C52.3,29.6,50,32.2,48,34.8z" fillRule="evenodd" /> <path className="ui-spinner_dark" clipRule="evenodd" d="M46.9,40c0-0.8-0.1-1.5-0.4-2.2c5.8-1.6,10-4.7,13.1-9.6c4.4,6.1,3.2,6.4-1.3,9.5c-1.5,1-3.3,1.7-5,2c-2.1,0.4-4.2,0.6-6.4,0.8L46.9,40z" fillRule="evenodd" /> </g> <circle className="ui-spinner_lighter" clipRule="evenodd" cx="40" cy="40" fillRule="evenodd" r="36" strokeLinecap="round" strokeLinejoin="round" strokeMiterlimit="10" strokeWidth="8" /> </g> </svg> </div> ); /* eslint-enable max-len */ } Spinner.defaultProps = { size: 'm', }; Spinner.propTypes = { /** * Custom class name */ className: PropTypes.string, /** * You can provide set of custom modifications. */ mods: PropTypes.arrayOf(PropTypes.string), /** * Spinner size. */ size: PropTypes.oneOf(['xs', 's', 'm', 'l', 'xl']), }; export default Spinner;
src/components/Title.js
roycejewell/flux-ui-example
import React, { Component } from 'react'; class Title extends Component { render() { return ( <h1 className={`title title--${this.props.type}`}>{this.props.children}</h1> ); } } export default Title;
packages/example-phone/src/scripts/components/call/media-status.js
glhewett/spark-js-sdk
import React from 'react'; export default function MediaStatus({audioDirection, videoDirection}) { return ( <table> <tbody> <tr> <td>audio:</td> <td className="audio-direction">{audioDirection}</td> </tr> <tr> <td>video:</td> <td className="video-direction">{videoDirection}</td> </tr> </tbody> </table> ); } MediaStatus.propTypes = { audioDirection: React.PropTypes.string.isRequired, videoDirection: React.PropTypes.string.isRequired };
src/components/Feedback/Feedback.js
ademuk/react-starter-kit
/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */ import React from 'react'; import styles from './Feedback.css'; import withStyles from '../../decorators/withStyles'; @withStyles(styles) class Feedback { render() { return ( <div className="Feedback"> <div className="Feedback-container"> <a className="Feedback-link" href="https://gitter.im/kriasoft/react-starter-kit">Ask a question</a> <span className="Feedback-spacer">|</span> <a className="Feedback-link" href="https://github.com/kriasoft/react-starter-kit/issues/new">Report an issue</a> </div> </div> ); } } export default Feedback;
test/componentsMock.js
michaltakac/mathworldvr
import React from 'react' import PropTypes from 'prop-types' module.exports = new Proxy({}, { get: (target, property) => { const Mock = (props) => <a-entity>{props.children}</a-entity> Mock.displayName = property Mock.propTypes = { children: PropTypes.any, } return Mock }, })
src/icons/Folder.js
fbfeix/react-icons
import React from 'react'; import IconBase from './../components/IconBase/IconBase'; export default class Folder extends React.Component { render() { if(this.props.bare) { return <g> <g> <path d="M430.1,192H81.9c-17.7,0-18.6,9.2-17.6,20.5l13,183c0.9,11.2,3.5,20.5,21.1,20.5h316.2c18,0,20.1-9.2,21.1-20.5l12.1-185.3 C448.7,199,447.8,192,430.1,192z"></path> <g> <path d="M426.2,143.3c-0.5-12.4-4.5-15.3-15.1-15.3c0,0-121.4,0-143.2,0c-21.8,0-24.4,0.3-40.9-17.4C213.3,95.8,218.7,96,190.4,96 c-22.6,0-75.3,0-75.3,0c-17.4,0-23.6-1.5-25.2,16.6c-1.5,16.7-5,57.2-5.5,63.4h343.4L426.2,143.3z"></path> </g> </g> </g>; } return <IconBase> <g> <path d="M430.1,192H81.9c-17.7,0-18.6,9.2-17.6,20.5l13,183c0.9,11.2,3.5,20.5,21.1,20.5h316.2c18,0,20.1-9.2,21.1-20.5l12.1-185.3 C448.7,199,447.8,192,430.1,192z"></path> <g> <path d="M426.2,143.3c-0.5-12.4-4.5-15.3-15.1-15.3c0,0-121.4,0-143.2,0c-21.8,0-24.4,0.3-40.9-17.4C213.3,95.8,218.7,96,190.4,96 c-22.6,0-75.3,0-75.3,0c-17.4,0-23.6-1.5-25.2,16.6c-1.5,16.7-5,57.2-5.5,63.4h343.4L426.2,143.3z"></path> </g> </g> </IconBase>; } };Folder.defaultProps = {bare: false}
node_modules/react-router/es6/RouteUtils.js
gurusewak/react101
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; import React from 'react'; function isValidChild(object) { return object == null || React.isValidElement(object); } export function isReactChildren(object) { return isValidChild(object) || Array.isArray(object) && object.every(isValidChild); } function createRoute(defaultProps, props) { return _extends({}, defaultProps, props); } export function createRouteFromReactElement(element) { var type = element.type; var route = createRoute(type.defaultProps, element.props); if (route.children) { var childRoutes = createRoutesFromReactChildren(route.children, route); if (childRoutes.length) route.childRoutes = childRoutes; delete route.children; } return route; } /** * Creates and returns a routes object from the given ReactChildren. JSX * provides a convenient way to visualize how routes in the hierarchy are * nested. * * import { Route, createRoutesFromReactChildren } from 'react-router' * * const routes = createRoutesFromReactChildren( * <Route component={App}> * <Route path="home" component={Dashboard}/> * <Route path="news" component={NewsFeed}/> * </Route> * ) * * Note: This method is automatically used when you provide <Route> children * to a <Router> component. */ export function createRoutesFromReactChildren(children, parentRoute) { var routes = []; React.Children.forEach(children, function (element) { if (React.isValidElement(element)) { // Component classes may have a static create* method. if (element.type.createRouteFromReactElement) { var route = element.type.createRouteFromReactElement(element, parentRoute); if (route) routes.push(route); } else { routes.push(createRouteFromReactElement(element)); } } }); return routes; } /** * Creates and returns an array of routes from the given object which * may be a JSX route, a plain object route, or an array of either. */ export function createRoutes(routes) { if (isReactChildren(routes)) { routes = createRoutesFromReactChildren(routes); } else if (routes && !Array.isArray(routes)) { routes = [routes]; } return routes; }
actor-apps/app-web/src/app/components/JoinGroup.react.js
hzy87email/actor-platform
import React from 'react'; import requireAuth from 'utils/require-auth'; import DialogActionCreators from 'actions/DialogActionCreators'; import JoinGroupActions from 'actions/JoinGroupActions'; import JoinGroupStore from 'stores/JoinGroupStore'; // eslint-disable-line class JoinGroup extends React.Component { static propTypes = { params: React.PropTypes.object }; static contextTypes = { router: React.PropTypes.func }; constructor(props) { super(props); JoinGroupActions.joinGroup(props.params.token) .then((peer) => { this.context.router.replaceWith('/'); DialogActionCreators.selectDialogPeer(peer); }).catch((e) => { console.warn(e, 'User is already a group member'); this.context.router.replaceWith('/'); }); } render() { return null; } } export default requireAuth(JoinGroup);
src/svg-icons/av/skip-previous.js
mtsandeep/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let AvSkipPrevious = (props) => ( <SvgIcon {...props}> <path d="M6 6h2v12H6zm3.5 6l8.5 6V6z"/> </SvgIcon> ); AvSkipPrevious = pure(AvSkipPrevious); AvSkipPrevious.displayName = 'AvSkipPrevious'; AvSkipPrevious.muiName = 'SvgIcon'; export default AvSkipPrevious;
imports/ui/pages/Admin/Suppliers/NewSupplier/NewSupplier.js
haraneesh/mydev
import React from 'react'; import PropTypes from 'prop-types'; import SupplierEditor from '../../../../components/SupplierEditor/SupplierEditor'; const NewSupplier = ({ history }) => ( <div className="NewSupplier"> <h2 className="page-header">New Supplier</h2> <SupplierEditor history={history} /> </div> ); NewSupplier.propTypes = { history: PropTypes.object.isRequired, }; export default NewSupplier;
app/packs/src/components/qc/components/substance/BlockIr.js
ComPlat/chemotion_ELN
import React from 'react'; import PropTypes from 'prop-types'; import { Panel, Alert } from 'react-bootstrap'; import QcMolView from '../helper/qc_mol_view'; import { iconByMargin } from '../helper/icon'; import { tableIr } from '../helper/ir'; const emptyBlock = () => ( <div className="card-qc"> <h5> <span>4 Analysis of the provided digital IR data:</span> </h5> <div className="card-qc"> <Alert bsStyle="danger"> No Information. Please upload spectra to Spectra Editor. </Alert> </div> </div> ); const BlockIr = ({ ansIr }) => { if (!ansIr.exist) return emptyBlock(); const { qcp } = ansIr; const { fgs, svg, numFg, numFg80, numFg90, posMac80, posOwn80, posMac90, posOwn90, negMac90, negOwn90, numMac, numOwn, ansMac80, ansOwn80, ansMacF90, ansOwnF90, } = qcp; return ( <div className="card-qc"> <h5> <span>4 Analysis of the provided digital IR data:</span> </h5> <div className="card-qc"> <div> <span>Amount of functional groups given: { numFg }</span> </div> <div> <span> Amount of functional groups that were part of the routine and accurracy &gt;80%: { numFg80 + numFg90 } </span> </div> <div> <span>Output true machine (&gt;80%): </span> { `${(posMac80 + posMac90)}/${(numMac)}` } { iconByMargin(ansMac80, 1) } </div> <div> <span>Output true owner (&gt;80%): </span> { `${(posOwn80 + posOwn90)}/${(numOwn)}` } { iconByMargin(ansOwn80, 1) } </div> <div> <span>Output false machine (&gt;90%): </span> { `${(negMac90)}/${(posMac90 + negMac90)}` } { iconByMargin(ansMacF90, 0) } </div> <div> <span>Output false owner (&gt; 90%): </span> { `${(negOwn90)}/${(posOwn90 + negOwn90)}` } { iconByMargin(ansOwnF90, 0) } </div> <Panel className="qc-detail-panel" id="qc-detail-panel-ir" defaultExpanded={false} > <Panel.Heading> <Panel.Title className="qc-detail-panel-title" toggle> IR Prediction Detail </Panel.Title> </Panel.Heading> <Panel.Collapse> <Panel.Body> <QcMolView svg={svg} /> { tableIr(fgs) } </Panel.Body> </Panel.Collapse> </Panel> </div> </div> ); }; BlockIr.propTypes = { ansIr: PropTypes.object.isRequired, }; export default BlockIr;
chapter-11/react_router_chunked/src/pages/NotFound.js
mocheng/react-and-redux
import React from 'react'; const NotFound = () => { return ( <div>404: Not Found</div> ); }; export default NotFound;
client/main.js
hr-memories/TagMe
import Exponent from 'exponent'; import React from 'react'; import Login from './login'; import Homescreen from './homescreen'; import Memory from './memory'; import Memories from './memories'; import { Navigator } from 'react-native'; class App extends React.Component { renderScene(route, navigator) { if (route.name === 'Login') { return <Login navigator={navigator} />; } if (route.name === 'Homescreen') { return <Homescreen navigator={navigator} {...route.passProps}/>; } if (route.name === 'Memory') { return <Memory navigator={navigator} {...route.passProps}/>; } if (route.name === 'Memories') { return <Memories navigator={navigator} {...route.passProps}/>; } } render() { return ( <Navigator initialRoute={{ name: 'Login' }} renderScene={this.renderScene} /> ); } } Exponent.registerRootComponent(App);
ui/src/pages/SettingsStoresPage/index.js
LearningLocker/learninglocker
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { withProps, compose } from 'recompose'; import { withModels } from 'ui/utils/hocs'; import { fromJS } from 'immutable'; import { queryStringToQuery, modelQueryStringSelector } from 'ui/redux/modules/search'; import { addModel } from 'ui/redux/modules/models'; import { loggedInUserId } from 'ui/redux/modules/auth'; import { clearModelsCache } from 'ui/redux/modules/pagination'; import SearchBox from 'ui/containers/SearchBox'; import ModelList from 'ui/containers/ModelList'; import StoreForm from './StoreForm'; const schema = 'lrs'; const StoreList = compose( withProps({ schema, sort: fromJS({ createdAt: -1, _id: -1 }) }), withModels )(ModelList); class Stores extends Component { static propTypes = { userId: PropTypes.string, addModel: PropTypes.func, searchString: PropTypes.string, }; onClickAdd = () => { this.addButton.blur(); return this.props.addModel({ schema, props: { owner: this.props.userId, isExpanded: true } }) .then(() => { // when we add a new store we also create a new client this.props.clearModelsCache({ schema: 'client' }); }) .catch((err) => { console.error(err); }); } render = () => ( <div> <header id="topbar"> <div className="heading heading-light"> <span className="pull-right open_panel_btn"> <button className="btn btn-primary btn-sm" ref={(ref) => { this.addButton = ref; }} onClick={this.onClickAdd}> <i className="ion ion-plus" /> Add new </button> </span> <span className="pull-right open_panel_btn" style={{ width: '25%' }}> <SearchBox schema={schema} /> </span> Learning Record Stores </div> </header> <div className="row"> <div className="col-md-12"> <StoreList filter={queryStringToQuery(this.props.searchString, schema)} getDescription={model => `${model.get('title', '')} ( ${model.get('statementCount')} )`} ModelForm={StoreForm} /> </div> </div> </div> ) } export default connect(state => ({ userId: loggedInUserId(state), searchString: modelQueryStringSelector(schema)(state), }), { addModel, clearModelsCache })(Stores);
docs/components/App/index.js
WEACOMRU/react-giphy-select
import React, { Component } from 'react'; import SyntaxHighlighter, { registerLanguage } from 'react-syntax-highlighter/dist/light'; import bash from 'react-syntax-highlighter/dist/languages/bash'; import javascript from 'react-syntax-highlighter/dist/languages/javascript'; import tomorrowNightEighties from 'react-syntax-highlighter/dist/styles/tomorrow-night-eighties'; import { ObjectInspector } from 'react-inspector'; import GiphySelect from 'GiphySelect'; // eslint-disable-line import/no-unresolved, import/extensions import styles from './styles.css'; registerLanguage('bash', bash); registerLanguage('javascript', javascript); const installationCode = '$ npm i -S react-giphy-select'; const stylesCode = 'node_modules/react-giphy-select/lib/styles.css'; const usageCode = `import React, { Component } from 'react'; import GiphySelect from 'react-giphy-select'; import 'react-giphy-select/lib/styles.css'; export default class Example extends Component { render() { return ( <div> <GiphySelect /> </div> ); } }`; const renderEntryCode = 'renderEntry(entry, onSelect, options)'; const onEntrySelectCode = 'onEntrySelect(entry)'; const contributingCode = `$ npm install $ npm start`; const testCode = `$ npm run lint $ npm test`; export default class App extends Component { state = { entry: {}, }; onEntrySelect = entry => { this.setState({ entry, }); }; render() { return ( <div className={styles.app}> <h1 className={styles.appTitle}>React Giphy Select Component</h1> <p>A React component for select GIFs by Giphy API.</p> <GiphySelect theme={{ select: styles.appSelect }} onEntrySelect={this.onEntrySelect} /> <div className={styles.appInspector}> <h3 className={styles.appInspectorTitle}> Please, select a GIF </h3> <ObjectInspector data={this.state.entry} /> </div> <p> By default it show GIFs currently trending online. But user can request a specific GIFs using the search input. </p> <h2 className={styles.appHeader2}>Attribution to Giphy</h2> <p> Please, read Giphy&nbsp; <a href="https://giphy.com/terms" rel="noopener noreferrer" target="_blank" >terms of service</a>. </p> <h2 className={styles.appHeader2}>Installation</h2> <SyntaxHighlighter language="bash" style={tomorrowNightEighties} >{installationCode}</SyntaxHighlighter> <h2 className={styles.appHeader2}>Usage</h2> <p> The plugin ships with a default styling available at this location in the installed package: </p> <SyntaxHighlighter language="bash" style={tomorrowNightEighties} >{stylesCode}</SyntaxHighlighter> <p> You will need&nbsp; <a href="https://webpack.js.org/" rel="noopener noreferrer" target="_blank" >Webpack</a> or other build system, that supports requiring css files. </p> <SyntaxHighlighter language="javascript" style={tomorrowNightEighties} >{usageCode}</SyntaxHighlighter> <h2 className={styles.appHeader2}>Props</h2> <dl className={styles.appProps}> <dt className={styles.appPropsName}>theme</dt> <dd className={styles.appPropsDesc}> Object of CSS classes with the following keys. <dl className={styles.appSubParams}> <dt className={styles.appSubParamsName}>select</dt> <dd className={styles.appSubParamsDesc}> CSS class for GiphySelect component. </dd> <dt className={styles.appSubParamsName}>selectInput</dt> <dd className={styles.appSubParamsDesc}> CSS class for search input. </dd> <dt className={styles.appSubParamsName}>list</dt> <dd className={styles.appSubParamsDesc}> CSS class for entries list. </dd> <dt className={styles.appSubParamsName}>listEmpty</dt> <dd className={styles.appSubParamsDesc}> CSS class for empty state of entries list. </dd> <dt className={styles.appSubParamsName}>listScrollbar</dt> <dd className={styles.appSubParamsDesc}> CSS class for scrollbar. </dd> <dt className={styles.appSubParamsName}>listScrollbarThumb</dt> <dd className={styles.appSubParamsDesc}> CSS class for scrollbar thumb. </dd> <dt className={styles.appSubParamsName}>listMasonry</dt> <dd className={styles.appSubParamsDesc}> CSS class for masonry layout. </dd> <dt className={styles.appSubParamsName}>listItem</dt> <dd className={styles.appSubParamsDesc}> CSS class for item of entries list. </dd> <dt className={styles.appSubParamsName}>listEntry</dt> <dd className={styles.appSubParamsDesc}> CSS class for entry. </dd> <dt className={styles.appSubParamsName}>listEntryImage</dt> <dd className={styles.appSubParamsDesc}> CSS class for entry image. </dd> <dt className={styles.appSubParamsName}>attribution</dt> <dd className={styles.appSubParamsDesc}> CSS class for attribution. </dd> </dl> </dd> <dt className={styles.appPropsName}>placeholder</dt> <dd className={styles.appPropsDesc}> Search input placeholder&nbsp; <em className={styles.appPropsDefault}>(by default &quot;Search GIFs&quot;)</em>. </dd> <dt className={styles.appPropsName}>requestDelay</dt> <dd className={styles.appPropsDesc}> Delay before sending a request after the search input value is changed&nbsp; <em className={styles.appPropsDefault}>(by default 500 ms)</em>. </dd> <dt className={styles.appPropsName}>requestKey</dt> <dd className={styles.appPropsDesc}> Key for Giphy API&nbsp; <em className={styles.appPropsDefault}> (by default is used public beta key &quot;dc6zaTOxFJmzC&quot;) </em>. </dd> <dt className={styles.appPropsName}>requestLang</dt> <dd className={styles.appPropsDesc}> Specify default country for regional content; format is 2-letter ISO 639-1 country code. See list of supported languages&nbsp; <a href="https://github.com/Giphy/GiphyAPI#language-support" rel="noopener noreferrer" target="_blank" >here</a>. </dd> <dt className={styles.appPropsName}>requestRating</dt> <dd className={styles.appPropsDesc}> Limit results to those rated (y,g, pg, pg-13 or r)&nbsp; <em className={styles.appPropsDefault}>(by default &quot;pg&quot;)</em>. </dd> <dt className={styles.appPropsName}>renderEntry</dt> <dd className={styles.appPropsDesc}> You can rewrite default&nbsp; <code className={styles.appCode}>renderEntry</code> method <SyntaxHighlighter language="javascript" style={tomorrowNightEighties} >{renderEntryCode}</SyntaxHighlighter> <dl className={styles.appSubParams}> <dt className={styles.appSubParamsName}>entry</dt> <dd className={styles.appSubParamsDesc}> Object with entry data from Giphy API. </dd> <dt className={styles.appSubParamsName}>onSelect</dt> <dd className={styles.appSubParamsDesc}> <code className={styles.appCode}>onEntrySelect</code> callback. </dd> <dt className={styles.appSubParamsName}>options</dt> <dd className={styles.appSubParamsDesc}> Object, that contains&nbsp; <code className={styles.appCode}>theme</code> &nbsp;parameter. </dd> </dl> </dd> <dt className={styles.appPropsName}>onEntrySelect</dt> <dd className={styles.appPropsDesc}> A callback which is triggered whenever the entry is selected <SyntaxHighlighter language="javascript" style={tomorrowNightEighties} >{onEntrySelectCode}</SyntaxHighlighter> <dl className={styles.appSubParams}> <dt className={styles.appSubParamsName}>entry</dt> <dd className={styles.appSubParamsDesc}> Object with entry data from Giphy API. </dd> </dl> </dd> </dl> <h2 className={styles.appHeader2}>Contribution</h2> <p>Install all dependencies, then start the demo</p> <SyntaxHighlighter language="bash" style={tomorrowNightEighties} >{contributingCode}</SyntaxHighlighter> <p>Do not forget about tests and lint check</p> <SyntaxHighlighter language="bash" style={tomorrowNightEighties} >{testCode}</SyntaxHighlighter> <p>Please, create issues and pull requests.</p> <h2 className={styles.appHeader2}>License</h2> <p>MIT.</p> </div> ); } }
js/pages/HomePage.js
KissLuckystar/HotelMarketingApp
/** * 主页 * @flow * Created by smk on 2017/2/23 */ import React, { Component } from 'react'; import { StyleSheet, Image, View, BackAndroid, ToastAndroid } from 'react-native'; //react-native导航条组件 import TabNavigator from 'react-native-tab-navigator'; import MainPage from './MainPage'; //第一页主导航 import ProductPage from './ProductPage'; //第二页产品导航 import MyPage from './MyPage'; //第三页个人导航 //数组的静态方法类 import ArrayUtils from '../util/ArrayUtils'; export var FLAG_TAB = { flag_mainTab:'flag_mainTab', flag_productTab:'flag_productTab', flag_myTab:'flag_myTab' } export default class HomePage extends Component { constructor(props) { super(props); this.subscribers = []; this.changedValues = { //favorite: {popularChange: false, trendingChange: false}, my: {languageChange: false, keyChange: false, themeChange: false} }; //设置默认选中的tab let selectedTab = this.props.selectedTab ? this.props.selectedTab : FLAG_TAB.flag_mainTab; this.state={ selectedTab:selectedTab, theme: this.props.theme } } addSubscriber(subscriber) { ArrayUtils.add(this.subscribers, subscriber); } removeSubscriber(subscriber) { ArrayUtils.remove(this.subscribers, subscriber); } //监听Android物理设备返回键事件 /*componentWillMount() { BackAndroid.addEventListener('hardwareBackPress',this.onBackAndroid); } ComponentWillUnmount() { BackAndroid.removeEventListener('hardwareBackPress',this.onBackAndroid); } onBackAndroid = () => { if( this.lastBackPressed && this.lastBackPressed + 2000 >= Date.now() ) { //最近两秒内按过back键,可以退出应用 return false; } else{ this.lastBackPressed = Date.now(); ToastAndroid.show('再按一次退出应用',ToastAndroid.SHORT); //return true; } return true; }*/ onSelected(object) { // if (this.updateFavorite && 'popularTab' === object)this.updateFavorite(object); if (object !== this.state.selectedTab) { this.subscribers.forEach((item, index, arr)=> { if (typeof(item) == 'function')item(this.state.selectedTab, object); }) } if(object===FLAG_TAB.flag_popularTab)this.changedValues.favorite.popularChange=false; if(object===FLAG_TAB.flag_trendingTab)this.changedValues.favorite.trendingChange=false; this.setState({ selectedTab: object, }) } onReStart(jumpToTab){ this.props.navigator.resetTo({ component: HomePage, name: 'HomePage', params: { ...this.props, theme:this.state.theme, selectedTab: jumpToTab, } }); } onThemeChange(theme) { if (!theme)return; this.setState({ theme: theme }) this.changedValues.my.themeChange = true; this.subscribers.forEach((item, index, arr)=> { if (typeof(item) == 'function')item(theme); }) this.changedValues.my.themeChange = false; } //定义Tab的内容和样式 _renderTab(Component,selectedTab,title,renderIcon) { return ( <TabNavigator.Item selected={this.state.selectedTab === selectedTab} title={ title } titleStyle={ styles.tabText } selectedTitleStyle={ this.state.theme.styles.selectedTitleStyle } renderIcon={ () => <Image style={styles.tabBarIcon} source={renderIcon} /> } renderSelectedIcon={ () => <Image style={[styles.tabBarSelectedIcon, this.state.theme.styles.tabBarSelectedIcon]} source={renderIcon} />} onPress={ () => this.onSelected(selectedTab)} > <Component {...this.props} theme={this.state.theme} homeComponent={this} /> </TabNavigator.Item> ) } render() { return ( <View style={styles.container}> <TabNavigator tabBarStyle={{opacity: 0.9,}} sceneStyle={{paddingBottom: 0}} > {this._renderTab(MainPage, FLAG_TAB.flag_mainTab, '首页', require('../../res/images/ic_main.png'))} {this._renderTab(ProductPage, FLAG_TAB.flag_productTab, '产品', require('../../res/images/ic_product.png'))} {this._renderTab(MyPage, FLAG_TAB.flag_myTab, '我的', require('../../res/images/ic_my.png'))} </TabNavigator> </View> ) } /*render() { return ( <View style={styles.container}> <TabNavigator> <TabNavigator.Item selected={this.state.selectedTab === FLAG_TAB.flag_mainTab} title="首页" titleStyle={ styles.tabText } selectedTitleStyle={ styles.selectedTabText } renderIcon={ () => <Image style={styles.tabBarIcon} source={require('../../res/images/ic_main.png')} /> } renderSelectedIcon={ () => <Image style={styles.tabBarSelectedIcon} source={require('../../res/images/ic_main.png')} />} onPress={ () => this.setState({selectedTab:FLAG_TAB.flag_mainTab})} > <MainPage navigator={this.props.navigator} /> </TabNavigator.Item> <TabNavigator.Item selected={this.state.selectedTab === FLAG_TAB.flag_productTab} title="产品" titleStyle={ styles.tabText } selectedTitleStyle={ styles.selectedTabText } renderIcon={ () => <Image style={styles.tabBarIcon} source={require('../../res/images/ic_product.png')} /> } renderSelectedIcon={ () => <Image style={styles.tabBarSelectedIcon} source={require('../../res/images/ic_product.png')} />} onPress={ () => this.setState({selectedTab:FLAG_TAB.flag_productTab})} > <ProductPage navigator={this.props.navigator} /> </TabNavigator.Item> <TabNavigator.Item selected={this.state.selectedTab === FLAG_TAB.flag_myTab} title="我的" titleStyle={ styles.tabText } selectedTitleStyle={ styles.selectedTabText } renderIcon={ () => <Image style={styles.tabBarIcon} source={require('../../res/images/ic_my.png')} /> } renderSelectedIcon={ () => <Image style={styles.tabBarSelectedIcon} source={require('../../res/images/ic_my.png')} />} onPress={ () => this.setState({selectedTab:FLAG_TAB.flag_myTab})} > <MyPage navigator={this.props.navigator} /> </TabNavigator.Item> </TabNavigator> </View> ) }*/ } const styles=StyleSheet.create({ container:{ flex:1 }, tabText:{ }, selectedTabText:{ color:'#3c78d8' }, tabBarIcon:{ width:26,height:26, resizeMode:'contain' }, tabBarSelectedIcon:{ width:26,height:26, resizeMode:'contain', tintColor:'#3c78d8' } })
examples/src/components/Contributors.js
mcls/react-select
import React from 'react'; import Select from 'react-select'; const CONTRIBUTORS = require('../data/contributors'); const MAX_CONTRIBUTORS = 6; const ASYNC_DELAY = 500; const Contributors = React.createClass({ displayName: 'Contributors', propTypes: { label: React.PropTypes.string, }, getInitialState () { return { multi: true, value: [CONTRIBUTORS[0]], }; }, onChange (value) { this.setState({ value: value, }); }, switchToMulti () { this.setState({ multi: true, value: [this.state.value], }); }, switchToSingle () { this.setState({ multi: false, value: this.state.value[0], }); }, getContributors (input, callback) { input = input.toLowerCase(); var options = CONTRIBUTORS.filter(i => { return i.github.substr(0, input.length) === input; }); var data = { options: options.slice(0, MAX_CONTRIBUTORS), complete: options.length <= MAX_CONTRIBUTORS, }; setTimeout(function() { callback(null, data); }, ASYNC_DELAY); }, gotoContributor (value, event) { window.open('https://github.com/' + value.github); }, render () { return ( <div className="section"> <h3 className="section-heading">{this.props.label}</h3> <Select.Async multi={this.state.multi} value={this.state.value} onChange={this.onChange} onValueClick={this.gotoContributor} valueKey="github" labelKey="name" loadOptions={this.getContributors} /> <div className="checkbox-list"> <label className="checkbox"> <input type="radio" className="checkbox-control" checked={this.state.multi} onChange={this.switchToMulti}/> <span className="checkbox-label">Multiselect</span> </label> <label className="checkbox"> <input type="radio" className="checkbox-control" checked={!this.state.multi} onChange={this.switchToSingle}/> <span className="checkbox-label">Single Value</span> </label> </div> <div className="hint">This example implements custom label and value properties, async options and opens the github profiles in a new window when values are clicked</div> </div> ); } }); module.exports = Contributors;
src/app/components/DatePickerExampleSimple.js
leoliew/react-webpack-example
/** * Created by leoliew on 2016/11/28. */ import React from 'react'; import DatePicker from 'material-ui/DatePicker'; import ShowCaseCard from './ShowCaseCard'; /** * The Date Picker defaults to a portrait dialog. The `mode` property can be set to `landscape`. * You can also disable the Dialog passing `true` to the `disabled` property. */ export default class ChipExampleSimple extends React.Component { render() { var showCase = <div> <DatePicker hintText="Portrait Dialog"/> <DatePicker hintText="Landscape Dialog" mode="landscape"/> <DatePicker hintText="Dialog Disabled" disabled={true}/> </div> ; return ( <ShowCaseCard title="Simple examples" subtitle="The Date Picker defaults to a portrait dialog. The mode property can be set to landscape. You can also disable the Dialog passing true to the disabled property." text={showCase} /> ) } }
src/components/FunctionBox.js
piecewisecss/piecewisecss.github.io
import React from 'react'; import { WindowResizeListener } from 'react-window-resize-listener' WindowResizeListener.DEBOUNCE_TIME = 20; export default class FunctionBox extends React.Component{ constructor(props){ super(props); this.state = { width: window.innerWidth }; } render(){ // console.log('state', this.state); let { width } = this.state, calc = `24px + ((${width}px - 480px) / (1000px - 480px)) / (48px - 24px)`, eqTop = <div className='eqTop'>(<span>{width + 'px'}</span> - 480px)</div>, eqMid = `(1000px - 480px)`, eqBot = `(48px - 24px)`, finalCalc = (24 + (width - 480) / ((1000 - 480) / (48 - 24))).toString().split('.')[0] + '.' + (24 + (width - 480) / ((1000 - 480) / (48 - 24))).toString().split('.')[1].substring(0, 2) + ((24 + (width - 480) / ((1000 - 480) / (48 - 24))).toString().split('.')[1].substring(0, 2).length == 1 ? '0' : '') + 'px' return ( <div className='functionBox'> <div className='currentWidth'>{width + 'px'}</div> <div className='calc'> <div className='calcTop'> <div className='topLeft left'>f(x) =</div> <div className='topMid mid'>48px</div> <div className='topRight right'>48px</div> </div> <div className='calcMid'> <div className='midLeft left noSelect'>f(x) =</div> <div className='midMid mid'> <div className='base'>24px +</div> <div className='equation'> {eqTop} <div className='eqMid'>{eqMid}</div> <div className='eqBot'>{eqBot}</div> </div> </div> <div className='midRight right'>{finalCalc}</div> </div> <div className='calcBot'> <div className='botLeft left noSelect'>f(x) =</div> <div className='botMid mid'>24px</div> <div className='botRight right'>24px</div> </div> </div> <WindowResizeListener onResize={windowSize => this.setState({ width: windowSize.windowWidth })}/> </div> ) } }
packages/material-ui-icons/src/Compare.js
dsslimshaddy/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from 'material-ui/SvgIcon'; let Compare = props => <SvgIcon {...props}> <path d="M10 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v2h2V1h-2v2zm0 15H5l5-6v6zm9-15h-5v2h5v13l-5-6v9h5c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z" /> </SvgIcon>; Compare = pure(Compare); Compare.muiName = 'SvgIcon'; export default Compare;
examples/websdk-samples/LayerReactNativeSample/src/LoginDialog.js
layerhq/layer-js-sampleapps
import React, { Component } from 'react'; import { StyleSheet, View, Modal, Text, TouchableOpacity, Image, TextInput } from 'react-native'; import Icon from 'react-native-vector-icons/FontAwesome'; export default class LoginDialog extends Component { constructor(props) { super(props); this.email = null; this.password = null; this.state = { selectedUserId: 0, } } login() { window.layerSample.email = this.email; window.layerSample.password = this.password; this.props.onLogin(); } render() { return ( <View style={styles.container}> <Image style={styles.logoImage} source={{uri: 'http://static.layer.com/logo-only-blue.png'}} resizeMode='contain' /> <Text style={styles.welcomeText}>Welcome to Layer Sample App!</Text> <Text style={styles.inputLabel}>Email</Text> <TextInput style={styles.input} onChangeText={(text) => this.email = text} value={this.state.text} autoCapitalize='none' autoCorrect={false} returnKeyType='done' /> <Text style={styles.inputLabel}>Password</Text> <TextInput style={styles.input} onChangeText={(text) => this.password = text} value={this.state.text} autoCapitalize='none' autoCorrect={false} returnKeyType='done' secureTextEntry={true} /> <TouchableOpacity style={styles.loginButton} onPress={this.login.bind(this)} activeOpacity={.5} > <Text style={styles.loginButtonText}>LOGIN</Text> </TouchableOpacity> </View> ) } } const styles = StyleSheet.create({ container: { backgroundColor: 'white', margin: 20, padding: 20, borderRadius: 25 }, logoImage: { width: 32, height: 32, alignSelf: 'center', marginBottom: 10 }, welcomeText: { alignSelf: 'center', fontFamily: 'System', fontSize: 20, textAlign: 'center', color: '#404F59', width: 200, marginBottom: 40 }, input: { height: 30, backgroundColor: '#fafbfc', borderWidth: 1, borderColor: '#e4e9ec', borderRadius: 5, marginBottom: 10 }, inputLabel: { fontFamily: 'System', fontSize: 14, color: '#404F59', marginBottom: 5 }, loginButton: { backgroundColor: '#27A6E1', borderRadius: 6, paddingVertical: 10, marginTop: 40 }, loginButtonText: { fontFamily: 'System', fontSize: 14, fontWeight: 'bold', color: 'white', textAlign: 'center' } });
packages/mineral-ui-icons/src/IconDomain.js
mineral-ui/mineral-ui
/* @flow */ import React from 'react'; import Icon from 'mineral-ui/Icon'; import type { IconProps } from 'mineral-ui/Icon/types'; /* eslint-disable prettier/prettier */ export default function IconDomain(props: IconProps) { const iconProps = { rtl: false, ...props }; return ( <Icon {...iconProps}> <g> <path d="M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z"/> </g> </Icon> ); } IconDomain.displayName = 'IconDomain'; IconDomain.category = 'social';