path stringlengths 5 195 | repo_name stringlengths 5 79 | content stringlengths 25 1.01M |
|---|---|---|
src/app/components/Paginations/index.js | cheton/cnc | import React from 'react';
import * as Paginations from '@trendmicro/react-paginations';
import '@trendmicro/react-paginations/dist/react-paginations.css';
import i18n from 'app/lib/i18n';
export const TablePagination = (props) => {
return (
<Paginations.TablePagination
{...props}
pageRecordsRenderer={({ totalRecords, from, to }) => {
if (totalRecords > 0) {
return i18n._('Records: {{from}} - {{to}} / {{total}}', {
from,
to,
total: totalRecords
});
}
return i18n._('Records: {{total}}', { total: totalRecords });
}}
pageLengthRenderer={({ pageLength }) => (
<span>
{i18n._('{{pageLength}} per page', { pageLength })}
<i className="caret" />
</span>
)}
/>
);
};
|
src/pages/chart/Recharts/AreaChartComponent.js | zuiidea/antd-admin | import React from 'react'
import { Row, Col, Card, Button } from 'antd'
import * as d3 from 'd3-shape'
import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip } from 'recharts'
import Container from './Container'
const data = [
{
name: 'Page A',
uv: 4000,
pv: 2400,
amt: 2400,
},
{
name: 'Page B',
uv: 3000,
pv: 1398,
amt: 2210,
},
{
name: 'Page C',
uv: 2000,
pv: 9800,
amt: 2290,
},
{
name: 'Page D',
uv: 2780,
pv: 3908,
amt: 2000,
},
{
name: 'Page E',
uv: 1890,
pv: 4800,
amt: 2181,
},
{
name: 'Page F',
uv: 2390,
pv: 3800,
amt: 2500,
},
{
name: 'Page G',
uv: 3490,
pv: 4300,
amt: 2100,
},
]
const mixData = [
{
name: 'Page A',
uv: 4000,
pv: 2400,
amt: 2400,
},
{
name: 'Page B',
uv: 3000,
pv: 1398,
amt: 2210,
},
{
name: 'Page C',
uv: 2000,
pv: 9800,
amt: 2290,
},
{
name: 'Page D',
uv: 2780,
pv: 3908,
amt: 2000,
},
{
name: 'Page E',
uv: 1890,
pv: 4800,
amt: 2181,
},
{
name: 'Page F',
uv: 2390,
pv: 3800,
amt: 2500,
},
{
name: 'Page G',
uv: 3490,
pv: 4300,
amt: 2100,
},
]
const percentData = [
{
month: '2015.01',
a: 4000,
b: 2400,
c: 2400,
},
{
month: '2015.02',
a: 3000,
b: 1398,
c: 2210,
},
{
month: '2015.03',
a: 2000,
b: 9800,
c: 2290,
},
{
month: '2015.04',
a: 2780,
b: 3908,
c: 2000,
},
{
month: '2015.05',
a: 1890,
b: 4800,
c: 2181,
},
{
month: '2015.06',
a: 2390,
b: 3800,
c: 2500,
},
{
month: '2015.07',
a: 3490,
b: 4300,
c: 2100,
},
]
const colProps = {
lg: 12,
md: 24,
}
const SimpleAreaChart = () => (
<Container>
<AreaChart
data={data}
margin={{
top: 10,
right: 30,
left: 0,
bottom: 0,
}}
>
<XAxis dataKey="name" />
<YAxis />
<CartesianGrid strokeDasharray="3 3" />
<Tooltip />
<Area type="monotone" dataKey="uv" stroke="#8884d8" fill="#8884d8" />
</AreaChart>
</Container>
)
const StackedAreaChart = () => (
<Container>
<AreaChart
data={mixData}
margin={{
top: 10,
right: 30,
left: 0,
bottom: 0,
}}
>
<XAxis dataKey="name" />
<YAxis />
<CartesianGrid strokeDasharray="3 3" />
<Tooltip />
<Area
type="monotone"
dataKey="uv"
stackId="1"
stroke="#8884d8"
fill="#8884d8"
/>
<Area
type="monotone"
dataKey="pv"
stackId="1"
stroke="#82ca9d"
fill="#82ca9d"
/>
<Area
type="monotone"
dataKey="amt"
stackId="1"
stroke="#ffc658"
fill="#ffc658"
/>
</AreaChart>
</Container>
)
// StackedAreaChart
const toPercent = (decimal, fixed = 0) => {
return `${(decimal * 100).toFixed(fixed)}%`
}
const getPercent = (value, total) => {
const ratio = total > 0 ? value / total : 0
return toPercent(ratio, 2)
}
const renderTooltipContent = o => {
const { payload, label } = o
const total = payload.reduce((result, entry) => result + entry.value, 0)
return (
<div className="customized-tooltip-content">
<p className="total">{`${label} (Total: ${total})`}</p>
<ul className="list">
{payload.map((entry, index) => (
<li
key={`item-${index}`}
style={{
color: entry.color,
}}
>
{`${entry.name}: ${entry.value}(${getPercent(entry.value, total)})`}
</li>
))}
</ul>
</div>
)
}
const PercentAreaChart = () => (
<Container>
<AreaChart
data={percentData}
stackOffset="expand"
margin={{
top: 10,
right: 30,
left: 0,
bottom: 0,
}}
>
<XAxis dataKey="month" />
<YAxis tickFormatter={toPercent} />
<CartesianGrid strokeDasharray="3 3" />
<Tooltip content={renderTooltipContent} />
<Area
type="monotone"
dataKey="a"
stackId="1"
stroke="#8884d8"
fill="#8884d8"
/>
<Area
type="monotone"
dataKey="b"
stackId="1"
stroke="#82ca9d"
fill="#82ca9d"
/>
<Area
type="monotone"
dataKey="c"
stackId="1"
stroke="#ffc658"
fill="#ffc658"
/>
</AreaChart>
</Container>
)
// CardinalAreaChart
const cardinal = d3.curveCardinal.tension(0.2)
const CardinalAreaChart = () => (
<Container>
<AreaChart
data={mixData}
margin={{
top: 10,
right: 30,
left: 0,
bottom: 0,
}}
>
<XAxis dataKey="name" />
<YAxis />
<CartesianGrid strokeDasharray="3 3" />
<Tooltip />
<Area
type="monotone"
dataKey="uv"
stroke="#8884d8"
fill="#8884d8"
fillOpacity={0.3}
/>
<Area
type={cardinal}
dataKey="pv"
stroke="#82ca9d"
fill="#82ca9d"
fillOpacity={0.3}
/>
</AreaChart>
</Container>
)
const AreaChartPage = () => (
<div className="content-inner">
<Button
type="primary"
style={{
position: 'absolute',
right: 0,
top: -48,
}}
>
<a
href="http://recharts.org/#/en-US/examples/TinyBarChart"
target="blank"
>
Show More
</a>
</Button>
<Row gutter={32}>
<Col {...colProps}>
<Card title="SimpleAreaChart">
<SimpleAreaChart />
</Card>
</Col>
<Col {...colProps}>
<Card title="StackedAreaChart">
<StackedAreaChart />
</Card>
</Col>
<Col {...colProps}>
<Card title="PercentAreaChart">
<PercentAreaChart />
</Card>
</Col>
<Col {...colProps}>
<Card title="CardinalAreaChart">
<CardinalAreaChart />
</Card>
</Col>
</Row>
</div>
)
export default AreaChartPage
|
website/src/components/button.js | explosion/spaCy | import React from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
import Link from './link'
import Icon from './icon'
import classes from '../styles/button.module.sass'
export default function Button({
to,
variant = 'secondary',
large = false,
icon,
className,
children,
...props
}) {
const buttonClassNames = classNames(classes.root, className, {
[classes.large]: large,
[classes.primary]: variant === 'primary',
[classes.secondary]: variant === 'secondary',
[classes.tertiary]: variant === 'tertiary',
})
return (
<Link to={to} className={buttonClassNames} hideIcon={true} {...props}>
{icon && <Icon name={icon} width={large ? 16 : 14} inline />}
{children}
</Link>
)
}
Button.propTypes = {
to: PropTypes.string,
variant: PropTypes.oneOf(['primary', 'secondary', 'tertiary']),
large: PropTypes.bool,
icon: PropTypes.string,
className: PropTypes.string,
}
|
rojak-ui-web/src/app/media/PairingSentiments.js | pyk/rojak | import React from 'react'
import SimpleList from '../kit/SimpleList'
import styles from './PairingSentiments.css'
class PairingSentiments extends React.Component {
static propTypes = {
sentiments: React.PropTypes.array
}
static defaultProps = {
sentiments: []
}
render () {
const { sentiments } = this.props
const sentimentItems = sentiments.map((sentiment, index) => (
<SentimentItem key={`sentiment-${index}`} sentiment={sentiment} />
))
return (
<div>
<h3>News Sentiments</h3>
<SimpleList style={{ fontSize: '14px' }}>
<thead>
<tr>
<th>Pasangan</th>
<th>Positive News</th>
<th>Negative News</th>
</tr>
</thead>
<tbody>
{sentimentItems}
</tbody>
</SimpleList>
</div>
)
}
}
const SentimentItem = ({ sentiment }) => (
<tr>
<td>
<div className={styles.iconBox}>
<img src={sentiment.pairing.logo_url} alt={sentiment.pairing.name} />
</div>
{sentiment.pairing.name}
</td>
<td>{sentiment.positive_news_count}</td>
<td>{sentiment.negative_news_count}</td>
</tr>
)
SentimentItem.propTypes = {
sentiment: React.PropTypes.object
}
export default PairingSentiments
|
src/components/App/index.js | fedebertolini/json-editor | import React from 'react';
import { connect } from 'react-redux';
import { Container } from 'semantic-ui-react'
import JsonLoader from '../JsonLoader';
import Editor from '../Editor';
import ViewJsonModal from '../ViewJsonModal';
import { selectLoaded } from '../../store/selectors/saved';
import { isModalOpen } from '../../store/selectors/viewModal';
const App = ({ loaded, showModal }) => (
<Container>
{!loaded && <JsonLoader />}
{loaded && <Editor />}
{showModal && <ViewJsonModal />}
</Container>
);
const mapStateToProps = state => ({
loaded: selectLoaded(state),
showModal: isModalOpen(state),
});
export default connect(mapStateToProps)(App);
|
app/scripts/components/footerComponent.js | Pygocentrus/browserify-es6-react-boilerplate | import React from 'react';
let FooterComponent = React.createClass({
// propTypes: {
// itemsDoneCount: PropTypes.number.isRequired,
// itemsRemainingCount: PropTypes.number.isRequired,
// },
render: function() {
let clearCompletedButton;
// Show the "Clear X completed items" button only if there are completed
// items.
if (this.props.itemsDoneCount > 0) {
clearCompletedButton = (
<a id="clear-completed" onClick={this.props.clearCompletedItems}>
Clear {this.props.itemsDoneCount} completed
{1 === this.props.itemsDoneCount ? " item" : " items"}
</a>
);
}
// Clicking the "Clear X completed items" button calls the
// "clearCompletedItems" function passed in on `props`.
return (
<footer>
{clearCompletedButton}
<div className="todo-count">
<b>{this.props.itemsRemainingCount}</b>
{1 === this.props.itemsRemainingCount ? " item" : " items"} left
</div>
</footer>
);
}
});
export default FooterComponent;
|
server/sonar-web/src/main/js/apps/about/components/AboutQualityModelForSonarQubeDotCom.js | lbndev/sonarqube | /*
* SonarQube
* Copyright (C) 2009-2017 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
import { translate } from '../../../helpers/l10n';
import BugIconForSonarQubeDotCom from './BugIconForSonarQubeDotCom';
import VulnerabilityIconForSonarQubeDotCom from './VulnerabilityIconForSonarQubeDotCom';
import CodeSmellIconForSonarQubeDotCom from './CodeSmellIconForSonarQubeDotCom';
export default class AboutQualityModelForSonarQubeDotCom extends React.Component {
render() {
return (
<div className="boxed-group about-quality-model sqcom-about-quality-model">
<h2>{translate('about_page.quality_model')}</h2>
<div className="boxed-group-inner clearfix">
<div className="flex-columns">
<div className="flex-column flex-column-third">
<div className="pull-left little-spacer-right"><BugIconForSonarQubeDotCom /></div>
<p className="about-page-text overflow-hidden">
<strong>{translate('issue.type.BUG.plural')}</strong>
{' '}
{translate('about_page.quality_model.bugs')}
</p>
</div>
<div className="flex-column flex-column-third">
<div className="pull-left little-spacer-right">
<VulnerabilityIconForSonarQubeDotCom />
</div>
<p className="about-page-text overflow-hidden">
<strong>{translate('issue.type.VULNERABILITY.plural')}</strong>
{' '}
{translate('about_page.quality_model.vulnerabilities')}
</p>
</div>
<div className="flex-column flex-column-third">
<div className="pull-left little-spacer-right">
<CodeSmellIconForSonarQubeDotCom />
</div>
<p className="about-page-text overflow-hidden">
<strong>{translate('issue.type.CODE_SMELL.plural')}</strong>
{' '}
{translate('about_page.quality_model.code_smells')}
</p>
</div>
</div>
</div>
</div>
);
}
}
|
src/app/atoms/AtomPreview.react.js | blueberryapps/react-bluekit | import Component from '../PureRenderComponent.react';
import extendComponentProps from '../../libraries/extendComponentProps';
import filterFunctionProps from '../../libraries/filterFunctionProps';
import notResolved from '../../libraries/notResolved';
import Radium from 'radium';
import React from 'react';
import RPT from 'prop-types';
import resolveComponent from '../../libraries/resolveComponent';
import wrapComponentWithRescue from '../../libraries/wrapComponentWithRescue';
@Radium
export default class AtomPreview extends Component {
mounted = false
static propTypes = {
atom: RPT.object,
disableFunctionProps: RPT.bool,
variantProps: RPT.object
}
state = {
component: this.resolveComponentFromProps(this.props)
}
componentWillReceiveProps(nextProps) {
this.setState({
component: this.resolveComponentFromProps(nextProps)
})
}
resolveComponentFromProps(props) {
if (!props.atom)
return null;
return wrapComponentWithRescue(resolveComponent(props.atom.get('component')));
}
atomProps(props) {
const {atom, disableFunctionProps, variantProps} = props
const simpleProps = atom.get('simpleProps').toJS()
const filteredProps = disableFunctionProps ? filterFunctionProps(simpleProps) : simpleProps
const extendedFiltered = extendComponentProps(filteredProps, atom.get('propsDefinition'))
const customProps = variantProps ? variantProps : {}
const extendedCustom = extendComponentProps(customProps, atom.get('propsDefinition'))
const extendedProps = extendedFiltered.mergeDeep(extendedCustom)
return extendedProps;
}
render() {
const ExampleComponent = this.state.component || notResolved(this.props)
return (
<div style={styles}>
<ExampleComponent {...this.atomProps(this.props).toJS()}/>
</div>
);
}
};
const styles = {
position: 'relative',
minHeight: '35px',
minWidth: '50px'
}
|
src/svg-icons/device/battery-charging-80.js | pradel/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let DeviceBatteryCharging80 = (props) => (
<SvgIcon {...props}>
<path fillOpacity=".3" d="M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V9h4.93L13 7v2h4V5.33C17 4.6 16.4 4 15.67 4z"/><path d="M13 12.5h2L11 20v-5.5H9L11.93 9H7v11.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V9h-4v3.5z"/>
</SvgIcon>
);
DeviceBatteryCharging80 = pure(DeviceBatteryCharging80);
DeviceBatteryCharging80.displayName = 'DeviceBatteryCharging80';
export default DeviceBatteryCharging80;
|
packages/plugins/i18n/admin/src/components/ModalCreate/index.js | wistityhq/strapi | import React from 'react';
import PropTypes from 'prop-types';
import { useRBACProvider, Form } from '@strapi/helper-plugin';
import {
ModalLayout,
ModalHeader,
ModalBody,
ModalFooter,
} from '@strapi/design-system/ModalLayout';
import { TabGroup, Tabs, Tab, TabPanels, TabPanel } from '@strapi/design-system/Tabs';
import { Button } from '@strapi/design-system/Button';
import { Typography } from '@strapi/design-system/Typography';
import { Divider } from '@strapi/design-system/Divider';
import { Box } from '@strapi/design-system/Box';
import { Flex } from '@strapi/design-system/Flex';
import Check from '@strapi/icons/Check';
import { useIntl } from 'react-intl';
import { Formik } from 'formik';
import localeFormSchema from '../../schemas';
import { getTrad } from '../../utils';
import useAddLocale from '../../hooks/useAddLocale';
import BaseForm from './BaseForm';
import AdvancedForm from './AdvancedForm';
const initialFormValues = {
code: '',
displayName: '',
isDefault: false,
};
const ModalCreate = ({ onClose }) => {
const { isAdding, addLocale } = useAddLocale();
const { formatMessage } = useIntl();
const { refetchPermissions } = useRBACProvider();
/**
* No need to explicitly call the onClose prop here
* since the all tree (from the root of the page) is destroyed and re-mounted
* because of the RBAC refreshing and the potential move of the default locale
*/
const handleLocaleAdd = async values => {
await addLocale({
code: values.code,
name: values.displayName,
isDefault: values.isDefault,
});
await refetchPermissions();
};
return (
<ModalLayout onClose={onClose} labelledBy="add-locale-title">
<Formik
initialValues={initialFormValues}
onSubmit={handleLocaleAdd}
validationSchema={localeFormSchema}
validateOnChange={false}
>
<Form>
<ModalHeader>
<Typography fontWeight="bold" textColor="neutral800" as="h2" id="add-locale-title">
{formatMessage({
id: getTrad('Settings.list.actions.add'),
defaultMessage: 'Add new locale',
})}
</Typography>
</ModalHeader>
<ModalBody>
<TabGroup
label={formatMessage({
id: getTrad('Settings.locales.modal.title'),
defaultMessage: 'Configurations',
})}
id="tabs"
variant="simple"
>
<Flex justifyContent="space-between">
<Typography as="h2" variant="beta">
{formatMessage({
id: getTrad('Settings.locales.modal.title'),
defaultMessage: 'Configurations',
})}
</Typography>
<Tabs>
<Tab>
{formatMessage({
id: getTrad('Settings.locales.modal.base'),
defaultMessage: 'Base settings',
})}
</Tab>
<Tab>
{formatMessage({
id: getTrad('Settings.locales.modal.advanced'),
defaultMessage: 'Advanced settings',
})}
</Tab>
</Tabs>
</Flex>
<Divider />
<Box paddingTop={7} paddingBottom={7}>
<TabPanels>
<TabPanel>
<BaseForm />
</TabPanel>
<TabPanel>
<AdvancedForm />
</TabPanel>
</TabPanels>
</Box>
</TabGroup>
</ModalBody>
<ModalFooter
startActions={
<Button variant="tertiary" onClick={onClose}>
{formatMessage({ id: 'app.components.Button.cancel', defaultMessage: 'Cancel' })}
</Button>
}
endActions={
<Button type="submit" startIcon={<Check />} disabled={isAdding}>
{formatMessage({ id: 'app.components.Button.save', defaultMessage: 'Save' })}
</Button>
}
/>
</Form>
</Formik>
</ModalLayout>
);
};
ModalCreate.propTypes = {
onClose: PropTypes.func.isRequired,
};
export default ModalCreate;
|
src/icons/BluetoothIcon.js | kiloe/ui | import React from 'react';
import Icon from '../Icon';
export default class BluetoothIcon extends Icon {
getSVG(){return <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M35.41 15.41L24 4h-2v15.17L12.83 10 10 12.83 21.17 24 10 35.17 12.83 38 22 28.83V44h2l11.41-11.41L26.83 24l8.58-8.59zM26 11.66l3.76 3.76L26 19.17v-7.51zm3.76 20.93L26 36.34v-7.52l3.76 3.77z"/></svg>;}
}; |
src/components/pages/Autobiography1Page/index.js | RussHR/github_page_src | import React from 'react';
import ContentLayout from '../../layout/ContentLayout';
import VideoIFrame from '../../VideoIFrame';
export default function Autobiography1Page() {
return (
<ContentLayout header="autobiography 1"
subheader="completed - august 2016"
links={[ 'http://russrinzler.com/autobiography-1', 'https://github.com/RussHR/autobiography-1-src' ]}>
<p>
autobiography 1 plays with a predominant principle of the relativity of color as highlighted
by the late Josef Albers. the colors of the hearts are always the same, and you can
toggle a bar of the same color in between the two.
</p>
<VideoIFrame style={{ width:"100%", paddingBottom: `${(666/1206) * 100}%` }}
src="https://player.vimeo.com/video/178854370" />
</ContentLayout>
);
} |
fields/types/money/MoneyField.js | tony2cssc/keystone | import Field from '../Field';
import React from 'react';
import { FormInput } from 'elemental';
module.exports = Field.create({
displayName: 'MoneyField',
valueChanged (event) {
var newValue = event.target.value.replace(/[^\d\s\,\.\$โฌยฃยฅ]/g, '');
if (newValue === this.props.value) return;
this.props.onChange({
path: this.props.path,
value: newValue,
});
},
renderField () {
return <FormInput name={this.props.path} ref="focusTarget" value={this.props.value} onChange={this.valueChanged} autoComplete="off" />;
},
});
|
client/components/lists/annotation-list.js | CommonActionForum/liqen-face | import React from 'react'
import PropTypes from 'prop-types'
import AnnotationItem from './annotation-item'
export default function Selector ({ annotations, onSelect }) {
return (
<div className='list-group list-group-flush'>
{
annotations.length > 0 && annotations.map(annotation => (
<div
className='list-group-item'
key={annotation.cid}
>
<AnnotationItem
tag={annotation.tag}
target={annotation.target}
pending={annotation.pending}
onSelect={() => onSelect(annotation)} />
</div>
))
}
{
annotations.length === 0 && (
<div className='list-group-item'>
Start highlighting and you will see the annotations here
</div>
)
}
</div>
)
}
Selector.propTypes = {
annotations: PropTypes.arrayOf(
PropTypes.shape({
cid: PropTypes.string.isRequired,
checked: PropTypes.bool,
tag: PropTypes.string.isRequired,
target: PropTypes.shape({
prefix: PropTypes.string.isRequired,
exact: PropTypes.string.isRequired,
suffix: PropTypes.string.isRequired
}),
pending: PropTypes.bool,
onSelect: PropTypes.func
})
)
}
|
client/src/scenes/application/scenes/Project/scenes/ProjectsList/presentation.js | YeFFreY/bernard | import React from 'react';
import { Container, Pusher, List, ListItem, ItemImage, ItemContent, FocusBox } from 'components/layout';
import { LinkButton } from 'components/form';
import { H1, H3, P } from 'components/typography';
import { addEllipsis } from 'utils';
const ProjectListItem = ({ project }) => (
<ListItem link={`/projects/${project.id}`}>
<ItemImage src="https://placehold.it/50x50" />
<ItemContent>
<H3>{project.title}</H3>
<P>{addEllipsis(project.plainDescription)}</P>
</ItemContent>
</ListItem>
);
const ProjectList = ({ projects }) => {
if (projects && projects.length > 0) {
return <List>{projects.map(project => <ProjectListItem project={project} key={project.id} />)}</List>;
} else {
return <P>No project created yet !</P>;
}
};
class ProjectsListScene extends React.Component {
componentDidMount() {
this.props.onMount();
}
render() {
return (
<Container>
<Pusher>
<H1 topOfPage>What are we going to work on today ?</H1>
<P>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.
</P>
<FocusBox>
<P>Would you like to create a new projects ?</P>
<LinkButton to="/projects/template-selection">Create Project</LinkButton>
</FocusBox>
<ProjectList projects={this.props.projects} />
</Pusher>
</Container>
);
}
}
export default ProjectsListScene;
|
app/components/GridCategories/index.js | scampersand/sonos-front | import React from 'react';
import { connect } from 'react-redux';
import ButtonArtists from 'components/ButtonArtists';
import { selectBrowserContent } from 'containers/BrowserPage/selectors';
import styles from './styles.css';
export class GridCategories extends React.Component { // eslint-disable-line react/prefer-stateless-function
render () {
let contentItems = this.props.content.items.map(({title, path}) => (
<ButtonArtists key={path} title={title} />
))
return (
<div className={styles.gridCategories}>
{contentItems}
</div>
);
}
}
const mapStateToProps = (state) => ({
content: selectBrowserContent(state),
})
const mapDispatchToProps = (dispatch) => ({
dispatch,
})
export default connect(mapStateToProps, mapDispatchToProps)(GridCategories);
|
src/components/menus/TorrentContextMenu/index.js | fcsonline/react-transmission | import React, { Component } from 'react';
import CSSModules from 'react-css-modules';
import { inject } from 'mobx-react';
import autobind from 'autobind-decorator';
import ContextMenu from 'components/menus/ContextMenu';
import styles from './styles/index.css';
@inject('view_store', 'torrents_store')
@CSSModules(styles)
class TorrentContextMenu extends Component {
@autobind pause() {
this.props.torrents_store.stop(this.props.view_store.selectedTorrents);
}
@autobind resume() {
this.props.torrents_store.start(this.props.view_store.selectedTorrents);
}
@autobind resumeNow() {
this.props.torrents_store.startNow(this.props.view_store.selectedTorrents);
}
@autobind remove() {
// TODO: Confirm dialog
this.props.torrents_store.remove(this.props.view_store.selectedTorrents);
}
@autobind trashAndRemove() {
// TODO: Confirm dialog
this.props.torrents_store.remove(this.props.view_store.selectedTorrents, {
'delete-local-data': true,
});
}
@autobind setLocation() {
this.props.view_store.toggleLocationPrompt();
}
@autobind rename() {
this.props.view_store.toggleRenamePrompt();
}
@autobind queueMoveTop() {
this.props.torrents_store.queueMoveTop(this.props.view_store.selectedTorrents);
}
@autobind queueMoveUp() {
this.props.torrents_store.queueMoveUp(this.props.view_store.selectedTorrents);
}
@autobind queueMoveDown() {
this.props.torrents_store.queueMoveDown(this.props.view_store.selectedTorrents);
}
@autobind queueMoveBottom() {
this.props.torrents_store.queueMoveBottom(this.props.view_store.selectedTorrents);
}
@autobind verify() {
this.props.torrents_store.verify(this.props.view_store.selectedTorrents);
}
@autobind askTrackerMorePeers() {
this.props.torrents_store.askTrackerMorePeers(this.props.view_store.selectedTorrents);
}
@autobind onSelectAll() {
this.props.view_store.selectTorrents(this.props.torrents_store.filteredTorrents.map((torrent) => torrent.id));
}
@autobind onDeselectAll() {
this.props.view_store.selectTorrents([]);
}
@autobind onToggleContextMenu() {
// TODO: Move it to ContextMenu component
this.props.view_store.toggleContextMenus();
}
render() {
const selectedTorrents = this.props.view_store.selectedTorrents;
const noMultiple = selectedTorrents.length > 1 ? styles.torrentMenuItemDisabled : styles.torrentMenuItem;
return (
<ContextMenu
show={this.props.show}
container={this.props.container}
target={this.props.target}
onHide={this.props.onHide}
>
<ul styleName='torrentMenu' onClick={this.onToggleContextMenu}>
<li styleName='torrentMenuItem' onClick={this.pause}>Pause</li>
<li styleName='torrentMenuItem' onClick={this.resume}>Resume</li>
<li styleName='torrentMenuItem' onClick={this.resumeNow}>Resume Now</li>
<li styleName='torrentMenuSeparator' />
<li styleName='torrentMenuItem' onClick={this.queueMoveTop}>Move to Top</li>
<li styleName='torrentMenuItem' onClick={this.queueMoveUp}>Move Up</li>
<li styleName='torrentMenuItem' onClick={this.queueMoveDown}>Move Down</li>
<li styleName='torrentMenuItem' onClick={this.queueMoveBottom}>Move to Bottom</li>
<li styleName='torrentMenuSeparator' />
<li styleName='torrentMenuItem' onClick={this.remove}>Remove From List...</li>
<li styleName='torrentMenuItem' onClick={this.trashAndRemove}>Trash Data & Remove From List...</li>
<li styleName='torrentMenuSeparator' />
<li styleName='torrentMenuItem' onClick={this.verify}>Verify Local Data</li>
<li className={noMultiple} onClick={this.setLocation} >Set Location...</li>
<li className={noMultiple} onClick={this.rename}>Rename...</li>
<li styleName='torrentMenuSeparator' />
<li styleName='torrentMenuItem' onClick={this.askTrackerMorePeers}>Ask tracker for more peers</li>
<li styleName='torrentMenuSeparator' />
<li styleName='torrentMenuItem' onClick={this.onSelectAll}>Select All</li>
<li styleName='torrentMenuItem' onClick={this.onDeselectAll}>Deselect All</li>
</ul>
</ContextMenu>
);
}
}
export default TorrentContextMenu;
|
admin/client/App/shared/Popout/PopoutListItem.js | Adam14Four/keystone | /**
* Render a popout list item
*/
import React from 'react';
import blacklist from 'blacklist';
import classnames from 'classnames';
var PopoutListItem = React.createClass({
displayName: 'PopoutListItem',
propTypes: {
icon: React.PropTypes.string,
iconHover: React.PropTypes.string,
isSelected: React.PropTypes.bool,
label: React.PropTypes.string.isRequired,
onClick: React.PropTypes.func,
},
getInitialState () {
return {
hover: false,
};
},
hover () {
this.setState({ hover: true });
},
unhover () {
this.setState({ hover: false });
},
// Render an icon
renderIcon () {
if (!this.props.icon) return null;
const icon = this.state.hover && this.props.iconHover ? this.props.iconHover : this.props.icon;
const iconClassname = classnames('PopoutList__item__icon octicon', ('octicon-' + icon));
return <span className={iconClassname} />;
},
render () {
const itemClassname = classnames('PopoutList__item', {
'is-selected': this.props.isSelected,
});
const props = blacklist(this.props, 'className', 'icon', 'iconHover', 'isSelected', 'label');
return (
<button
type="button"
title={this.props.label}
className={itemClassname}
onFocus={this.hover}
onBlur={this.unhover}
onMouseOver={this.hover}
onMouseOut={this.unhover}
{...props}
>
{this.renderIcon()}
<span className="PopoutList__item__label">
{this.props.label}
</span>
</button>
);
},
});
module.exports = PopoutListItem;
|
packages/material-ui-icons/src/PlayCircleFilled.js | dsslimshaddy/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from 'material-ui/SvgIcon';
let PlayCircleFilled = props =>
<SvgIcon {...props}>
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z" />
</SvgIcon>;
PlayCircleFilled = pure(PlayCircleFilled);
PlayCircleFilled.muiName = 'SvgIcon';
export default PlayCircleFilled;
|
src/pages/Forgot/index.js | Kitware/HPCCloud | import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import get from 'mout/src/object/get';
import style from 'HPCCloudStyle/Login.mcss';
import layout from 'HPCCloudStyle/Layout.mcss';
import getNetworkError from '../../utils/getNetworkError';
import { forgetPassword } from '../../redux/actions/user';
import { dispatch } from '../../redux';
class ForgotPassword extends React.Component {
constructor(props) {
super(props);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleSubmit(event) {
event.preventDefault();
this.props.onResetPassword(this.email.value);
}
render() {
return (
<div className={layout.textCenter}>
<div className={style.header}>
<i className={style.forgetCloudIcon} />
<p className={style.subtitle}> Forget your password</p>
</div>
<form className={style.loginForm} onSubmit={this.handleSubmit}>
<input
ref={(c) => {
this.email = c;
}}
className={style.loginInput}
type="email"
placeholder="email"
required
/>
<div>
<button className={style.loginButton}>
Send <i className={style.sendIcon} />
</button>
</div>
{this.props.error && (
<p className={style.errorBox}>{this.props.error}</p>
)}
{this.props.success && (
<p className={style.successBox}>{this.props.success}</p>
)}
</form>
</div>
);
}
}
ForgotPassword.propTypes = {
error: PropTypes.string,
success: PropTypes.string,
onResetPassword: PropTypes.func,
};
ForgotPassword.defaultProps = {
error: null,
success: null,
onResetPassword: () => {},
};
// Binding --------------------------------------------------------------------
/* eslint-disable arrow-body-style */
export default connect(
(state) => {
return {
error: getNetworkError(state, 'user_forget'),
success: get(state, 'network.success.user_forget.resp.data.message'),
};
},
() => {
return {
onResetPassword: (email) => dispatch(forgetPassword(email)),
};
}
)(ForgotPassword);
|
src/index.js | rodrigo-puente/poke-nostalgia | import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import { browserHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux'
import rootReducer from './reducers';
import { Root } from './containers/root';
import './index.css';
const store = createStore(
rootReducer,
applyMiddleware(thunk)
);
const history = syncHistoryWithStore(browserHistory, store);
ReactDOM.render(
<Root store={store} history={history} />,
document.getElementById('root')
);
|
app/addons/documents/index-results/components/queryoptions/QueryButtons.js | michellephung/couchdb-fauxton | // 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.
import PropTypes from 'prop-types';
import React from 'react';
export default class QueryButtons extends React.Component {
constructor (props) {
super(props);
}
hideTray () {
this.props.onCancel();
}
render () {
return (
<div className="controls-group query-group">
<div id="button-options" className="controls controls-row">
<button type="submit" className="btn btn-secondary">Run Query</button>
<a onClick={this.hideTray.bind(this)} className="btn btn-cancelDark">Cancel</a>
</div>
</div>
);
}
}
QueryButtons.propTypes = {
onCancel: PropTypes.func.isRequired
};
|
src/svg-icons/action/donut-small.js | hwo411/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionDonutSmall = (props) => (
<SvgIcon {...props}>
<path d="M11 9.16V2c-5 .5-9 4.79-9 10s4 9.5 9 10v-7.16c-1-.41-2-1.52-2-2.84s1-2.43 2-2.84zM14.86 11H22c-.48-4.75-4-8.53-9-9v7.16c1 .3 1.52.98 1.86 1.84zM13 14.84V22c5-.47 8.52-4.25 9-9h-7.14c-.34.86-.86 1.54-1.86 1.84z"/>
</SvgIcon>
);
ActionDonutSmall = pure(ActionDonutSmall);
ActionDonutSmall.displayName = 'ActionDonutSmall';
ActionDonutSmall.muiName = 'SvgIcon';
export default ActionDonutSmall;
|
app/components/ToggleOption/index.js | SenyOrg/kekecmed-frontend | /**
*
* ToggleOption
*
*/
import React from 'react';
import { injectIntl, intlShape } from 'react-intl';
const ToggleOption = ({ value, message, intl }) => (
<option value={value}>
{intl.formatMessage(message)}
</option>
);
ToggleOption.propTypes = {
value: React.PropTypes.string.isRequired,
message: React.PropTypes.object.isRequired,
intl: intlShape.isRequired,
};
export default injectIntl(ToggleOption);
|
src/lib/withData.js | OpenCollective/frontend | // This file is mostly adapted from:
// https://github.com/zeit/next.js/blob/3949c82bdfe268f841178979800aa8e71bbf412c/examples/with-apollo/lib/withData.js
import React from 'react';
import PropTypes from 'prop-types';
import Head from 'next/head';
import { getDataFromTree } from 'react-apollo';
import initClient from './initClient';
// Gets the display name of a JSX component for dev tools
function getComponentDisplayName(Component) {
return Component.displayName || Component.name || 'Unknown';
}
export default ComposedComponent => {
return class WithData extends React.Component {
static defaultProps = {
serverState: {
apollo: {},
},
};
static async getInitialProps(ctx) {
// Initial serverState with apollo (empty)
let serverState = {
apollo: {
data: {},
},
};
const { Component, router } = ctx;
const options = {
headers: ctx.req ? ctx.req.headers : {},
};
// Evaluate the composed component's getInitialProps()
let composedInitialProps = {};
if (ComposedComponent.getInitialProps) {
composedInitialProps = await ComposedComponent.getInitialProps(ctx);
}
// Run all GraphQL queries in the component tree
// and extract the resulting data
const apollo = initClient(undefined);
try {
// create the url prop which is passed to every page
const url = {
query: ctx.query,
asPath: ctx.asPath,
pathname: ctx.pathname,
};
// Run all GraphQL queries
await getDataFromTree(
<ComposedComponent
ctx={ctx}
url={url}
client={apollo}
Component={Component}
router={router}
{...composedInitialProps}
/>,
{
router: {
asPath: ctx.asPath,
pathname: ctx.pathname,
query: ctx.query,
},
client: apollo,
},
);
} catch (error) {
// Prevent Apollo Client GraphQL errors from crashing SSR.
// Handle them in components via the data.error prop:
// http://dev.apollodata.com/react/api-queries.html#graphql-query-data-error
if (process.env.DEBUG) console.error('>>> apollo error: ', error);
}
if (!process.browser) {
// getDataFromTree does not call componentWillUnmount
// head side effect therefore need to be cleared manually
Head.rewind();
}
// Extract query data from the Apollo store
serverState = {
apollo: {
data: apollo.cache.extract(),
},
};
return {
options,
serverState,
...composedInitialProps,
};
}
static displayName = `WithData(${getComponentDisplayName(ComposedComponent)})`;
static propTypes = {
serverState: PropTypes.object.isRequired,
options: PropTypes.object,
};
static defaultProps = {
serverState: {
apollo: {
data: {},
},
},
};
constructor(props) {
super(props);
const { serverState } = this.props;
this.apollo = initClient(serverState.apollo.data);
}
render() {
return <ComposedComponent {...this.props} client={this.apollo} />;
}
};
};
|
src/documentation/RegularPage/RegularPage.stories.js | wfp/ui | import React from 'react';
import Blockquote from '../../components/Blockquote';
import RegularPage from '../RegularPage';
import Story from '../../components/Story';
import Wrapper from '../../components/Wrapper';
import { Module, ModuleHeader, ModuleBody } from '../../components/Module';
import markdown from './README.mdx';
export default {
title: 'Templates/Regular Page',
parameters: {
componentSubtitle: 'Example',
status: 'released',
mdx: markdown,
introText:
'The regular page template is used for content pages showing mainly linear texts like blog articles, wikis or news. Avoid using it for dashboards with a lot of Modules.',
previewWidth: 'full',
},
};
export const Regular = (args) => (
<RegularPage title="Regular content page" withoutSecondaryTabs>
<Wrapper pageWidth="lg" spacing="md">
<div className="row">
<div className="col-xs-12 col-md-8 col-lg-8">
<Story>
<p>
Use this page type with a white background for displaying{' '}
<span className="wfp--inline-highlight">read-only</span> content,
like documentation, news or wiki pages.
</p>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua. At vero eos et accusam et justo duo
dolores et ea rebum. Stet clita kasd gubergren, no sea takimata
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua.
</p>
<h3>Use this for regular content pages</h3>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua. At vero eos et accusam et justo duo
dolores et ea rebum. Stet clita kasd gubergren, no sea takimata
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua.
</p>
<Blockquote title="Notice">
Notice Resources should not be spent trying to modify legacy
systems, 3rd party applications or other user interfaces which
cannot easily be customised.
</Blockquote>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua. At vero eos et accusam et justo duo
dolores et ea rebum. Stet clita kasd gubergren, no sea takimata
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua.
</p>
</Story>
</div>
<div className="col-xs-12 col-md-4 col-lg-4">
<Module noMargin light style={{ padding: '1rem 0 0 2rem' }}>
<ModuleHeader>Module Example</ModuleHeader>
<ModuleBody>
<p>
Lorem Ipsum is dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy
text ever since the 1500s, when an unknown printer took a galley
of type and scrambled it to make a type specimen book.
</p>
</ModuleBody>
</Module>
<Module noMargin light style={{ padding: '1rem 0 0 2rem' }}>
<ModuleHeader>Module Example</ModuleHeader>
<ModuleBody>
<p>
It has survived not only five centuries, but also the leap into
electronic typesetting, remaining essentially unchanged.
</p>
</ModuleBody>
</Module>
</div>
</div>
</Wrapper>
</RegularPage>
);
Regular.args = {};
|
src/components/Iconfont/Iconfont.js | IssaTan1990/antd-admin | import React from 'react'
import PropTypes from 'prop-types'
import './iconfont.less'
const Iconfont = ({ type }) => <span
dangerouslySetInnerHTML={{
__html: `<svg class="iconfont" aria-hidden="true"><use xlink:href="#anticon-${type}"></use></svg>`,
}}
/>
Iconfont.propTypes = {
type: PropTypes.string,
}
export default Iconfont
|
app/scripts/containers/friends/friends.js | oriondean/stickr | import * as ActionCreators from '../../actions/index';
import React from 'react';
import { connect } from 'react-redux';
import Header from '../../components/header/header';
import './friends.scss';
class Friends extends React.Component {
render() {
let noFriendsMessage;
let noFriendRequestMessage;
let noSearchResultsMessage;
if (this.props.friends.isEmpty()) {
noFriendsMessage = <h2>You have no friends</h2>
}
if (this.props.friendRequests.size == 0) {
noFriendRequestMessage = <h2>You have no friend requests</h2>
}
if (this.props.userSearchResults.size == 0) {
noSearchResultsMessage = <h2>There are no search results</h2>;
}
return <div>
<Header isLoggedIn={this.props.isLoggedIn} user={this.props.user} viewHome={this.props.viewHome} viewFriends={this.props.viewFriends}/>
<div className="friends content">
<div className="top">
<div className="col-lg-6">
<h1>Friends</h1>
<ul className="friendList">
{ this.props.friends.toArray().map(friend => <li className="friend" key={friend.id}>{friend.name}</li>) }
</ul>
{noFriendsMessage}
</div>
<div className="col-lg-6">
<h1>Friend Requests</h1>
<ul className="friendRequestList">
{
this.props.friendRequests.toArray().map(user => {
return <li className="friendRequest" key={user.id}>
<div className="name">
{user.name}
</div>
<div className = "buttonSection">
<span className="button" onClick={() => this.props.respondToFriendRequest(true,user.id)}> Accept </span>
<span className="button" onClick={() => this.props.respondToFriendRequest(false,user.id)}> Reject </span>
</div>
</li>;
})
}
</ul>
{noFriendRequestMessage}
</div>
</div>
<div className="col-lg-12 bottom">
<div className="searchTop">
<h1>User Search</h1>
<input className="searchInput" type="text" onChange={event => this.updateUserSearchResults(event)} />
</div>
<div className="searchBody">
<ul className="searchResults">
{ this.props.userSearchResults.toArray().map(user => {
return <li className="searchResult" key={user.id}>
<span className="button" onClick={this.props.sendFriendRequest(user.id)}>Send friend request</span>
<span className="name">{user.name}</span>
</li>
})
}
</ul>
{noSearchResultsMessage}
</div>
</div>
</div>
</div>;
}
componentWillMount() {
this.props.getFriends();
this.props.getFriendRequests();
}
updateUserSearchResults(event) {
this.props.userSearch(event.target.value);
}
}
const mapStateToProps = state => {
return {
friends: state.friends,
friendRequests: state.friendRequests,
userSearchResults: state.userSearchResults,
isLoggedIn: state.authentication.get('isLoggedIn'),
user: state.authentication.get('user')
};
};
const mapDispatchToProps = dispatch => {
return {
getFriendRequests: () => dispatch(ActionCreators.getFriendRequests()),
getFriends: () => dispatch(ActionCreators.getFriends()),
sendFriendRequest: userId => ActionCreators.sendFriendRequest(userId),
respondToFriendRequest: (isAccepted, userId) => dispatch(ActionCreators.respondToFriendRequest(isAccepted, userId)),
userSearch: searchTerm => dispatch(ActionCreators.searchUsersByName(searchTerm)),
viewFriends: () => dispatch(ActionCreators.viewFriends()),
viewHome: () => dispatch(ActionCreators.viewHome())
};
};
export default connect(mapStateToProps, mapDispatchToProps)(Friends); |
src/svg-icons/action/open-in-new.js | mit-cml/iot-website-source | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionOpenInNew = (props) => (
<SvgIcon {...props}>
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"/>
</SvgIcon>
);
ActionOpenInNew = pure(ActionOpenInNew);
ActionOpenInNew.displayName = 'ActionOpenInNew';
ActionOpenInNew.muiName = 'SvgIcon';
export default ActionOpenInNew;
|
app/javascript/mastodon/features/public_timeline/components/column_settings.js | danhunsaker/mastodon | import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { injectIntl, FormattedMessage } from 'react-intl';
import SettingToggle from '../../notifications/components/setting_toggle';
export default @injectIntl
class ColumnSettings extends React.PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,
onChange: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
columnId: PropTypes.string,
};
render () {
const { settings, onChange } = this.props;
return (
<div>
<div className='column-settings__row'>
<SettingToggle settings={settings} settingPath={['other', 'onlyMedia']} onChange={onChange} label={<FormattedMessage id='community.column_settings.media_only' defaultMessage='Media only' />} />
<SettingToggle settings={settings} settingPath={['other', 'onlyRemote']} onChange={onChange} label={<FormattedMessage id='community.column_settings.remote_only' defaultMessage='Remote only' />} />
</div>
</div>
);
}
}
|
packages/cra-universal/templates/server/app.js | antonybudianto/cra-universal | import path from 'path';
import React from 'react';
import { createReactAppExpress } from '@cra-express/core';
let App = require('../src/App').default;
const clientBuildPath = path.resolve(__dirname, '../client');
const app = createReactAppExpress({
clientBuildPath,
universalRender: (req, res) => <App />,
});
if (module.hot) {
module.hot.accept('../src/App', () => {
App = require('../src/App').default;
console.log('โ
Server hot reloaded App');
});
}
export default app;
|
docs-ui/components/narrowLayout.stories.js | looker/sentry | import React from 'react';
import {storiesOf} from '@storybook/react';
// import {action} from '@storybook/addon-actions';
import {withInfo} from '@storybook/addon-info';
import NarrowLayout from 'app/components/narrowLayout';
storiesOf('NarrowLayout', module).add(
'default',
withInfo('A narrow layout')(() => <NarrowLayout>Narrow Layout</NarrowLayout>)
);
|
src/components/ToggleArrow/ToggleArrow.js | typical000/paveldavydov | import React from 'react'
import PropTypes from 'prop-types'
import cn from 'classnames'
import {rotateZ, translate, translateX, multiple} from 'css-functions'
import {Arrow} from '../icons'
import {transition} from '../../utils/css'
import injectSheet from '../../utils/jss'
const styles = (theme) => ({
toggler: {
letterSpacing: 2,
textTransform: 'uppercase',
font: {
family: theme.typography.fontFamily,
size: 18,
weight: 'bold',
},
border: 0,
outline: 0,
padding: 0,
margin: 0,
background: 'transparent',
cursor: 'pointer',
color: theme.text.default,
fill: theme.text.default,
transition: transition(1000),
},
text: {
verticalAlign: 'middle',
'&:empty': {
display: 'none',
},
},
arrow: {
display: 'inline-block',
verticalAlign: 'middle',
opacity: 0.5,
'&:first-child': {
paddingRight: 20,
'& $icon': {
transform: rotateZ(180),
},
},
'&:last-child': {
paddingLeft: 20,
},
},
icon: {
height: 13,
maxWidth: 'none',
},
// Directions
up: {
transformOrigin: ['100%', 0],
transform: multiple(translate('-100%', 0), rotateZ(-90)),
'&:hover': {
transform: multiple(translate('-100%', 20), rotateZ(-90)),
},
},
down: {
transformOrigin: ['100%', '100%'],
transform: multiple(translate('-100%', 0), rotateZ(90)),
'&:hover': {
transform: multiple(translate('-100%', -20), rotateZ(90)),
},
},
left: {
'&:hover': {
transform: translateX(20),
},
},
right: {
'&:hover': {
transform: translateX(-20),
},
},
})
const isInvertedArrow = (direction) => {
if (direction === 'top' || direction === 'left') {
return true
}
return false
}
const ToggleArrow = ({onClick, classes, children, direction}) => {
const classNames = cn(classes.toggler, {
[classes.up]: direction === 'up',
[classes.down]: direction === 'down',
[classes.left]: direction === 'left',
[classes.right]: direction === 'right',
})
const inverted = isInvertedArrow(direction)
const Tag = onClick ? 'button' : 'div'
return (
<Tag className={classNames} onClick={onClick}>
{inverted && (
<div className={classes.arrow}>
<Arrow className={classes.icon} />
</div>
)}
<span className={classes.text}>{children}</span>
{!inverted && (
<div className={classes.arrow}>
<Arrow className={classes.icon} />
</div>
)}
</Tag>
)
}
ToggleArrow.propTypes = {
classes: PropTypes.objectOf(PropTypes.string).isRequired,
children: PropTypes.node,
onClick: PropTypes.func,
direction: PropTypes.oneOf(['right', 'left', 'up', 'down']),
}
ToggleArrow.defaultProps = {
children: '',
onClick: null,
direction: 'right',
}
export default injectSheet(styles)(ToggleArrow)
|
app/javascript/flavours/glitch/components/autosuggest_input.js | Kirishima21/mastodon | import React from 'react';
import AutosuggestAccountContainer from 'flavours/glitch/features/compose/containers/autosuggest_account_container';
import AutosuggestEmoji from './autosuggest_emoji';
import AutosuggestHashtag from './autosuggest_hashtag';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import ImmutablePureComponent from 'react-immutable-pure-component';
import classNames from 'classnames';
const textAtCursorMatchesToken = (str, caretPosition, searchTokens) => {
let word;
let left = str.slice(0, caretPosition).search(/[^\s\u200B]+$/);
let right = str.slice(caretPosition).search(/[\s\u200B]/);
if (right < 0) {
word = str.slice(left);
} else {
word = str.slice(left, right + caretPosition);
}
if (!word || word.trim().length < 3 || searchTokens.indexOf(word[0]) === -1) {
return [null, null];
}
word = word.trim().toLowerCase();
if (word.length > 0) {
return [left, word];
} else {
return [null, null];
}
};
export default class AutosuggestInput extends ImmutablePureComponent {
static propTypes = {
value: PropTypes.string,
suggestions: ImmutablePropTypes.list,
disabled: PropTypes.bool,
placeholder: PropTypes.string,
onSuggestionSelected: PropTypes.func.isRequired,
onSuggestionsClearRequested: PropTypes.func.isRequired,
onSuggestionsFetchRequested: PropTypes.func.isRequired,
onChange: PropTypes.func.isRequired,
onKeyUp: PropTypes.func,
onKeyDown: PropTypes.func,
autoFocus: PropTypes.bool,
className: PropTypes.string,
id: PropTypes.string,
searchTokens: PropTypes.arrayOf(PropTypes.string),
maxLength: PropTypes.number,
};
static defaultProps = {
autoFocus: true,
searchTokens: ['@', ':', '#'],
};
state = {
suggestionsHidden: true,
focused: false,
selectedSuggestion: 0,
lastToken: null,
tokenStart: 0,
};
onChange = (e) => {
const [ tokenStart, token ] = textAtCursorMatchesToken(e.target.value, e.target.selectionStart, this.props.searchTokens);
if (token !== null && this.state.lastToken !== token) {
this.setState({ lastToken: token, selectedSuggestion: 0, tokenStart });
this.props.onSuggestionsFetchRequested(token);
} else if (token === null) {
this.setState({ lastToken: null });
this.props.onSuggestionsClearRequested();
}
this.props.onChange(e);
}
onKeyDown = (e) => {
const { suggestions, disabled } = this.props;
const { selectedSuggestion, suggestionsHidden } = this.state;
if (disabled) {
e.preventDefault();
return;
}
if (e.which === 229 || e.isComposing) {
// Ignore key events during text composition
// e.key may be a name of the physical key even in this case (e.x. Safari / Chrome on Mac)
return;
}
switch(e.key) {
case 'Escape':
if (suggestions.size === 0 || suggestionsHidden) {
document.querySelector('.ui').parentElement.focus();
} else {
e.preventDefault();
this.setState({ suggestionsHidden: true });
}
break;
case 'ArrowDown':
if (suggestions.size > 0 && !suggestionsHidden) {
e.preventDefault();
this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) });
}
break;
case 'ArrowUp':
if (suggestions.size > 0 && !suggestionsHidden) {
e.preventDefault();
this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) });
}
break;
case 'Enter':
case 'Tab':
// Select suggestion
if (this.state.lastToken !== null && suggestions.size > 0 && !suggestionsHidden) {
e.preventDefault();
e.stopPropagation();
this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestions.get(selectedSuggestion));
}
break;
}
if (e.defaultPrevented || !this.props.onKeyDown) {
return;
}
this.props.onKeyDown(e);
}
onBlur = () => {
this.setState({ suggestionsHidden: true, focused: false });
}
onFocus = () => {
this.setState({ focused: true });
}
onSuggestionClick = (e) => {
const suggestion = this.props.suggestions.get(e.currentTarget.getAttribute('data-index'));
e.preventDefault();
this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion);
this.input.focus();
}
componentWillReceiveProps (nextProps) {
if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) {
this.setState({ suggestionsHidden: false });
}
}
setInput = (c) => {
this.input = c;
}
renderSuggestion = (suggestion, i) => {
const { selectedSuggestion } = this.state;
let inner, key;
if (suggestion.type === 'emoji') {
inner = <AutosuggestEmoji emoji={suggestion} />;
key = suggestion.id;
} else if (suggestion.type ==='hashtag') {
inner = <AutosuggestHashtag tag={suggestion} />;
key = suggestion.name;
} else if (suggestion.type === 'account') {
inner = <AutosuggestAccountContainer id={suggestion.id} />;
key = suggestion.id;
}
return (
<div role='button' tabIndex='0' key={key} data-index={i} className={classNames('autosuggest-textarea__suggestions__item', { selected: i === selectedSuggestion })} onMouseDown={this.onSuggestionClick}>
{inner}
</div>
);
}
render () {
const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength } = this.props;
const { suggestionsHidden } = this.state;
return (
<div className='autosuggest-input'>
<label>
<span style={{ display: 'none' }}>{placeholder}</span>
<input
type='text'
ref={this.setInput}
disabled={disabled}
placeholder={placeholder}
autoFocus={autoFocus}
value={value}
onChange={this.onChange}
onKeyDown={this.onKeyDown}
onKeyUp={onKeyUp}
onFocus={this.onFocus}
onBlur={this.onBlur}
dir='auto'
aria-autocomplete='list'
id={id}
className={className}
maxLength={maxLength}
/>
</label>
<div className={`autosuggest-textarea__suggestions ${suggestionsHidden || suggestions.isEmpty() ? '' : 'autosuggest-textarea__suggestions--visible'}`}>
{suggestions.map(this.renderSuggestion)}
</div>
</div>
);
}
}
|
packages/giu/src/inputs/textNumberRangeInput.js | guigrpa/giu | // @flow
import React from 'react';
import { omit } from 'timm';
import classnames from 'classnames';
import { isNumber } from '../gral/validators';
import type { Theme } from '../gral/themeContext';
import Input, { INPUT_HOC_INVALID_HTML_PROPS } from '../hocs/input';
import type { InputHocPublicProps } from '../hocs/input';
const NULL_VALUE = '';
const CLASS_OPTIONS = {
text: {
toInternalValue: val => (val != null ? val : NULL_VALUE),
toExternalValue: val => (val !== NULL_VALUE ? val : null),
isNull: val => val === NULL_VALUE,
},
password: {
toInternalValue: val => (val != null ? val : NULL_VALUE),
toExternalValue: val => (val !== NULL_VALUE ? val : null),
isNull: val => val === NULL_VALUE,
},
number: {
toInternalValue: val => (val != null ? String(val) : NULL_VALUE),
toExternalValue: val => (val !== NULL_VALUE ? Number(val) : null),
isNull: val => val === NULL_VALUE,
defaultValidators: { isNumber: isNumber() },
},
range: {
toInternalValue: val => (val != null ? String(val) : NULL_VALUE),
toExternalValue: val => (val !== NULL_VALUE ? Number(val) : null),
isNull: val => val === NULL_VALUE,
},
};
CLASS_OPTIONS.email = CLASS_OPTIONS.text;
CLASS_OPTIONS.url = CLASS_OPTIONS.text;
// ==========================================
// Declarations
// ==========================================
// -- Props:
// -- START_DOCS
type PublicProps = {
...$Exact<InputHocPublicProps>, // common to all inputs (check the docs!)
className?: string,
id?: string,
disabled?: boolean,
skipTheme?: boolean,
vertical?: boolean, // only for RangeInput
// all others are passed through to the `input` unchanged
};
// -- END_DOCS
type Props = {
...$Exact<PublicProps>,
id?: string,
placeholder?: string,
// Input HOC
theme: Theme,
curValue: any,
errors: Array<string>,
registerOuterRef: Function,
registerFocusableRef: Function,
fFocused: boolean,
};
// Should include all public props, + 'required', 'style':
const FILTERED_OUT_PROPS = [
...INPUT_HOC_INVALID_HTML_PROPS,
'className',
'id',
'disabled',
'skipTheme',
'vertical',
'required',
'style',
];
const FILTERED_OUT_PROPS_MDL = FILTERED_OUT_PROPS.concat(['placeholder']);
// ==========================================
// Component
// ==========================================
function createClass(componentName, inputType) {
const BaseKlass = class extends React.Component<Props> {
static displayName = componentName;
refMdl: any = React.createRef();
componentDidMount() {
if (this.props.theme.id === 'mdl' && this.refMdl.current) {
window.componentHandler.upgradeElement(this.refMdl.current);
}
}
// ==========================================
render() {
if (
!this.props.skipTheme &&
this.props.theme.id === 'mdl' &&
!this.props.vertical
) {
return this.renderMdl();
}
const {
curValue,
disabled,
registerFocusableRef,
// For ranges
vertical,
} = this.props;
const otherProps = omit(this.props, FILTERED_OUT_PROPS);
return (
<input
ref={registerFocusableRef}
className={classnames(
`giu-input-reset giu-${inputType}-input`,
{ 'giu-input-disabled': disabled },
this.props.className
)}
id={this.props.id}
type={inputType}
value={curValue}
{...otherProps}
orient={vertical ? 'vertical' : undefined}
tabIndex={disabled ? -1 : undefined}
/>
);
}
renderMdl() {
if (inputType === 'range') return this.renderMdlSlider();
const {
id,
curValue,
disabled,
registerFocusableRef,
fFocused,
} = this.props;
const otherProps = omit(this.props, FILTERED_OUT_PROPS_MDL);
const internalId = id ? `giu-${inputType}-input-${id}` : undefined;
return (
<div
ref={this.refMdl}
className={classnames(
`giu-${inputType}-input`,
`giu-${inputType}-input-mdl`,
'mdl-textfield mdl-js-textfield mdl-textfield--floating-label',
{
'is-dirty': curValue !== '' || fFocused,
disabled,
},
this.props.className
)}
id={id}
>
<input
ref={registerFocusableRef}
className="mdl-textfield__input"
type={inputType === 'password' ? 'password' : 'text'}
value={curValue}
id={internalId}
{...otherProps}
tabIndex={disabled ? -1 : undefined}
/>
<label className="mdl-textfield__label" htmlFor={internalId}>
{this.props.placeholder || ''}
</label>
</div>
);
}
renderMdlSlider() {
const { curValue, disabled, registerFocusableRef } = this.props;
const otherProps = omit(this.props, FILTERED_OUT_PROPS);
return (
<input
ref={registerFocusableRef}
className={classnames(
`giu-${inputType}-input giu-${inputType}-input-mdl`,
'mdl-slider mdl-js-slider',
this.props.className
)}
id={this.props.id}
type={inputType}
value={curValue}
{...otherProps}
tabIndex={disabled ? -1 : undefined}
/>
);
}
};
// ==========================================
const hocOptions = {
componentName,
...CLASS_OPTIONS[inputType],
className: `giu-${inputType}-input-wrapper`,
};
const render = props => <BaseKlass {...props} />;
// $FlowFixMe
const Klass = React.forwardRef((publicProps: PublicProps, ref) => (
<Input hocOptions={hocOptions} render={render} {...publicProps} ref={ref} />
));
return Klass;
}
// ==========================================
// Public
// ==========================================
const TextInput = createClass('TextInput', 'text');
const EmailInput = createClass('EmailInput', 'email');
const UrlInput = createClass('UrlInput', 'url');
const PasswordInput = createClass('PasswordInput', 'password');
const NumberInput = createClass('NumberInput', 'number');
const RangeInput = createClass('RangeInput', 'range');
export {
TextInput,
EmailInput,
UrlInput,
PasswordInput,
NumberInput,
RangeInput,
};
|
src/svg-icons/maps/local-activity.js | jacklam718/react-svg-iconx | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let MapsLocalActivity = (props) => (
<SvgIcon {...props}>
<path d="M20 12c0-1.1.9-2 2-2V6c0-1.1-.9-2-2-2H4c-1.1 0-1.99.9-1.99 2v4c1.1 0 1.99.9 1.99 2s-.89 2-2 2v4c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-4c-1.1 0-2-.9-2-2zm-4.42 4.8L12 14.5l-3.58 2.3 1.08-4.12-3.29-2.69 4.24-.25L12 5.8l1.54 3.95 4.24.25-3.29 2.69 1.09 4.11z"/>
</SvgIcon>
);
MapsLocalActivity = pure(MapsLocalActivity);
MapsLocalActivity.displayName = 'MapsLocalActivity';
MapsLocalActivity.muiName = 'SvgIcon';
export default MapsLocalActivity;
|
src/server.js | rongkaixia/order-server | import Express from 'express';
import React from 'react';
import ReactDOM from 'react-dom/server';
import favicon from 'serve-favicon';
import compression from 'compression';
import httpProxy from 'http-proxy';
import path from 'path';
import PrettyError from 'pretty-error';
import http from 'http';
import {Provider} from 'react-redux';
import BodyParser from 'body-parser';
import CookieParser from 'cookie-parser';
import { RouterContext, match } from 'react-router';
import { ReduxAsyncConnect, loadOnServer } from 'redux-async-connect';
import createHistory from 'react-router/lib/createMemoryHistory';
import createStore from './redux/create';
import ApiClient from 'api/ApiClient';
import Html from './helpers/Html';
import getRoutes from './routes';
import ProductMiddleware from './middleware/ProductMiddleware';
import csurf from 'csrf-protection';
import {load as loadCsrfToken} from './redux/modules/csrf';
import ApiPath from 'api/ApiPath';
import {checkoutSync} from './redux/modules/checkout';
import Config from 'config';
// api
import * as api from 'api';
const pretty = new PrettyError();
const session = require('express-session');
const MongoStore = require('connect-mongo')(session);
// mango
let mango = require('mango');
mango.options['module root'] = '/Users/rk/Desktop/share_folder/order-server/src'
mango.importModels('models');
mango.mongo = Config.mongo.product_url;
mango.start();
// app and server
const app = new Express();
const server = new http.Server(app);
// express middleware
app.use(CookieParser())
app.use(BodyParser.json()); // for parsing application/json
app.use(BodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
app.use(compression());
app.use(favicon(path.join(__dirname, '..', 'static', 'favicon.ico')));
app.use(Express.static(path.join(__dirname, '..', 'static')));
const mongoSessionOptions = {url: Config.mongo.session_url};
const cookieOptions = {path: '/', httpOnly: true, secure: false,
maxAge: null, domain: Config.mainDomain};
app.use(session({
secret: 'foo',
cookie: cookieOptions,
saveUninitialized: false, // don't create session until something stored
resave: false, //don't save session if unmodified
store: new MongoStore(mongoSessionOptions)
}));
// csrf protection
const csrfProtection = csurf({cookie: true, ignoredPath: ['/buy/checkout']})
app.use(csrfProtection)
// captain router, redirect request to captain server
// app.use(ProductMiddleware);
// api
app.post(ApiPath.ORDER, api.Order);
app.post(ApiPath.NOTIFY, api.Notify);
app.get(ApiPath.ORDER_INFO, api.QueryOrderInfo);
app.post(ApiPath.DELIVER, api.Deliver);
app.post(ApiPath.DELIVER_CONFIRM, api.DeliverConfirm);
app.post(ApiPath.REFUND, api.Refund);
app.post(ApiPath.REFUND_CONFIRM, api.RefundConfirm);
app.post(ApiPath.CANCEL, api.Cancel);
app.use(ApiPath.AUTH, api.Auth);
app.use(ApiPath.LOGIN, api.Login);
app.use(ApiPath.LOGOUT, api.Logout);
app.use(ApiPath.SIGNUP, api.Signup);
app.get(ApiPath.USER_INFO, api.QueryUserInfo);
app.post(ApiPath.USER_INFO + '/:field', api.UpdateUserInfo);
app.get(ApiPath.USER_ORDER, api.QueryUserOrder);
app.post(ApiPath.USER_ADDRESS, api.AddUserAddress);
app.delete(ApiPath.USER_ADDRESS, api.DeleteUserAddress);
app.put(ApiPath.USER_ADDRESS, api.UpdateUserAddress);
app.get(ApiPath.USER_CART, api.QueryCart);
app.post(ApiPath.USER_CART, api.AddCart);
app.put(ApiPath.USER_CART, api.UpdateCart);
app.delete(ApiPath.USER_CART, api.DeleteCart);
app.get(ApiPath.PRODUCT_INFO, api.QueryProductInfo)
app.get(ApiPath.ITEM_INFO, api.QueryItemInfo)
app.post(ApiPath.PRICING, api.Pricing)
// load redux store middleware
app.use((req, res, next) => {
const apiClient = new ApiClient(req,res);
const history = createHistory(req.originalUrl);
const initData = undefined;
const store = createStore(history, initData, {apiClient: apiClient});
// load csrf token to store
store.dispatch(loadCsrfToken(req.csrfToken()));
req.history = history;
req.reduxStore = store;
next();
})
app.use((req, res) => {
console.log("*************In normal app use((req,res)=>{...})***************")
console.log("req.originalUrl: " + req.originalUrl)
console.log("req.path: " + req.path)
console.log("req.method: " + req.method)
if (__DEVELOPMENT__) {
// Do not cache webpack stats: the script file would change since
// hot module replacement is enabled in the development env
webpackIsomorphicTools.refresh();
}
const history = req.history;
const store = req.reduxStore;
function hydrateOnClient() {
res.send('<!doctype html>\n' +
ReactDOM.renderToString(<Html assets={webpackIsomorphicTools.assets()} store={store}/>));
}
if (__DISABLE_SSR__) {
hydrateOnClient();
return;
}
match({ history, routes: getRoutes(store), location: req.originalUrl }, (error, redirectLocation, renderProps) => {
if (redirectLocation) {
console.info('redirect')
res.redirect(redirectLocation.pathname + redirectLocation.search);
} else if (error) {
console.error('ROUTER ERROR:', pretty.render(error));
res.status(500);
hydrateOnClient();
} else if (renderProps) {
// load csrf token into store
store.dispatch(loadCsrfToken(req.csrfToken()));
if (req.path === '/buy/checkout' && req.method === 'POST' && req.body) {
console.log("=============/buy/checkout/=============")
console.log(JSON.stringify(req.body))
store.dispatch(checkoutSync(req.body.items));
}
loadOnServer({...renderProps, store, helpers: {req}}).then(() => {
const component = (
<Provider store={store} key="provider">
<ReduxAsyncConnect {...renderProps} />
</Provider>
);
res.status(200);
global.navigator = {userAgent: req.headers['user-agent']};
res.send('<!doctype html>\n' +
ReactDOM.renderToString(<Html assets={webpackIsomorphicTools.assets()} component={component} store={store}/>));
});
} else {
res.status(404).send('Not found');
}
});
});
// start server
if (Config.port) {
server.listen(Config.port, (err) => {
if (err) {
console.error(err);
}
console.info('==> ๐ป Open http://%s:%s in a browser to view the app.', Config.host, Config.port);
});
} else {
console.error('==> ERROR: No PORT environment variable has been specified');
}
|
examples/react/todomvc/src/components/App.js | rohan-deshpande/trux | import React from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import { TodoApp } from './connectors';
import Info from './Info';
export default function App() {
return (
<main>
<Router>
<Switch>
<Route exact path="/" component={TodoApp} />
<Route path="/active" component={TodoApp} />
<Route path="/completed" component={TodoApp} />
</Switch>
</Router>
<Info />
</main>
);
}
|
src/svg-icons/action/report-problem.js | pradel/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionReportProblem = (props) => (
<SvgIcon {...props}>
<path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/>
</SvgIcon>
);
ActionReportProblem = pure(ActionReportProblem);
ActionReportProblem.displayName = 'ActionReportProblem';
export default ActionReportProblem;
|
docs/app/Examples/collections/Menu/index.js | mohammed88/Semantic-UI-React | import React from 'react'
import Content from './Content'
import Types from './Types'
import States from './States'
import Variations from './Variations'
const MenuExamples = () => {
return (
<div>
<Types />
<Content />
<States />
<Variations />
</div>
)
}
export default MenuExamples
|
src/redux-form/createInputCreator.js | esbenp/react-native-clean-form | import React from 'react'
import { View } from 'react-native'
import PropTypes from 'prop-types'
import { FormGroup, Label } from '../../index'
import styled from 'styled-components/native'
import defaultTheme from '../Theme'
const ErrorMessage = styled.Text`
color: ${props => props.theme.ErrorMessage.color};
fontSize: ${props => props.theme.ErrorMessage.fontSize};
marginBottom: ${props => props.theme.ErrorMessage.marginBottom};
textAlign: ${props => props.theme.ErrorMessage.textAlign};
`
ErrorMessage.defaultProps = {
theme: defaultTheme
}
const render = renderComponent => props => {
const { border, input : { onChange, ...restInput }, label, inlineLabel, theme, meta: { touched, error } } = props
return (
<View>
<FormGroup border={border} inlineLabel={inlineLabel} theme={theme} error={touched && !!error} {...props} >
<Label theme={theme}>{ label }</Label>
{ renderComponent(props) }
</FormGroup>
{ touched && error && <ErrorMessage theme={theme}>{ error }</ErrorMessage> }
</View>
)
}
const createInputCreator = ReduxFormFieldComponent => (name, renderFunction, PropTypesOverrides = {}, defaultProps = {}) => {
const Component = render(renderFunction)
Component.displayName = name
const FieldWrapper = props => {
const { component, name, ...rest } = props
return <ReduxFormFieldComponent name={name} component={Component} {...rest} />
}
FieldWrapper.displayName = 'FieldWrapper'
FieldWrapper.propTypes = Object.assign({
border: PropTypes.bool,
inlineLabel: PropTypes.bool,
label: PropTypes.string.isRequired,
name: PropTypes.string.isRequired
}, PropTypesOverrides)
FieldWrapper.defaultProps = Object.assign({
border: FormGroup.defaultProps.border,
inlineLabel: FormGroup.defaultProps.inlineLabel
}, defaultProps)
return FieldWrapper
}
export default createInputCreator
|
examples/todos-with-undo/src/containers/UndoRedo.js | roth1002/redux | import React from 'react'
import { ActionCreators as UndoActionCreators } from 'redux-undo'
import { connect } from 'react-redux'
let UndoRedo = ({ canUndo, canRedo, onUndo, onRedo }) => (
<p>
<button onClick={onUndo} disabled={!canUndo}>
Undo
</button>
<button onClick={onRedo} disabled={!canRedo}>
Redo
</button>
</p>
)
const mapStateToProps = (state) => ({
canUndo: state.todos.past.length > 0,
canRedo: state.todos.future.length > 0
})
const mapDispatchToProps = ({
onUndo: UndoActionCreators.undo,
onRedo: UndoActionCreators.redo
})
UndoRedo = connect(
mapStateToProps,
mapDispatchToProps
)(UndoRedo)
export default UndoRedo
|
website/src/pages/calendar/canvas.js | plouc/nivo | import React from 'react'
import { ResponsiveCalendarCanvas, calendarCanvasDefaultProps } from '@nivo/calendar'
import { generateDayCounts } from '@nivo/generators'
import { ComponentTemplate } from '../../components/components/ComponentTemplate'
import meta from '../../data/components/calendar/meta.yml'
import mapper from '../../data/components/calendar/mapper'
import { groups } from '../../data/components/calendar/props'
import { graphql, useStaticQuery } from 'gatsby'
const from = new Date(2013, 3, 1)
const to = new Date(2019, 7, 12)
const generateData = () => generateDayCounts(from, to)
const Tooltip = data => {
/* return custom tooltip */
}
const initialProperties = {
pixelRatio:
typeof window !== 'undefined' && window.devicePixelRatio ? window.devicePixelRatio : 1,
from: '2013-03-01',
to: '2019-07-12',
align: 'center',
emptyColor: '#aa7942',
colors: ['#61cdbb', '#97e3d5', '#e8c1a0', '#f47560'],
minValue: 0,
maxValue: 'auto',
margin: {
top: 40,
right: 40,
bottom: 50,
left: 40,
},
direction: 'vertical',
yearSpacing: 30,
yearLegendPosition: 'before',
yearLegendOffset: 10,
monthSpacing: 0,
monthBorderWidth: 2,
monthBorderColor: '#ffffff',
monthLegendPosition: 'before',
monthLegendOffset: 10,
daySpacing: 0,
dayBorderWidth: 0,
dayBorderColor: '#ffffff',
isInteractive: true,
'custom tooltip example': false,
legends: [
{
anchor: 'bottom-right',
direction: 'row',
translateY: 36,
itemCount: 4,
itemWidth: 42,
itemHeight: 36,
itemsSpacing: 14,
itemDirection: 'right-to-left',
},
],
}
const CalendarCanvas = () => {
const {
image: {
childImageSharp: { gatsbyImageData: image },
},
} = useStaticQuery(graphql`
query {
image: file(absolutePath: { glob: "**/src/assets/captures/calendar.png" }) {
childImageSharp {
gatsbyImageData(layout: FIXED, width: 700, quality: 100)
}
}
}
`)
return (
<ComponentTemplate
name="CalendarCanvas"
meta={meta.CalendarCanvas}
icon="calendar"
flavors={meta.flavors}
currentFlavor="canvas"
properties={groups}
initialProperties={initialProperties}
defaultProperties={calendarCanvasDefaultProps}
propertiesMapper={mapper}
codePropertiesMapper={properties => ({
...properties,
tooltip: properties.tooltip ? Tooltip : undefined,
})}
generateData={generateData}
image={image}
>
{(properties, data, theme, logAction) => {
return (
<ResponsiveCalendarCanvas
data={data}
{...properties}
theme={theme}
onClick={day => {
logAction({
type: 'click',
label: `[day] ${day.day}: ${day.value}`,
color: day.color,
data: day,
})
}}
/>
)
}}
</ComponentTemplate>
)
}
export default CalendarCanvas
|
src/svg-icons/action/event-seat.js | owencm/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionEventSeat = (props) => (
<SvgIcon {...props}>
<path d="M4 18v3h3v-3h10v3h3v-6H4zm15-8h3v3h-3zM2 10h3v3H2zm15 3H7V5c0-1.1.9-2 2-2h6c1.1 0 2 .9 2 2v8z"/>
</SvgIcon>
);
ActionEventSeat = pure(ActionEventSeat);
ActionEventSeat.displayName = 'ActionEventSeat';
ActionEventSeat.muiName = 'SvgIcon';
export default ActionEventSeat;
|
front_end/src/pages/Tiles/TileViewPage.js | mozilla/splice | import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import { updateDocTitle, pageVisit, displayMessage, shownMessage } from 'actions/App/AppActions';
import { updateTile } from 'actions/Tiles/TileActions';
import { fetchHierarchy } from 'actions/App/BreadCrumbActions';
import TileDetails from 'components/Tiles/TileDetails/TileDetails';
import TilePreview from 'components/Tiles/TilePreview/TilePreview';
class TileViewPage extends Component {
componentWillMount() {
this.fetchTileDetails(this.props);
}
componentWillReceiveProps(nextProps) {
if (nextProps.params.tileId !== this.props.params.tileId) {
this.fetchTileDetails(nextProps);
}
}
render() {
let output = (<div/>);
if(this.props.Tile.details) {
output = (
<div className="row">
<div className="col-xs-12">
<TileDetails Tile={this.props.Tile}/>
<TilePreview Tile={this.props.Tile} handleApprove={() => this.handleApprove()} handleDisapprove={() => this.handleDisapprove()}/>
</div>
</div>
);
}
return output;
}
fetchTileDetails(props) {
const { dispatch } = props;
updateDocTitle('Tile View');
dispatch(fetchHierarchy('tile', props))
.then(() => {
if(this.props.Tile.details.id) {
pageVisit('Tile - ' + this.props.Tile.details.title, this);
}
else{
props.history.replaceState(null, '/error404');
}
});
}
handleApprove(){
const { dispatch } = this.props;
const data = JSON.stringify({id: this.props.Tile.details.id, status: 'approved'});
dispatch(updateTile(this.props.Tile.details.id, data))
.then(function(response){
dispatch(displayMessage('success', 'Tile has been Approved.') );
dispatch(shownMessage());
});
}
handleDisapprove(){
const { dispatch } = this.props;
const data = JSON.stringify({id: this.props.Tile.details.id, status: 'disapproved'});
dispatch(updateTile(this.props.Tile.details.id, data))
.then(function(response){
dispatch(displayMessage('success', 'Tile has been Disapproved.') );
dispatch(shownMessage());
});
}
}
TileViewPage.propTypes = {};
function select(state) {
return {
Account: state.Account,
Campaign: state.Campaign,
AdGroup: state.AdGroup,
Tile: state.Tile
};
}
// Wrap the component to inject dispatch and state into it
export default connect(select)(TileViewPage);
|
packages/site/src/components/richText.js | massgov/mayflower | import React from 'react';
import PropTypes from 'prop-types';
import ReactHtmlParser from 'react-html-parser';
const RichText = ({
className, id, htmlTag, rawHtml, transform
}) => {
const CustomElement = htmlTag;
return(
<CustomElement ref={(element) => element} className={className} id={id}>
{ReactHtmlParser(rawHtml, { transform })}
</CustomElement>
);
};
RichText.propTypes = {
/** The raw html that you want to render. * */
rawHtml: PropTypes.string,
/** A className that you want to component to reference. * */
className: PropTypes.string,
/** An id to be rendered on the component. * */
id: PropTypes.string,
/** The html tag you want the component to be. By default, this is a `div`. * */
htmlTag: PropTypes.string,
/** The transform function will be called for every node that is parsed by ReactHtmlParser.
* See documentation of react-html-parser for the transform function: https://www.npmjs.com/package/react-html-parser#transform-function
* */
transform: PropTypes.func
};
RichText.defaultProps = {
htmlTag: 'div'
};
export default RichText;
|
jenkins-design-language/src/js/components/material-ui/svg-icons/device/location-disabled.js | alvarolobato/blueocean-plugin | import React from 'react';
import SvgIcon from '../../SvgIcon';
const DeviceLocationDisabled = (props) => (
<SvgIcon {...props}>
<path d="M20.94 11c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06c-1.13.12-2.19.46-3.16.97l1.5 1.5C10.16 5.19 11.06 5 12 5c3.87 0 7 3.13 7 7 0 .94-.19 1.84-.52 2.65l1.5 1.5c.5-.96.84-2.02.97-3.15H23v-2h-2.06zM3 4.27l2.04 2.04C3.97 7.62 3.25 9.23 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c1.77-.2 3.38-.91 4.69-1.98L19.73 21 21 19.73 4.27 3 3 4.27zm13.27 13.27C15.09 18.45 13.61 19 12 19c-3.87 0-7-3.13-7-7 0-1.61.55-3.09 1.46-4.27l9.81 9.81z"/>
</SvgIcon>
);
DeviceLocationDisabled.displayName = 'DeviceLocationDisabled';
DeviceLocationDisabled.muiName = 'SvgIcon';
export default DeviceLocationDisabled;
|
app/components/Header/index.js | perry-ugroop/ugroop-react-dup2 | import React from 'react';
import { FormattedMessage } from 'react-intl';
import A from './A';
import Img from './Img';
import NavBar from './NavBar';
import HeaderLink from './HeaderLink';
import Banner from './banner.jpg';
import messages from './messages';
class Header extends React.Component { // eslint-disable-line react/prefer-stateless-function
render() {
return (
<div>
<A href="https://twitter.com/mxstbr">
<Img src={Banner} alt="react-boilerplate - Logo" />
</A>
<NavBar>
<HeaderLink to="/">
<FormattedMessage {...messages.home} />
</HeaderLink>
<HeaderLink to="/features">
<FormattedMessage {...messages.features} />
</HeaderLink>
</NavBar>
</div>
);
}
}
export default Header;
|
src/utils/react.spec.js | HenriBeck/materialize-react | // @flow strict-local
import React from 'react';
import test from 'ava';
import sinon from 'sinon';
import {
cloneChildren,
cloneElement,
} from './react';
test('cloneElement: should clone an element with a new classname', (t) => {
const div = <div>Hello</div>;
const clonedDiv = cloneElement(div, { className: 'classname' });
t.deepEqual(clonedDiv.props.className, 'classname');
});
test('cloneElement: should not override the classname', (t) => {
const div = <div className="classname">Hello</div>;
const clonedDiv = cloneElement(div, {});
t.deepEqual(clonedDiv.props.className, 'classname');
});
test('cloneElement: should merge the classnames', (t) => {
const div = <div className="classname1">Hello</div>;
const clonedDiv = cloneElement(div, { className: 'classname2' });
t.deepEqual(clonedDiv.props.className, 'classname2 classname1');
});
test('cloneChildren: should clone an array of elements with the passed props', (t) => {
const clonedChildren = cloneChildren([
<div key="div" />,
<span key="span" />,
], { className: 'test' });
t.deepEqual(clonedChildren[0].props.className, 'test');
t.deepEqual(clonedChildren[1].props.className, 'test');
});
test('cloneChildren: should clone the children and call the function for the props', (t) => {
const clonedChildren = cloneChildren([
<div key="div" />,
<span key="span" />,
], () => {
return { className: 'test' };
});
t.deepEqual(clonedChildren[0].props.className, 'test');
t.deepEqual(clonedChildren[1].props.className, 'test');
});
test('cloneChildren: should only clone children which are valid react elements', (t) => {
const func = sinon.spy(() => {
return {};
});
cloneChildren([
<div key="div" />,
null,
], func);
t.deepEqual(func.callCount, 1);
});
|
fields/types/email/EmailField.js | woody0907/keystone | import Field from '../Field';
import React from 'react';
import { FormInput } from 'elemental';
/*
TODO:
- gravatar
- validate email address
*/
module.exports = Field.create({
displayName: 'EmailField',
renderValue () {
return this.props.value ? (
<FormInput noedit href={'mailto:' + this.props.value}>{this.props.value}</FormInput>
) : (
<FormInput noedit>(not set)</FormInput>
);
}
});
|
src/components/IssueTable/IssueRow.js | IndyXTechFellowship/Cultural-Trail-Web | import React from 'react'
import classes from './IssueRow.scss'
import moment from 'moment'
// components
import { Button, Glyphicon } from 'react-bootstrap'
const isResolved = (open) => (
open ? <Glyphicon glyph="remove" className={classes.removeIcon} /> : <Glyphicon glyph="ok" className={classes.okIcon} />
)
const renderDate = (date) => {
const d = moment(date);
return d.isValid() ? d.format("MMM DD, YYYY") : "N/A";
}
export const IssueRow = (props) => (
<tr key={props.issue.id} className={props.selected ? classes.selected : classes["not-selected"]} onClick={props.onSelect.bind(this, props.issue.id)}>
<td className={classes.resolved}>{isResolved(props.issue.open)}</td>
<td>{props.issue.name}</td>
<td>{renderDate(props.issue.reportedDate)}</td>
<td>{renderDate(props.issue.resolvedDate)}</td>
<td>CT</td>
</tr>
);
export default IssueRow
|
docs/app/Examples/elements/Label/Types/LabelExampleImage.js | vageeshb/Semantic-UI-React | import React from 'react'
import { Label } from 'semantic-ui-react'
const LabelExampleImage = () => (
<div>
<Label as='a' image>
<img src='http://semantic-ui.com/images/avatar/small/joe.jpg' />
Joe
</Label>
<Label as='a' image>
<img src='http://semantic-ui.com/images/avatar/small/elliot.jpg' />
Elliot
</Label>
<Label as='a' image>
<img src='http://semantic-ui.com/images/avatar/small/stevie.jpg' />
Stevie
</Label>
</div>
)
export default LabelExampleImage
|
app/jsx/add_people/components/people_validation_issues.js | venturehive/canvas-lms | /*
* Copyright (C) 2016 - present Instructure, Inc.
*
* This file is part of Canvas.
*
* Canvas is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, version 3 of the License.
*
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import I18n from 'i18n!roster'
import React from 'react'
import PropTypes from 'prop-types'
import shapes from './shapes'
import DuplicateSection from './duplicate_section'
import MissingPeopleSection from './missing_people_section'
import Alert from 'instructure-ui/lib/components/Alert'
class PeopleValidationIssues extends React.Component {
static propTypes = {
searchType: PropTypes.string.isRequired,
inviteUsersURL: PropTypes.string,
duplicates: PropTypes.shape(shapes.duplicatesShape),
missing: PropTypes.shape(shapes.missingsShape),
onChangeDuplicate: PropTypes.func.isRequired,
onChangeMissing: PropTypes.func.isRequired
};
static defaultProps = {
inviteUsersURL: undefined
};
static defaultProps = {
duplicates: {},
missing: {}
};
constructor (props) {
super(props);
this.state = {
newUsersForMissing: {},
focusElem: null
}
}
componentDidUpdate () {
if (this.state.focusElem) {
this.state.focusElem.focus();
}
}
// event handlers ------------------------------------
// our user chose one from a set of duplicates
// @param address: the address searched for that returned duplicate canvas users
// @param user: the user data for the one selected
onSelectDuplicate = (address, user) => {
this.props.onChangeDuplicate({address, selectedUserId: user.user_id});
}
// our user chose to create a new canvas user rather than select one of the duplicate results
// @param address: the address searched for that returned duplicate canvas users
// @param newUserInfo: the new canvas user data entered by our user
onNewForDuplicate = (address, newUserInfo) => {
this.props.onChangeDuplicate({address, newUserInfo});
}
// our user chose to skip this searched for address
// @param address: the address searched for that returned duplicate canvas users
onSkipDuplicate = (address) => {
this.props.onChangeDuplicate({address, skip: true});
}
// when the MissingPeopleSection changes,
// it sends us the current list
// @param address: the address searched for
// @param newUserInfo: the new person user wants to invite, or false if skipping
onNewForMissing = (address, newUserInfo) => {
this.props.onChangeMissing({address, newUserInfo});
}
// rendering ------------------------------------
// render the duplicates sections
renderDuplicates () {
const duplicateAddresses = this.props.duplicates && Object.keys(this.props.duplicates);
if (!duplicateAddresses || duplicateAddresses.length === 0) {
return null;
}
return (
<div className="peopleValidationissues__duplicates">
<Alert variant="warning">
{I18n.t('There were several possible matches with the import. Please resolve them below.')}
</Alert>
{duplicateAddresses.map((address) => {
const dupeSet = this.props.duplicates[address];
return (
<DuplicateSection
key={`dupe_${address}`}
inviteUsersURL={this.props.inviteUsersURL}
duplicates={dupeSet}
onSelectDuplicate={this.onSelectDuplicate}
onNewForDuplicate={this.onNewForDuplicate}
onSkipDuplicate={this.onSkipDuplicate}
/>
)
})}
</div>
);
}
// render the missing section
renderMissing () {
const missingAddresses = this.props.missing && Object.keys(this.props.missing);
if (!missingAddresses || missingAddresses.length === 0) {
return null;
}
const alertText = this.props.inviteUsersURL
? I18n.t('We were unable to find matches below. Select any you would like to create as new users. Unselected will be skipped at this time.')
: I18n.t('We were unable to find matches below.');
return (
<div className="peoplevalidationissues__missing">
<Alert variant="warning">{alertText}</Alert>
<MissingPeopleSection
inviteUsersURL={this.props.inviteUsersURL}
missing={this.props.missing}
searchType={this.props.searchType}
onChange={this.onNewForMissing}
/>
</div>
);
}
render () {
return (
<div className="addpeople__peoplevalidationissues">
{this.renderDuplicates()}
{this.renderMissing()}
</div>
);
}
}
export default PeopleValidationIssues
|
src/components/Header/Header.js | neozhangthe1/react-starter-kit | /*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */
import React, { Component } from 'react';
import styles from './Header.css';
import withStyles from '../../decorators/withStyles';
import Link from '../Link';
import Navigation from '../Navigation';
@withStyles(styles)
class Header extends Component {
render() {
return (
<div className="Header">
<div className="Header-container">
<a className="Header-brand" href="/" onClick={Link.handleClick}>
<img className="Header-brandImg" src={require('./logo-small.png')} width="38" height="38" alt="React" />
<span className="Header-brandTxt">Your Company</span>
</a>
<Navigation className="Header-nav" />
<div className="Header-banner">
<h1 className="Header-bannerTitle">React</h1>
<p className="Header-bannerDesc">Complex web apps made easy</p>
</div>
</div>
</div>
);
}
}
export default Header;
|
3-namespace/button.js | aruberto/styling-react-components | import React from 'react';
import cx from 'classnames';
const Button = ({ error, ...restProps }) => (
<button
{...restProps}
className={cx(
'my-namespace-button',
{ 'my-namespace-button-error': error }
)}
/>
);
Button.propTypes = {
error: React.PropTypes.bool,
};
export default Button;
|
src/svg-icons/av/forward-10.js | pomerantsev/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let AvForward10 = (props) => (
<SvgIcon {...props}>
<path d="M4 13c0 4.4 3.6 8 8 8s8-3.6 8-8h-2c0 3.3-2.7 6-6 6s-6-2.7-6-6 2.7-6 6-6v4l5-5-5-5v4c-4.4 0-8 3.6-8 8zm6.8 3H10v-3.3L9 13v-.7l1.8-.6h.1V16zm4.3-1.8c0 .3 0 .6-.1.8l-.3.6s-.3.3-.5.3-.4.1-.6.1-.4 0-.6-.1-.3-.2-.5-.3-.2-.3-.3-.6-.1-.5-.1-.8v-.7c0-.3 0-.6.1-.8l.3-.6s.3-.3.5-.3.4-.1.6-.1.4 0 .6.1.3.2.5.3.2.3.3.6.1.5.1.8v.7zm-.8-.8v-.5s-.1-.2-.1-.3-.1-.1-.2-.2-.2-.1-.3-.1-.2 0-.3.1l-.2.2s-.1.2-.1.3v2s.1.2.1.3.1.1.2.2.2.1.3.1.2 0 .3-.1l.2-.2s.1-.2.1-.3v-1.5z"/>
</SvgIcon>
);
AvForward10 = pure(AvForward10);
AvForward10.displayName = 'AvForward10';
AvForward10.muiName = 'SvgIcon';
export default AvForward10;
|
src/components/Header/Header.js | mimiflynn/react-starter-kit | /*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */
import React from 'react';
import styles from './Header.css';
import withStyles from '../../decorators/withStyles';
import Link from '../../utils/Link';
import Navigation from '../Navigation';
@withStyles(styles)
class Header {
render() {
return (
<div className="Header">
<div className="Header-container">
<a className="Header-brand" href="/" onClick={Link.handleClick}>
<img className="Header-brandImg" src={require('./logo-small.png')} width="38" height="38" alt="React" />
<span className="Header-brandTxt">Your Company</span>
</a>
<Navigation className="Header-nav" />
<div className="Header-banner">
<h1 className="Header-bannerTitle">React</h1>
<p className="Header-bannerDesc">Complex web apps made easy</p>
</div>
</div>
</div>
);
}
}
export default Header;
|
src/frontend/components/TwitterFeed.js | gbgtech/gbgtechWeb | import React from 'react';
const TwitterFeed = React.createClass({
render() {
const { path, id, children} = this.props;
return (
<div className="twitter-container paper-shadow">
<h2>Twitter - <a href={`https://twitter.com/${path}`}>{children}</a></h2>
<a
className="twitter-timeline"
ref={(link) => this.link = link }
data-chrome="noborders noheader nofooter transparent"
data-widget-id={id}>
</a>
</div>
);
}
});
export default TwitterFeed;
|
public/components/AllServers.js | supportivesantas/project-ipsum | import React from 'react';
import actions from '../actions/ipsumActions.js';
import { connect } from 'react-redux';
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';
import { Link } from 'react-router';
import _ from 'underscore';
import request from '../util/restHelpers.js';
import {Grid, Row, Col, Button} from 'react-bootstrap';
const selectRowProp = {
mode: 'checkbox',
bgColor: 'rgb(238, 193, 213)',
};
class AllServers extends React.Component {
constructor(props) {
super(props);
this.state = {
loading: false
};
}
tableLinkForm(cell) {
return (
<Link to="/myServer">
<div onClick={this.goToServer.bind(this, cell)}>
===>
</div>
</Link>
);
}
updateServers() {
this.setState({loading: true});
request.get('/user/init', (err, res) => {
if (res.status !== 401) {
console.log('refreshed', res.text)
const data = JSON.parse(res.text);
if (data.apps) {this.props.dispatch(actions.MASS_POPULATE_APPS(data.apps));}
if (data.servers) {this.props.dispatch(actions.MASS_POPULATE_SERVERS(data.servers));}
if (data.userhandle) {this.props.dispatch(actions.POPULATE_USER_DATA(data.userhandle));}
} else {
browserHistory.push('/logout');
}
this.setState({loading: false})
});
}
goToServer(cell) {
let serverSelection = _.findWhere(this.refs.table.props.data, {id: cell})
this.props.dispatch(actions.ADD_SERVER_SELECTION(serverSelection));
}
goToApp(appId) {
var apps = this.props.state.applications;
var app;
for (var i = 0; i < apps.length; i++) {
if (apps[i].id === appId) {
app = apps[i];
break;
}
}
this.props.dispatch(actions.ADD_APP_SELECTION(app));
}
tableAppsLinkForm(cell) {
return (
<div>
{cell.map((app) => {
return (<div key={app[0]+app[1]}><Link onClick={this.goToApp.bind(this, app[0])} to="/myApp">{app[1]}</Link></div>);
})}
</div>
);
}
enumFormatter(cell, row, enumObject) {
return enumObject(cell);
}
render() {
return (
<Grid style={{marginBottom:'5em'}}>
<Row><Col md={12} xs={12}> <Button bsStyle='primary' onClick={this.updateServers.bind(this)}>Refresh List</Button></Col></Row>
<Row><Col md={12} xs={12}>
{this.state.loading ? <div style={{display: 'flex', alignItems: 'center', justifyContent: 'center'}}><img src="assets/loading.gif" /></div> :
<BootstrapTable ref='table' data={this.props.state.servers} striped={true} hover={true} selectRow={selectRowProp} search={true}>
<TableHeaderColumn dataField="id" isKey={true} dataAlign="center" dataSort={true}>Server ID</TableHeaderColumn>
<TableHeaderColumn dataField="ip" dataAlign="center" dataSort={true}>Server IP</TableHeaderColumn>
<TableHeaderColumn dataField="hostname" dataAlign="center" dataSort={true}>Hostname</TableHeaderColumn>
<TableHeaderColumn dataField="platform" dataSort={true}>Platform</TableHeaderColumn>
<TableHeaderColumn dataField="active" dataSort={true}>Status</TableHeaderColumn>
<TableHeaderColumn dataField="apps" dataFormat={this.enumFormatter} formatExtraData={this.tableAppsLinkForm.bind(this)}>Application</TableHeaderColumn>
<TableHeaderColumn dataField="id" dataFormat={this.enumFormatter} formatExtraData={this.tableLinkForm.bind(this)}>See Stats</TableHeaderColumn>
</BootstrapTable>
}
</Col></Row></Grid>
);
}
}
AllServers = connect(state => ({ state: state }))(AllServers);
export default AllServers;
|
app/javascript/mastodon/features/followers/index.js | glitch-soc/mastodon | import React from 'react';
import { connect } from 'react-redux';
import ImmutablePureComponent from 'react-immutable-pure-component';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { debounce } from 'lodash';
import LoadingIndicator from '../../components/loading_indicator';
import {
lookupAccount,
fetchAccount,
fetchFollowers,
expandFollowers,
} from '../../actions/accounts';
import { FormattedMessage } from 'react-intl';
import AccountContainer from '../../containers/account_container';
import Column from '../ui/components/column';
import HeaderContainer from '../account_timeline/containers/header_container';
import ColumnBackButton from '../../components/column_back_button';
import ScrollableList from '../../components/scrollable_list';
import MissingIndicator from 'mastodon/components/missing_indicator';
import TimelineHint from 'mastodon/components/timeline_hint';
const mapStateToProps = (state, { params: { acct, id } }) => {
const accountId = id || state.getIn(['accounts_map', acct]);
if (!accountId) {
return {
isLoading: true,
};
}
return {
accountId,
remote: !!(state.getIn(['accounts', accountId, 'acct']) !== state.getIn(['accounts', accountId, 'username'])),
remoteUrl: state.getIn(['accounts', accountId, 'url']),
isAccount: !!state.getIn(['accounts', accountId]),
accountIds: state.getIn(['user_lists', 'followers', accountId, 'items']),
hasMore: !!state.getIn(['user_lists', 'followers', accountId, 'next']),
isLoading: state.getIn(['user_lists', 'followers', accountId, 'isLoading'], true),
blockedBy: state.getIn(['relationships', accountId, 'blocked_by'], false),
};
};
const RemoteHint = ({ url }) => (
<TimelineHint url={url} resource={<FormattedMessage id='timeline_hint.resources.followers' defaultMessage='Followers' />} />
);
RemoteHint.propTypes = {
url: PropTypes.string.isRequired,
};
export default @connect(mapStateToProps)
class Followers extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.shape({
acct: PropTypes.string,
id: PropTypes.string,
}).isRequired,
accountId: PropTypes.string,
dispatch: PropTypes.func.isRequired,
accountIds: ImmutablePropTypes.list,
hasMore: PropTypes.bool,
isLoading: PropTypes.bool,
blockedBy: PropTypes.bool,
isAccount: PropTypes.bool,
remote: PropTypes.bool,
remoteUrl: PropTypes.string,
multiColumn: PropTypes.bool,
};
_load () {
const { accountId, isAccount, dispatch } = this.props;
if (!isAccount) dispatch(fetchAccount(accountId));
dispatch(fetchFollowers(accountId));
}
componentDidMount () {
const { params: { acct }, accountId, dispatch } = this.props;
if (accountId) {
this._load();
} else {
dispatch(lookupAccount(acct));
}
}
componentDidUpdate (prevProps) {
const { params: { acct }, accountId, dispatch } = this.props;
if (prevProps.accountId !== accountId && accountId) {
this._load();
} else if (prevProps.params.acct !== acct) {
dispatch(lookupAccount(acct));
}
}
handleLoadMore = debounce(() => {
this.props.dispatch(expandFollowers(this.props.accountId));
}, 300, { leading: true });
render () {
const { accountIds, hasMore, blockedBy, isAccount, multiColumn, isLoading, remote, remoteUrl } = this.props;
if (!isAccount) {
return (
<Column>
<MissingIndicator />
</Column>
);
}
if (!accountIds) {
return (
<Column>
<LoadingIndicator />
</Column>
);
}
let emptyMessage;
if (blockedBy) {
emptyMessage = <FormattedMessage id='empty_column.account_unavailable' defaultMessage='Profile unavailable' />;
} else if (remote && accountIds.isEmpty()) {
emptyMessage = <RemoteHint url={remoteUrl} />;
} else {
emptyMessage = <FormattedMessage id='account.followers.empty' defaultMessage='No one follows this user yet.' />;
}
const remoteMessage = remote ? <RemoteHint url={remoteUrl} /> : null;
return (
<Column>
<ColumnBackButton multiColumn={multiColumn} />
<ScrollableList
scrollKey='followers'
hasMore={hasMore}
isLoading={isLoading}
onLoadMore={this.handleLoadMore}
prepend={<HeaderContainer accountId={this.props.accountId} hideTabs />}
alwaysPrepend
append={remoteMessage}
emptyMessage={emptyMessage}
bindToDocument={!multiColumn}
>
{blockedBy ? [] : accountIds.map(id =>
<AccountContainer key={id} id={id} withNote={false} />,
)}
</ScrollableList>
</Column>
);
}
}
|
analysis/warlockdemonology/src/modules/soulshards/SoulShardDetails.js | yajinni/WoWAnalyzer | import React from 'react';
import SPELLS from 'common/SPELLS';
import Analyzer from 'parser/core/Analyzer';
import ResourceBreakdown from 'parser/shared/modules/resources/resourcetracker/ResourceBreakdown';
import { Panel } from 'interface';
import STATISTIC_ORDER from 'parser/ui/STATISTIC_ORDER';
import Statistic from 'parser/ui/Statistic';
import BoringSpellValueText from 'parser/ui/BoringSpellValueText';
import { t } from '@lingui/macro';
import SoulShardTracker from './SoulShardTracker';
const SOUL_SHARD_ICON = 'inv_misc_gem_amethyst_02';
class SoulShardDetails extends Analyzer {
get suggestionThresholds() {
const shardsWasted = this.soulShardTracker.wasted;
const shardsWastedPerMinute = (shardsWasted / this.owner.fightDuration) * 1000 * 60;
return {
actual: shardsWastedPerMinute,
isGreaterThan: {
minor: 5 / 10, // 5 shards in 10 minute fight
average: 5 / 3, // 5 shards in 3 minute fight
major: 10 / 3, // 10 shards in 3 minute fight
},
style: 'number', // TODO: not sure about this yet
};
}
static dependencies = {
soulShardTracker: SoulShardTracker,
};
statisticOrder = STATISTIC_ORDER.CORE(2);
suggestions(when) {
const shardsWasted = this.soulShardTracker.wasted;
when(this.suggestionThresholds)
.addSuggestion((suggest, actual, recommended) => suggest('You are wasting Soul Shards. Try to use them and not let them cap and go to waste unless you\'re preparing for bursting adds etc.')
.icon(SOUL_SHARD_ICON)
.actual(t({
id: "warlock.demonology.suggestions.soulShards.wastedPerMinutes",
message: `${shardsWasted} Soul Shards wasted (${actual.toFixed(2)} per minute)`
}))
.recommended(`< ${recommended.toFixed(2)} Soul Shards per minute wasted are recommended`));
}
statistic() {
const shardsWasted = this.soulShardTracker.wasted;
return (
<Statistic
position={STATISTIC_ORDER.CORE(3)}
size="flexible"
tooltip={(<>In order for Focus Magic to compete with the other talents on that row, you need to ensure you are getting as much uptime out of the buff as possible. Therefore, if you forget to put the buff on another player or if they player you gave it to is not getting crits very often, then you might need to consider giving the buff to someone else. Ideally, you should aim to trade buffs with another mage who has also taken Focus Magic so you both get the full benefit.</>)}
>
<BoringSpellValueText spell={SPELLS.SOUL_SHARDS}>
{shardsWasted} <small>Wasted Soul Shards</small>
</BoringSpellValueText>
</Statistic>
);
}
tab() {
return {
title: 'Soul Shard usage',
url: 'soul-shards',
render: () => (
<Panel>
<ResourceBreakdown
tracker={this.soulShardTracker}
showSpenders
/>
</Panel>
),
};
}
}
export default SoulShardDetails;
|
server/sonar-web/src/main/js/apps/custom-measures/routes.js | Builders-SonarSource/sonarqube-bis | /*
* SonarQube
* Copyright (C) 2009-2016 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
import { IndexRoute } from 'react-router';
import CustomMeasuresAppContainer from './components/CustomMeasuresAppContainer';
export default (
<IndexRoute component={CustomMeasuresAppContainer}/>
);
|
src/routes.js | enapupe/know-your-bundle | import React from 'react'
import { Route } from 'react-router'
import App from './components/app'
import Main from './views/main'
const routes = () => (
<Route component={App} >
<Route path="/" component={Main} />
</Route>
)
export default routes
|
app/routes.js | derycktse/reedee | /* eslint flowtype-errors/show-errors: 0 */
import React from 'react';
import { Switch, Route } from 'react-router';
import App from './containers/App';
import HomePage from './containers/HomePage';
import CounterPage from './containers/CounterPage';
import ReedeePage from './containers/ReedeePage'
export default () => (
<App>
<Switch>
<Route path="/reedee" component={ReedeePage} />
<Route path="/counter" component={CounterPage} />
<Route path="/" component={HomePage} />
</Switch>
</App>
);
|
webpack/src/components/tray-button.js | scruffian/javascripture.mobi | import React from 'react';
export default React.createClass( {
handleClick: function() {
this.props.onChangeDisplayState( this.props.target );
},
render: function() {
var className = this.props.open ? 'open' : '';
return (
<button onClick={ this.handleClick } className={ className }>
<span className="text">{ this.props.text }</span>
<span className="icon"><img src={ this.props.icon } /></span>
</button>
);
}
} ); |
src/svg-icons/image/panorama-vertical.js | hai-cea/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImagePanoramaVertical = (props) => (
<SvgIcon {...props}>
<path d="M19.94 21.12c-1.1-2.94-1.64-6.03-1.64-9.12 0-3.09.55-6.18 1.64-9.12.04-.11.06-.22.06-.31 0-.34-.23-.57-.63-.57H4.63c-.4 0-.63.23-.63.57 0 .1.02.2.06.31C5.16 5.82 5.71 8.91 5.71 12c0 3.09-.55 6.18-1.64 9.12-.05.11-.07.22-.07.31 0 .33.23.57.63.57h14.75c.39 0 .63-.24.63-.57-.01-.1-.03-.2-.07-.31zM6.54 20c.77-2.6 1.16-5.28 1.16-8 0-2.72-.39-5.4-1.16-8h10.91c-.77 2.6-1.16 5.28-1.16 8 0 2.72.39 5.4 1.16 8H6.54z"/>
</SvgIcon>
);
ImagePanoramaVertical = pure(ImagePanoramaVertical);
ImagePanoramaVertical.displayName = 'ImagePanoramaVertical';
ImagePanoramaVertical.muiName = 'SvgIcon';
export default ImagePanoramaVertical;
|
client/src/components/Alert.js | MaximeSarrato/dariobattle | import React from 'react';
import Snackbar from 'material-ui/Snackbar';
import IconButton from 'material-ui/IconButton';
import CloseIcon from 'material-ui-icons/Close';
import { withStyles } from 'material-ui/styles';
import PropTypes from 'prop-types';
const styles = theme => ({
close: {
width: theme.spacing.unit * 4,
height: theme.spacing.unit * 4
}
});
class Alert extends React.Component {
constructor(props) {
super(props);
this.state = {
open: true
};
}
handleClose = (event, reason) => {
if (reason === 'clickaway') {
return;
}
this.setState({ open: false });
};
render() {
const { classes } = this.props;
return (
<Snackbar
anchorOrigin={{
vertical: this.props.vertical,
horizontal: this.props.horizontal
}}
autoHideDuration={6000}
open={this.state.open}
onClose={this.handleClose}
message={this.props.message}
action={[
<IconButton
key="close"
aria-label="Close"
color="secondary"
className={classes.close}
onClick={this.handleClose}
>
<CloseIcon />
</IconButton>
]}
/>
);
}
}
Alert.propTypes = {
message: PropTypes.string.isRequired,
vertical: PropTypes.string.isRequired,
horizontal: PropTypes.string.isRequired
};
export default withStyles(styles)(Alert);
|
Lab12/app.js | prpatel/react-workshop-day1 | import React from 'react';
import ReactDOM from 'react-dom';
import moment from 'moment';
import Bootstrap from 'react-bootstrap';
import Jumbotron from 'react-bootstrap/lib/Jumbotron';
import Panel from 'react-bootstrap/lib/Panel';
import Input from 'react-bootstrap/lib/Input';
import Label from 'react-bootstrap/lib/Label';
import Button from 'react-bootstrap/lib/Button';
// import api from './api';
import axios from 'axios';
var endpoint = '/lunches';
class LunchApp extends React.Component {
render() {
var now = new Date();
var formattedDate = moment(now).format('MMMM Do YYYY');
return (
<div>
<Panel>
<h2>Options for lunch for {formattedDate}:</h2>
<LunchOptionsPanel lunchData={this.props.lunchChoices}> </LunchOptionsPanel>
</Panel>
</div>
);
}
}
class LunchOptionsPanel extends React.Component {
constructor(props) {
super(props);
this.state = {selectedLunch: 'Nothing selected', lunchOrders: []};
this.handleClick = this.handleClick.bind(this);
this.showLunchOrdersHandler = this.showLunchOrdersHandler.bind(this);
this.saveLunchOrderHandler = this.saveLunchOrderHandler.bind(this);
}
handleClick(event) {
// may need to use innerText for older IE
this.setState({
selectedLunch: event.target.textContent
});
}
showLunchOrdersHandler() {
let that = this;
this.getData(function(response) {
console.log(response.data);
that.setState({lunchOrders: response.data, selectedLunch: that.state.selectedLunch});
}, function(response) {
if (response instanceof Error) {
// Something happened in setting up the request that triggered an Error
console.log('error', response);
}
});
}
saveLunchOrderHandler (name, instructions) {
console.log('sending this data to server:', this.state.selectedLunch, name, instructions);
this.saveData(this.state.selectedLunch, name, instructions, function() {
alert('sent data to server');
}, function(response) {
alert('error sending data to server' + JSON.stringify(response));
});
}
saveData(selection, name, instructions, success, error) {
// superagent.post(endpoint)
// .send({
// name: name,
// lunch: selection,
// instructions: instructions
// })
// .end(function(err, res){
// if (res.ok) {
// console.log('yay got ' + JSON.stringify(res.body));
// } else {
// console.log('Oh no! error ' + res.text);
// }
// });
axios.post(endpoint, {
name: name,
lunch: selection,
instructions: instructions
})
.then(function (response) {
success(response);
console.log(response);
})
.catch(function (response) {
error(response);
});
}
getData(success, error) {
axios.get(endpoint)
.then(function (response) {
success(response);
})
.catch(function (response) {
error(response);
});
}
render() {
let clickHandler = this.handleClick;
let lunchOptions = this.props.lunchData.map(function(c,i) {
return <h3 key={i} onClick={clickHandler}><Label>{c}</Label></h3>;
});
return (
<div>
<Panel header="Please select one" bsStyle="info">
{lunchOptions}
</Panel>
<SelectedLunchPanel selectedLunch={this.state.selectedLunch}
saveLunchOrderHandler={this.saveLunchOrderHandler}></SelectedLunchPanel>
<AllLunchOrdersPanel lunchOrders={this.state.lunchOrders} showLunchOrdersHandler={this.showLunchOrdersHandler}></AllLunchOrdersPanel>
</div>
);
}
}
class SelectedLunchPanel extends React.Component {
constructor(props) {
super(props);
this.updateInstructions = this.updateInstructions.bind(this);
this.state = { instructions: '' , guestName: ''};
}
updateInstructions(instructions, guestName) {
this.setState({instructions: instructions, guestName: guestName});
this.props.saveLunchOrderHandler(guestName, instructions);
}
render() {
return (
<div>
<Panel header="You've picked" bsStyle="warning">
<Label>{this.props.selectedLunch}</Label>
<p>Special Instructions: {this.state.instructions} for {this.state.guestName}</p>
<SpecialInstructionsInput
value={this.state.instructions}
updateInstructions={this.updateInstructions}
/>
</Panel>
</div>
);
}
}
class SpecialInstructionsInput extends React.Component {
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
}
handleChange() {
this.props.updateInstructions(this.refs.specialInstructionsInput.getValue(), this.refs.guestName.getValue());
}
render() {
return (
<div>
<Input
ref='specialInstructionsInput'
type='text'
placeholder="Enter Instructions"
/>
<Input
ref='guestName'
type='text'
placeholder="Enter Guest Name.."
/>
<Button onClick={this.handleChange}>Submit</Button>
</div>
);
}
}
class AllLunchOrdersPanel extends React.Component {
constructor(props) {
super(props);
}
render() {
let lunchOrders = this.props.lunchOrders.map(function(c,i) {
return <p key={i}>Guest: {c.name} ordered {c.lunch} with instructions: {c.instructions} </p>;
});
return (
<div>
<Panel header="Current Orders" bsStyle="info">
<Button onClick={this.props.showLunchOrdersHandler}>Get Lunch Orders</Button>
{lunchOrders}
</Panel>
</div>
);
}
}
var lunchChoices = ['Chicken', 'Fish', 'Vegetarian'];
ReactDOM.render(
<LunchApp lunchChoices={lunchChoices}/>,
document.getElementById('root')
);
|
frontend/src/MovieFile/Quality/SelectQualityModalContentConnector.js | Radarr/Radarr | import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { updateMovieFiles } from 'Store/Actions/movieFileActions';
import { fetchQualityProfileSchema } from 'Store/Actions/settingsActions';
import getQualities from 'Utilities/Quality/getQualities';
import SelectQualityModalContent from './SelectQualityModalContent';
function createMapStateToProps() {
return createSelector(
(state) => state.settings.qualityProfiles,
(qualityProfiles) => {
const {
isSchemaFetching: isFetching,
isSchemaPopulated: isPopulated,
schemaError: error,
schema
} = qualityProfiles;
return {
isFetching,
isPopulated,
error,
items: getQualities(schema.items)
};
}
);
}
const mapDispatchToProps = {
dispatchFetchQualityProfileSchema: fetchQualityProfileSchema,
dispatchupdateMovieFiles: updateMovieFiles
};
class SelectQualityModalContentConnector extends Component {
//
// Lifecycle
componentDidMount = () => {
if (!this.props.isPopulated) {
this.props.dispatchFetchQualityProfileSchema();
}
};
//
// Listeners
onQualitySelect = ({ qualityId, proper, real }) => {
const quality = _.find(this.props.items,
(item) => item.id === qualityId);
const revision = {
version: proper ? 2 : 1,
real: real ? 1 : 0
};
const movieFileIds = this.props.ids;
this.props.dispatchupdateMovieFiles({
movieFileIds,
quality: {
quality,
revision
}
});
this.props.onModalClose(true);
};
//
// Render
render() {
return (
<SelectQualityModalContent
{...this.props}
onQualitySelect={this.onQualitySelect}
/>
);
}
}
SelectQualityModalContentConnector.propTypes = {
ids: PropTypes.arrayOf(PropTypes.number).isRequired,
isFetching: PropTypes.bool.isRequired,
isPopulated: PropTypes.bool.isRequired,
error: PropTypes.object,
items: PropTypes.arrayOf(PropTypes.object).isRequired,
dispatchFetchQualityProfileSchema: PropTypes.func.isRequired,
dispatchupdateMovieFiles: PropTypes.func.isRequired,
onModalClose: PropTypes.func.isRequired
};
export default connect(createMapStateToProps, mapDispatchToProps)(SelectQualityModalContentConnector);
|
docs/app/Examples/elements/Button/States/index.js | aabustamante/Semantic-UI-React | import React from 'react'
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'
const ButtonStatesExamples = () => (
<ExampleSection title='States'>
<ComponentExample
title='Active'
description='A button can show it is currently the active user selection.'
examplePath='elements/Button/States/ButtonExampleActive'
/>
<ComponentExample
title='Disabled'
description='A button can show it is currently unable to be interacted with.'
examplePath='elements/Button/States/ButtonExampleDisabled'
/>
<ComponentExample
title='Loading'
description='A button can show a loading indicator.'
examplePath='elements/Button/States/ButtonExampleLoading'
/>
</ExampleSection>
)
export default ButtonStatesExamples
|
app/containers/App/index.js | belongapp/belong | /**
*
* App.react.js
*
* This component is the skeleton around the actual pages, and should only
* contain code that should be seen on all pages. (e.g. navigation bar)
*/
import React from 'react';
import Relay from 'react-relay';
import Helmet from 'react-helmet';
// Import the CSS reset, which HtmlWebpackPlugin transfers to the build folder
import 'sanitize.css/sanitize.css';
import Header from 'components/Header';
import Footer from 'components/Footer';
import styles from './styles.css';
function App(props) {
return (
<div className={styles.wrapper}>
<Helmet
titleTemplate="%s - Belong"
defaultTitle="Belong"
meta={[
{ name: 'description', content: 'A prototype meditation timer' },
]}
/>
<Header location={props.location.pathname} viewer={props.viewer} />
{React.Children.toArray(props.children)}
<Footer />
</div>
);
}
App.propTypes = {
viewer: React.PropTypes.object.isRequired,
children: React.PropTypes.node,
location: React.PropTypes.shape({
pathname: React.PropTypes.string.isRequired,
}).isRequired,
};
export default Relay.createContainer(App, {
fragments: {
viewer: () => Relay.QL`
fragment on Viewer {
${Header.getFragment('viewer')}
}
`,
},
});
|
src/Parser/Druid/Restoration/Modules/Talents/Cultivation.js | enragednuke/WoWAnalyzer | import React from 'react';
import StatisticBox, { STATISTIC_ORDER } from 'Main/StatisticBox';
import { formatPercentage } from 'common/format';
import SpellIcon from 'common/SpellIcon';
import SpellLink from 'common/SpellLink';
import Wrapper from 'common/Wrapper';
import SPELLS from 'common/SPELLS';
import Analyzer from 'Parser/Core/Analyzer';
import Combatants from 'Parser/Core/Modules/Combatants';
import Mastery from '../Core/Mastery';
class Cultivation extends Analyzer {
static dependencies = {
combatants: Combatants,
mastery: Mastery,
};
on_initialized() {
const hasCultivation = this.combatants.selected.hasTalent(SPELLS.CULTIVATION_TALENT.id);
this.active = hasCultivation;
}
get directPercent() {
return this.owner.getPercentageOfTotalHealingDone(this.mastery.getDirectHealing(SPELLS.CULTIVATION.id));
}
get masteryPercent() {
return this.owner.getPercentageOfTotalHealingDone(this.mastery.getMasteryHealing(SPELLS.CULTIVATION.id));
}
get totalPercent() {
return this.directPercent + this.masteryPercent;
}
get suggestionThresholds() {
return {
actual: this.totalPercent,
isLessThan: {
minor: 0.08,
average: 0.06,
major: 0.04,
},
style: 'percentage',
};
}
statistic() {
return (
<StatisticBox
icon={<SpellIcon id={SPELLS.CULTIVATION.id} />}
value={`${formatPercentage(this.totalPercent)} %`}
label="Cultivation Healing"
tooltip={`This is the sum of the direct healing from Cultivation and the healing enabled by Cultivation's extra mastery stack.
<ul>
<li>Direct: <b>${formatPercentage(this.directPercent)}%</b></li>
<li>Mastery: <b>${formatPercentage(this.masteryPercent)}%</b></li>
</ul>`}
/>
);
}
statisticOrder = STATISTIC_ORDER.OPTIONAL();
suggestions(when) {
when(this.suggestionThresholds)
.addSuggestion((suggest, actual, recommended) => {
return suggest(<Wrapper>Your healing from <SpellLink id={SPELLS.CULTIVATION.id} /> could be improved. You may have too many healers or doing easy
content, thus having low cultivation proc rate. You may considering selecting another talent.</Wrapper>)
.icon(SPELLS.CULTIVATION.icon)
.actual(`${formatPercentage(this.totalPercent)}% healing`)
.recommended(`>${Math.round(formatPercentage(recommended))}% is recommended`);
});
}
}
export default Cultivation;
|
src/components/container/ProductPage/ProductPage.js | AurimasSk/DemoStore | import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as productActions from "../../../actions/productActions";
import ProductDetails from '../../presentational/ProductDetails/ProductDetails';
class ProductPage extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
product: Object.assign({}, props.product),
};
}
componentWillReceiveProps(nextProps) {
if (this.props.product.id != nextProps.product.id) {
// Necessary to populate from when existing product is loaded directly
this.setState({ product: Object.assign({}, nextProps.product) });
}
}
render() {
return (
<div>
{
<ProductDetails product={this.props.product}/>
}
</div>
);
}
}
function getProductById(products, id) {
const product = products.filter(product => product.id == id);
if (product)
return product[0];
return null;
}
// ownProps represents any props passed to our component
function mapStateToProps(state, ownProps) {
const productId = ownProps.params.id;
let product = { id: '', info: '', otherDetails: '' };
if (productId && state.products.length > 0) {
product = getProductById(state.products, productId);
}
return {
product: product,
};
}
function mapDispatchToProps(dispatch) {
return {
productActions: bindActionCreators(productActions, dispatch)
};
}
ProductPage.propTypes = {
product: PropTypes.object.isRequired,
productActions: PropTypes.object.isRequired
};
export default connect(mapStateToProps, mapDispatchToProps)(ProductPage);
|
src/app.js | BobWhitelock/game-of-life |
import React from 'react'
import ReactDOM from 'react-dom'
import App from 'components/App'
ReactDOM.render(
<App />,
document.getElementById('root')
)
|
src/scenes/home/landing/moreInformation/moreInformation.js | alexspence/operationcode_frontend | import React, { Component } from 'react';
import Section from 'shared/components/section/section';
import ClipPathImage from 'shared/components/clipPathImage/clipPathImage';
import familyImage from 'images/Family-1.jpg';
import milImage from 'images/Mil-1.jpg';
import volunteerImage from 'images/Volunteer-1.jpg';
import styles from './moreInformation.css';
class MoreInformation extends Component {
render() {
return (
<Section title="More Information" theme="gray">
<div className={styles.moreInformation}>
<ClipPathImage
title="Military Families and Spouses"
image={familyImage}
altText="Military Families and Spouses"
link="#"
/>
<ClipPathImage
title="Veterans, Active Duty, and Reservists"
image={milImage}
altText="Veterans, Active Duty, and Reservists"
link="#"
/>
<ClipPathImage
title="Volunteers and Sponsors"
image={volunteerImage}
altText="Volunteers and Sponsors"
link="#"
/>
</div>
</Section>
);
}
}
export default MoreInformation;
|
src/svg-icons/image/landscape.js | jacklam718/react-svg-iconx | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageLandscape = (props) => (
<SvgIcon {...props}>
<path d="M14 6l-3.75 5 2.85 3.8-1.6 1.2C9.81 13.75 7 10 7 10l-6 8h22L14 6z"/>
</SvgIcon>
);
ImageLandscape = pure(ImageLandscape);
ImageLandscape.displayName = 'ImageLandscape';
ImageLandscape.muiName = 'SvgIcon';
export default ImageLandscape;
|
ajax/libs/recompose/0.20.1/Recompose.js | AMoo-Miki/cdnjs | (function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"));
else if(typeof define === 'function' && define.amd)
define(["react"], factory);
else if(typeof exports === 'object')
exports["Recompose"] = factory(require("react"));
else
root["Recompose"] = factory(root["React"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(29);
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var createHelper = function createHelper(func, helperName) {
var setDisplayName = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];
var noArgs = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
if (false) {
var _ret = function () {
/* eslint-disable global-require */
var wrapDisplayName = require('./wrapDisplayName').default;
/* eslint-enable global-require */
if (noArgs) {
return {
v: function v(BaseComponent) {
var Component = func(BaseComponent);
Component.displayName = wrapDisplayName(BaseComponent, helperName);
return Component;
}
};
}
return {
v: function v() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (args.length > func.length) {
/* eslint-disable */
console.error(
/* eslint-enable */
'Too many arguments passed to ' + helperName + '(). It should called ' + ('like so: ' + helperName + '(...args)(BaseComponent).'));
}
return function (BaseComponent) {
var Component = func.apply(undefined, args)(BaseComponent);
Component.displayName = wrapDisplayName(BaseComponent, helperName);
return Component;
};
}
};
}();
if (typeof _ret === "object") return _ret.v;
}
return func;
};
exports.default = createHelper;
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createEagerElementUtil = __webpack_require__(18);
var _createEagerElementUtil2 = _interopRequireDefault(_createEagerElementUtil);
var _isReferentiallyTransparentFunctionComponent = __webpack_require__(16);
var _isReferentiallyTransparentFunctionComponent2 = _interopRequireDefault(_isReferentiallyTransparentFunctionComponent);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createFactory = function createFactory(type) {
var isReferentiallyTransparent = (0, _isReferentiallyTransparentFunctionComponent2.default)(type);
return function (p, c) {
return (0, _createEagerElementUtil2.default)(false, isReferentiallyTransparent, type, p, c);
};
};
exports.default = createFactory;
/***/ },
/* 3 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var mapProps = function mapProps(propsMapper) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
return function (props) {
return factory(propsMapper(props));
};
};
};
exports.default = (0, _createHelper2.default)(mapProps, 'mapProps');
/***/ },
/* 5 */
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
var _config = {
fromESObservable: null,
toESObservable: null
};
var configureObservable = function configureObservable(c) {
_config = c;
};
var config = exports.config = {
fromESObservable: function fromESObservable(observable) {
return typeof _config.fromESObservable === 'function' ? _config.fromESObservable(observable) : observable;
},
toESObservable: function toESObservable(stream) {
return typeof _config.toESObservable === 'function' ? _config.toESObservable(stream) : stream;
}
};
exports.default = configureObservable;
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _shallowEqual = __webpack_require__(49);
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _shallowEqual2.default;
/***/ },
/* 7 */
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
var getDisplayName = function getDisplayName(Component) {
if (typeof Component === 'string') {
return Component;
}
if (!Component) {
return undefined;
}
return Component.displayName || Component.name || 'Component';
};
exports.default = getDisplayName;
/***/ },
/* 8 */
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
var isClassComponent = function isClassComponent(Component) {
return Boolean(Component && Component.prototype && typeof Component.prototype.isReactComponent === 'object');
};
exports.default = isClassComponent;
/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var setStatic = function setStatic(key, value) {
return function (BaseComponent) {
/* eslint-disable no-param-reassign */
BaseComponent[key] = value;
/* eslint-enable no-param-reassign */
return BaseComponent;
};
};
exports.default = (0, _createHelper2.default)(setStatic, 'setStatic', false);
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _react = __webpack_require__(3);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var shouldUpdate = function shouldUpdate(test) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
return function (_Component) {
_inherits(_class, _Component);
function _class() {
_classCallCheck(this, _class);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
_class.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
return test(this.props, nextProps);
};
_class.prototype.render = function render() {
return factory(this.props);
};
return _class;
}(_react.Component);
};
};
exports.default = (0, _createHelper2.default)(shouldUpdate, 'shouldUpdate');
/***/ },
/* 11 */
/***/ function(module, exports) {
"use strict";
exports.__esModule = true;
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var omit = function omit(obj, keys) {
var rest = _objectWithoutProperties(obj, []);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (rest.hasOwnProperty(key)) {
delete rest[key];
}
}
return rest;
};
exports.default = omit;
/***/ },
/* 12 */
/***/ function(module, exports) {
"use strict";
exports.__esModule = true;
var pick = function pick(obj, keys) {
var result = {};
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (obj.hasOwnProperty(key)) {
result[key] = obj[key];
}
}
return result;
};
exports.default = pick;
/***/ },
/* 13 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/* global window */
'use strict';
module.exports = __webpack_require__(51)(global || window || this);
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 14 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.componentFromStreamWithConfig = undefined;
var _react = __webpack_require__(3);
var _changeEmitter = __webpack_require__(19);
var _symbolObservable = __webpack_require__(13);
var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
var _setObservableConfig = __webpack_require__(5);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var componentFromStreamWithConfig = exports.componentFromStreamWithConfig = function componentFromStreamWithConfig(config) {
return function (propsToVdom) {
return function (_Component) {
_inherits(ComponentFromStream, _Component);
function ComponentFromStream() {
var _config$fromESObserva;
var _temp, _this, _ret;
_classCallCheck(this, ComponentFromStream);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = { vdom: null }, _this.propsEmitter = (0, _changeEmitter.createChangeEmitter)(), _this.props$ = config.fromESObservable((_config$fromESObserva = {
subscribe: function subscribe(observer) {
var unsubscribe = _this.propsEmitter.listen(function (props) {
return observer.next(props);
});
return { unsubscribe: unsubscribe };
}
}, _config$fromESObserva[_symbolObservable2.default] = function () {
return this;
}, _config$fromESObserva)), _this.vdom$ = config.toESObservable(propsToVdom(_this.props$)), _temp), _possibleConstructorReturn(_this, _ret);
}
// Stream of props
// Stream of vdom
ComponentFromStream.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
// Subscribe to child prop changes so we know when to re-render
this.subscription = this.vdom$.subscribe({
next: function next(vdom) {
_this2.setState({ vdom: vdom });
}
});
this.propsEmitter.emit(this.props);
};
ComponentFromStream.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
// Receive new props from the owner
this.propsEmitter.emit(nextProps);
};
ComponentFromStream.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
return nextState.vdom !== this.state.vdom;
};
ComponentFromStream.prototype.componentWillUnmount = function componentWillUnmount() {
// Clean-up subscription before un-mounting
this.subscription.unsubscribe();
};
ComponentFromStream.prototype.render = function render() {
return this.state.vdom;
};
return ComponentFromStream;
}(_react.Component);
};
};
var componentFromStream = componentFromStreamWithConfig(_setObservableConfig.config);
exports.default = componentFromStream;
/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createEagerElementUtil = __webpack_require__(18);
var _createEagerElementUtil2 = _interopRequireDefault(_createEagerElementUtil);
var _isReferentiallyTransparentFunctionComponent = __webpack_require__(16);
var _isReferentiallyTransparentFunctionComponent2 = _interopRequireDefault(_isReferentiallyTransparentFunctionComponent);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createEagerElement = function createEagerElement(type, props, children) {
var isReferentiallyTransparent = (0, _isReferentiallyTransparentFunctionComponent2.default)(type);
/* eslint-disable */
var hasKey = props && props.hasOwnProperty('key');
/* eslint-enable */
return (0, _createEagerElementUtil2.default)(hasKey, isReferentiallyTransparent, type, props, children);
};
exports.default = createEagerElement;
/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _isClassComponent = __webpack_require__(8);
var _isClassComponent2 = _interopRequireDefault(_isClassComponent);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var isReferentiallyTransparentFunctionComponent = function isReferentiallyTransparentFunctionComponent(Component) {
return Boolean(typeof Component === 'function' && !(0, _isClassComponent2.default)(Component) && !Component.defaultProps && !Component.contextTypes && !Component.propTypes);
};
exports.default = isReferentiallyTransparentFunctionComponent;
/***/ },
/* 17 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _shouldUpdate = __webpack_require__(10);
var _shouldUpdate2 = _interopRequireDefault(_shouldUpdate);
var _shallowEqual = __webpack_require__(6);
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _pick = __webpack_require__(12);
var _pick2 = _interopRequireDefault(_pick);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var onlyUpdateForKeys = function onlyUpdateForKeys(propKeys) {
return (0, _shouldUpdate2.default)(function (props, nextProps) {
return !(0, _shallowEqual2.default)((0, _pick2.default)(nextProps, propKeys), (0, _pick2.default)(props, propKeys));
});
};
exports.default = (0, _createHelper2.default)(onlyUpdateForKeys, 'onlyUpdateForKeys');
/***/ },
/* 18 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createEagerElementUtil = function createEagerElementUtil(hasKey, isReferentiallyTransparent, type, props, children) {
if (!hasKey && isReferentiallyTransparent) {
if (children) {
return type(_extends({}, props, { children: children }));
}
return type(props);
}
var Component = type;
if (children) {
return _react2.default.createElement(
Component,
props,
children
);
}
return _react2.default.createElement(Component, props);
};
exports.default = createEagerElementUtil;
/***/ },
/* 19 */
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var createChangeEmitter = exports.createChangeEmitter = function createChangeEmitter() {
var currentListeners = [];
var nextListeners = currentListeners;
function ensureCanMutateNextListeners() {
if (nextListeners === currentListeners) {
nextListeners = currentListeners.slice();
}
}
function listen(listener) {
if (typeof listener !== 'function') {
throw new Error('Expected listener to be a function.');
}
var isSubscribed = true;
ensureCanMutateNextListeners();
nextListeners.push(listener);
return function () {
if (!isSubscribed) {
return;
}
isSubscribed = false;
ensureCanMutateNextListeners();
var index = nextListeners.indexOf(listener);
nextListeners.splice(index, 1);
};
}
function emit() {
currentListeners = nextListeners;
var listeners = currentListeners;
for (var i = 0; i < listeners.length; i++) {
listeners[i].apply(listeners, arguments);
}
}
return {
listen: listen,
emit: emit
};
};
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var branch = function branch(test, left, right) {
return function (BaseComponent) {
return function (_React$Component) {
_inherits(_class2, _React$Component);
function _class2(props, context) {
_classCallCheck(this, _class2);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
_this.LeftComponent = null;
_this.RightComponent = null;
_this.computeChildComponent(_this.props);
return _this;
}
_class2.prototype.computeChildComponent = function computeChildComponent(props) {
if (test(props)) {
this.leftFactory = this.leftFactory || (0, _createEagerFactory2.default)(left(BaseComponent));
this.factory = this.leftFactory;
} else {
this.rightFactory = this.rightFactory || (0, _createEagerFactory2.default)(right(BaseComponent));
this.factory = this.rightFactory;
}
};
_class2.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
this.computeChildComponent(nextProps);
};
_class2.prototype.render = function render() {
return this.factory(this.props);
};
return _class2;
}(_react2.default.Component);
};
};
exports.default = (0, _createHelper2.default)(branch, 'branch');
/***/ },
/* 21 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _omit = __webpack_require__(11);
var _omit2 = _interopRequireDefault(_omit);
var _createEagerElement = __webpack_require__(15);
var _createEagerElement2 = _interopRequireDefault(_createEagerElement);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var componentFromProp = function componentFromProp(propName) {
var Component = function Component(props) {
return (0, _createEagerElement2.default)(props[propName], (0, _omit2.default)(props, [propName]));
};
Component.displayName = 'componentFromProp(' + propName + ')';
return Component;
};
exports.default = componentFromProp;
/***/ },
/* 22 */
/***/ function(module, exports) {
"use strict";
exports.__esModule = true;
exports.default = compose;
function compose() {
for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
funcs[_key] = arguments[_key];
}
if (funcs.length === 0) {
return function (arg) {
return arg;
};
}
if (funcs.length === 1) {
return funcs[0];
}
var last = funcs[funcs.length - 1];
return function () {
var result = last.apply(undefined, arguments);
for (var i = funcs.length - 2; i >= 0; i--) {
var f = funcs[i];
result = f(result);
}
return result;
};
}
/***/ },
/* 23 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.createEventHandlerWithConfig = undefined;
var _symbolObservable = __webpack_require__(13);
var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
var _changeEmitter = __webpack_require__(19);
var _setObservableConfig = __webpack_require__(5);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createEventHandlerWithConfig = exports.createEventHandlerWithConfig = function createEventHandlerWithConfig(config) {
return function () {
var _config$fromESObserva;
var emitter = (0, _changeEmitter.createChangeEmitter)();
var stream = config.fromESObservable((_config$fromESObserva = {
subscribe: function subscribe(observer) {
var unsubscribe = emitter.listen(function (value) {
return observer.next(value);
});
return { unsubscribe: unsubscribe };
}
}, _config$fromESObserva[_symbolObservable2.default] = function () {
return this;
}, _config$fromESObserva));
return {
handler: emitter.emit,
stream: stream
};
};
};
var createEventHandler = createEventHandlerWithConfig(_setObservableConfig.config);
exports.default = createEventHandler;
/***/ },
/* 24 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _react = __webpack_require__(3);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var createSink = function createSink(callback) {
return function (_Component) {
_inherits(Sink, _Component);
function Sink() {
_classCallCheck(this, Sink);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Sink.prototype.componentWillMount = function componentWillMount() {
callback(this.props);
};
Sink.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
callback(nextProps);
};
Sink.prototype.render = function render() {
return null;
};
return Sink;
}(_react.Component);
};
exports.default = createSink;
/***/ },
/* 25 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var defaultProps = function defaultProps(props) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
var DefaultProps = function DefaultProps(ownerProps) {
return factory(ownerProps);
};
DefaultProps.defaultProps = props;
return DefaultProps;
};
};
exports.default = (0, _createHelper2.default)(defaultProps, 'defaultProps');
/***/ },
/* 26 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var flattenProp = function flattenProp(propName) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
return function (props) {
return factory(_extends({}, props, props[propName]));
};
};
};
exports.default = (0, _createHelper2.default)(flattenProp, 'flattenProp');
/***/ },
/* 27 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var getContext = function getContext(contextTypes) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
var GetContext = function GetContext(ownerProps, context) {
return factory(_extends({}, ownerProps, context));
};
GetContext.contextTypes = contextTypes;
return GetContext;
};
};
exports.default = (0, _createHelper2.default)(getContext, 'getContext');
/***/ },
/* 28 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _hoistNonReactStatics = __webpack_require__(50);
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var hoistStatics = function hoistStatics(higherOrderComponent) {
return function (BaseComponent) {
var NewComponent = higherOrderComponent(BaseComponent);
(0, _hoistNonReactStatics2.default)(NewComponent, BaseComponent);
return NewComponent;
};
};
exports.default = hoistStatics;
/***/ },
/* 29 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.setObservableConfig = exports.createEventHandler = exports.mapPropsStream = exports.componentFromStream = exports.hoistStatics = exports.nest = exports.componentFromProp = exports.createSink = exports.createEagerFactory = exports.createEagerElement = exports.isClassComponent = exports.shallowEqual = exports.wrapDisplayName = exports.getDisplayName = exports.compose = exports.setDisplayName = exports.setPropTypes = exports.setStatic = exports.toClass = exports.lifecycle = exports.getContext = exports.withContext = exports.onlyUpdateForPropTypes = exports.onlyUpdateForKeys = exports.pure = exports.shouldUpdate = exports.renderNothing = exports.renderComponent = exports.branch = exports.withReducer = exports.withState = exports.flattenProp = exports.renameProps = exports.renameProp = exports.defaultProps = exports.withHandlers = exports.withPropsOnChange = exports.withProps = exports.mapProps = undefined;
var _mapProps2 = __webpack_require__(4);
var _mapProps3 = _interopRequireDefault(_mapProps2);
var _withProps2 = __webpack_require__(44);
var _withProps3 = _interopRequireDefault(_withProps2);
var _withPropsOnChange2 = __webpack_require__(45);
var _withPropsOnChange3 = _interopRequireDefault(_withPropsOnChange2);
var _withHandlers2 = __webpack_require__(43);
var _withHandlers3 = _interopRequireDefault(_withHandlers2);
var _defaultProps2 = __webpack_require__(25);
var _defaultProps3 = _interopRequireDefault(_defaultProps2);
var _renameProp2 = __webpack_require__(35);
var _renameProp3 = _interopRequireDefault(_renameProp2);
var _renameProps2 = __webpack_require__(36);
var _renameProps3 = _interopRequireDefault(_renameProps2);
var _flattenProp2 = __webpack_require__(26);
var _flattenProp3 = _interopRequireDefault(_flattenProp2);
var _withState2 = __webpack_require__(47);
var _withState3 = _interopRequireDefault(_withState2);
var _withReducer2 = __webpack_require__(46);
var _withReducer3 = _interopRequireDefault(_withReducer2);
var _branch2 = __webpack_require__(20);
var _branch3 = _interopRequireDefault(_branch2);
var _renderComponent2 = __webpack_require__(37);
var _renderComponent3 = _interopRequireDefault(_renderComponent2);
var _renderNothing2 = __webpack_require__(38);
var _renderNothing3 = _interopRequireDefault(_renderNothing2);
var _shouldUpdate2 = __webpack_require__(10);
var _shouldUpdate3 = _interopRequireDefault(_shouldUpdate2);
var _pure2 = __webpack_require__(34);
var _pure3 = _interopRequireDefault(_pure2);
var _onlyUpdateForKeys2 = __webpack_require__(17);
var _onlyUpdateForKeys3 = _interopRequireDefault(_onlyUpdateForKeys2);
var _onlyUpdateForPropTypes2 = __webpack_require__(33);
var _onlyUpdateForPropTypes3 = _interopRequireDefault(_onlyUpdateForPropTypes2);
var _withContext2 = __webpack_require__(42);
var _withContext3 = _interopRequireDefault(_withContext2);
var _getContext2 = __webpack_require__(27);
var _getContext3 = _interopRequireDefault(_getContext2);
var _lifecycle2 = __webpack_require__(30);
var _lifecycle3 = _interopRequireDefault(_lifecycle2);
var _toClass2 = __webpack_require__(41);
var _toClass3 = _interopRequireDefault(_toClass2);
var _setStatic2 = __webpack_require__(9);
var _setStatic3 = _interopRequireDefault(_setStatic2);
var _setPropTypes2 = __webpack_require__(40);
var _setPropTypes3 = _interopRequireDefault(_setPropTypes2);
var _setDisplayName2 = __webpack_require__(39);
var _setDisplayName3 = _interopRequireDefault(_setDisplayName2);
var _compose2 = __webpack_require__(22);
var _compose3 = _interopRequireDefault(_compose2);
var _getDisplayName2 = __webpack_require__(7);
var _getDisplayName3 = _interopRequireDefault(_getDisplayName2);
var _wrapDisplayName2 = __webpack_require__(48);
var _wrapDisplayName3 = _interopRequireDefault(_wrapDisplayName2);
var _shallowEqual2 = __webpack_require__(6);
var _shallowEqual3 = _interopRequireDefault(_shallowEqual2);
var _isClassComponent2 = __webpack_require__(8);
var _isClassComponent3 = _interopRequireDefault(_isClassComponent2);
var _createEagerElement2 = __webpack_require__(15);
var _createEagerElement3 = _interopRequireDefault(_createEagerElement2);
var _createEagerFactory2 = __webpack_require__(2);
var _createEagerFactory3 = _interopRequireDefault(_createEagerFactory2);
var _createSink2 = __webpack_require__(24);
var _createSink3 = _interopRequireDefault(_createSink2);
var _componentFromProp2 = __webpack_require__(21);
var _componentFromProp3 = _interopRequireDefault(_componentFromProp2);
var _nest2 = __webpack_require__(32);
var _nest3 = _interopRequireDefault(_nest2);
var _hoistStatics2 = __webpack_require__(28);
var _hoistStatics3 = _interopRequireDefault(_hoistStatics2);
var _componentFromStream2 = __webpack_require__(14);
var _componentFromStream3 = _interopRequireDefault(_componentFromStream2);
var _mapPropsStream2 = __webpack_require__(31);
var _mapPropsStream3 = _interopRequireDefault(_mapPropsStream2);
var _createEventHandler2 = __webpack_require__(23);
var _createEventHandler3 = _interopRequireDefault(_createEventHandler2);
var _setObservableConfig2 = __webpack_require__(5);
var _setObservableConfig3 = _interopRequireDefault(_setObservableConfig2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.mapProps = _mapProps3.default; // Higher-order component helpers
exports.withProps = _withProps3.default;
exports.withPropsOnChange = _withPropsOnChange3.default;
exports.withHandlers = _withHandlers3.default;
exports.defaultProps = _defaultProps3.default;
exports.renameProp = _renameProp3.default;
exports.renameProps = _renameProps3.default;
exports.flattenProp = _flattenProp3.default;
exports.withState = _withState3.default;
exports.withReducer = _withReducer3.default;
exports.branch = _branch3.default;
exports.renderComponent = _renderComponent3.default;
exports.renderNothing = _renderNothing3.default;
exports.shouldUpdate = _shouldUpdate3.default;
exports.pure = _pure3.default;
exports.onlyUpdateForKeys = _onlyUpdateForKeys3.default;
exports.onlyUpdateForPropTypes = _onlyUpdateForPropTypes3.default;
exports.withContext = _withContext3.default;
exports.getContext = _getContext3.default;
exports.lifecycle = _lifecycle3.default;
exports.toClass = _toClass3.default;
// Static property helpers
exports.setStatic = _setStatic3.default;
exports.setPropTypes = _setPropTypes3.default;
exports.setDisplayName = _setDisplayName3.default;
// Composition function
exports.compose = _compose3.default;
// Other utils
exports.getDisplayName = _getDisplayName3.default;
exports.wrapDisplayName = _wrapDisplayName3.default;
exports.shallowEqual = _shallowEqual3.default;
exports.isClassComponent = _isClassComponent3.default;
exports.createEagerElement = _createEagerElement3.default;
exports.createEagerFactory = _createEagerFactory3.default;
exports.createSink = _createSink3.default;
exports.componentFromProp = _componentFromProp3.default;
exports.nest = _nest3.default;
exports.hoistStatics = _hoistStatics3.default;
// Observable helpers
exports.componentFromStream = _componentFromStream3.default;
exports.mapPropsStream = _mapPropsStream3.default;
exports.createEventHandler = _createEventHandler3.default;
exports.setObservableConfig = _setObservableConfig3.default;
/***/ },
/* 30 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(3);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var lifecycle = function lifecycle(spec) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
if (false) {
console.error('lifecycle() does not support the render method; its behavior is to ' + 'pass all props and state to the base component.');
}
/* eslint-disable react/prefer-es6-class */
return (0, _react.createClass)(_extends({}, spec, {
render: function render() {
return factory(_extends({}, this.props, this.state));
}
}));
/* eslint-enable react/prefer-es6-class */
};
};
exports.default = (0, _createHelper2.default)(lifecycle, 'lifecycle');
/***/ },
/* 31 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.mapPropsStreamWithConfig = undefined;
var _symbolObservable = __webpack_require__(13);
var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _componentFromStream = __webpack_require__(14);
var _setObservableConfig = __webpack_require__(5);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var identity = function identity(t) {
return t;
};
var componentFromStream = (0, _componentFromStream.componentFromStreamWithConfig)({
fromESObservable: identity,
toESObservable: identity
});
var mapPropsStreamWithConfig = exports.mapPropsStreamWithConfig = function mapPropsStreamWithConfig(config) {
return function (transform) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
var fromESObservable = config.fromESObservable;
var toESObservable = config.toESObservable;
return componentFromStream(function (props$) {
var _ref;
return _ref = {
subscribe: function subscribe(observer) {
var subscription = toESObservable(transform(fromESObservable(props$))).subscribe({
next: function next(childProps) {
return observer.next(factory(childProps));
}
});
return {
unsubscribe: function unsubscribe() {
return subscription.unsubscribe();
}
};
}
}, _ref[_symbolObservable2.default] = function () {
return this;
}, _ref;
});
};
};
};
var mapPropsStream = mapPropsStreamWithConfig(_setObservableConfig.config);
exports.default = (0, _createHelper2.default)(mapPropsStream, 'mapPropsStream');
/***/ },
/* 32 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var nest = function nest() {
for (var _len = arguments.length, Components = Array(_len), _key = 0; _key < _len; _key++) {
Components[_key] = arguments[_key];
}
var factories = Components.map(_createEagerFactory2.default);
var Nest = function Nest(_ref) {
var props = _objectWithoutProperties(_ref, []);
var children = _ref.children;
return factories.reduceRight(function (child, factory) {
return factory(props, child);
}, children);
};
if (false) {
/* eslint-disable global-require */
var getDisplayName = require('./getDisplayName').default;
/* eslint-enable global-require */
var displayNames = Components.map(getDisplayName);
Nest.displayName = 'nest(' + displayNames.join(', ') + ')';
}
return Nest;
};
exports.default = nest;
/***/ },
/* 33 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _onlyUpdateForKeys = __webpack_require__(17);
var _onlyUpdateForKeys2 = _interopRequireDefault(_onlyUpdateForKeys);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var onlyUpdateForPropTypes = function onlyUpdateForPropTypes(BaseComponent) {
var propTypes = BaseComponent.propTypes;
if (false) {
/* eslint-disable global-require */
var getDisplayName = require('./getDisplayName').default;
/* eslint-enable global-require */
if (!propTypes) {
/* eslint-disable */
console.error('A component without any `propTypes` was passed to ' + '`onlyUpdateForPropTypes()`. Check the implementation of the ' + ('component with display name "' + getDisplayName(BaseComponent) + '".'));
/* eslint-enable */
}
}
var propKeys = Object.keys(propTypes || {});
var OnlyUpdateForPropTypes = (0, _onlyUpdateForKeys2.default)(propKeys)(BaseComponent);
return OnlyUpdateForPropTypes;
};
exports.default = (0, _createHelper2.default)(onlyUpdateForPropTypes, 'onlyUpdateForPropTypes', true, true);
/***/ },
/* 34 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _shouldUpdate = __webpack_require__(10);
var _shouldUpdate2 = _interopRequireDefault(_shouldUpdate);
var _shallowEqual = __webpack_require__(6);
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var pure = (0, _shouldUpdate2.default)(function (props, nextProps) {
return !(0, _shallowEqual2.default)(props, nextProps);
});
exports.default = (0, _createHelper2.default)(pure, 'pure', true, true);
/***/ },
/* 35 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _omit = __webpack_require__(11);
var _omit2 = _interopRequireDefault(_omit);
var _mapProps = __webpack_require__(4);
var _mapProps2 = _interopRequireDefault(_mapProps);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var renameProp = function renameProp(oldName, newName) {
return (0, _mapProps2.default)(function (props) {
var _extends2;
return _extends({}, (0, _omit2.default)(props, [oldName]), (_extends2 = {}, _extends2[newName] = props[oldName], _extends2));
});
};
exports.default = (0, _createHelper2.default)(renameProp, 'renameProp');
/***/ },
/* 36 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _omit = __webpack_require__(11);
var _omit2 = _interopRequireDefault(_omit);
var _pick = __webpack_require__(12);
var _pick2 = _interopRequireDefault(_pick);
var _mapProps = __webpack_require__(4);
var _mapProps2 = _interopRequireDefault(_mapProps);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var keys = Object.keys;
var mapKeys = function mapKeys(obj, func) {
return keys(obj).reduce(function (result, key) {
var val = obj[key];
/* eslint-disable no-param-reassign */
result[func(val, key)] = val;
/* eslint-enable no-param-reassign */
return result;
}, {});
};
var renameProps = function renameProps(nameMap) {
return (0, _mapProps2.default)(function (props) {
return _extends({}, (0, _omit2.default)(props, keys(nameMap)), mapKeys((0, _pick2.default)(props, keys(nameMap)), function (_, oldName) {
return nameMap[oldName];
}));
});
};
exports.default = (0, _createHelper2.default)(renameProps, 'renameProps');
/***/ },
/* 37 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// import React from 'react'
var renderComponent = function renderComponent(Component) {
return function (_) {
var factory = (0, _createEagerFactory2.default)(Component);
var RenderComponent = function RenderComponent(props) {
return factory(props);
};
// const RenderComponent = props => <Component {...props} />
if (false) {
/* eslint-disable global-require */
var wrapDisplayName = require('./wrapDisplayName').default;
/* eslint-enable global-require */
RenderComponent.displayName = wrapDisplayName(Component, 'renderComponent');
}
return RenderComponent;
};
};
exports.default = (0, _createHelper2.default)(renderComponent, 'renderComponent', false);
/***/ },
/* 38 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var renderNothing = function renderNothing(_) {
var Nothing = function Nothing() {
return null;
};
Nothing.displayName = 'Nothing';
return Nothing;
};
exports.default = (0, _createHelper2.default)(renderNothing, 'renderNothing', false, true);
/***/ },
/* 39 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _setStatic = __webpack_require__(9);
var _setStatic2 = _interopRequireDefault(_setStatic);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var setDisplayName = function setDisplayName(displayName) {
return (0, _setStatic2.default)('displayName', displayName);
};
exports.default = (0, _createHelper2.default)(setDisplayName, 'setDisplayName', false);
/***/ },
/* 40 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _setStatic = __webpack_require__(9);
var _setStatic2 = _interopRequireDefault(_setStatic);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var setPropTypes = function setPropTypes(propTypes) {
return (0, _setStatic2.default)('propTypes', propTypes);
};
exports.default = (0, _createHelper2.default)(setPropTypes, 'setPropTypes', false);
/***/ },
/* 41 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
var _getDisplayName = __webpack_require__(7);
var _getDisplayName2 = _interopRequireDefault(_getDisplayName);
var _isClassComponent = __webpack_require__(8);
var _isClassComponent2 = _interopRequireDefault(_isClassComponent);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var toClass = function toClass(baseComponent) {
if ((0, _isClassComponent2.default)(baseComponent)) {
return baseComponent;
}
var ToClass = function (_Component) {
_inherits(ToClass, _Component);
function ToClass() {
_classCallCheck(this, ToClass);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
ToClass.prototype.render = function render() {
if (typeof baseComponent === 'string') {
return _react2.default.createElement('baseComponent', this.props);
}
return baseComponent(this.props, this.context);
};
return ToClass;
}(_react.Component);
ToClass.displayName = (0, _getDisplayName2.default)(baseComponent);
ToClass.propTypes = baseComponent.propTypes;
ToClass.contextTypes = baseComponent.contextTypes;
ToClass.defaultProps = baseComponent.defaultProps;
return ToClass;
};
exports.default = toClass;
/***/ },
/* 42 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _react = __webpack_require__(3);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var withContext = function withContext(childContextTypes, getChildContext) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
var WithContext = function (_Component) {
_inherits(WithContext, _Component);
function WithContext() {
var _temp, _this, _ret;
_classCallCheck(this, WithContext);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.getChildContext = function () {
return getChildContext(_this.props);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
WithContext.prototype.render = function render() {
return factory(this.props);
};
return WithContext;
}(_react.Component);
WithContext.childContextTypes = childContextTypes;
return WithContext;
};
};
exports.default = (0, _createHelper2.default)(withContext, 'withContext');
/***/ },
/* 43 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(3);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var mapValues = function mapValues(obj, func) {
var result = [];
var i = 0;
/* eslint-disable no-restricted-syntax */
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
i += 1;
result[key] = func(obj[key], key, i);
}
}
/* eslint-enable no-restricted-syntax */
return result;
};
var withHandlers = function withHandlers(handlers) {
return function (BaseComponent) {
var _class, _temp2, _initialiseProps;
var factory = (0, _createEagerFactory2.default)(BaseComponent);
return _temp2 = _class = function (_Component) {
_inherits(_class, _Component);
function _class() {
var _temp, _this, _ret;
_classCallCheck(this, _class);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _initialiseProps.call(_this), _temp), _possibleConstructorReturn(_this, _ret);
}
_class.prototype.componentWillReceiveProps = function componentWillReceiveProps() {
this.cachedHandlers = {};
};
_class.prototype.render = function render() {
return factory(_extends({}, this.props, this.handlers));
};
return _class;
}(_react.Component), _initialiseProps = function _initialiseProps() {
var _this2 = this;
this.cachedHandlers = {};
this.handlers = mapValues(handlers, function (createHandler, handlerName) {
return function () {
var cachedHandler = _this2.cachedHandlers[handlerName];
if (cachedHandler) {
return cachedHandler.apply(undefined, arguments);
}
var handler = createHandler(_this2.props);
_this2.cachedHandlers[handlerName] = handler;
if (false) {
console.error('withHandlers(): Expected a map of higher-order functions. ' + 'Refer to the docs for more info.');
}
return handler.apply(undefined, arguments);
};
});
}, _temp2;
};
};
exports.default = (0, _createHelper2.default)(withHandlers, 'withHandlers');
/***/ },
/* 44 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _mapProps = __webpack_require__(4);
var _mapProps2 = _interopRequireDefault(_mapProps);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var withProps = function withProps(input) {
return (0, _mapProps2.default)(function (props) {
return _extends({}, props, typeof input === 'function' ? input(props) : input);
});
};
exports.default = (0, _createHelper2.default)(withProps, 'withProps');
/***/ },
/* 45 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(3);
var _pick = __webpack_require__(12);
var _pick2 = _interopRequireDefault(_pick);
var _shallowEqual = __webpack_require__(6);
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var withPropsOnChange = function withPropsOnChange(shouldMapOrKeys, propsMapper) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
var shouldMap = typeof shouldMapOrKeys === 'function' ? shouldMapOrKeys : function (props, nextProps) {
return !(0, _shallowEqual2.default)((0, _pick2.default)(props, shouldMapOrKeys), (0, _pick2.default)(nextProps, shouldMapOrKeys));
};
return function (_Component) {
_inherits(_class2, _Component);
function _class2() {
var _temp, _this, _ret;
_classCallCheck(this, _class2);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.computedProps = propsMapper(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
}
_class2.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (shouldMap(this.props, nextProps)) {
this.computedProps = propsMapper(nextProps);
}
};
_class2.prototype.render = function render() {
return factory(_extends({}, this.props, this.computedProps));
};
return _class2;
}(_react.Component);
};
};
exports.default = (0, _createHelper2.default)(withPropsOnChange, 'withPropsOnChange');
/***/ },
/* 46 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(3);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var withReducer = function withReducer(stateName, dispatchName, reducer, initialState) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
return function (_Component) {
_inherits(_class2, _Component);
function _class2() {
var _temp, _this, _ret;
_classCallCheck(this, _class2);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = {
stateValue: typeof initialState === 'function' ? initialState(_this.props) : initialState
}, _this.dispatch = function (action) {
return _this.setState(function (_ref) {
var stateValue = _ref.stateValue;
return {
stateValue: reducer(stateValue, action)
};
});
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_class2.prototype.render = function render() {
var _extends2;
return factory(_extends({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[dispatchName] = this.dispatch, _extends2)));
};
return _class2;
}(_react.Component);
};
};
exports.default = (0, _createHelper2.default)(withReducer, 'withReducer');
/***/ },
/* 47 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(3);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var withState = function withState(stateName, stateUpdaterName, initialState) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
return function (_Component) {
_inherits(_class2, _Component);
function _class2() {
var _temp, _this, _ret;
_classCallCheck(this, _class2);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = {
stateValue: typeof initialState === 'function' ? initialState(_this.props) : initialState
}, _this.updateStateValue = function (updateFn, callback) {
return _this.setState(function (_ref) {
var stateValue = _ref.stateValue;
return {
stateValue: typeof updateFn === 'function' ? updateFn(stateValue) : updateFn
};
}, callback);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_class2.prototype.render = function render() {
var _extends2;
return factory(_extends({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[stateUpdaterName] = this.updateStateValue, _extends2)));
};
return _class2;
}(_react.Component);
};
};
exports.default = (0, _createHelper2.default)(withState, 'withState');
/***/ },
/* 48 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _getDisplayName = __webpack_require__(7);
var _getDisplayName2 = _interopRequireDefault(_getDisplayName);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var wrapDisplayName = function wrapDisplayName(BaseComponent, hocName) {
return hocName + '(' + (0, _getDisplayName2.default)(BaseComponent) + ')';
};
exports.default = wrapDisplayName;
/***/ },
/* 49 */
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*
*/
/*eslint-disable no-self-compare */
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
function is(x, y) {
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return x !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
}
/**
* Performs equality by iterating through keys on an object and returning false
* when any key has values which are not strictly equal between the arguments.
* Returns true when the values of all keys are strictly equal.
*/
function shallowEqual(objA, objB) {
if (is(objA, objB)) {
return true;
}
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// Test for A's keys different from B.
for (var i = 0; i < keysA.length; i++) {
if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
return false;
}
}
return true;
}
module.exports = shallowEqual;
/***/ },
/* 50 */
/***/ function(module, exports) {
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
var REACT_STATICS = {
childContextTypes: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
arguments: true,
arity: true
};
module.exports = function hoistNonReactStatics(targetComponent, sourceComponent) {
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
var keys = Object.getOwnPropertyNames(sourceComponent);
for (var i=0; i<keys.length; ++i) {
if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]]) {
try {
targetComponent[keys[i]] = sourceComponent[keys[i]];
} catch (error) {
}
}
}
}
return targetComponent;
};
/***/ },
/* 51 */
/***/ function(module, exports) {
'use strict';
module.exports = function symbolObservablePonyfill(root) {
var result;
var Symbol = root.Symbol;
if (typeof Symbol === 'function') {
if (Symbol.observable) {
result = Symbol.observable;
} else {
result = Symbol('observable');
Symbol.observable = result;
}
} else {
result = '@@observable';
}
return result;
};
/***/ }
/******/ ])
});
; |
src/mui/detail/CreateActions.js | matteolc/admin-on-rest | import React from 'react';
import { CardActions } from 'material-ui/Card';
import { ListButton } from '../button';
const cardActionStyle = {
zIndex: 2,
display: 'inline-block',
float: 'right',
};
const CreateActions = ({ basePath }) => (
<CardActions style={cardActionStyle}>
<ListButton basePath={basePath} />
</CardActions>
);
export default CreateActions;
|
ui/src/components/TabPanel.js | untoldwind/eightyish | import React from 'react'
export default class TabPanel extends React.Component {
static propTypes = {
title: React.PropTypes.string.isRequired,
children: React.PropTypes.oneOfType([
React.PropTypes.array,
React.PropTypes.element
]).isRequired
}
render() {
return <div>{this.props.children}</div>
}
}
|
src/components/main/NavigationItem/NavigationItem.js | 5rabbits/portrait | import React from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
export default class NavigationItem extends React.Component {
static propTypes = {
children: PropTypes.node,
containerProps: PropTypes.object,
component: PropTypes.oneOfType([
PropTypes.string, PropTypes.func,
]),
isActive: PropTypes.bool,
icon: PropTypes.node,
label: PropTypes.node,
}
static defaultProps = {
children: null,
component: 'a',
containerProps: {},
isActive: false,
icon: null,
label: null,
}
static contextTypes = {
isNestedNavigationItem: PropTypes.bool,
}
static childContextTypes = {
isNestedNavigationItem: PropTypes.bool,
}
getChildContext() {
return {
isNestedNavigationItem: true,
}
}
render() {
const {
component: Component, isActive, icon, label, children, containerProps,
...other
} = this.props
const isNested = this.context.isNestedNavigationItem || false
const isDropdown = children != null
return (
<li
{...containerProps}
className={classNames(containerProps.className, {
active: isActive,
dropdown: isDropdown,
'navigation-item--top-level': !isNested,
})}
>
<Component
{...other}
data-toggle={isDropdown ? 'dropdown' : undefined}
>
{icon &&
<span className="mr-xs navigation-item__icon">
{icon}
</span>
}
<span className={classNames({ 'hidden-sm': !isNested })}>
{label}
</span>
{isDropdown &&
<span className="caret navigation-item__caret" />
}
</Component>
{isDropdown &&
<ul className="dropdown-menu">
{children}
</ul>
}
</li>
)
}
}
|
docs/src/app/components/pages/get-started/Installation.js | pancho111203/material-ui | import React from 'react';
import Title from 'react-title-component';
import MarkdownElement from '../../MarkdownElement';
import installationText from './installation.md';
const Installation = () => (
<div>
<Title render={(previousTitle) => `Installation - ${previousTitle}`} />
<MarkdownElement text={installationText} />
</div>
);
export default Installation;
|
src/shared/components/socialMedia/socialMediaItem/socialMediaItem.js | sethbergman/operationcode_frontend | import React from 'react';
import PropTypes from 'prop-types';
import styles from './socialMediaItem.css';
const SocialMediaItem = (props) => {
const {
smImage,
smText,
link,
} = props;
return (
<div className={styles.socialMediaItem}>
<a href={link} target="_blank" rel="noopener noreferrer">
<img src={smImage} alt={smText} />
</a>
</div>
);
};
SocialMediaItem.propTypes = {
smImage: PropTypes.string.isRequired,
smText: PropTypes.string.isRequired,
link: PropTypes.string.isRequired,
};
export default SocialMediaItem;
|
src/svg-icons/av/fiber-dvr.js | pancho111203/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let AvFiberDvr = (props) => (
<SvgIcon {...props}>
<path d="M17.5 10.5h2v1h-2zm-13 0h2v3h-2zM21 3H3c-1.11 0-2 .89-2 2v14c0 1.1.89 2 2 2h18c1.11 0 2-.9 2-2V5c0-1.11-.89-2-2-2zM8 13.5c0 .85-.65 1.5-1.5 1.5H3V9h3.5c.85 0 1.5.65 1.5 1.5v3zm4.62 1.5h-1.5L9.37 9h1.5l1 3.43 1-3.43h1.5l-1.75 6zM21 11.5c0 .6-.4 1.15-.9 1.4L21 15h-1.5l-.85-2H17.5v2H16V9h3.5c.85 0 1.5.65 1.5 1.5v1z"/>
</SvgIcon>
);
AvFiberDvr = pure(AvFiberDvr);
AvFiberDvr.displayName = 'AvFiberDvr';
AvFiberDvr.muiName = 'SvgIcon';
export default AvFiberDvr;
|
src/routes/contact/index.js | dabrowski-adam/react-isomorphic | /**
* 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 Template from '../../components/Template';
import Back from '../../components/Back';
const title = 'Contact';
export default {
path: '/contact',
action() {
return {
title,
component: <Template card={<Back />} />,
};
},
};
|
src/components/list.js | rahavMatan/react-phonecat | import React, { Component } from 'react';
import {connect} from 'react-redux';
import {getFiltered, getAll, sortBy} from '../actions'
import ListItem from './list-item';
import SearchBar from './search-bar';
import { CSSTransitionGroup } from 'react-transition-group' // ES6
class List extends Component {
componentWillMount(){
this.props.getAll();
}
renderList(){
if(!this.props.filtered.length){
return(
<h2>no phones found..</h2>
)
};
return this.props.filtered.map(phone=>{
return (
<ListItem key={phone.id} phone={phone} />
)
})
}
render() {
return (
<div className="row">
<div className="col-md-2 search-container">
<SearchBar />
</div>
<div className="col-md-8 list-container">
<ul className="list-group">
<CSSTransitionGroup transitionName="example"
transitionEnterTimeout={500} transitionLeaveTimeout={500} transitionAppear={true}
transitionAppearTimeout={500}>
{ this.renderList()}
</CSSTransitionGroup>
</ul>
</div>
</div>
);
}
}
function stateToProps(state){
return {
filtered:state.filtered
};
}
export default connect(stateToProps,{getFiltered,getAll, sortBy})(List)
|
packages/mcs-lite-landing-web/src/components/SVG/SVGManagement.js | MCS-Lite/mcs-lite | /**
* svgtoreact
*
* @author Michael Hsu
*/
import React from 'react';
export default function SVGManagement(props) {
return (
<svg width={42} height={32} viewBox="0 0 42 32" {...props}>
<g fill="none">
<path d="M-9-14h60v60h-60z" />
<path
d="M2.5 25.991v4.018c0 .267.223.491.491.491h4.018c.267 0 .491-.223.491-.491v-4.018c0-.267-.223-.491-.491-.491h-4.018c-.267 0-.491.223-.491.491zm-1 0c0-.821.673-1.491 1.491-1.491h4.018c.821 0 1.491.673 1.491 1.491v4.018c0 .821-.673 1.491-1.491 1.491h-4.018c-.821 0-1.491-.673-1.491-1.491v-4.018zm13.5 2.509c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h26c.276 0 .5.224.5.5s-.224.5-.5.5h-26zm-12.5-12.509v4.018c0 .267.223.491.491.491h4.018c.267 0 .491-.223.491-.491v-4.018c0-.267-.223-.491-.491-.491h-4.018c-.267 0-.491.223-.491.491zm-1 0c0-.821.673-1.491 1.491-1.491h4.018c.821 0 1.491.673 1.491 1.491v4.018c0 .821-.673 1.491-1.491 1.491h-4.018c-.821 0-1.491-.673-1.491-1.491v-4.018zm13.5 2.509c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h26c.276 0 .5.224.5.5s-.224.5-.5.5h-26zm-13.208-14.511l3.304 4.282 5.065-7.815c.3-.463.92-.596 1.383-.295.463.3.596.92.295 1.383l-5.285 8.153c-.68 1.049-2.033 1.104-2.794.117l-3.552-4.603c-.337-.437-.256-1.065.181-1.403.437-.337 1.065-.256 1.403.181zm13.208 4.511c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h26c.276 0 .5.224.5.5s-.224.5-.5.5h-26z"
fill="#fff"
/>
</g>
</svg>
);
}
|
js/App/Components/TabViews/SubViews/JobRow.js | telldus/telldus-live-mobile-v3 | /**
* Copyright 2016-present Telldus Technologies AB.
*
* This file is part of the Telldus Live! app.
*
* Telldus Live! app is free : you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Telldus Live! app is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Telldus Live! app. If not, see <http://www.gnu.org/licenses/>.
*/
// @flow
'use strict';
import React from 'react';
import {
TouchableOpacity,
Platform,
} from 'react-native';
const isEqual = require('react-fast-compare');
import {
BlockIcon,
IconTelldus,
ListRow,
View,
Text,
TimezoneFormattedTime,
} from '../../../../BaseComponents';
import NowRow from './Jobs/NowRow';
import Theme from '../../../Theme';
import { ACTIONS, Description, TextRowWrapper, Title } from '../../Schedule/SubViews';
import {
getDeviceActionIcon,
getKnownModes,
getRepeatDescription,
} from '../../../Lib';
import type { Schedule } from '../../../Actions/Types';
import {
withTheme,
PropsThemedComponent,
} from '../../HOC/withTheme';
import { methods } from '../../../../Constants';
import i18n from '../../../Translations/common';
type Props = PropsThemedComponent & {
active: boolean,
method: number,
methodValue?: number | number,
effectiveHour: string,
effectiveMinute: string,
offset: number,
randomInterval: number,
type: string,
weekdays: number[],
isFirst: boolean,
appLayout: Object,
showNow: boolean,
expired: boolean,
deviceType: string,
deviceSupportedMethods: Object,
gatewayTimezone: string,
ScreenName: string,
showName?: boolean,
intl: Object,
editJob: (schedule: Schedule) => void,
};
class JobRow extends View<null, Props, null> {
static defaultProps = {
showName: true,
};
shouldComponentUpdate(nextProps: Object, nextState: Object): boolean {
const { appLayout, intl, editJob, weekdays, currentScreen, ScreenName, ...others } = this.props;// eslint-disable-line
const { appLayout: appLayoutN, intl: intlN, editJob: editJobN, weekdays: weekdaysN, currentScreen: currentScreenN, ScreenName: ScreenNameN, ...othersN } = nextProps;// eslint-disable-line
if (currentScreenN === ScreenNameN) {
// Force re-render once to gain/loose accessibility
if (currentScreen !== ScreenName && nextProps.screenReaderEnabled) {
return true;
}
const newLayout = nextProps.appLayout.width !== appLayout.width;
if (newLayout) {
return true;
}
if (weekdays.length !== weekdaysN.length) {
return true;
}
const propsEqual = isEqual(others, othersN);
if (!propsEqual) {
return true;
}
}
// Force re-render once to gain/loose accessibility
if (currentScreenN !== ScreenNameN && currentScreen === ScreenName && nextProps.screenReaderEnabled) {
return true;
}
return false;
}
editJob = () => {
const {
editJob,
id,
deviceId,
method,
methodValue,
type,
hour,
minute,
offset,
randomInterval,
active,
weekdays,
retries,
retryInterval,
reps,
} = this.props;
const schedule: Schedule = {
id,
deviceId,
method,
methodValue,
type,
hour,
minute,
offset,
randomInterval,
active,
weekdays,
retries,
retryInterval,
reps,
};
editJob(schedule);
};
render(): React$Element<any> | null {
const {
type,
effectiveHour,
effectiveMinute,
deviceName: dName,
offset,
randomInterval,
active,
isFirst,
editJob,
appLayout,
intl,
showNow,
expired,
currentScreen,
ScreenName,
showName,
colors,
} = this.props;
const {
container,
textWrapper,
title,
description,
iconOffset,
iconRandom,
roundIcon,
time,
rowContainer,
roundIconContainer,
rowWithTriangleContainer,
lineStyle,
rowWithTriangleContainerNow,
} = this._getStyle(appLayout);
const color = !active ? '#BDBDBD' : (expired ? '#999999' : '#929292');
const repeat = this._getRepeatDescription();
const date = `01/01/2017 ${effectiveHour}:${effectiveMinute}`;
const timestamp = Date.parse(date);
const { actionIcon, actionLabel, triangleColor } = this._renderActionIcon();
const { formatMessage } = intl;
const deviceName = dName ? dName : formatMessage(i18n.noName);
const labelDevice = `${formatMessage(i18n.labelDevice)} ${deviceName}`;
const labelAction = `${formatMessage(i18n.labelAction)} ${actionLabel}`;
const accessible = currentScreen === ScreenName;
const accessibilityLabel = `${formatMessage(i18n.phraseOneSheduler)} ${effectiveHour}:${effectiveMinute}, ${labelDevice}, ${labelAction}, ${formatMessage(i18n.activateEdit)}`;
return (
<View importantForAccessibility={accessible ? 'no' : 'no-hide-descendants'}>
<TouchableOpacity
style={container}
onPress={this.editJob}
disabled={!editJob}
accessible={accessible}
importantForAccessibility={accessible ? 'yes' : 'no-hide-descendants'}
accessibilityLabel={accessible ? accessibilityLabel : ''}
>
<ListRow
roundIcon={!active ? 'pause' : type}
roundIconStyle={roundIcon}
roundIconContainerStyle={[roundIconContainer, { backgroundColor: color } ]}
time={timestamp}
timeFormat= {{
hour: 'numeric',
minute: 'numeric',
}}
timeStyle={time}
rowContainerStyle={rowContainer}
rowWithTriangleContainerStyle={rowWithTriangleContainer}
triangleColor={triangleColor}
showShadow={active}
isFirst={isFirst}
appLayout={appLayout}>
{actionIcon}
<View
level={2}
style={{ flex: 1 }}>
<TextRowWrapper style={textWrapper} appLayout={appLayout}>
{showName && <Title numberOfLines={1} ellipsizeMode="tail" style={title} appLayout={appLayout}>
{deviceName}
</Title>
}
<Description numberOfLines={1} ellipsizeMode="tail" style={description} appLayout={appLayout}>
{repeat}{' '}
{type === 'time' && (
<TimezoneFormattedTime
value={timestamp}
formattingOptions={{
hour: 'numeric',
minute: 'numeric',
}}
style={description}
/>)
}
</Description>
</TextRowWrapper>
{!!offset && (
<IconTelldus
level={25}
icon="offset"
style={iconOffset}
/>
)}
{!!randomInterval && (
<IconTelldus
level={25}
icon="random"
style={iconRandom}
/>
)}
</View>
</ListRow>
</TouchableOpacity>
{!!showNow && (
<View
style={container}
>
<NowRow
text={formatMessage(i18n.now)}
roundIconContainerStyle={[
roundIconContainer, {
backgroundColor: colors.colorOffActiveBg,
},
]}
rowWithTriangleContainerStyle={rowWithTriangleContainerNow}
textStyle={time}
lineStyle={lineStyle}
appLayout={appLayout}
/>
</View>
)}
</View>
);
}
_renderActionIcon = (): Object => {
const {
intl,
method,
appLayout,
methodValue,
expired,
active,
deviceSupportedMethods,
deviceType,
colors,
} = this.props;
const { formatMessage } = intl;
const action = ACTIONS.find((a: Object): boolean => a.method === method);
if (action) {
const {
methodIconContainer,
methodIcon,
thermostatInfo,
thermostateModeControlIcon,
inactiveGray,
} = this._getStyle(appLayout);
const actionIcons = getDeviceActionIcon(deviceType, null, deviceSupportedMethods);
const methodString = methods[action.method];
let iconName = actionIcons[methodString];
if (action.name === 'Dim') {
const roundVal = Math.round(methodValue / 255 * 100);
const value = `${roundVal}%`;
return (
{
triangleColor: methodIconContainer.backgroundColor,
actionIcon: <View style={methodIconContainer}>
<Text style={methodIcon}>
{value}
</Text>
</View>,
actionLabel: `${typeof action.actionLabel === 'string' ? action.actionLabel : formatMessage(action.actionLabel)} ${value}`,
}
);
}
if (action.name === 'Thermostat') {
const {
mode = '',
temperature,
scale,
changeMode,
} = JSON.parse(methodValue);
const modesInfo = getKnownModes(formatMessage);
// $FlowFixMe
let Icon, label;
modesInfo.map((info: Object) => {
if (info.mode.trim() === mode.trim()) {
Icon = info.IconActive;
label = info.label;
}
});
const {
fontSize,
color,
} = thermostateModeControlIcon;
const showModeIcon = !!Icon;
return (
{
triangleColor: methodIconContainer.backgroundColor,
actionIcon: <View style={methodIconContainer}>
<View style={{
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
}}>
{showModeIcon && (
// $FlowFixMe
<Icon
height={fontSize}
width={fontSize}
style={{
color: color,
}}/>
)}
{!!changeMode &&
(
<IconTelldus icon={'play'} style={thermostateModeControlIcon}/>
)
}
</View>
<>
{!!label && <Text style={thermostatInfo}>
{label.toUpperCase()}
</Text>
}
{(typeof temperature !== 'undefined' && temperature !== null && temperature !== '')
&& <Text style={thermostatInfo}>
{temperature}{scale ? 'ยฐF' : 'ยฐC'}
</Text>
}
</>
</View>,
actionLabel: `${typeof action.actionLabel === 'string' ? action.actionLabel : formatMessage(action.actionLabel)} ${mode} ${temperature}`,
}
);
}
if (action.name === 'Rgb') {
const color = methodValue.toLowerCase() === '#ffffff' ? colors.inAppBrandSecondary : methodValue;
return (
{
triangleColor: !active ? inactiveGray : expired ? '#999999' : color,
actionIcon: <BlockIcon
icon={iconName ? iconName : action.icon}
containerStyle={[
methodIconContainer,
{
backgroundColor: !active ? inactiveGray : expired ? '#999999' : color,
},
]}
style={methodIcon}
/>,
actionLabel: typeof action.actionLabel === 'string' ? action.actionLabel : formatMessage(action.actionLabel),
}
);
}
return (
{
triangleColor: methodIconContainer.backgroundColor,
actionIcon: <BlockIcon
icon={iconName ? iconName : action.icon}
containerStyle={[
methodIconContainer,
{
backgroundColor: !active ? inactiveGray : expired ? '#999999' : colors[action.bgColor],
}]}
style={methodIcon}
/>,
actionLabel: typeof action.actionLabel === 'string' ? action.actionLabel : formatMessage(action.actionLabel),
}
);
}
return {};
};
_getRepeatDescription = (): string => {
const { type, weekdays, intl } = this.props;
return getRepeatDescription({
type, weekdays, intl,
});
};
_getStyle = (appLayout: Object): Object => {
let {
borderRadiusRow,
inactiveGray,
} = Theme.Core;
let {
active,
method,
methodValue,
expired,
colors,
} = this.props;
let { height, width } = appLayout;
let isPortrait = height > width;
let deviceWidth = isPortrait ? width : height;
const {
textTwo,
colorOffActiveBg,
} = colors;
const {
fontSizeFactorFour,
} = Theme.Core;
const { land } = Theme.Core.headerHeightFactor;
let headerHeight = (Platform.OS === 'android' && !isPortrait) ? (width * land) + (height * 0.13) : 0;
width = width - headerHeight;
const timeWidth = width * 0.26;
const rowWidth = width * 0.57;
const rowWithTriangleWidth = width * 0.59;
let backgroundColor;
const action = ACTIONS.find((a: Object): boolean => a.method === method);
if (action) {
let showDarkBG = false;
if (action.name === 'Dim') {
let roundVal = Math.round(methodValue / 255 * 100);
showDarkBG = roundVal >= 50 && roundVal < 100;
}
backgroundColor = !active ? inactiveGray : (expired ? '#999999' : (showDarkBG ? colors[action.bgColorDark] : colors[action.bgColor]));
}
return {
inactiveGray,
container: {
flexDirection: 'row',
alignItems: 'center',
paddingHorizontal: width * 0.03888888,
width: width,
backgroundColor: 'transparent',
},
methodIconContainer: {
backgroundColor,
borderTopLeftRadius: borderRadiusRow,
borderBottomLeftRadius: borderRadiusRow,
alignItems: 'center',
justifyContent: 'center',
width: width * 0.16,
},
methodIcon: {
color: '#fff',
fontSize: action && action.name === 'Dim' ? deviceWidth * fontSizeFactorFour : deviceWidth * 0.056,
},
thermostateModeControlIcon: {
color: '#fff',
fontSize: deviceWidth * fontSizeFactorFour,
},
thermostatInfo: {
color: '#fff',
fontSize: deviceWidth * 0.028,
textAlign: 'center',
},
textWrapper: {
flex: 1,
paddingLeft: width * 0.032,
paddingRight: width * 0.032,
width: null,
},
title: {
color: !active ? inactiveGray : textTwo,
fontSize: deviceWidth * fontSizeFactorFour,
marginBottom: width * 0.008,
},
description: {
color: !active ? inactiveGray : textTwo,
fontSize: deviceWidth * 0.032,
},
iconOffset: {
position: 'absolute',
right: width * 0.014666667,
top: width * 0.016,
},
iconRandom: {
position: 'absolute',
right: width * 0.014666667,
bottom: width * 0.016,
},
roundIcon: {
color: '#fff',
fontSize: deviceWidth * 0.044,
},
time: {
width: timeWidth,
textAlign: 'center',
fontSize: deviceWidth * 0.044,
color: !active ? inactiveGray : textTwo,
},
rowContainer: {
width: rowWidth,
minHeight: deviceWidth * 0.1,
},
roundIconContainer: {
marginLeft: isPortrait ? 0 : width * 0.01788,
},
rowWithTriangleContainer: {
width: rowWithTriangleWidth,
justifyContent: 'center',
},
lineStyle: {
height: 1 + (deviceWidth * 0.005),
width: '100%',
backgroundColor: colorOffActiveBg,
},
rowWithTriangleContainerNow: {
width: rowWithTriangleWidth + timeWidth,
height: deviceWidth * 0.082,
justifyContent: 'center',
},
};
};
}
export default (withTheme(JobRow): Object);
|
src/App.js | wix/react-templates-transform-boilerplate | import React, { Component } from 'react';
import template from './App.rt';
export class App extends Component {
render() {
return template()
}
}
|
examples/04 Sortable/Simple/index.js | colbyr/react-dnd | import React from 'react';
import Container from './Container';
export default class SortableSimple {
render() {
return (
<div>
<p>
<b><a href='https://github.com/gaearon/react-dnd/tree/master/examples/04%20Sortable/Simple'>Browse the Source</a></b>
</p>
<p>
It is easy to implement a sortable interface with React DnD. Just make the same component both a drag source and a drop target, and reorder the data in the <code>hover</code> handler.
</p>
<Container />
</div>
);
}
} |
fields/types/markdown/MarkdownField.js | w01fgang/keystone | import Field from '../Field';
import React from 'react';
import { FormInput } from '../../../admin/client/App/elemental';
/**
* TODO:
* - Remove dependency on jQuery
*/
// Scope jQuery and the bootstrap-markdown editor so it will mount
var $ = require('jquery');
require('./lib/bootstrap-markdown');
// Append/remove ### surround the selection
// Source: https://github.com/toopay/bootstrap-markdown/blob/master/js/bootstrap-markdown.js#L909
var toggleHeading = function (e, level) {
var chunk;
var cursor;
var selected = e.getSelection();
var content = e.getContent();
var pointer;
var prevChar;
if (selected.length === 0) {
// Give extra word
chunk = e.__localize('heading text');
} else {
chunk = selected.text + '\n';
}
// transform selection and set the cursor into chunked text
if ((pointer = level.length + 1, content.substr(selected.start - pointer, pointer) === level + ' ')
|| (pointer = level.length, content.substr(selected.start - pointer, pointer) === level)) {
e.setSelection(selected.start - pointer, selected.end);
e.replaceSelection(chunk);
cursor = selected.start - pointer;
} else if (selected.start > 0 && (prevChar = content.substr(selected.start - 1, 1), !!prevChar && prevChar !== '\n')) {
e.replaceSelection('\n\n' + level + ' ' + chunk);
cursor = selected.start + level.length + 3;
} else {
// Empty string before element
e.replaceSelection(level + ' ' + chunk);
cursor = selected.start + level.length + 1;
}
// Set the cursor
e.setSelection(cursor, cursor + chunk.length);
};
var renderMarkdown = function (component) {
// dependsOn means that sometimes the component is mounted as a null, so account for that & noop
if (!component.refs.markdownTextarea) {
return;
}
var options = {
autofocus: false,
savable: false,
resize: 'vertical',
height: component.props.height,
hiddenButtons: ['Heading'],
// Heading buttons
additionalButtons: [{
name: 'groupHeaders',
data: [{
name: 'cmdH1',
title: 'Heading 1',
btnText: 'H1',
callback: function (e) {
toggleHeading(e, '#');
},
}, {
name: 'cmdH2',
title: 'Heading 2',
btnText: 'H2',
callback: function (e) {
toggleHeading(e, '##');
},
}, {
name: 'cmdH3',
title: 'Heading 3',
btnText: 'H3',
callback: function (e) {
toggleHeading(e, '###');
},
}, {
name: 'cmdH4',
title: 'Heading 4',
btnText: 'H4',
callback: function (e) {
toggleHeading(e, '####');
},
}],
}],
// Insert Header buttons into the toolbar
reorderButtonGroups: ['groupFont', 'groupHeaders', 'groupLink', 'groupMisc', 'groupUtil'],
};
if (component.props.toolbarOptions.hiddenButtons) {
var hiddenButtons = (typeof component.props.toolbarOptions.hiddenButtons === 'string')
? component.props.toolbarOptions.hiddenButtons.split(',')
: component.props.toolbarOptions.hiddenButtons;
options.hiddenButtons = options.hiddenButtons.concat(hiddenButtons);
}
$(component.refs.markdownTextarea).markdown(options);
};
module.exports = Field.create({
displayName: 'MarkdownField',
statics: {
type: 'Markdown',
getDefaultValue: () => ({}),
},
// override `shouldCollapse` to check the markdown field correctly
shouldCollapse () {
return this.props.collapse && !this.props.value.md;
},
// only have access to `refs` once component is mounted
componentDidMount () {
if (this.props.wysiwyg) {
renderMarkdown(this);
}
},
// only have access to `refs` once component is mounted
componentDidUpdate () {
if (this.props.wysiwyg) {
renderMarkdown(this);
}
},
renderField () {
const styles = {
padding: 8,
height: this.props.height,
};
const defaultValue = (
this.props.value !== undefined
&& this.props.value.md !== undefined
)
? this.props.value.md
: '';
return (
<textarea
className="md-editor__input code"
defaultValue={defaultValue}
name={this.getInputName(this.props.paths.md)}
ref="markdownTextarea"
style={styles}
/>
);
},
renderValue () {
// TODO: victoriafrench - is this the correct way to do this? the object
// should be creating a default md where one does not exist imo.
const innerHtml = (
this.props.value !== undefined
&& this.props.value.md !== undefined
)
? this.props.value.md.replace(/\n/g, '<br />')
: '';
return (
<FormInput
dangerouslySetInnerHTML={{ __html: innerHtml }}
multiline
noedit
/>
);
},
});
|
src/core/components/NotFound.js | mstriemer/addons-frontend | import React from 'react';
import { gettext as _ } from 'core/utils';
export default class NotFound extends React.Component {
render() {
return (
<div className="not-found">
<h1 ref={(ref) => { this.heading = ref; }}>
{_("We're sorry, but we can't find what you're looking for.")}
</h1>
<p>{_(dedent`The page or file you requested wasn't found on our site. It's possible that you
clicked a link that's out of date, or typed in the address incorrectly.`)}</p>
</div>
);
}
}
|
app/index.js | redpelicans/wall-street-react | import React from 'react';
import Router from 'react-router';
import routes from './routes';
Router.run(routes, Router.HashLocation, (Root) => {
React.render(<Root/>, document.body);
});
|
client/components/Dashbord/allRecipe.js | kenware/more-recipes | import React, { Component } from 'react';
import { BrowserRouter, Route, Switch, Redirect, Link } from 'react-router-dom';
import { PropTypes } from 'react';
import * as actions from '../../redux/Action/action.js';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import './dashbord.scss'
import trim from '../trim';
import { Markup } from 'interweave';
import ReactEasyPaginate from 'react-easy-paginate';
import 'react-easy-paginate/dist/react-easy-paginate.css';
const limit = 6;
class AllRecipe extends Component {
constructor(props){
super(props)
this.state = {
}
this.handlePaginateClick = this.handlePaginateClick.bind(this)
}
componentWillMount() {
this.props.actions.loadRecipes('id','DESC',1,limit,'none');
}
handlePaginateClick(pageNum) {
this.props.actions.loadRecipes('id','DESC',pageNum,limit);
}
render() {
return (
<div className="col-12">
<div className="row">
<div className="card mb-4 col-12">
<div className="card-block">
<div className="card-header">
<h3 className="card-title">All Recipes</h3>
<div className="dropdown card-title-btn-container float-right">
<button className="btn btn-sm btn-subtle" type="button"><em className="fa fa-list-ul"></em> View All</button>
<button className="btn btn-sm btn-subtle dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><em className="fa fa-cog"></em>
</button>
<div className="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton"><a className="dropdown-item" href="#"><em className="fa fa-search mr-1"></em> More info</a>
<a className="dropdown-item" href="#"><em className="fa fa-thumb-tack mr-1"></em> Pin Window</a>
<a className="dropdown-item" href="#"><em className="fa fa-remove mr-1"></em> Close Window</a>
</div>
</div>
<h6 className="card-subtitle mb-2 text-muted">List of all available recipe</h6>
</div>
<div className="divider" style={{marginTop: '1rem'}}></div>
<div className="articles-container">
{ this.props.paginate.map(recipe=>
<div key={recipe.id} className="article border-bottom">
<div className="col-xs-12">
<div className="row">
<div className="col-2">
{recipe.createdAt}
</div>
<div className="col-2 date">
<a href={recipe.image}><img className="img-fluid rounded-circle card-img-top " src={recipe.image}/></a>
</div>
<div className="col-5">
<h4><Link to={`/dashbord/detail/${recipe.id}`}>recipe.title</Link></h4>
<p className="card-text">
<Markup content={ trim.trim(`${recipe.content}`) + '...'}
/>
<Link to={`/dashbord/detail/${recipe.id}`}>Read More → </Link></p>
</div>
<div className="col-3">
<Link to={`/dashbord/detail/${recipe.id}`}>add favorite/View</Link>
</div>
</div>
</div>
<div className="clear"></div>
</div>
)}
</div>
</div>
</div>
</div>
<div className="row">
<div id="react-easy-paginate" className="col-12 text-center">
<ReactEasyPaginate pageTotal={Math.floor(this.props.recipes.length / limit) + 1} rangeDisplayed={4} onClick={this.handlePaginateClick} />
</div>
</div>
</div>
);
}
}
function mapStateToProps(state, ownProps) {
return {
recipes: state.recipes,
paginate:state.paginate
};
}
function mapDispatchToProps(dispatch) {
return {actions: bindActionCreators(actions, dispatch)}
}
export default connect(mapStateToProps, mapDispatchToProps)(AllRecipe); |
actor-apps/app-web/src/app/components/activity/ActivityHeader.react.js | xiaotaijun/actor-platform | import React from 'react';
import ReactMixin from 'react-mixin';
import addons from 'react/addons';
const {addons: { PureRenderMixin }} = addons;
@ReactMixin.decorate(PureRenderMixin)
class ActivityHeader extends React.Component {
static propTypes = {
close: React.PropTypes.func,
title: React.PropTypes.string
};
constructor(props) {
super(props);
}
render() {
const title = this.props.title;
const close = this.props.close;
let headerTitle;
if (typeof title !== 'undefined') {
headerTitle = <span className="activity__header__title">{title}</span>;
}
return (
<header className="activity__header toolbar">
<a className="activity__header__close material-icons" onClick={close}>clear</a>
{headerTitle}
</header>
);
}
}
export default ActivityHeader;
|
src/svg-icons/action/line-weight.js | nathanmarks/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionLineWeight = (props) => (
<SvgIcon {...props}>
<path d="M3 17h18v-2H3v2zm0 3h18v-1H3v1zm0-7h18v-3H3v3zm0-9v4h18V4H3z"/>
</SvgIcon>
);
ActionLineWeight = pure(ActionLineWeight);
ActionLineWeight.displayName = 'ActionLineWeight';
ActionLineWeight.muiName = 'SvgIcon';
export default ActionLineWeight;
|
node_modules/react-images/src/components/Arrow.js | ed1d1a8d/macweb | import PropTypes from 'prop-types';
import React from 'react';
import { css, StyleSheet } from 'aphrodite/no-important';
import defaults from '../theme';
import { deepMerge } from '../utils';
import Icon from './Icon';
function Arrow ({
direction,
icon,
onClick,
size,
...props,
},
{
theme,
}) {
const classes = StyleSheet.create(deepMerge(defaultStyles, theme));
return (
<button
type="button"
className={css(classes.arrow, classes['arrow__direction__' + direction], size && classes['arrow__size__' + size])}
onClick={onClick}
onTouchEnd={onClick}
{...props}
>
<Icon fill={!!theme.arrow && theme.arrow.fill || defaults.arrow.fill} type={icon} />
</button>
);
}
Arrow.propTypes = {
direction: PropTypes.oneOf(['left', 'right']),
icon: PropTypes.string,
onClick: PropTypes.func.isRequired,
size: PropTypes.oneOf(['medium', 'small']).isRequired,
};
Arrow.defaultProps = {
size: 'medium',
};
Arrow.contextTypes = {
theme: PropTypes.object.isRequired,
};
const defaultStyles = {
arrow: {
background: 'none',
border: 'none',
borderRadius: 4,
cursor: 'pointer',
outline: 'none',
padding: 10, // increase hit area
position: 'absolute',
top: '50%',
// disable user select
WebkitTouchCallout: 'none',
userSelect: 'none',
},
// sizes
arrow__size__medium: {
height: defaults.arrow.height,
marginTop: defaults.arrow.height / -2,
width: 40,
'@media (min-width: 768px)': {
width: 70,
},
},
arrow__size__small: {
height: defaults.thumbnail.size,
marginTop: defaults.thumbnail.size / -2,
width: 30,
'@media (min-width: 500px)': {
width: 40,
},
},
// direction
arrow__direction__right: {
right: defaults.container.gutter.horizontal,
},
arrow__direction__left: {
left: defaults.container.gutter.horizontal,
},
};
module.exports = Arrow;
|
src/components/reactResearch/SearchBar.js | mpeinado/react-starter | import React, { Component } from 'react';
class SearchBar extends Component {
handleFilterProductsChange = (e) => {
e.preventDefault();
const text = e.target.value;
this.props.handleFilterProductsChange(text);
}
handleInStockChange = (e) => {
const showOnlyInStock = e.target.checked;
this.props.handleInStockChange(showOnlyInStock);
}
render () {
const rowStyle = {
paddingTop: 15,
paddingBottom: 35
};
return(
<div className="row" style={rowStyle}>
<div className="col">
<form>
<div className="form-group">
<label htmlFor="formSerch">Search</label>
<input type="text" className="form-control" id="formSerch" placeholder="Search"
value={this.props.filterText}
onChange={this.handleFilterProductsChange} />
</div>
<div className="form-check">
<input type="checkbox" className="form-check-input" id="showProductsInStock" onChange={this.handleInStockChange} />
<label className="form-check-label" htmlFor="showProductsInStock">Only show products in Stock</label>
</div>
</form>
</div>
</div>
);
}
}
export default SearchBar; |
src/PhotoLayoutEditor/Container/Side/index.js | RedgooseDev/react-photo-layout-editor | import React from 'react';
import { connect } from 'react-redux';
import classNames from 'classnames';
import $ from 'jquery/dist/jquery.slim';
import * as actions from '../../actions';
import ToggleSideButton from './ToggleSideButton';
import Navigation from './Navigation';
import Items from './Items';
import * as lib from '../../lib';
import selectItems from './selectItems';
class Side extends React.Component {
constructor(props)
{
super(props);
this.dragTarget = null;
this.dragPosition = [];
this.$gridItems = null;
this.$dragItem = null;
this.uploading = false;
}
/**
* get gridster item
* ํฌ์ธํธ ์์น์ ์๋ gridster๋ธ๋ญ์ ๊ฐ์ ธ์จ๋ค.
*
* @return {Object} gridster item
*/
getGridsterItem()
{
const { props } = this;
let target = null;
this.$gridItems = $(props.element).find('.ple-grid > div');
this.$gridItems.each((n, el) => {
const $this = $(el);
const pos = $this.offset();
if (pos.left < this.dragPosition[0] &&
(pos.left + $this.width()) > this.dragPosition[0] &&
pos.top < this.dragPosition[1] &&
(pos.top + $this.height()) > this.dragPosition[1])
{
target = $this.data('key');
return false;
}
});
return target;
}
/**
* On select items
*
* @param {Number} key
*/
_selectItem(key)
{
const { props } = this;
let selected = selectItems(props, key);
props.api.side.select(selected);
}
/**
* Remove items
*/
_removeItems()
{
const { props } = this;
let keys = props.api.side.getKeys('selected');
if (keys.length)
{
if (confirm('Do you really want to delete it?'))
{
props.api.side.remove(keys);
}
}
else
{
if (!confirm('Delete all?')) return;
keys = props.api.side.getKeys('all');
props.api.side.remove(keys);
}
}
/**
* upload
*
* @param {FileList} files
*/
_upload(files)
{
const { props } = this;
props.api.side.upload(files);
}
/**
* Attach images to grid
*/
_attach()
{
try
{
let keys = this.props.api.side.getKeys('selected');
let result = this.props.api.side.attachToGrid(keys);
if (result) throw result;
}
catch(e)
{
alert(e.message);
}
}
_dragStartItem(evt)
{
const { props } = this;
// for firefox
evt.dataTransfer.setData('text/plain', null);
this.$gridItems = $(props.element).find('.ple-grid > div');
this.$gridItems.on('dragover', (e) => {
e.preventDefault();
if ($(e.currentTarget).hasClass('ple-grid__item-hover')) return;
$(e.currentTarget).addClass('ple-grid__item-hover');
}).on('dragleave', (e) => {
e.preventDefault();
$(e.currentTarget).removeClass('ple-grid__item-hover');
}).on('drop', (e) => {
e.preventDefault();
$(e.currentTarget).removeClass('ple-grid__item-hover');
this.dragTarget = $(e.currentTarget).data('key');
});
}
_dragEndItem(e)
{
const { props } = this;
this.$gridItems.off();
this.$gridItems = null;
// check drag target
if (this.dragTarget === null) return;
// play redux
props.dispatch(actions.body.attachImage(
this.dragTarget,
$(e.currentTarget).data('image')
));
// empty dragTarget
this.dragTarget = null;
}
_touchStartItem(e)
{
this.$dragItem = $(e.currentTarget)
.clone()
.removeAttr('draggable')
.addClass('ple-side__placeholder')
.width($(e.currentTarget).width())
.height($(e.currentTarget).height());
$('body').append(this.$dragItem);
}
_touchMoveItem(e)
{
if (!lib.util.checkSupportCss('touch-action', 'pan-y'))
{
e.preventDefault();
}
let touch = e.nativeEvent.touches[0];
this.dragPosition = [touch.pageX, touch.pageY];
this.$dragItem.css({
left: touch.pageX - (this.$dragItem.width() * 0.5),
top: touch.pageY - (this.$dragItem.height() * 0.5)
});
}
_touchEndItem(e)
{
const { props } = this;
this.$dragItem.remove();
this.$dragItem = null;
if (this.dragPosition.length > 0)
{
this.dragTarget = this.getGridsterItem();
// check drag target
if (this.dragTarget === null) return;
// play redux
props.dispatch(actions.body.attachImage(
this.dragTarget,
$(e.currentTarget).data('image')
));
this.dragPosition = [];
}
}
render()
{
const { props } = this;
return (
<aside className="ple-side">
<div className={classNames(
'ple-side__wrap',
{ 'ple-side__wrap-show': props.tree.side.visible }
)}>
<span
onClick={() => props.api.side.toggleSelectAll(false)}
className="ple-side__background"/>
<ToggleSideButton
show={props.tree.side.visible}
onClick={() => props.api.util.toggleSide(undefined)}/>
<Navigation
onAttach={() => this._attach()}
onToggleSelect={() => props.api.side.toggleSelectAll()}
onUpload={(e) => this._upload(e)}
onRemove={() => this._removeItems()}/>
<Items
files={props.tree.side.files}
onSelect={(e) => this._selectItem(e)}
onDragStart={(e) => this._dragStartItem(e)}
onDragEnd={(e) => this._dragEndItem(e)}
onTouchStart={(e) => this._touchStartItem(e)}
onTouchMove={(e) => this._touchMoveItem(e)}
onTouchEnd={(e) => this._touchEndItem(e)}
progress={props.tree.side.progressPercent}/>
</div>
</aside>
);
}
}
Side.displayName = 'Side';
Side.defaultProps = {
tree: {}, // data tree in reduce
setting: {}, // setting in reduce
api: {}, // api
dispatch: null, // redux dispatch
};
export default connect((state) => Object.assign({}, state))(Side);
|
app/modules/vieweditor/vieweditor.container.js | benmccormick/trollbox | /* @flow */
import { bindActionCreators } from 'redux';
import React from 'react';
import Select from 'react-select';
import { connect } from 'react-redux';
import {map} from 'lodash';
import { getAllBoards } from '../../data/boards';
import {addView} from '../../actions/views';
import {container, form, formLabel, formInput, formSelect, primaryButton} from './vieweditor.css';
import { switchPageToSearch } from '../../actions/page';
import type { Board} from '../../interfaces/trello';
import type { View } from '../../interfaces/view';
import 'react-select/dist/react-select.css?global=true';
type boardOption = {
value: string,
label: string,
};
export class ViewEditor extends React.Component {
state: {
name: string,
selectedBoards: string[],
};
updateName(name: string) {
this.setState({name});
}
constructor(props: any) {
super(props);
this.state = {
name: '',
selectedBoards: [],
};
}
buildView() {
let {addView: _addView, switchPageToSearch: _switchViewToSearch} = this.props;
let {name, selectedBoards} = this.state;
let newView: View = {
name,
sources: {
boards: selectedBoards,
}
};
_addView(newView);
_switchViewToSearch();
}
selectBoards(boardIds: boardOption[]) {
this.setState({
selectedBoards: map(boardIds, option => option.value),
});
}
render() {
let boards: Board = this.props.boards;
let boardOptions = map(boards, board => ({value: board.id, label: board.name}));
let {name, selectedBoards} = this.state;
return (<div className={container}>
<h2> Create a new View </h2>
<div className={form}>
<label htmlFor="view-name" className={formLabel}>View Name</label>
<input
id="view-name"
defaultValue={name}
className={formInput}
onChange={e => this.updateName(e.target.value)}
/>
<label htmlFor="view-boards" className={formLabel}>Boards To Pull Cards From</label>
<Select
id="view-boards"
className={formSelect}
options={boardOptions}
value={selectedBoards}
onChange={selectedIds => this.selectBoards(selectedIds)}
multi={true}
/>
<span
className={primaryButton}
onClick={() => this.buildView()}>
Create View
</span>
</div>
</div>);
}
}
ViewEditor.propTypes = {
boards: React.PropTypes.array.isRequired,
addView: React.PropTypes.func.isRequired,
switchPageToSearch: React.PropTypes.func.isRequired,
};
const mapStateToProps = (state) => ({
boards: getAllBoards(state),
});
const mapDispatchToProps = (dispatch) => bindActionCreators({
addView,
switchPageToSearch,
}, dispatch);
export const ViewEditorContainer = connect(mapStateToProps, mapDispatchToProps)(ViewEditor);
|
site/WorkHard_Profile/src/ProfilePanel.js | harrydrippin/Workhard | import React, { Component } from 'react';
import FloatingActionButton from 'material-ui/FloatingActionButton';
import ContentAdd from 'material-ui/svg-icons/content/add';
var lipsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum vitae consectetur est, faucibus tempor massa. Cras sagittis diam quam. Quisque euismod diam ut turpis egestas, vel rhoncus nisi porttitor. Nullam a tempus ligula, ac eleifend sapien. Cras at ante ipsum. Suspendisse potenti. Duis lacinia lobortis vestibulum. Sed feugiat vestibulum pulvinar. Maecenas vestibulum diam ut libero euismod porttitor in vitae purus. Proin eu elit quam.\n Vivamus luctus lectus sit amet enim facilisis, a auctor lacus facilisis. Praesent nec tincidunt enim, vitae rutrum mi. Sed non enim eget odio commodo convallis ac sit amet arcu. Nullam imperdiet lorem vitae consequat pellentesque. Phasellus ut mattis ligula. Sed ac velit scelerisque nisl dapibus vehicula. Quisque tincidunt et mi vitae aliquam. Interdum et malesuada fames ac ante ipsum primis in faucibus. Etiam eu ante urna.\nIn hac habitasse platea dictumst. Cum sociis natoque penatibus";
class ProfilePanel extends Component {
constructor() {
super(...arguments);
}
render() {
return (
<div className="panel-wrapper">
<div className="panel-header">
<span className="panel-title">๋ง์ด ํ์ด์ง</span>
</div>
<div className="container panel-grid">
<ContentPanel />
</div>
<FloatingActionButton style={{
position: 'absolute',
bottom: 75,
right: 90
}}>
<ContentAdd />
</FloatingActionButton>
</div>
);
}
}
class ContentPanel extends Component {
constructor() {
super(...arguments);
}
render() {
return (
<div className="col-md-4 panel-item">
<div className="panel-item-wrapper">
<a href="#" className="hover-a">
<div className="panel-item-header">
์์์ฒ ํ:์์ ๊ณผํ ๋ก ๊ธฐ๋ง ํ๊ณผ์ 4์กฐ
</div>
<div className="panel-item-body">
์๊ธฐ์ดํด์ ์ค๋ฆฌํ: <strong>์ํผ์คํธ</strong>์ <strong>์ํฌ๋ผํ
์ค</strong><br />
๊ทธ๋ฆฌ๊ณ ์๋๋ฐ์์ค์ ์นดํ๋ฐ์์ค: <strong>ํ๋ผํค</strong> ์ค๋ฆฌํ์ ๋ํด ์กฐ์ฌํ์ฌ ๋ฐํํ์ธ์.<br /><br />ํ๊ฐ์์<br />
(1) ์ฃผ์ด์ง ๊ฐ๋
๋ฐ ์ธ๋ฌผ์ ๋ํ ์ ํํ ์ดํด๋ (50%)<br /><br />
(2) ๋
์ฐฝ์ฑ๊ณผ ๋
ผ๋ฆฌ์ฑ(์ฒด๊ณ์ฑ) (30%)<br /><br />
(3) ์ ์ฑ์ ํ๊ฐ (20%)<br />
</div>
</a>
</div>
</div>
);
}
}
export default ProfilePanel;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.