path
stringlengths 5
296
| repo_name
stringlengths 5
85
| content
stringlengths 25
1.05M
|
|---|---|---|
examples/complete/react-native/screens/LinksScreen.js
|
prescottprue/react-redux-firebase
|
import React from 'react';
import { ScrollView, StyleSheet } from 'react-native';
import { ExpoLinksView } from '@expo/samples';
export default class LinksScreen extends React.Component {
static navigationOptions = {
title: 'Links',
};
render() {
return (
<ScrollView style={styles.container}>
{/* Go ahead and delete ExpoLinksView and replace it with your
* content, we just wanted to provide you with some helpful links */}
<ExpoLinksView />
</ScrollView>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
paddingTop: 15,
backgroundColor: '#fff',
},
});
|
src/Parser/Druid/Restoration/CombatLogParser.js
|
enragednuke/WoWAnalyzer
|
import React from 'react';
import Tab from 'Main/Tab';
import Mana from 'Main/Mana';
import CoreCombatLogParser from 'Parser/Core/CombatLogParser';
import LowHealthHealing from 'Parser/Core/Modules/LowHealthHealing';
import HealingDone from 'Parser/Core/Modules/HealingDone';
import WildGrowthNormalizer from './Normalizers/WildGrowth';
import ClearcastingNormalizer from './Normalizers/ClearcastingNormalizer';
import Mastery from './Modules/Core/Mastery';
import Rejuvenation from './Modules/Core/Rejuvenation';
import Ekowraith from './Modules/Items/Ekowraith';
import XonisCaress from './Modules/Items/XonisCaress';
import DarkTitanAdvice from './Modules/Items/DarkTitanAdvice';
import EssenceOfInfusion from './Modules/Items/EssenceOfInfusion';
import SoulOfTheArchdruid from './Modules/Items/SoulOfTheArchdruid';
import Tearstone from './Modules/Items/Tearstone';
import DarkmoonDeckPromises from './Modules/Items/DarkmoonDeckPromises';
import GarothiFeedbackConduit from './Modules/Items/GarothiFeedbackConduit';
import CarafeOfSearingLight from './Modules/Items/CarafeOfSearingLight';
import T19_2Set from './Modules/Items/T19_2Set';
import T20_2Set from './Modules/Items/T20_2Set';
import T20_4Set from './Modules/Items/T20_4Set';
import T21_2Set from './Modules/Items/T21_2Set';
import T21_4Set from './Modules/Items/T21_4Set';
import HealingTouch from './Modules/Features/HealingTouch';
import AlwaysBeCasting from './Modules/Features/AlwaysBeCasting';
import AverageHots from './Modules/Features/AverageHots';
import Abilities from './Modules/Features/Abilities';
import CooldownThroughputTracker from './Modules/Features/CooldownThroughputTracker';
import WildGrowth from './Modules/Features/WildGrowth';
import Lifebloom from './Modules/Features/Lifebloom';
import Efflorescence from './Modules/Features/Efflorescence';
import Clearcasting from './Modules/Features/Clearcasting';
import Innervate from './Modules/Features/Innervate';
import PowerOfTheArchdruid from './Modules/Features/PowerOfTheArchdruid';
import Dreamwalker from './Modules/Features/Dreamwalker';
import EssenceOfGhanir from './Modules/Features/EssenceOfGhanir';
import NaturesEssence from './Modules/Features/NaturesEssence';
import Ironbark from './Modules/Features/Ironbark';
import CenarionWard from './Modules/Talents/CenarionWard';
import Cultivation from './Modules/Talents/Cultivation';
import Flourish from './Modules/Talents/Flourish';
import SpringBlossoms from './Modules/Talents/SpringBlossoms';
import SoulOfTheForest from './Modules/Talents/SoulOfTheForest';
import TreeOfLife from './Modules/Talents/TreeOfLife';
import RelicTraits from './Modules/Traits/RelicTraits';
import ArmorOfTheAncients from './Modules/Traits/ArmorOfTheAncients';
import BlessingOfTheWorldTree from './Modules/Traits/BlessingOfTheWorldTree';
import EssenceOfNordrassil from './Modules/Traits/EssenceOfNordrassil';
import Grovewalker from './Modules/Traits/Grovewalker';
import InfusionOfNature from './Modules/Traits/InfusionOfNature';
import KnowledgeOfTheAncients from './Modules/Traits/KnowledgeOfTheAncients';
import NaturalMending from './Modules/Traits/NaturalMending';
import Persistence from './Modules/Traits/Persistence';
import SeedsOfTheWorldTree from './Modules/Traits/SeedsOfTheWorldTree';
import EternalRestoration from './Modules/Traits/EternalRestoration';
import StatWeights from './Modules/Features/StatWeights';
import { ABILITIES_AFFECTED_BY_HEALING_INCREASES } from './Constants';
import MurderousIntent from "./Modules/NetherlightCrucibleTraits/MurderousIntent";
import Shocklight from "./Modules/NetherlightCrucibleTraits/Shocklight";
import LightSpeed from "./Modules/NetherlightCrucibleTraits/LightSpeed";
import NLCTraits from "./Modules/NetherlightCrucibleTraits/NLCTraits";
import MasterOfShadows from "./Modules/NetherlightCrucibleTraits/MasterOfShadows";
class CombatLogParser extends CoreCombatLogParser {
static abilitiesAffectedByHealingIncreases = ABILITIES_AFFECTED_BY_HEALING_INCREASES;
static specModules = {
// Normalizers
wildGrowthNormalizer: WildGrowthNormalizer,
clearcastingNormalizer: ClearcastingNormalizer,
// Core
healingDone: [HealingDone, { showStatistic: true }],
// Features
healingTouch : HealingTouch,
lowHealthHealing: LowHealthHealing,
alwaysBeCasting: AlwaysBeCasting,
averageHots: AverageHots,
cooldownThroughputTracker: CooldownThroughputTracker,
abilities: Abilities,
rejuvenation: Rejuvenation,
wildGrowth: WildGrowth,
lifebloom: Lifebloom,
efflorescence: Efflorescence,
clearcasting: Clearcasting,
treeOfLife: TreeOfLife,
flourish: Flourish,
innervate: Innervate,
powerOfTheArchdruid: PowerOfTheArchdruid,
dreamwalker: Dreamwalker,
soulOfTheForest: SoulOfTheForest,
essenceOfGhanir: EssenceOfGhanir,
mastery: Mastery,
springBlossoms: SpringBlossoms,
cultivation: Cultivation,
cenarionWard: CenarionWard,
naturesEssence: NaturesEssence,
ironbark: Ironbark,
// Items:
ekowraith: Ekowraith,
xonisCaress: XonisCaress,
darkTitanAdvice: DarkTitanAdvice,
essenceOfInfusion: EssenceOfInfusion,
soulOfTheArchdruid: SoulOfTheArchdruid,
tearstone: Tearstone,
t19_2set: T19_2Set,
t20_2set: T20_2Set,
t20_4set: T20_4Set,
t21_2set: T21_2Set,
t21_4set: T21_4Set,
// TODO:
// Edraith
// Aman'Thul's Wisdom
// NLC
murderousIntent: MurderousIntent,
shocklight: Shocklight,
lightSpeed: LightSpeed,
masterOfShadows: MasterOfShadows,
nlcTraits: NLCTraits,
// Shared:
darkmoonDeckPromises: DarkmoonDeckPromises,
garothiFeedbackConduit: GarothiFeedbackConduit,
carafeOfSearingLight: CarafeOfSearingLight,
// Traits
RelicTraits: RelicTraits,
ArmorOfTheAncients: ArmorOfTheAncients,
BlessingOfTheWorldTree: BlessingOfTheWorldTree,
EssenceOfNordrassil: EssenceOfNordrassil,
Grovewalker: Grovewalker,
InfusionOfNature: InfusionOfNature,
KnowledgeOfTheAncients: KnowledgeOfTheAncients,
NaturalMending: NaturalMending,
Persistence: Persistence,
SeedsOfTheWorldTree: SeedsOfTheWorldTree,
EternalRestoration: EternalRestoration,
statWeights: StatWeights,
};
generateResults() {
const results = super.generateResults();
results.tabs = [
...results.tabs,
{
title: 'Mana',
url: 'mana',
render: () => (
<Tab title="Mana" style={{ padding: '15px 22px' }}>
<Mana parser={this} />
</Tab>
),
},
];
return results;
}
}
export default CombatLogParser;
|
learning/index.js
|
YashdalfTheGray/talks
|
import React from 'react';
import { render } from 'react-dom';
import Presentation from './presentation';
render(<Presentation/>, document.querySelector('#root'));
|
frontend/src/components/on_boarding/ContributorPicker.js
|
OpenCollective/opencollective-website
|
import React from 'react';
import ContributorPickerItem from './ContributorPickerItem'
export default class ContributorPicker extends React.Component {
constructor(props) {
super(props);
}
renderChosenContributors() {
const { chosen, onRemove } = this.props;
return chosen.map((contributor, index) => {
return (
<ContributorPickerItem
key={index}
name={contributor.name}
avatar={contributor.avatar}
onRemove={() => onRemove(contributor)}
/>
)
});
}
render() {
const { available, onChoose } = this.props;
return (
<div className="ContributorPicker">
{this.renderChosenContributors()}
{available.length ? <ContributorPickerItem available={available} onChoose={onChoose} /> : null}
</div>
)
}
}
|
src/app/components/team/SmoochBot/SmoochBotMainMenu.js
|
meedan/check-web
|
import React from 'react';
import PropTypes from 'prop-types';
import { injectIntl, intlShape, defineMessages, FormattedMessage } from 'react-intl';
import Typography from '@material-ui/core/Typography';
import { languageLabel } from '../../../LanguageRegistry';
import SmoochBotMainMenuSection from './SmoochBotMainMenuSection';
const messages = defineMessages({
privacyStatement: {
id: 'smoochBotMainMenu.privacyStatement',
defaultMessage: 'Privacy statement',
description: 'Menu label used in the tipline bot',
},
});
const SmoochBotMainMenu = ({
value,
languages,
enabledIntegrations,
intl,
onChange,
}) => {
const resources = value.smooch_custom_resources || [];
const handleChangeTitle = (newValue, menu) => {
onChange({ smooch_menu_title: newValue }, menu);
};
const handleChangeMenuOptions = (newOptions, menu) => {
onChange({ smooch_menu_options: newOptions }, menu);
};
const whatsAppEnabled = (enabledIntegrations.whatsapp && enabledIntegrations.whatsapp.status === 'active');
return (
<React.Fragment>
<Typography variant="subtitle2" component="div">
<FormattedMessage id="smoochBotMainMenu.mainMenu" defaultMessage="Main menu" description="Title of the tipline bot main menu settings page." />
</Typography>
<Typography component="div" variant="body2" paragraph>
<FormattedMessage
id="smoochBotMainMenu.subtitle"
defaultMessage="The menu of your bot, asking the user to choose between a set of options."
description="Subtitle displayed in tipline settings page for the main menu."
/>
</Typography>
{ Object.keys(enabledIntegrations).filter(platformName => platformName !== 'whatsapp').length > 0 ? // Any platform other than WhatsApp
<Typography component="div" variant="body2" paragraph>
<FormattedMessage
id="smoochBotMainMenu.subtitle2"
defaultMessage="Please note that some messaging services may have different menu display options than others. {linkToLearnMore}."
description="Subtitle displayed in tipline settings page for the main menu if the tipline is enabled for WhatsApp and at least one more platform."
values={{
linkToLearnMore: (
<a href="http://help.checkmedia.org/en/articles/4838307-creating-your-tipline-bot" target="_blank" rel="noopener noreferrer">
<FormattedMessage
id="smoochBotMainMenu.learnMore"
defaultMessage="Learn more"
description="Link with help article about which menu features are supported by each platform in tipline settings page for the main menu."
/>
</a>
),
}}
/>
</Typography> : null }
<SmoochBotMainMenuSection
number={1}
value={value.smooch_state_main}
resources={resources}
noTitleNoDescription={!whatsAppEnabled}
onChangeTitle={(newValue) => { handleChangeTitle(newValue, 'smooch_state_main'); }}
onChangeMenuOptions={(newOptions) => { handleChangeMenuOptions(newOptions, 'smooch_state_main'); }}
/>
{ whatsAppEnabled ?
<SmoochBotMainMenuSection
number={2}
value={value.smooch_state_secondary}
resources={resources}
onChangeTitle={(newValue) => { handleChangeTitle(newValue, 'smooch_state_secondary'); }}
onChangeMenuOptions={(newOptions) => { handleChangeMenuOptions(newOptions, 'smooch_state_secondary'); }}
optional
/> : null }
<SmoochBotMainMenuSection
number={3}
value={
languages.length > 1 ?
{
smooch_menu_title: <FormattedMessage id="smoochBotMainMenu.languagesAndPrivacy" defaultMessage="Languages and Privacy" description="Title of the main menu third section of the tipline where there is more than one supported language" />,
smooch_menu_options: languages.map(l => ({ smooch_menu_option_label: languageLabel(l) })).concat({ smooch_menu_option_label: intl.formatMessage(messages.privacyStatement) }),
} :
{
smooch_menu_title: <FormattedMessage id="smoochBotMainMenu.privacy" defaultMessage="Privacy" description="Title of the main menu third section of the tipline when there is only one supported language" />,
smooch_menu_options: [{ smooch_menu_option_label: intl.formatMessage(messages.privacyStatement) }],
}
}
onChangeTitle={() => {}}
onChangeMenuOptions={() => {}}
readOnly
/>
</React.Fragment>
);
};
SmoochBotMainMenu.defaultProps = {
value: {},
languages: [],
};
SmoochBotMainMenu.propTypes = {
value: PropTypes.object,
languages: PropTypes.arrayOf(PropTypes.string),
intl: intlShape.isRequired,
enabledIntegrations: PropTypes.object.isRequired,
onChange: PropTypes.func.isRequired,
};
export default injectIntl(SmoochBotMainMenu);
|
src/icons/IosCog.js
|
fbfeix/react-icons
|
import React from 'react';
import IconBase from './../components/IconBase/IconBase';
export default class IosCog extends React.Component {
render() {
if(this.props.bare) {
return <g>
<g>
<path d="M293.25,150.32L265.2,254.9l74.954,75C358.159,309.457,368,283.486,368,256c0-29.916-11.65-58.042-32.805-79.196
C323.154,164.763,308.854,155.807,293.25,150.32z"></path>
<path d="M278.068,146.161C270.88,144.732,263.496,144,256,144c-29.916,0-58.042,11.65-79.196,32.805
C155.65,197.958,144,226.084,144,256c0,7.468,0.727,14.824,2.145,21.988L250.3,250.1L278.068,146.161z"></path>
<path d="M150.473,293.697c5.5,15.43,14.404,29.572,26.331,41.498C197.958,356.35,226.083,368,256,368
c27.009,0,52.558-9.499,72.835-26.911L253.9,266.2L150.473,293.697z"></path>
<path d="M448,272.754v-32.008l-33.291-8.703l-2.601-13.204l27.594-20.905l-12.197-29.608l-34.392,4.802l-7.498-10.603
l17.695-29.708l-22.594-22.605l-30.191,17.404l-10.697-7.302l5.298-35.009l-29.492-12.303L294.04,101.31l-12.297-2.601L273.045,64
h-31.991l-9.197,34.909l-12.098,2.4l-21.494-29.008l-29.592,12.304l4.799,35.709l-11.697,7.202l-31.292-18.705l-22.594,22.606
l18.795,31.508l-6.698,10.502l-35.49-5.001l-12.197,29.608l28.893,21.706l-2.399,12.203L64,240.846v32.007l34.69,8.903l2.4,12.503
l-28.394,21.307l12.297,29.508l34.991-5.002l7.099,11.303l-17.896,30.607l22.595,22.605l30.192-18.204l11.196,7.302l-4.498,34.311
l29.592,12.202l20.595-27.808l13.396,2.5L241.054,448h31.991l8.298-33.109l13.597-2.601l20.694,27.106l29.593-12.203l-4.998-33.709
l10.196-7.4l28.992,16.904l22.595-22.606l-16.795-28.907l7.896-11.402l33.791,4.802l12.298-29.508l-27.193-20.507l2.7-13.502
L448,272.754z M256,384c-70.692,0-128-57.307-128-128c0-70.692,57.308-128,128-128c70.692,0,128,57.308,128,128
C384,326.693,326.692,384,256,384z"></path>
</g>
</g>;
} return <IconBase>
<g>
<path d="M293.25,150.32L265.2,254.9l74.954,75C358.159,309.457,368,283.486,368,256c0-29.916-11.65-58.042-32.805-79.196
C323.154,164.763,308.854,155.807,293.25,150.32z"></path>
<path d="M278.068,146.161C270.88,144.732,263.496,144,256,144c-29.916,0-58.042,11.65-79.196,32.805
C155.65,197.958,144,226.084,144,256c0,7.468,0.727,14.824,2.145,21.988L250.3,250.1L278.068,146.161z"></path>
<path d="M150.473,293.697c5.5,15.43,14.404,29.572,26.331,41.498C197.958,356.35,226.083,368,256,368
c27.009,0,52.558-9.499,72.835-26.911L253.9,266.2L150.473,293.697z"></path>
<path d="M448,272.754v-32.008l-33.291-8.703l-2.601-13.204l27.594-20.905l-12.197-29.608l-34.392,4.802l-7.498-10.603
l17.695-29.708l-22.594-22.605l-30.191,17.404l-10.697-7.302l5.298-35.009l-29.492-12.303L294.04,101.31l-12.297-2.601L273.045,64
h-31.991l-9.197,34.909l-12.098,2.4l-21.494-29.008l-29.592,12.304l4.799,35.709l-11.697,7.202l-31.292-18.705l-22.594,22.606
l18.795,31.508l-6.698,10.502l-35.49-5.001l-12.197,29.608l28.893,21.706l-2.399,12.203L64,240.846v32.007l34.69,8.903l2.4,12.503
l-28.394,21.307l12.297,29.508l34.991-5.002l7.099,11.303l-17.896,30.607l22.595,22.605l30.192-18.204l11.196,7.302l-4.498,34.311
l29.592,12.202l20.595-27.808l13.396,2.5L241.054,448h31.991l8.298-33.109l13.597-2.601l20.694,27.106l29.593-12.203l-4.998-33.709
l10.196-7.4l28.992,16.904l22.595-22.606l-16.795-28.907l7.896-11.402l33.791,4.802l12.298-29.508l-27.193-20.507l2.7-13.502
L448,272.754z M256,384c-70.692,0-128-57.307-128-128c0-70.692,57.308-128,128-128c70.692,0,128,57.308,128,128
C384,326.693,326.692,384,256,384z"></path>
</g>
</IconBase>;
}
};IosCog.defaultProps = {bare: false}
|
src/ui/containers/account.js
|
redcom/aperitive
|
// @flow
import React from 'react';
import { withRouter } from 'react-router';
import { Row, Button } from 'react-bootstrap';
import { isNil } from 'ramda';
import LoginAuth0 from './LoginAuth0';
import { auth0Config } from '../../config';
type Props = {
loading: boolean,
};
class Account extends React.Component {
props: Props;
static contextTypes = {
router: React.PropTypes.object.isRequired,
};
isLoggedIn() {
return (__CLIENT__ && !isNil(global.localStorage.getItem('account.auth0IdAuthorization')));
}
logout = () => {
if (__CLIENT__) {
global.localStorage.removeItem('account.auth0IdAuthorization');
global.location.reload();
}
}
renderLoggedIn() {
return (
<div>
<Button onClick={this.logout}>Logout</Button>
</div>
);
}
renderLoggedOut() {
if (!__CLIENT__) return null;
return (
<Row>
<LoginAuth0
clientId={auth0Config.clientId}
domain={auth0Config.domain}
/>
</Row>
);
}
render() {
if (this.props.loading) {
return (
<Row className="text-center">
Loading...
</Row>
);
}
if (this.isLoggedIn()) {
return this.renderLoggedIn();
} else {
return this.renderLoggedOut();
}
}
}
export default withRouter(Account);
|
modules/__tests__/element-test.js
|
slashtu/react-scroll
|
import { render, unmountComponentAtNode } from 'react-dom'
import expect from 'expect'
import React from 'react'
var Element = require('../components/Element.js');
var assert = require('assert');
describe('Element', function() {
let node
beforeEach(function () {
node = document.createElement('div')
})
afterEach(function () {
unmountComponentAtNode(node)
})
it('renders only one component', function (done) {
var component = <Element name="test1" className="element">Test 1</Element>
render(component, node, function() {
expect(node.textContent).toEqual('Test 1');
done();
});
})
it('renders two components', function (done) {
var component = <div>
<Element name="test1" className="element">A</Element>
<Element name="test1" className="element">B</Element>
</div>
render(component, node, function() {
expect(node.textContent).toEqual('AB');
done();
});
})
});
|
node_modules/react-select/examples/src/components/Creatable.js
|
rblin081/drafting-client
|
import React from 'react';
import createClass from 'create-react-class';
import PropTypes from 'prop-types';
import Select from 'react-select';
var CreatableDemo = createClass({
displayName: 'CreatableDemo',
propTypes: {
hint: PropTypes.string,
label: PropTypes.string
},
getInitialState () {
return {
multi: true,
multiValue: [],
options: [
{ value: 'R', label: 'Red' },
{ value: 'G', label: 'Green' },
{ value: 'B', label: 'Blue' }
],
value: undefined
};
},
handleOnChange (value) {
const { multi } = this.state;
if (multi) {
this.setState({ multiValue: value });
} else {
this.setState({ value });
}
},
render () {
const { multi, multiValue, options, value } = this.state;
return (
<div className="section">
<h3 className="section-heading">{this.props.label}</h3>
<Select.Creatable
multi={multi}
options={options}
onChange={this.handleOnChange}
value={multi ? multiValue : value}
/>
<div className="hint">{this.props.hint}</div>
<div className="checkbox-list">
<label className="checkbox">
<input
type="radio"
className="checkbox-control"
checked={multi}
onChange={() => this.setState({ multi: true })}
/>
<span className="checkbox-label">Multiselect</span>
</label>
<label className="checkbox">
<input
type="radio"
className="checkbox-control"
checked={!multi}
onChange={() => this.setState({ multi: false })}
/>
<span className="checkbox-label">Single Value</span>
</label>
</div>
</div>
);
}
});
module.exports = CreatableDemo;
|
src/svg-icons/image/add-to-photos.js
|
igorbt/material-ui
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageAddToPhotos = (props) => (
<SvgIcon {...props}>
<path d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9h-4v4h-2v-4H9V9h4V5h2v4h4v2z"/>
</SvgIcon>
);
ImageAddToPhotos = pure(ImageAddToPhotos);
ImageAddToPhotos.displayName = 'ImageAddToPhotos';
ImageAddToPhotos.muiName = 'SvgIcon';
export default ImageAddToPhotos;
|
client/extensions/woocommerce/app/reviews/review-reply-create.js
|
Automattic/woocommerce-connect-client
|
/**
* External depedencies
*
* @format
*/
import React, { Component } from 'react';
import { bindActionCreators } from 'redux';
import classNames from 'classnames';
import { connect } from 'react-redux';
import { localize } from 'i18n-calypso';
import PropTypes from 'prop-types';
/**
* Internal dependencies
*/
import { createReviewReply } from 'woocommerce/state/sites/review-replies/actions';
import { getCurrentUser } from 'state/current-user/selectors';
import Gravatar from 'components/gravatar';
import { successNotice } from 'state/notices/actions';
// Matches comments reply box heights
const TEXTAREA_HEIGHT_COLLAPSED = 47; // 1 line
const TEXTAREA_HEIGHT_FOCUSED = 68; // 2 lines
const TEXTAREA_MAX_HEIGHT = 236; // 10 lines
const TEXTAREA_VERTICAL_BORDER = 2;
class ReviewReplyCreate extends Component {
static propTypes = {
siteId: PropTypes.number.isRequired,
review: PropTypes.shape( {
status: PropTypes.string,
} ).isRequired,
};
// TODO Update this to use Redux edits state for creates at some point. Unfortunately it only supports holding one at a time,
// so we will use internal component state to hold the text for now.
state = {
commentText: '',
hasFocus: false,
textareaHeight: TEXTAREA_HEIGHT_COLLAPSED,
};
bindTextareaRef = textarea => {
this.textarea = textarea;
};
calculateTextareaHeight = () => {
const textareaScrollHeight = this.textarea.scrollHeight;
const textareaHeight = Math.min(
TEXTAREA_MAX_HEIGHT,
textareaScrollHeight + TEXTAREA_VERTICAL_BORDER
);
return Math.max( TEXTAREA_HEIGHT_FOCUSED, textareaHeight );
};
getTextareaPlaceholder = () => {
const { review, translate } = this.props;
if ( 'approved' === review.status ) {
return translate( 'Reply to %(reviewAuthor)s…', { args: { reviewAuthor: review.name } } );
}
return translate( 'Approve and reply to %(reviewAuthor)s…', {
args: { reviewAuthor: review.name },
} );
};
onTextChange = event => {
const { value } = event.target;
const textareaHeight = this.calculateTextareaHeight();
this.setState( {
commentText: value,
textareaHeight,
} );
};
setFocus = () =>
this.setState( {
hasFocus: true,
textareaHeight: this.calculateTextareaHeight(),
} );
unsetFocus = () =>
this.setState( {
hasFocus: false,
textareaHeight: TEXTAREA_HEIGHT_COLLAPSED,
} );
onSubmit = event => {
event.preventDefault();
const { siteId, review, translate } = this.props;
const { commentText } = this.state;
const { product } = review;
const shouldApprove = 'pending' === review.status ? true : false;
this.props.createReviewReply( siteId, product.id, review.id, commentText, shouldApprove );
this.setState( {
commentText: '',
} );
this.props.successNotice( translate( 'Reply submitted.' ), { duration: 5000 } );
};
render() {
const { translate, currentUser } = this.props;
const { hasFocus, textareaHeight, commentText } = this.state;
const hasCommentText = commentText.trim().length > 0;
// Only show the scrollbar if the textarea content exceeds the max height
const hasScrollbar = textareaHeight >= TEXTAREA_MAX_HEIGHT;
const buttonClasses = classNames( 'reviews__reply-submit', {
'has-scrollbar': hasScrollbar,
'is-active': hasCommentText,
'is-visible': hasFocus || hasCommentText,
} );
const gravatarClasses = classNames( { 'is-visible': ! hasFocus } );
const textareaClasses = classNames( {
'has-content': hasCommentText,
'has-focus': hasFocus,
'has-scrollbar': hasScrollbar,
} );
// Without focus, force the textarea to collapse even if it was manually resized
const textareaStyle = {
height: hasFocus ? textareaHeight : TEXTAREA_HEIGHT_COLLAPSED,
};
return (
<form className="reviews__reply-textarea">
<textarea
className={ textareaClasses }
onBlur={ this.unsetFocus }
onChange={ this.onTextChange }
onFocus={ this.setFocus }
placeholder={ this.getTextareaPlaceholder() }
ref={ this.bindTextareaRef }
style={ textareaStyle }
value={ commentText }
/>
<Gravatar className={ gravatarClasses } size={ 24 } user={ currentUser } />
<button className={ buttonClasses } disabled={ ! hasCommentText } onClick={ this.onSubmit }>
{ translate( 'Send' ) }
</button>
</form>
);
}
}
function mapStateToProps( state ) {
return {
currentUser: getCurrentUser( state ),
};
}
function mapDispatchToProps( dispatch ) {
return bindActionCreators(
{
createReviewReply,
successNotice,
},
dispatch
);
}
export default connect(
mapStateToProps,
mapDispatchToProps
)( localize( ReviewReplyCreate ) );
|
1l_React_ET_Lynda/Ex_Files_React_EssT/Ch03/03_04/finish/src/index.js
|
yevheniyc/Autodidact
|
import React from 'react'
import { render } from 'react-dom'
import { SkiDayCount } from './components/SkiDayCount'
window.React = React
render(
<SkiDayCount total={50}
powder={20}
backcountry={10}
goal={100}/>,
document.getElementById('react-container')
)
|
react-router-tutorial/lessons/08-index-routes/index.js
|
zerotung/practices-and-notes
|
import React from 'react'
import { render } from 'react-dom'
import { Router, Route, hashHistory } from 'react-router'
import App from './modules/App'
import About from './modules/About'
import Repos from './modules/Repos'
import Repo from './modules/Repo'
render((
<Router history={hashHistory}>
<Route path="/" component={App}>
<Route path="/repos" component={Repos}>
<Route path="/repos/:userName/:repoName" component={Repo}/>
</Route>
<Route path="/about" component={About}/>
</Route>
</Router>
), document.getElementById('app'))
|
public/js/sequenceserver.js
|
elsiklab/sequenceserver
|
import 'jquery';
import 'jquery-ui';
import 'bootstrap';
import 'webshim';
import React from 'react';
import Router from 'react-router';
import {Page as Search} from './search';
import {Page as Report} from './report';
var Route = Router.Route;
var DefaultRoute = Router.DefaultRoute;
var RouteHandler = Router.RouteHandler;
/**
* Simple, small jQuery extensions for convenience.
*/
(function ($) {
/**
* Disable an element.
*
* Sets `disabled` property to `true` and adds `disabled` class.
*/
$.fn.disable = function () {
return this.prop('disabled', true).addClass('disabled');
};
/**
* Enable an element.
*
* Sets `disabled` property to `false` and removes `disabled` class
* if present.
*/
$.fn.enable = function () {
return this.prop('disabled', false).removeClass('disabled');
};
/**
* Check an element.
*
* Sets `checked` property to `true`.
*/
$.fn.check = function () {
return this.prop('checked', true);
};
/**
* Un-check an element.
*
* Sets `checked` property to `false`.
*/
$.fn.uncheck = function () {
return this.prop('checked', false);
};
/**
* Initialise Bootstrap tooltip on an element with presets. Takes title.
*/
$.fn._tooltip = $.fn.tooltip;
$.fn.tooltip = function (options) {
return this
._tooltip('destroy')
._tooltip($.extend({
container: 'body',
placement: 'left',
delay: {
show: 1000
}
}, options));
};
/**
* Returns true / false if any modal is active.
*/
$.modalActive = function () {
var active = false;
$('.modal').each(function () {
var modal = $(this).data('bs.modal');
if (modal) {
active = modal.isShown;
return !active;
}
});
return active;
};
/**
* Wiggle an element.
*
* Used for wiggling BLAST button.
*/
$.fn.wiggle = function () {
this.finish().effect("bounce", {
direction: 'left',
distance: 24,
times: 4,
}, 250);
};
}(jQuery));
SequenceServer = React.createClass({
// Class methods. //
statics: {
FASTA_FORMAT: /^>/,
setupTooltips: function () {
$('.pos-label').each(function () {
$(this).tooltip({
placement: 'right'
});
});
$('.downloads a').each(function () {
$(this).tooltip();
});
},
showErrorModal: function (jqXHR, beforeShow) {
setTimeout(function () {
beforeShow();
if (jqXHR.responseText) {
$("#error").html(jqXHR.responseText).modal();
}
else {
$("#error-no-response").modal();
}
}, 500);
},
routes: function () {
return (
<Route handler={SequenceServer}>
<Route path="/" handler={Search}/>
<Route path="/:jid" handler={Report}/>
</Route>
);
},
run: function () {
Router.run(this.routes(), Router.HistoryLocation, function (Root) {
React.render(<Root/>, document.getElementById("view"));
});
}
},
// Lifecycle methods. //
render: function () {
return (<RouteHandler/>);
}
});
SequenceServer.run();
|
app/javascript/mastodon/features/list_timeline/index.js
|
mstdn-jp/mastodon
|
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import StatusListContainer from '../ui/containers/status_list_container';
import Column from '../../components/column';
import ColumnHeader from '../../components/column_header';
import { addColumn, removeColumn, moveColumn } from '../../actions/columns';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
import { connectListStream } from '../../actions/streaming';
import { expandListTimeline } from '../../actions/timelines';
import { fetchList, deleteList } from '../../actions/lists';
import { openModal } from '../../actions/modal';
import MissingIndicator from '../../components/missing_indicator';
import LoadingIndicator from '../../components/loading_indicator';
const messages = defineMessages({
deleteMessage: { id: 'confirmations.delete_list.message', defaultMessage: 'Are you sure you want to permanently delete this list?' },
deleteConfirm: { id: 'confirmations.delete_list.confirm', defaultMessage: 'Delete' },
});
const mapStateToProps = (state, props) => ({
list: state.getIn(['lists', props.params.id]),
hasUnread: state.getIn(['timelines', `list:${props.params.id}`, 'unread']) > 0,
});
@connect(mapStateToProps)
@injectIntl
export default class ListTimeline extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = {
params: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired,
columnId: PropTypes.string,
hasUnread: PropTypes.bool,
multiColumn: PropTypes.bool,
list: PropTypes.oneOfType([ImmutablePropTypes.map, PropTypes.bool]),
intl: PropTypes.object.isRequired,
};
handlePin = () => {
const { columnId, dispatch } = this.props;
if (columnId) {
dispatch(removeColumn(columnId));
} else {
dispatch(addColumn('LIST', { id: this.props.params.id }));
this.context.router.history.push('/');
}
}
handleMove = (dir) => {
const { columnId, dispatch } = this.props;
dispatch(moveColumn(columnId, dir));
}
handleHeaderClick = () => {
this.column.scrollTop();
}
componentDidMount () {
const { dispatch } = this.props;
const { id } = this.props.params;
dispatch(fetchList(id));
dispatch(expandListTimeline(id));
this.disconnect = dispatch(connectListStream(id));
}
componentWillUnmount () {
if (this.disconnect) {
this.disconnect();
this.disconnect = null;
}
}
setRef = c => {
this.column = c;
}
handleLoadMore = maxId => {
const { id } = this.props.params;
this.props.dispatch(expandListTimeline(id, { maxId }));
}
handleEditClick = () => {
this.props.dispatch(openModal('LIST_EDITOR', { listId: this.props.params.id }));
}
handleDeleteClick = () => {
const { dispatch, columnId, intl } = this.props;
const { id } = this.props.params;
dispatch(openModal('CONFIRM', {
message: intl.formatMessage(messages.deleteMessage),
confirm: intl.formatMessage(messages.deleteConfirm),
onConfirm: () => {
dispatch(deleteList(id));
if (!!columnId) {
dispatch(removeColumn(columnId));
} else {
this.context.router.history.push('/lists');
}
},
}));
}
render () {
const { hasUnread, columnId, multiColumn, list } = this.props;
const { id } = this.props.params;
const pinned = !!columnId;
const title = list ? list.get('title') : id;
if (typeof list === 'undefined') {
return (
<Column>
<div className='scrollable'>
<LoadingIndicator />
</div>
</Column>
);
} else if (list === false) {
return (
<Column>
<div className='scrollable'>
<MissingIndicator />
</div>
</Column>
);
}
return (
<Column ref={this.setRef}>
<ColumnHeader
icon='list-ul'
active={hasUnread}
title={title}
onPin={this.handlePin}
onMove={this.handleMove}
onClick={this.handleHeaderClick}
pinned={pinned}
multiColumn={multiColumn}
>
<div className='column-header__links'>
<button className='text-btn column-header__setting-btn' tabIndex='0' onClick={this.handleEditClick}>
<i className='fa fa-pencil' /> <FormattedMessage id='lists.edit' defaultMessage='Edit list' />
</button>
<button className='text-btn column-header__setting-btn' tabIndex='0' onClick={this.handleDeleteClick}>
<i className='fa fa-trash' /> <FormattedMessage id='lists.delete' defaultMessage='Delete list' />
</button>
</div>
<hr />
</ColumnHeader>
<StatusListContainer
trackScroll={!pinned}
scrollKey={`list_timeline-${columnId}`}
timelineId={`list:${id}`}
onLoadMore={this.handleLoadMore}
emptyMessage={<FormattedMessage id='empty_column.list' defaultMessage='There is nothing in this list yet. When members of this list post new statuses, they will appear here.' />}
/>
</Column>
);
}
}
|
admin/client/App/elemental/DropdownButton/index.js
|
snowkeeper/keystone
|
/* eslint quote-props: ["error", "as-needed"] */
import React from 'react';
import { css, StyleSheet } from 'aphrodite/no-important';
import Button from '../Button';
function DropdownButton ({ children, ...props }) {
return (
<Button {...props}>
{children}
<span className={css(classes.arrow)} />
</Button>
);
};
// NOTE
// 1: take advantage of `currentColor` by leaving border top color undefined
// 2: even though the arrow is vertically centered, visually it appears too low
// because of lowercase characters beside it
const classes = StyleSheet.create({
arrow: {
borderLeft: '0.3em solid transparent',
borderRight: '0.3em solid transparent',
borderTop: '0.3em solid', // 1
display: 'inline-block',
height: 0,
marginTop: '-0.125em', // 2
verticalAlign: 'middle',
width: 0,
// add spacing
':first-child': {
marginRight: '0.5em',
},
':last-child': {
marginLeft: '0.5em',
},
},
});
module.exports = DropdownButton;
|
app/javascript/mastodon/components/dropdown_menu.js
|
dunn/mastodon
|
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import IconButton from './icon_button';
import Overlay from 'react-overlays/lib/Overlay';
import Motion from '../features/ui/util/optional_motion';
import spring from 'react-motion/lib/spring';
import detectPassiveEvents from 'detect-passive-events';
const listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false;
let id = 0;
class DropdownMenu extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = {
items: PropTypes.array.isRequired,
onClose: PropTypes.func.isRequired,
style: PropTypes.object,
placement: PropTypes.string,
arrowOffsetLeft: PropTypes.string,
arrowOffsetTop: PropTypes.string,
openedViaKeyboard: PropTypes.bool,
};
static defaultProps = {
style: {},
placement: 'bottom',
};
state = {
mounted: false,
};
handleDocumentClick = e => {
if (this.node && !this.node.contains(e.target)) {
this.props.onClose();
}
}
componentDidMount () {
document.addEventListener('click', this.handleDocumentClick, false);
document.addEventListener('keydown', this.handleKeyDown, false);
document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);
if (this.focusedItem && this.props.openedViaKeyboard) {
this.focusedItem.focus();
}
this.setState({ mounted: true });
}
componentWillUnmount () {
document.removeEventListener('click', this.handleDocumentClick, false);
document.removeEventListener('keydown', this.handleKeyDown, false);
document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions);
}
setRef = c => {
this.node = c;
}
setFocusRef = c => {
this.focusedItem = c;
}
handleKeyDown = e => {
const items = Array.from(this.node.getElementsByTagName('a'));
const index = items.indexOf(document.activeElement);
let element;
switch(e.key) {
case 'ArrowDown':
element = items[index+1];
if (element) {
element.focus();
}
break;
case 'ArrowUp':
element = items[index-1];
if (element) {
element.focus();
}
break;
case 'Tab':
if (e.shiftKey) {
element = items[index-1] || items[items.length-1];
} else {
element = items[index+1] || items[0];
}
if (element) {
element.focus();
e.preventDefault();
e.stopPropagation();
}
break;
case 'Home':
element = items[0];
if (element) {
element.focus();
}
break;
case 'End':
element = items[items.length-1];
if (element) {
element.focus();
}
break;
case 'Escape':
this.props.onClose();
break;
}
}
handleItemKeyPress = e => {
if (e.key === 'Enter' || e.key === ' ') {
this.handleClick(e);
}
}
handleClick = e => {
const i = Number(e.currentTarget.getAttribute('data-index'));
const { action, to } = this.props.items[i];
this.props.onClose();
if (typeof action === 'function') {
e.preventDefault();
action(e);
} else if (to) {
e.preventDefault();
this.context.router.history.push(to);
}
}
renderItem (option, i) {
if (option === null) {
return <li key={`sep-${i}`} className='dropdown-menu__separator' />;
}
const { text, href = '#', target = '_blank', method } = option;
return (
<li className='dropdown-menu__item' key={`${text}-${i}`}>
<a href={href} target={target} data-method={method} rel='noopener noreferrer' role='button' tabIndex='0' ref={i === 0 ? this.setFocusRef : null} onClick={this.handleClick} onKeyPress={this.handleItemKeyPress} data-index={i}>
{text}
</a>
</li>
);
}
render () {
const { items, style, placement, arrowOffsetLeft, arrowOffsetTop } = this.props;
const { mounted } = this.state;
return (
<Motion defaultStyle={{ opacity: 0, scaleX: 0.85, scaleY: 0.75 }} style={{ opacity: spring(1, { damping: 35, stiffness: 400 }), scaleX: spring(1, { damping: 35, stiffness: 400 }), scaleY: spring(1, { damping: 35, stiffness: 400 }) }}>
{({ opacity, scaleX, scaleY }) => (
// It should not be transformed when mounting because the resulting
// size will be used to determine the coordinate of the menu by
// react-overlays
<div className={`dropdown-menu ${placement}`} style={{ ...style, opacity: opacity, transform: mounted ? `scale(${scaleX}, ${scaleY})` : null }} ref={this.setRef}>
<div className={`dropdown-menu__arrow ${placement}`} style={{ left: arrowOffsetLeft, top: arrowOffsetTop }} />
<ul>
{items.map((option, i) => this.renderItem(option, i))}
</ul>
</div>
)}
</Motion>
);
}
}
export default class Dropdown extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = {
icon: PropTypes.string.isRequired,
items: PropTypes.array.isRequired,
size: PropTypes.number.isRequired,
title: PropTypes.string,
disabled: PropTypes.bool,
status: ImmutablePropTypes.map,
isUserTouching: PropTypes.func,
isModalOpen: PropTypes.bool.isRequired,
onOpen: PropTypes.func.isRequired,
onClose: PropTypes.func.isRequired,
dropdownPlacement: PropTypes.string,
openDropdownId: PropTypes.number,
openedViaKeyboard: PropTypes.bool,
};
static defaultProps = {
title: 'Menu',
};
state = {
id: id++,
};
handleClick = ({ target, type }) => {
if (this.state.id === this.props.openDropdownId) {
this.handleClose();
} else {
const { top } = target.getBoundingClientRect();
const placement = top * 2 < innerHeight ? 'bottom' : 'top';
this.props.onOpen(this.state.id, this.handleItemClick, placement, type !== 'click');
}
}
handleClose = () => {
if (this.activeElement) {
this.activeElement.focus();
this.activeElement = null;
}
this.props.onClose(this.state.id);
}
handleMouseDown = () => {
if (!this.state.open) {
this.activeElement = document.activeElement;
}
}
handleButtonKeyDown = (e) => {
switch(e.key) {
case ' ':
case 'Enter':
this.handleMouseDown();
break;
}
}
handleKeyPress = (e) => {
switch(e.key) {
case ' ':
case 'Enter':
this.handleClick(e);
e.stopPropagation();
e.preventDefault();
break;
}
}
handleItemClick = e => {
const i = Number(e.currentTarget.getAttribute('data-index'));
const { action, to } = this.props.items[i];
this.handleClose();
if (typeof action === 'function') {
e.preventDefault();
action();
} else if (to) {
e.preventDefault();
this.context.router.history.push(to);
}
}
setTargetRef = c => {
this.target = c;
}
findTarget = () => {
return this.target;
}
componentWillUnmount = () => {
if (this.state.id === this.props.openDropdownId) {
this.handleClose();
}
}
render () {
const { icon, items, size, title, disabled, dropdownPlacement, openDropdownId, openedViaKeyboard } = this.props;
const open = this.state.id === openDropdownId;
return (
<div>
<IconButton
icon={icon}
title={title}
active={open}
disabled={disabled}
size={size}
ref={this.setTargetRef}
onClick={this.handleClick}
onMouseDown={this.handleMouseDown}
onKeyDown={this.handleButtonKeyDown}
onKeyPress={this.handleKeyPress}
/>
<Overlay show={open} placement={dropdownPlacement} target={this.findTarget}>
<DropdownMenu items={items} onClose={this.handleClose} openedViaKeyboard={openedViaKeyboard} />
</Overlay>
</div>
);
}
}
|
app/desktop/LiveUser/index.js
|
christianalfoni/webpack-bin
|
import React from 'react';
import {Decorator as Cerebral} from 'cerebral-view-react';
import styles from './styles.css';
@Cerebral({
userName: 'live.userName',
controllingUser: 'live.controllingUser'
})
class LiveUser extends React.Component {
render() {
return (
<div className={styles.wrapper}>
<div
className={this.props.controllingUser === this.props.userName ? styles.activeUser : styles.user}>
{this.props.userName}
</div>
</div>
);
}
}
export default LiveUser;
|
src/components/Portfolio.js
|
jerednel/jerednel.github.io
|
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import { Card, CardContent, CardActionArea, CardMedia, Typography, Grid, Container } from '@material-ui/core/';
const useStyles = makeStyles((theme) => ({
root: {
display: 'flex',
backgroundColor: theme.palette.primary.light,
},
card: {
maxWidth: 250,
margin: 0,
},
media: {
height: 160,
},
}));
export default function Portfolio(props) {
const classes = useStyles();
if (props.data) {
var projects = props.data.projects.map(function (projects) {
var projectImage = 'images/portfolio/' + projects.image;
return (
<div key={projects.title} className="columns portfolio-item">
<Card className={classes.card}>
<CardActionArea href={projects.url}>
<CardMedia className={classes.media} image={projectImage} title={projects.title} />
<CardContent>
<Typography gutterBottom variant="h5" component="h2">{projects.title}</Typography>
<Typography variant="body2" gutterBottom>{projects.category}</Typography>
</CardContent>
</CardActionArea>
</Card>
</div>
)
})
}
return (
<section className={classes.root} id="portfolio">
<Container className="row">
<h1>Check Out Some of My Works.</h1>
<div id="portfolio-wrapper" className="bgrid-quarters s-bgrid-thirds cf">
{projects}
</div>
</Container>
</section>
);
}
|
node_modules/react-bootstrap/es/DropdownMenu.js
|
Crisa221/Lista-Giocatori
|
import _extends from 'babel-runtime/helpers/extends';
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import _Array$from from 'babel-runtime/core-js/array/from';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
import classNames from 'classnames';
import keycode from 'keycode';
import React from 'react';
import ReactDOM from 'react-dom';
import RootCloseWrapper from 'react-overlays/lib/RootCloseWrapper';
import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
import createChainedFunction from './utils/createChainedFunction';
import ValidComponentChildren from './utils/ValidComponentChildren';
var propTypes = {
open: React.PropTypes.bool,
pullRight: React.PropTypes.bool,
onClose: React.PropTypes.func,
labelledBy: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]),
onSelect: React.PropTypes.func
};
var defaultProps = {
bsRole: 'menu',
pullRight: false
};
var DropdownMenu = function (_React$Component) {
_inherits(DropdownMenu, _React$Component);
function DropdownMenu(props) {
_classCallCheck(this, DropdownMenu);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
_this.handleKeyDown = _this.handleKeyDown.bind(_this);
return _this;
}
DropdownMenu.prototype.handleKeyDown = function handleKeyDown(event) {
switch (event.keyCode) {
case keycode.codes.down:
this.focusNext();
event.preventDefault();
break;
case keycode.codes.up:
this.focusPrevious();
event.preventDefault();
break;
case keycode.codes.esc:
case keycode.codes.tab:
this.props.onClose(event);
break;
default:
}
};
DropdownMenu.prototype.getItemsAndActiveIndex = function getItemsAndActiveIndex() {
var items = this.getFocusableMenuItems();
var activeIndex = items.indexOf(document.activeElement);
return { items: items, activeIndex: activeIndex };
};
DropdownMenu.prototype.getFocusableMenuItems = function getFocusableMenuItems() {
var node = ReactDOM.findDOMNode(this);
if (!node) {
return [];
}
return _Array$from(node.querySelectorAll('[tabIndex="-1"]'));
};
DropdownMenu.prototype.focusNext = function focusNext() {
var _getItemsAndActiveInd = this.getItemsAndActiveIndex();
var items = _getItemsAndActiveInd.items;
var activeIndex = _getItemsAndActiveInd.activeIndex;
if (items.length === 0) {
return;
}
var nextIndex = activeIndex === items.length - 1 ? 0 : activeIndex + 1;
items[nextIndex].focus();
};
DropdownMenu.prototype.focusPrevious = function focusPrevious() {
var _getItemsAndActiveInd2 = this.getItemsAndActiveIndex();
var items = _getItemsAndActiveInd2.items;
var activeIndex = _getItemsAndActiveInd2.activeIndex;
if (items.length === 0) {
return;
}
var prevIndex = activeIndex === 0 ? items.length - 1 : activeIndex - 1;
items[prevIndex].focus();
};
DropdownMenu.prototype.render = function render() {
var _extends2,
_this2 = this;
var _props = this.props;
var open = _props.open;
var pullRight = _props.pullRight;
var onClose = _props.onClose;
var labelledBy = _props.labelledBy;
var onSelect = _props.onSelect;
var className = _props.className;
var children = _props.children;
var props = _objectWithoutProperties(_props, ['open', 'pullRight', 'onClose', 'labelledBy', 'onSelect', 'className', 'children']);
var _splitBsProps = splitBsProps(props);
var bsProps = _splitBsProps[0];
var elementProps = _splitBsProps[1];
var classes = _extends({}, getClassSet(bsProps), (_extends2 = {}, _extends2[prefix(bsProps, 'right')] = pullRight, _extends2));
var list = React.createElement(
'ul',
_extends({}, elementProps, {
role: 'menu',
className: classNames(className, classes),
'aria-labelledby': labelledBy
}),
ValidComponentChildren.map(children, function (child) {
return React.cloneElement(child, {
onKeyDown: createChainedFunction(child.props.onKeyDown, _this2.handleKeyDown),
onSelect: createChainedFunction(child.props.onSelect, onSelect)
});
})
);
if (open) {
return React.createElement(
RootCloseWrapper,
{ noWrap: true, onRootClose: onClose },
list
);
}
return list;
};
return DropdownMenu;
}(React.Component);
DropdownMenu.propTypes = propTypes;
DropdownMenu.defaultProps = defaultProps;
export default bsClass('dropdown-menu', DropdownMenu);
|
src/app.js
|
fkoester/tachograph-app
|
import React from 'react';
import { UIManager } from 'react-native';
import { Provider } from 'react-redux';
import store from './store';
import scenes from './scenes';
import './i18n';
UIManager.setLayoutAnimationEnabledExperimental(true);
export default class App extends React.Component {
componentDidMount() {
}
render() {
return (
<Provider store={store}>
{scenes}
</Provider>
);
}
}
|
src/pages/SignoutPage.js
|
ihenvyr/react-parse
|
import React from 'react';
import Helmet from 'react-helmet';
import { withRouter } from 'react-router';
import Parse from 'parse';
class SignoutPage extends React.Component {
static propTypes = {};
static defaultProps = {};
componentDidMount() {
Parse.User.logOut().then(() => {
this.props.router.push('/');
});
}
render() {
return (
<div>
<Helmet
title="Logging out.."
meta={[
{ name: "description", content: "Logging out.." }
]}
/>
<p>Logging out..</p>
</div>
);
}
}
export default withRouter(SignoutPage);
|
src/routes.js
|
taoveweb/reactTemplate
|
//import React from 'react';
//import { Route, IndexRoute } from 'react-router';
import App from './components/App';
/*import Home from './containers/Home';
import About from './containers/About';
import New from './containers/New';
import New1 from './containers/New1';
import NotFound from './containers/NotFound';*/
function errorLoading(err) {
console.error('Dynamic page loading failed', err);
}
function loadRoute(cb) {
return (module) => cb(null, module.default);
}
/*export default (
<Route path="/" component={App}>
<IndexRoute component={Home}/>
<Route path="about" component={About}/>
<Route path="new" component={New}/>
<Route path="new1" component={New1}/>
<Route path="*" component={NotFound}/>
</Route>
);*/
export default {
component: App,
childRoutes: [
{
path: '/',
getComponent(location, cb) {
System.import('./containers/Home').then(loadRoute(cb)).catch(errorLoading);
}
},
{
path: 'about',
getComponent(location, cb) {
require("./static/css/about.scss");
System.import('./containers/About').then(loadRoute(cb)).catch(errorLoading);
}
},
]
};
|
packages/node_modules/@webex/react-component-adaptive-card/src/index.js
|
ciscospark/react-ciscospark
|
import React from 'react';
import PropTypes from 'prop-types';
import ReactDOM from 'react-dom';
import classnames from 'classnames';
import {getAdaptiveCard, CARD_CONTAINS_IMAGE, replaceIndexWithBlobURL, API_ACTIVITY_VERB} from '@webex/react-component-utils';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {handleAdaptiveCardSubmitAction} from '@webex/redux-module-conversation';
import './adaptiveCard.scss';
import styles from './styles.css';
import messages from './messages';
class AdaptiveCard extends React.Component {
constructor(props) {
super(props);
this.nodeElement = React.createRef();
this.addChildNode = this.addChildNode.bind(this);
this.handleSubmitAction = this.handleSubmitAction.bind(this);
this.dismissStatusMessage = this.dismissStatusMessage.bind(this);
this.setupState = this.setupState.bind(this);
this.setStateForCardActionStatus = this.setStateForCardActionStatus.bind(this);
this.setStateForCardActionSubmissionFailed = this.setStateForCardActionSubmissionFailed.bind(this);
this.lastAcknowledgedCardActionActivityId = null;
this.cards = this.props.cards;
this.hasReplacedCard = false;
this.parentActivityId = null;
this.state = {
childNodes: [],
hasReplacedImagesInJSON: false,
actionStatusMessage: '',
isCardActionClicked: false,
isCardActionSubmissionFailed: false
};
}
componentDidMount() {
if (Object.prototype.hasOwnProperty.call(this, 'nodeElement') && Object.prototype.hasOwnProperty.call(this.nodeElement, 'current')) {
this.nodeElement.current.appendChild(
getAdaptiveCard(
this.cards,
this.props.displayName,
this.props.sdkInstance,
this.addChildNode,
this.props.activityId,
this.props.conversation,
this.handleSubmitAction
)
);
}
}
componentDidUpdate(prevProps) {
if (prevProps !== this.props) {
if (this.props.verb === API_ACTIVITY_VERB.SHARE) {
try {
const decryptedURLs = this.props.items.filter((file) => file.type === CARD_CONTAINS_IMAGE)
.map((file) => {
const thumbnail = file.mimeType === 'image/gif' ? this.props.share.getIn(['files', file.url]) : this.props.share.getIn(['files', file.image.url]);
if (thumbnail) {
const objectUrl = thumbnail.get('objectUrl');
return objectUrl;
}
return undefined;
});
const cardsObject = JSON.parse(this.props.cards[0]);
const undefinedUrls = decryptedURLs.filter((file) => file === undefined);
if (undefinedUrls.length === 0) {
this.cards[0] = JSON.stringify(replaceIndexWithBlobURL(cardsObject, decryptedURLs));
if (this.cards[0]) {
this.setupState();
}
}
}
catch (error) {
this.props.sdkInstance.logger.error('Unable render Adaptive Card', error.message);
}
}
if (this.props.conversation.get('lastAcknowledgedCardActionActivity')) {
const {formatMessage} = this.props.intl;
this.lastAcknowledgedCardActionActivityId = this.props.conversation.get('lastAcknowledgedCardActionActivity').cardActionAcknowledgmentId;
this.parentActivityId = this.props.conversation.get('lastAcknowledgedCardActionActivity').parentId;
if ((this.props.activityId === this.parentActivityId) &&
(!!this.lastAcknowledgedCardActionActivityId) && this.state.isCardActionClicked) {
setTimeout(() => {
this.setStateForCardActionStatus(formatMessage(messages.sent));
}, 500);
}
else if (this.parentActivityId === null && this.lastAcknowledgedCardActionActivityId === null) {
this.setStateForCardActionSubmissionFailed(true);
}
}
}
return null;
}
componentWillUnmount() {
this.state.childNodes.forEach((childNode) => {
ReactDOM.unmountComponentAtNode(childNode);
});
}
/**
* set state to actionStatusMessage
* @param {string} status
* @returns {void}
*/
setStateForCardActionStatus(status) {
this.setState({actionStatusMessage: status});
}
/**
* set state to isCardActionSubmissionFailed
* @param {boolean} isSubmissionFailed
* @returns {void}
*/
setStateForCardActionSubmissionFailed(isSubmissionFailed) {
const {formatMessage} = this.props.intl;
this.setState({isCardActionSubmissionFailed: isSubmissionFailed});
if (this.state.isCardActionSubmissionFailed) {
this.setStateForCardActionStatus(formatMessage(messages.unableToSendYourRequest));
}
}
/**
* set state to tohasReplacedImagesInJSON
* @returns {void}
*/
setupState() {
this.setState({hasReplacedImagesInJSON: true});
}
/**
* set state to maintain a list of all the DOM nodes
* @param {object} childNode
* @returns {void}
*/
addChildNode(childNode) {
this.setState((prevState) => ({childNodes: [...prevState.childNodes, childNode]}));
}
/**
* calls handleAdaptiveCardSubmitAction action when card action is performed
* @param {string} url
* @param {object} actionInput
* @param {string} parentId
* @returns {void}
*/
handleSubmitAction(url, actionInput, parentId) {
const {formatMessage} = this.props.intl;
this.props.handleAdaptiveCardSubmitAction(url, actionInput, parentId, this.props.sdkInstance);
this.setStateForCardActionStatus(formatMessage(messages.sending));
this.setState({isCardActionClicked: true});
}
/**
* method used to set the state variables to default state
* @returns {void}
*/
dismissStatusMessage() {
setTimeout(() => {
this.setStateForCardActionStatus('');
this.setState({isCardActionClicked: false});
this.lastAcknowledgedCardActionActivityId = null;
this.setStateForCardActionSubmissionFailed(false);
}, 2000);
}
render() {
const activityItemMsgClass = classnames('activity-item--adaptive-card');
const {formatMessage} = this.props.intl;
if (this.state.hasReplacedImagesInJSON && !this.hasReplacedCard) {
if (Object.prototype.hasOwnProperty.call(this, 'nodeElement') && Object.prototype.hasOwnProperty.call(this.nodeElement, 'current')) {
this.nodeElement.current.replaceChild(
getAdaptiveCard(
this.cards,
this.props.displayName,
this.props.sdkInstance,
this.addChildNode,
this.props.activityId,
this.props.conversation,
this.handleSubmitAction
),
this.nodeElement.current.firstChild
);
this.hasReplacedCard = true;
}
}
if (this.state.actionStatusMessage === formatMessage(messages.sending)
|| this.state.actionStatusMessage === formatMessage(messages.unableToSendYourRequest)) {
this.dismissStatusMessage();
}
return (
<div>
<div
ref={this.nodeElement}
className={activityItemMsgClass}
/>
{
this.state.isCardActionClicked && (this.state.isCardActionSubmissionFailed
? (
<div className={classnames('failed-status-box', styles.failedStatusBox)}>
<span className={classnames('failed-error-text', styles.failedErrorText)}>{this.state.actionStatusMessage}</span>
</div>
)
: (
<p className={classnames('pending-status-box', styles.pendingStatusBox)}>
<span className={classnames('pending-status-text', styles.pendingStatusText)}>{this.state.actionStatusMessage}</span>
</p>
)
)
}
</div>
);
}
}
const injectedPropTypes = {
handleAdaptiveCardSubmitAction: PropTypes.func.isRequired
};
AdaptiveCard.propTypes = {
cards: PropTypes.array,
displayName: PropTypes.string,
sdkInstance: PropTypes.object,
verb: PropTypes.string,
items: PropTypes.array,
share: PropTypes.object,
conversation: PropTypes.object,
activityId: PropTypes.string,
intl: PropTypes.object.isRequired,
...injectedPropTypes
};
AdaptiveCard.defaultProps = {
cards: [],
displayName: '',
sdkInstance: {},
verb: '',
items: [],
share: {},
conversation: {},
activityId: ''
};
export default connect(
(state) => ({
conversation: state.conversation
}),
(dispatch) => bindActionCreators({
handleAdaptiveCardSubmitAction
}, dispatch)
)(AdaptiveCard);
|
src/forms/rentFields.js
|
codeforboston/cliff-effects
|
import React, { Component } from 'react';
import { MonthlyCashFlowRow } from './cashflow';
import {
isNonNegNumber,
hasOnlyNonNegNumberChars,
} from '../utils/validators';
const BLANK_FUNCTION = function () {};
class RentShareField extends Component {
state = { valid: true, message: null };
storeValidator = (ownValue) => {
let message = null,
valid = true;
let isPosNum = isNonNegNumber(ownValue);
if (!isPosNum) {
valid = false;
} else {
valid = (Number(ownValue) <= this.props.timeState[ `contractRent` ]);
if (!valid) {
message = `Rent share must be less than contract rent`;
}
}
this.setState({ valid: valid, message: message });
return valid;
};
onBlur = (evnt) => {
this.setState({ valid: true, message: null });
};
render() {
const {
timeState,
updateClientValue,
} = this.props,
{
valid,
message,
} = this.state;
const inputProps = {
name: `rentShare`,
displayValidator: hasOnlyNonNegNumberChars,
storeValidator: this.storeValidator,
onBlur: this.onBlur,
},
rowProps = {
label: `Your Monthly Rent Share (how much of the total rent you have to pay)`,
name: `rentShare`,
validRow: valid,
message: message,
};
return (
<MonthlyCashFlowRow
inputProps = { inputProps }
baseValue = { timeState[ `rentShare` ] }
includes = { [ `monthly` ] }
updateClientValue = { updateClientValue }
rowProps = { rowProps } />
);
};
}; // Ends <RentShareField>
class ContractRentField extends Component {
state = { valid: true, message: null };
storeValidator = (ownValue) => {
let message = null,
valid = true;
let isPosNum = isNonNegNumber(ownValue);
if (!isPosNum) {
valid = false;
} else {
valid = (ownValue >= this.props.timeState[ `rentShare` ]);
if (!valid) {
message = `Contract rent must be more than rent share`;
}
}
this.setState({ valid: valid, message: message });
return valid;
};
onBlur = (evnt) => {
this.setState({ valid: true, message: null });
};
render() {
const {
timeState,
updateClientValue,
} = this.props,
{
valid,
message,
} = this.state;
const inputProps = {
name: `contractRent`,
displayValidator: hasOnlyNonNegNumberChars,
storeValidator: this.storeValidator,
onBlur: this.onBlur,
},
rowProps = {
label: `Monthly Contract Rent (the total rent for your apartment)`,
name: `contractRent`,
validRow: valid,
message: message,
};
return (
<MonthlyCashFlowRow
inputProps = { inputProps }
baseValue = { timeState[ `contractRent` ] }
includes = { [ `monthly` ] }
updateClientValue = { updateClientValue }
rowProps = { rowProps } />
);
};
}; // Ends <ContractRentField>
const PlainRentRow = function ({ timeState, updateClientValue }) {
const inputProps = {
name: `rent`,
displayValidator: hasOnlyNonNegNumberChars,
storeValidator: isNonNegNumber,
onBlur: BLANK_FUNCTION,
},
rowProps = {
label: `Monthly Rent`,
validRow: true,
message: null,
};
return (
<MonthlyCashFlowRow
inputProps = { inputProps }
baseValue = { timeState[ `rent` ] }
includes = { [ `monthly` ] }
updateClientValue = { updateClientValue }
rowProps = { rowProps } />
);
};
export {
ContractRentField,
RentShareField,
PlainRentRow,
};
|
src/Button.js
|
mattBlackDesign/react-materialize
|
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import constants from './constants';
import cx from 'classnames';
import Icon from './Icon';
import idgen from './idgen';
class Button extends Component {
constructor (props) {
super(props);
this.renderIcon = this.renderIcon.bind(this);
this.renderFab = this.renderFab.bind(this);
}
render () {
const {
className,
node,
fab,
fabClickOnly,
modal,
flat,
floating,
large,
disabled,
waves,
...other
} = this.props;
const toggle = fabClickOnly ? 'click-to-toggle' : '';
let C = node;
let classes = {
btn: true,
disabled,
'waves-effect': waves
};
if (constants.WAVES.indexOf(waves) > -1) {
classes['waves-' + waves] = true;
}
let styles = { flat, floating, large };
constants.STYLES.forEach(style => {
classes['btn-' + style] = styles[style];
});
if (modal) {
classes['modal-action'] = true;
classes['modal-' + modal] = true;
}
if (fab) {
return this.renderFab(cx(classes, className), fab, toggle);
} else {
return (
<C
{...other}
disabled={!!disabled}
onClick={this.props.onClick}
className={cx(classes, className)}
>
{ this.renderIcon() }
{ this.props.children }
</C>
);
}
}
renderFab (className, orientation, clickOnly) {
const classes = cx(orientation, clickOnly);
return (
<div className={cx('fixed-action-btn', classes)}>
<a className={className}>{ this.renderIcon() }</a>
<ul>
{
React.Children.map(this.props.children, child => {
return <li key={idgen()}>{child}</li>;
})
}
</ul>
</div>
);
}
renderIcon () {
const { icon } = this.props;
if (!icon) return;
return <Icon>{icon}</Icon>;
}
}
Button.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
disabled: PropTypes.bool,
/**
* Enable other styles
*/
flat: PropTypes.bool,
large: PropTypes.bool,
floating: PropTypes.bool,
/**
* Fixed action button
* If enabled, any children button will be rendered as actions, remember to provide an icon.
* @default vertical
*/
fab: PropTypes.oneOf(['vertical', 'horizontal']),
/**
* The icon to display, if specified it will create a button with the material icon
*/
icon: PropTypes.string,
modal: PropTypes.oneOf(['close', 'confirm']),
node: PropTypes.node,
onClick: PropTypes.func,
/**
* Tooltip to show when mouse hovered
*/
tooltip: PropTypes.string,
waves: PropTypes.oneOf(['light', 'red', 'yellow', 'orange', 'purple', 'green', 'teal']),
/**
* FAB Click-Only
* Turns a FAB from a hover-toggle to a click-toggle
*/
fabClickOnly: PropTypes.bool
};
Button.defaultProps = {
node: 'button'
};
export default Button;
|
src/app/containers/index.js
|
blowsys/reservo
|
import React from 'react';
import thunk from 'redux-thunk';
import { createStore, applyMiddleware, compose } from 'redux';
import type { Store } from 'redux';
import { Provider } from 'react-redux';
import Router from 'react-router/HashRouter';
import { connect } from 'react-redux';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import reducers from 'reducers/index';
import './styles.scss';
import { generateRouteMatches } from 'core/routes/helper';
import BaseRoutes, { indexPathname } from './routes';
import { getAppUser } from 'selectors/index';
const composeEnhancers =
process.env.NODE_ENV !== 'production' &&
typeof window === 'object' &&
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? // eslint-disable-line no-underscore-dangle
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ // eslint-disable-line no-underscore-dangle
}) : compose;
const enhancer = composeEnhancers(
applyMiddleware(thunk),
);
const store: Store<*, *> = createStore(reducers, enhancer);
const mapStateToProps = (state) => ({
auth: getAppUser(state)
});
const RoutesHandler = connect(mapStateToProps)((props) => {
const { auth = {} } = props;
return (
<Router>
<fb className="grow" style={{ height: '100%' }}>
{ generateRouteMatches(BaseRoutes, indexPathname, auth.isLoading || false, auth.isLoggedIn || false) }
</fb>
</Router>
);
});
export default class App extends React.Component {
render() {
return (
<MuiThemeProvider>
<Provider store={store}>
<RoutesHandler />
</Provider>
</MuiThemeProvider>
);
}
}
|
src/components/body/menu/options/AddModal.js
|
TechyFatih/Nuzlog
|
import React from 'react';
import { Modal, Media, Panel, Button, Row, Col, ControlLabel } from 'react-bootstrap';
import { actions } from 'react-redux-form';
import { connect } from 'react-redux';
import natures from 'data/natures.json';
import abilities from 'data/abilities.json';
import male from 'img/male.png';
import female from 'img/female.png';
import PokeSlot from 'components/pokemon/slot/PokeSlot';
import PokeSprite from 'components/pokemon/sprite/PokeSprite';
import { RRForm, RRFControl } from 'components/form/RRF';
import { addPokemon } from 'actions';
class AddModal extends React.Component {
constructor(props) {
super(props);
this.state = {
pokemon: null,
locations: {},
validLocation: false,
open: false
};
this.handleEnter = this.handleEnter.bind(this);
this.updatePokemon = this.updatePokemon.bind(this);
this.checkLocation = this.checkLocation.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
this.handleHide = this.handleHide.bind(this);
}
componentWillReceiveProps(nextProps) {
const {pokemon} = nextProps;
if (this.props.pokemon != pokemon) {
const locations = {};
for (let i in pokemon)
locations[pokemon[i].location] = true;
this.setState({locations});
}
}
handleEnter() {
const {location} = this.props;
this.setState({
pokemon: null,
open: false
});
this.dispatch(actions.change('local.location', location));
this.checkLocation(location);
this.dispatch(actions.setPristine('local'));
this.dispatch(actions.focus('local.species'));
}
updatePokemon(pokemon) {
this.setState(prevState => {
return {
pokemon: {...prevState.pokemon, ...pokemon}
};
});
}
checkLocation(location) {
this.setState(({locations}) => ({
validLocation: !locations[location]}
));
}
handleSubmit(values) {
let moves;
if (Array.isArray(values.moves))
moves = values.moves.filter(move => move);
this.props.onAddPokemon({
species: values.species,
nickname: values.nickname,
location: values.location,
level: values.level,
gender: values.gender,
shiny: values.shiny,
form: values.form,
nature: values.nature,
ability: values.ability,
moves,
item: values.item,
method: values.method
});
this.handleHide();
}
handleHide() {
this.setState({
open: false
});
this.props.onHide();
}
render() {
const {pokemon, validLocation} = this.state;
return (
<Modal show={this.props.show} onEnter={this.handleEnter}
onHide={this.handleHide}>
<RRForm getDispatch={dispatch => this.dispatch = dispatch}
onSubmit={this.handleSubmit}>
<Modal.Header closeButton><h2>Add Pokémon</h2></Modal.Header>
<Modal.Body>
<PokeSlot pokemon={pokemon} />
<PokeSprite pokemon={pokemon} />
<Row className='row-no-padding'>
<Col xs={6}>
<RRFControl model='.species' component='pokemon'
label='Pokemon*' placeholder='Bulbasaur' required
onChange={species => this.updatePokemon({species})} />
</Col>
<Col xs={6}>
<RRFControl model='.nickname' label='Nickname'
placeholder='Bulby' />
</Col>
</Row>
<ControlLabel>Location*</ControlLabel>
{validLocation ? (
<em> (No catches here yet)</em>
) : (
<em className='text-danger'> (You already reported this location!)</em>
)}
<Row className='row-no-padding'>
<Col xs={6}>
<RRFControl model='.method' componentClass='select'>
<option value='Received at:'>Received at:</option>
<option value='Caught at:'>Caught at:</option>
</RRFControl>
</Col>
<Col xs={6}>
<RRFControl model='.location' placeholder='Pallet Town'
onChange={this.checkLocation} required />
</Col>
</Row>
<Button onClick={() => this.setState(({open}) => ({open: !open}))}
block>
More Details
</Button>
<Panel collapsible expanded={this.state.open} className='no-margin'>
<Row>
<Col sm={6} xs={12}>
<RRFControl model='.level' type='number' label='Level'
placeholder='1-100'
onChange={level => this.updatePokemon({level})} />
</Col>
<Col sm={4} xs={7}>
<RRFControl model='.gender' component='toggle' type='radio'
label='Gender'
onChange={gender => this.updatePokemon({gender})}>
<img src={male} value='M' />
<img src={female} value='F' />
<span value='N'>N/A</span>
</RRFControl>
</Col>
<Col xs={2}>
<RRFControl model='.shiny' component='check'
onChange={shiny => this.updatePokemon({shiny})}>
Shiny
</RRFControl>
</Col>
</Row>
<Row>
<Col xs={6}>
<RRFControl model='.form' component='forms' label='Form'
placeholder='Normal' pokemon={this.state.pokemon}
onChange={form => this.updatePokemon({form})} />
<RRFControl model='.nature' component='combobox'
label='Nature' placeholder='Adamant'>
{natures}
</RRFControl>
<RRFControl model='.ability' component='combobox'
label='Ability' placeholder='Overgrow'>
{abilities}
</RRFControl>
</Col>
<Col xs={6}>
<RRFControl model='.moves' component='moves' label='Moves' />
</Col>
</Row>
<RRFControl model='.item' label='Item' placeholder='Oran Berry' />
</Panel>
</Modal.Body>
<Modal.Footer>
<Button type='submit' bsStyle='success' bsSize='large' block>
Add Pokémon
</Button>
</Modal.Footer>
</RRForm>
</Modal>
);
}
}
const mapStateToProps = state => {
return {
location: state.location,
pokemon: state.pokemon
}
};
const mapDispatchToProps = dispatch => {
return {
onAddPokemon: (pokemon) => {
dispatch(addPokemon(pokemon))
}
};
};
export default connect(mapStateToProps, mapDispatchToProps)(AddModal);
|
Native/Learn_NavigationBox/index.android.js
|
renxlWin/React-Native_Demo
|
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Button
} from 'react-native';
import { StackNavigator } from 'react-navigation'
class HomeScreen extends React.Component {
static navigationOptions = {
title : '附近',
};
render() {
const { navigate } = this.props.navigation;
var testPra = {'testKey' : '我是谁','user' : 'React'}
return (
<View>
<Text>Hello,React</Text>
<Button
onPress={() =>
navigate('Detail',testPra)
}
title = '详情'
/>
</View>
);
}
}
class DetailSereen extends React.Component {
static navigationOptions = ({ navigation }) => ({
title: `${navigation.state.params.user}`,
});
render() {
const { params } = this.props.navigation.state;
return (
<Text>Hello {params.testKey}</Text>
);
}
}
const Learn_NavigationBox = StackNavigator({
Home : { screen : HomeScreen },
Detail : { screen : DetailSereen},
});
AppRegistry.registerComponent('Learn_NavigationBox', () => Learn_NavigationBox);
|
examples/tutorials/react-integration/front/src/index.js
|
softindex/datakernel
|
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
|
react_state/index.android.js
|
devSC/react-native
|
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
} from 'react-native';
import setup from './setup'
AppRegistry.registerComponent('react_state', () => setup);
|
src/containers/Launch/LaunchView.js
|
yursky/recommend
|
/**
* Launch Screen
* - Shows a nice loading screen whilst:
* - Preloading any specified app content
* - Checking if user is logged in, and redirects from there
*
* React Native Starter App
* https://github.com/mcnamee/react-native-starter-app
*/
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
View,
Image,
Alert,
StatusBar,
StyleSheet,
ActivityIndicator,
} from 'react-native';
import { Actions } from 'react-native-router-flux';
// Consts and Libs
import { AppStyles, AppSizes } from '@theme/';
/* Styles ==================================================================== */
const styles = StyleSheet.create({
launchImage: {
width: AppSizes.screen.width,
height: AppSizes.screen.height,
},
});
/* Component ==================================================================== */
class AppLaunch extends Component {
static componentName = 'AppLaunch';
static propTypes = {
login: PropTypes.func.isRequired,
getYelpUsers: PropTypes.func.isRequired
}
constructor() {
super();
console.ignoredYellowBox = ['Setting a timer'];
}
componentDidMount = () => {
// Show status bar on app launch
StatusBar.setHidden(false, true);
// Preload content here
Promise.all([
this.props.getYelpUsers(),
]).then(() => {
// Once we've preloaded basic content,
// - Try to authenticate based on existing token
this.props.login()
// Logged in, show index screen
.then(() => Actions.app({ type: 'reset' }))
// Not Logged in, show Login screen
.catch(() => Actions.authenticate({ type: 'reset' }));
}).catch(err => Alert.alert(err.message));
}
render = () => (
<View style={[AppStyles.container]}>
<Image
source={require('../../images/launch.jpg')}
style={[styles.launchImage, AppStyles.containerCentered]}
>
<ActivityIndicator
animating
size={'large'}
color={'#C1C5C8'}
/>
</Image>
</View>
);
}
/* Export Component ==================================================================== */
export default AppLaunch;
|
game-new/src/utils/Icon.js
|
d07RiV/d3planner
|
import React from 'react';
import classNames from 'classnames';
class Icon extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {visible: false};
}
onLoad = () => {
this.setState({visible: true});
}
componentWillReceiveProps(newProps) {
if (newProps.src !== this.props.src) {
this.setState({visible: false});
}
}
render() {
const { className, ...props } = this.props;
return <img {...props} className={classNames(className, {"image-loading": !this.state.visible})} onLoad={this.onLoad}/>;
}
}
export { Icon };
export default Icon;
|
app/routes.js
|
alexdibattista/no-noise
|
/* eslint flowtype-errors/show-errors: 0 */
import React from 'react';
import { HashRouter as Router } from 'react-router-dom';
import { Switch, Route } from 'react-router';
import App from './containers/App';
import HomePage from './containers/HomePage';
import CounterPage from './containers/CounterPage';
export default () => (
<Router>
<App>
<Switch>
<Route path="/counter" component={CounterPage} />
<Route path="/" component={HomePage} />
</Switch>
</App>
</Router>
);
|
src/sidebar/app/router.js
|
cedricium/notes
|
import React from 'react';
import { HashRouter, Route } from 'react-router-dom';
import ListPanel from './components/ListPanel';
import EditorPanel from './components/EditorPanel';
const styles = {
container: {
flex: '100%',
display: 'flex',
flexDirection: 'column'
}
};
class Router extends React.Component {
render() {
return (
<HashRouter>
<div style={styles.container}>
<Route exact path="/" component={ListPanel} />
<Route exact path="/note" component={EditorPanel} />
<Route exact path="/note/:id" component={EditorPanel} />
</div>
</HashRouter>
);
}
}
export default Router;
|
src/sources/youtube/ImportPanel.js
|
welovekpop/uwave-web-welovekpop.club
|
import React from 'react';
import PropTypes from 'prop-types';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { IDLE, LOADING, LOADED } from '../../constants/LoadingStates';
import { addMediaMenu as openAddMediaMenu } from '../../actions/PlaylistActionCreators';
import { PLAYLIST, CHANNEL } from './constants';
import { importPlaylist } from './actions';
import LoadingPanel from './LoadingPanel';
import ChannelPanel from './ChannelPanel';
import PlaylistPanel from './PlaylistPanel';
const mapStateToProps = () => ({});
const mapDispatchToProps = dispatch => bindActionCreators({
onImportPlaylist: importPlaylist,
onOpenAddMediaMenu: openAddMediaMenu,
}, dispatch);
const YouTubeImportPanel = ({ type, importingState, ...props }) => {
if (importingState === LOADED) {
if (type === PLAYLIST) {
return <PlaylistPanel {...props} />;
}
return <ChannelPanel {...props} />;
}
return <LoadingPanel {...props} />;
};
YouTubeImportPanel.propTypes = {
type: PropTypes.oneOf([PLAYLIST, CHANNEL]).isRequired,
importingState: PropTypes.oneOf([IDLE, LOADING, LOADED]),
};
export default connect(mapStateToProps, mapDispatchToProps)(YouTubeImportPanel);
|
src/components/common/svg-icons/image/crop-din.js
|
abzfarah/Pearson.NAPLAN.GnomeH
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageCropDin = (props) => (
<SvgIcon {...props}>
<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z"/>
</SvgIcon>
);
ImageCropDin = pure(ImageCropDin);
ImageCropDin.displayName = 'ImageCropDin';
ImageCropDin.muiName = 'SvgIcon';
export default ImageCropDin;
|
geonode/contrib/monitoring/frontend/src/components/organisms/ws-analytics/index.js
|
kartoza/geonode
|
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import HoverPaper from '../../atoms/hover-paper';
import HR from '../../atoms/hr';
import WSServiceSelect from '../../molecules/ws-service-select';
import ResponseTime from '../../cels/response-time';
import Throughput from '../../cels/throughput';
import ErrorsRate from '../../cels/errors-rate';
import { getCount, getTime } from '../../../utils';
import styles from './styles';
import actions from './actions';
const mapStateToProps = (state) => ({
errors: state.wsErrorSequence.response,
interval: state.interval.interval,
responseTimes: state.wsServiceData.response,
responses: state.wsResponseSequence.response,
selected: state.wsService.service,
throughputs: state.wsThroughputSequence.throughput,
timestamp: state.interval.timestamp,
});
@connect(mapStateToProps, actions)
class WSAnalytics extends React.Component {
static propTypes = {
errors: PropTypes.object,
getErrors: PropTypes.func.isRequired,
getResponseTimes: PropTypes.func.isRequired,
getResponses: PropTypes.func.isRequired,
getThroughputs: PropTypes.func.isRequired,
interval: PropTypes.number,
resetErrors: PropTypes.func.isRequired,
resetResponseTimes: PropTypes.func.isRequired,
resetResponses: PropTypes.func.isRequired,
resetThroughputs: PropTypes.func.isRequired,
responseTimes: PropTypes.object,
responses: PropTypes.object,
selected: PropTypes.string,
throughputs: PropTypes.object,
timestamp: PropTypes.instanceOf(Date),
}
constructor(props) {
super(props);
this.get = (
service = this.props.selected,
interval = this.props.interval,
) => {
this.props.getResponses(service, interval);
this.props.getResponseTimes(service, interval);
this.props.getThroughputs(service, interval);
this.props.getErrors(service, interval);
};
this.reset = () => {
this.props.resetResponses();
this.props.resetResponseTimes();
this.props.resetThroughputs();
this.props.resetErrors();
};
}
componentWillMount() {
if (this.props.timestamp && this.props.selected) {
this.get();
}
}
componentWillReceiveProps(nextProps) {
if (nextProps && nextProps.selected && nextProps.timestamp) {
if ((nextProps.timestamp !== this.props.timestamp) ||
(nextProps.selected !== this.props.selected)) {
this.get(nextProps.selected, nextProps.interval);
}
}
}
componentWillUnmount() {
this.reset();
}
render() {
let responseData = [];
let throughputData = [];
let errorRateData = [];
let averageResponseTime = 0;
let maxResponseTime = 0;
if (this.props.responseTimes) {
const data = this.props.responseTimes.data.data;
if (data.length > 0) {
if (data[0].data.length > 0) {
const metric = data[0].data[0];
maxResponseTime = Math.floor(metric.max);
averageResponseTime = Math.floor(metric.val);
}
}
}
responseData = getTime(this.props.responses);
throughputData = getCount(this.props.throughputs);
errorRateData = getCount(this.props.errors);
return (
<HoverPaper style={styles.content}>
<h3>W*S Analytics</h3>
<WSServiceSelect />
<ResponseTime
average={averageResponseTime}
max={maxResponseTime}
data={responseData}
/>
<HR />
<Throughput data={throughputData} />
<HR />
<ErrorsRate data={errorRateData} />
</HoverPaper>
);
}
}
export default WSAnalytics;
|
src/components/App.js
|
dzwiedziu-nkg/books-collection-frontend
|
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import 'bootstrap';
import './basic/EditButton';
import '../styles/App.css';
import EditButton from "./basic/EditButton";
class AppComponent extends React.Component {
static propTypes = {
brand_name: PropTypes.string,
children: PropTypes.node,
edit: PropTypes.bool,
onEditChange: PropTypes.func
};
static defaultProps = {
edit: false,
onEditChange: (edit) => {}
};
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
handleClick(event) {
this.props.onEditChange(!this.props.edit);
}
render() {
const { edit } = this.props;
return (
<div className="container">
<div className="jumbotron">
<EditButton active={edit} onEditClick={this.handleClick}/>
<h1><Link to="/">{this.props.brand_name}</Link></h1>
</div>
{this.props.children}
</div>
);
}
}
export default AppComponent;
|
src/components/Header.js
|
codevinsky/deep-ellum-jukebox-ui
|
import React from 'react';
import { Grid, Row, Col, Button, Glyphicon, Input } from 'react-bootstrap';
import FitterHappierText from 'react-fitter-happier-text';
import ReactFitText from 'react-fittext';
import { Hatchshow, FullScreenSearch, BigText } from './index';
class Header extends React.Component {
constructor(...args) {
super(...args);
this.state = {searchQuery: ''};
this.handleInput = _.bind(this.handleInput, this);
this.searchLink = {
value: this.state.searchQuery,
requestChange: this.handleInput
};
}
handleInput(event) {
let query = event.target.value;
this.setState({searchQuery: query});
if ( query.length >= 4 ) {
_.delay(() => this.setState({searchQuery: ''}), 1000);
}
}
render() {
return (
<header>
<Row className="intro-text">
<Col xs={8}
sm={6}
md={5}
lg={4}
className="intro-heading">
<Hatchshow>
DEEP
</Hatchshow>
<Hatchshow>
ELLUM
</Hatchshow>
<Hatchshow>
JUKEBOX
</Hatchshow>
<Hatchshow>
.COM
</Hatchshow>
</Col>
</Row>
</header>
);
}
}
export default Header;
|
javascript/src/containers/ViewToggleContainer.js
|
unclecheese/silverstripe-kickassets
|
import React from 'react';
import Reflux from 'reflux';
import Navigation from '../actions/Navigation';
import ViewToggle from '../views/ViewToggle';
const ViewToggleContainer = React.createClass({
mixins: [
React.addons.PureRenderMixin,
Reflux.ListenerMixin
],
propTypes: {
routerParams: React.PropTypes.object.isRequired
},
handleToggle (view) {
Navigation.updateView(view);
},
render () {
return <ViewToggle onToggle={this.handleToggle} view={this.props.routerParams.get('view')} />
}
});
export default ViewToggleContainer;
|
components/CheckboxGroup/index.js
|
azl397985856/ltcrm-components
|
import React from 'react';
import {Col} from 'antd';
import Checkbox from 'rc-checkbox';
const CheckboxGroup = React.createClass({
getDefaultProps() {
return {
prefixCls: 'ant-checkbox',
options: [],
defaultValue: [],
onChange() {},
span: 4,
};
},
propTypes: {
defaultValue: React.PropTypes.array,
value: React.PropTypes.array,
options: React.PropTypes.array.isRequired,
onChange: React.PropTypes.func,
span: React.PropTypes.string,
},
getInitialState() {
const props = this.props;
let value;
if ('value' in props) {
value = props.value;
} else if ('defaultValue' in props) {
value = props.defaultValue;
}
return { value };
},
componentWillReceiveProps(nextProps) {
if ('value' in nextProps) {
this.setState({
value: nextProps.value || [],
});
}
},
toggleOption(option) {
const optionIndex = this.state.value.indexOf(option);
const value = [...this.state.value];
if (optionIndex === - 1) {
value.push(option);
} else {
value.splice(optionIndex, 1);
}
if (!('value' in this.props)) {
this.setState({ value });
}
this.props.onChange(value);
},
render() {
const options = this.props.options;
const span = this.props.span;
return (
<div className="ant-checkbox-group col-24">
{
options.map(option =>
<Col span= {span}>
<label className="ant-checkbox-group-item" key={option}>
<Checkbox disabled={this.props.disabled} {...this.props}
checked={this.state.value.indexOf(option) !== -1}
onChange={this.toggleOption.bind(this, option)} />
{option}
</label>
</Col>
)
}
</div>
);
},
});
export default CheckboxGroup;
module.exports = exports['default'];
|
app/javascript/mastodon/components/__tests__/display_name-test.js
|
ambition-vietnam/mastodon
|
import React from 'react';
import renderer from 'react-test-renderer';
import { fromJS } from 'immutable';
import DisplayName from '../display_name';
describe('<DisplayName />', () => {
it('renders display name + account name', () => {
const account = fromJS({
username: 'bar',
acct: 'bar@baz',
display_name_html: '<p>Foo</p>',
});
const component = renderer.create(<DisplayName account={account} />);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
});
|
pilgrim3/components/serviceBrowser.js
|
opendoor-labs/pilgrim3
|
import React from 'react';
import state from './state';
import { Link } from 'react-router';
import { map } from 'lodash';
import { relativeName } from './utils';
import ProtoInfo from './protoInfo';
import DocBlock from './docBlock';
import OptionsPopover from './optionsPopover';
export default class ServiceBrowser extends React.Component {
renderService(service) {
// TODO(daicoden) replace test-done with template mechanism, tests will use it to inject this data, others can use it to styleize page
return (
<div>
<h1>{service.name}<OptionsPopover placement='right' obj={service} /></h1>
<DocBlock docs={service.documentation} />
<ProtoInfo infoObject={service}/>
{this.renderMethods(service)}
<div id="test-done"></div>
</div>
);
}
renderMethods(service) {
let methodRows = this.renderMethodRows(service.method, service);
return (
<div className='panel panel-default'>
<div className='panel-heading'>Methods</div>
<table className='table table-hover'>
<thead>
<tr>
<th/>
<th>Name</th>
<th>Input</th>
<th>Output</th>
<th/>
</tr>
</thead>
<tbody>
{methodRows}
</tbody>
</table>
</div>
);
}
renderMethodRows(methods, service) {
return map(methods, (meth) => {
let deprecated = (meth.options && meth.options.deprecated) ? 'deprecated' : '';
return (
<tr key={`rpc-method-${service.fullName}-${meth.name}`} className={deprecated}>
<td><OptionsPopover obj={meth}/></td>
<td>{meth.name}</td>
<td><Link to={`/messages/${meth.inputType}`}>{relativeName(meth.inputType, service.fileDescriptor)}</Link></td>
<td><Link to={`/messages/${meth.outputType}`}>{relativeName(meth.outputType, service.fileDescriptor)}</Link></td>
<td>{meth.documentation}</td>
</tr>
);
});
}
render() {
if (!state.byService) {
return (<div className='alert alert-info'>Loading</div>);
}
let service = state.byService[this.props.params.service_name];
if (!service) {
return (<div className='alert alert-danger'>Service Not Found</div>);
} else {
return this.renderService(service);
}
}
}
|
webapp/src/containers/search/logList.js
|
nathandunn/agr
|
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Tooltip, OverlayTrigger } from 'react-bootstrap';
import style from './style.css';
const DEFAULT_LABEL = 'Homologs';
const HIGHLIGHT_EL = 'em';
import { selectQueryParams } from '../../selectors/searchSelectors';
class LogListComponent extends Component {
renderLabel(raw) {
if (this.props.rawHighlight) {
let q = this.props.query;
let re = new RegExp(q, 'gi');
let htmlStr = raw.replace(re, `<${HIGHLIGHT_EL}>${q}</${HIGHLIGHT_EL}>`);
return <span dangerouslySetInnerHTML={{ __html: htmlStr }} />;
}
return raw;
}
render() {
let logs = this.props.logs;
let label = this.props.label;
if (!logs) return null;
label = label || DEFAULT_LABEL;
if (logs.length === 0) return null;
let nodes = logs.map( (d, i) => {
let commaNode = (i === logs.length - 1) ? null : ', ';
let tooltipNode = <Tooltip className='in' id='tooltip-top' placement='top'><i>{d.species}</i> type: {d.relationship_type}</Tooltip>;
return (
<span key={'h.' + i}>
<OverlayTrigger overlay={tooltipNode} placement='top'>
<a href={d.href} target='_new'>
{this.renderLabel(d.symbol)}
</a>
</OverlayTrigger>
<a className={style.evidenceFootnote} href={d.evidence_href} target='_new'>
{this.renderLabel(d.evidence_name)}
</a>
{commaNode}
</span>
);
});
return (
<div className={style.detailContainer}>
<span className={style.detailLabel}><strong>{label}:</strong> {nodes}</span>
</div>
);
}
}
LogListComponent.propTypes = {
label: React.PropTypes.string,
logs: React.PropTypes.array,
query: React.PropTypes.string,
rawHighlight: React.PropTypes.string
};
function mapStateToProps(state) {
let qp = selectQueryParams(state);
return {
query: qp.q || ''
};
}
export default connect(mapStateToProps)(LogListComponent);
|
sourcestats/webpack/main.js
|
Fizzadar/SourceServerStats
|
// Source Server Stats
// File: sourcestats/webpack/main.jsx
// Desc: frontend entry-point
import React from 'react';
import ReactDOM from 'react-dom';
// Not included by default
import 'react-select/less/default.less';
import 'metrics-graphics/dist/metricsgraphics.css';
import './main.less';
import { App } from './App';
ReactDOM.render(
<App />,
document.getElementById('app')
);
|
client/src/js/components/Nav/Footer.js
|
yassinej/oerk_v4
|
import React, { Component } from 'react';
class Footer extends Component {
render() {
return (
<div className="container-fluid p-1 p-md-3 text-center bg-warning">
Footer
</div>
);
}
}
export default Footer;
|
src/scripts/modules/guest/forgot/UserForgotComponent.js
|
arikanmstf/userauth
|
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import InputText from '../../../common/input/InputText';
class UserForgotComponent extends Component {
constructor (props) {
super(props);
this.state = props;
this.submitForgotForm = this.submitForgotForm.bind(this);
}
submitForgotForm () {
const form = {
email: this.state.email
};
this.props.submitForgotForm(form);
}
render () {
return (
<div className="user-forgot-component">
<p>Enter your email address to recover your password</p>
<InputText
onChange={e => this.setState({ email: e })}
placeholder="Example email: admin@example.com"
/>
<button className="btn btn-primary" onClick={() => this.submitForgotForm()}>Submit</button>
</div>
);
}
}
UserForgotComponent.propTypes = {
submitForgotForm: PropTypes.func.isRequired
};
export default UserForgotComponent;
|
src/Divider/Divider.spec.js
|
lawrence-yu/material-ui
|
/* eslint-env mocha */
import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import Divider from './Divider';
import getMuiTheme from '../styles/getMuiTheme';
describe('<Divider />', () => {
const muiTheme = getMuiTheme();
const shallowWithContext = (node) => shallow(node, {context: {muiTheme}});
it('renders className', () => {
const wrapper = shallowWithContext(
<Divider
className="test-class-name"
/>
);
assert.ok(wrapper.is('.test-class-name'), 'should contain the className');
});
it('renders inset', () => {
const wrapper = shallowWithContext(
<Divider
inset={true}
/>
);
const cheerioDivider = wrapper.render().children();
assert.strictEqual(cheerioDivider.css('margin-left'), '72px');
});
it('overwrite styles', () => {
const style = {
backgroundColor: 'red',
};
const wrapper = shallowWithContext(
<Divider
style={style}
/>
);
assert.strictEqual(wrapper.prop('style').backgroundColor, 'red', 'should have red backgroundColor');
});
});
|
ui/lib/search.js
|
Bit-Nation/BITNATION-Pangea
|
'use babel'
import React from 'react'
import ssbref from 'ssb-ref'
import app from './app'
import u from 'patchkit-util'
import social from 'patchkit-util/social'
import t from 'patchwork-translations'
const MAX_CHANNEL_RESULTS = 3
const MAX_USER_RESULTS = 3
export function getResults (query) {
var results = []
// ssb references
if (ssbref.isLink(query)) {
var shortened = u.shortString(query)
if (ssbref.isFeedId(query)) results = [{ icon: 'user', label: t('search.OpenUser', {id: shortened}), fn: openObject }]
else if (ssbref.isMsgId(query)) results = [{ icon: 'envelope', label: t('search.OpenMessage', {id: shortened}), fn: openObject }]
else if (ssbref.isBlobId(query)) results = [{ icon: 'file', label: t('search.OpenFile', {id: shortened}), fn: openObject }]
results.push({ icon: 'search', label: t('search.SearchForReferences', {id: shortened}), fn: doSearch({ type: 'mentions' }) })
return results
}
// general results
results = results.concat([
{ icon: 'envelope', label: t('search.SearchMessages', {query}), fn: doSearch({ type: 'posts' }) }
])
// builtin pages
// TODO
// known users
results = results.concat(getUserResults(query))
// channels
results = results.concat(getChannelResults(query))
return results
}
function getUserResults (query) {
if (query.charAt(0) == '#') // strip off the pound
query = query.slice(1)
query = query.toLowerCase()
var results = []
for (let id in app.users.names) {
var name = app.users.names[id]
if (typeof name == 'string' && name.toLowerCase().indexOf(query) !== -1)
results.push(id)
}
// sort by popularity (isnt that just the way of things?)
results.sort(social.sortByPopularity.bind(social, app.users))
results = results
.slice(0, MAX_USER_RESULTS)
.map(id => { return { icon: 'user', label: t('search.OpenUser', {id: app.users.names[id]}), fn: () => openObject(id) } })
return results
}
function getChannelResults (query) {
if (query.charAt(0) == '#') // strip off the pound
query = query.slice(1)
query = query.toLowerCase()
var hasExact = false
var results = []
for (var i=0; i < app.channels.length && results.length < MAX_CHANNEL_RESULTS; i++) {
var ch = app.channels[i]
if (ch.name.toLowerCase().indexOf(query) !== -1) {
if (!hasExact)
hasExact = (ch.name == query)
results.push({
icon: 'hashtag',
label: <span>{t('search.OpenChannel', {name: ch.name})}</span>,
fn: openChannel(ch.name)
})
}
}
if (!hasExact)
results.push({ icon: 'hashtag', label: t('search.OpenChannel', {name: query}), fn: openChannel(query) })
return results
}
function openObject (ref) {
if (ssbref.isFeedId(ref)) {
app.history.pushState(null, '/profile/'+encodeURIComponent(ref))
} else if (ssbref.isMsgId(ref)) {
app.history.pushState(null, '/msg/'+encodeURIComponent(ref))
} else if (ssbref.isBlobId(ref)) {
window.location = '/'+encodeURIComponent(ref)
}
}
const openChannel = channel => () => {
if (channel.charAt(0) == '#') // strip off the pound
channel = channel.slice(1)
app.history.pushState(null, '/channel/'+encodeURIComponent(channel))
}
export const doSearch = opts => query => {
// TODO incorporate `opts`
app.history.pushState(null, '/search/'+encodeURIComponent(query))
}
|
src/svg-icons/av/forward-10.js
|
xmityaz/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;
|
stories/list/index.js
|
JerryBerton/dh-component
|
import React from 'react';
import { storiesOf, action, linkTo } from '@kadira/storybook';
import withReadme from 'storybook-readme/with-readme';
import { List, Menu, Dropdown, Icon, Avatar} from '../../src';
import listReadme from './list.md';
const addWithInfoOptions = { inline: true, propTables: false };
const menu = (
<Menu>
<Menu.Item>
<span>菜单1</span>
</Menu.Item>
<Menu.Item>
<span>菜单2</span>
</Menu.Item>
</Menu>
);
const suffix = (
<Dropdown overlay={menu} trigger="click">
<Icon type="list-circle"/>
</Dropdown>
);
storiesOf('列表组件', module)
.addDecorator(withReadme(listReadme))
.addWithInfo('默认列表', () => (
<List mode="only" itemClassName="wjb-" itemStyles={{color: 'red'}}>
<List.Item key="1" onClick={action('onClick')}> 我是默认列表 </List.Item>
<List.Item key="2" onClick={action('onClick')}> 我是默认列表 </List.Item>
<List.Item key="3" onClick={action('onClick')}> 我是默认列表 </List.Item>
</List>
), addWithInfoOptions)
.addWithInfo('单行选择', () => (
<List
mode="only"
selectedKeys={['1']}
onChange={action('onChange')}>
<List.Item key="1"> 我可以被操作选择</List.Item>
<List.Item key="2"> 我可以被操作选择</List.Item>
<List.Item key="3"> 我可以被操作选择</List.Item>
</List>
), addWithInfoOptions)
.addWithInfo('单行选择不可变', () => (
<List
mode="only"
immutable
icon
onChange={action('onChange')}>
<List.Item key="1"> 我可以被操作选择, 但是不可变</List.Item>
<List.Item key="2"> 我可以被操作选择, 但是不可变</List.Item>
<List.Item key="3"> 我可以被操作选择, 但是不可变</List.Item>
</List>
), addWithInfoOptions)
.addWithInfo('多行选择', () => (
<List mode="multiple" icon onChange={action('onChange')}>
<List.Item key="1"> 来点我一下</List.Item>
<List.Item key="2"> 来点我一下</List.Item>
<List.Item key="3"> 来点我一下</List.Item>
</List>
), addWithInfoOptions)
.addWithInfo('前缀图标', () => (
<List>
<List.Item key="1" prefix={<Avatar />}>Avatar的前置图标</List.Item>
<List.Item
key="2"
prefix={<Avatar src="http://7xr8fr.com1.z0.glb.clouddn.com/IMG_2197.JPG"/>}
>
Avatar用户传入图片
</List.Item>
<List.Item
key="3"
prefix={<Avatar>OK</Avatar>}
>
Avatar自定义中间元素
</List.Item>
<List.Item
key="4"
prefix={<Avatar radius={false}>中国</Avatar>}
>
我是方形的前置元素
</List.Item>
</List>
), addWithInfoOptions)
.addWithInfo('后缀图标', () => (
<List>
<List.Item key="1" suffix={suffix}> Avatar用户传入图片</List.Item>
<List.Item key="2" suffix={suffix}> Avatar用户传入图片</List.Item>
<List.Item key="3" suffix={suffix}> Avatar用户传入图片</List.Item>
<List.Item key="4" suffix={suffix}> Avatar用户传入图片</List.Item>
<List.Item key="5" suffix={suffix}> Avatar用户传入图片</List.Item>
</List>
), addWithInfoOptions)
|
src/routes/appointment/EditAppointment.js
|
chunkiat82/rarebeauty-ui
|
import React from 'react';
import moment from 'moment';
import Appointment from './components/Individual';
import Layout from '../../components/Layout';
import {
listContacts,
getAppointment,
queryPastAppointments,
getServices,
cancelAppointment,
updateAppointment,
} from './common/functions';
import CancelSection from './components/CancelSection';
function show(store) {
return () => {
store.dispatch({ type: 'SHOW_LOADER' });
};
}
function hide(store) {
return () => {
store.dispatch({ type: 'HIDE_LOADER' });
};
}
async function action({ fetch, params, store }) {
const apptId = params.id;
const appointment = await getAppointment(fetch)(apptId);
if (appointment.error) {
return {
chunks: ['appointment-edit'],
title: 'Rare Beauty Professional',
component: (
<Layout>
<center>
<h1>Appointment Does Not Exist</h1>
</center>
</Layout>
),
};
}
show(store)();
const contacts = await listContacts(fetch)();
const { event, transaction } = appointment;
const name = event.name;
const mobile = event.mobile;
const startDate = moment(event.start);
const endDate = moment(event.end);
const duration = Number(moment.duration(endDate - startDate) / 60000);
const serviceIds = event.serviceIds;
const resourceName = event.resourceName;
let discount = 0;
let additional = 0;
let totalAmount = 0;
let deposit = 0;
if (transaction) {
discount = transaction.discount;
additional = transaction.additional;
totalAmount = transaction.totalAmount;
deposit = transaction.deposit;
}
// const pastAppointments = await queryPastAppointments(fetch)(resourceName);
const {
appointments: pastAppointments,
cancelCount: cancelAppointmentsCount,
} = await queryPastAppointments(fetch)(resourceName);
const services = await getServices(fetch)();
// console.log(`resourceName=${resourceName}`);
// console.log(`Edit pastAppointments=${JSON.stringify(pastAppointments)}`);
hide(store)();
if (!contacts) throw new Error('Failed to load the contact feed.');
return {
chunks: ['appointment-edit'],
title: 'Rare Beauty Professional',
component: (
<Layout>
<Appointment
post={async input => {
// console.log(input);
await updateAppointment(fetch)(
Object.assign({ id: apptId, resourceName }, input),
);
return { updatedAppointment: true };
}}
queryPastAppointments={queryPastAppointments(fetch)}
pastAppointments={pastAppointments}
cancelAppointmentsCount={cancelAppointmentsCount}
services={services}
contacts={contacts}
name={name}
mobile={mobile}
apptId={apptId}
startDate={startDate.toDate()}
startTime={startDate.toDate()}
serviceIds={serviceIds}
discount={discount}
additional={additional}
totalAmount={totalAmount}
duration={duration}
resourceName={resourceName}
postText={'Update Appointment'}
successMessage={'Appointment Updated'}
errorMessage={'Appointment Creation Failed'}
showLoading={show(store)}
hideLoading={hide(store)}
deposit={deposit}
toBeInformed={false}
cancelButton={
<CancelSection
label="Customer Cancel"
showLoading={show(store)}
hideLoading={hide(store)}
post={async () => {
// console.log(input);
await cancelAppointment(fetch)({ apptId });
return { canceledAppointment: true };
}}
/>
}
{...this.props}
/>
</Layout>
),
};
}
export default action;
|
public/components/tehtPage/tabsComponents/templates/KuvatVideotTemplate.js
|
City-of-Vantaa-SmartLab/kupela
|
import React from 'react';
import MainContent from './MainContent';
const KuvatVideotTemplate = (props) => (
<div className="kuvatvideot-grid">
<MainContent component={props.component} className="kuvatvideotcontent" {...props} />
</div>
);
export default KuvatVideotTemplate;
|
src/components/frankulator/Conductors.js
|
SashaKoro/reactulator
|
import React from 'react';
import styled from 'styled-components';
const LeftConductor = styled.span`
background-color: gray;
float: left;
color: red;
float: left;
height: 40px;
width: 40px;
margin-left: -47px;
margin-top: -55px;
-webkit-border-radius: 5px 0 0 5px;
`;
const RightConductor = styled(LeftConductor)`
margin-left: 393px;
-webkit-border-radius: 0 5px 5px 0;
boxShadow: 5px 8px 3px black;
`;
const Conductors = () => {
return (
<div>
<LeftConductor />
<RightConductor />
</div>
);
};
export default Conductors;
|
src/hello.js
|
GRT/react-example
|
import React from 'react';
export default React.createClass({
render: function() {
return <div>Hello {this.props.name}</div>;
}
});
|
pollard/components/Setlist.js
|
spencerliechty/pollard
|
import React, { Component } from 'react';
import SearchSong from './SearchSong';
import AddedSongs from './AddedSongs';
import NewPlaylistInstructions from './NewPlaylistInstructions.js';
export default class Setlist extends Component {
render() {
const {
songs,
} = this.props;
return (
<div className="row">
<ul className="list-group">
<SearchSong/>
{
(songs.size === 0) ?
<NewPlaylistInstructions /> :
''
}
<AddedSongs />
</ul>
</div>
);
}
}
|
static/src/components/RegisterView.js
|
PMA-2020/pma-translation-hub
|
/* eslint camelcase: 0, no-underscore-dangle: 0 */
import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import TextField from 'material-ui/TextField';
import RaisedButton from 'material-ui/RaisedButton';
import Paper from 'material-ui/Paper';
import * as actionCreators from '../actions/auth';
import { validateEmail } from '../utils/misc';
function mapStateToProps(state) {
return {
isRegistering: state.auth.isRegistering,
registerStatusText: state.auth.registerStatusText,
};
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(actionCreators, dispatch);
}
const style = {
marginTop: 50,
paddingBottom: 50,
paddingTop: 25,
width: '100%',
textAlign: 'center',
display: 'inline-block',
};
@connect(mapStateToProps, mapDispatchToProps)
export default class RegisterView extends React.Component {
constructor(props) {
super(props);
const redirectRoute = '/login';
this.state = {
email: '',
password: '',
email_error_text: null,
password_error_text: null,
redirectTo: redirectRoute,
disabled: true,
};
}
isDisabled() {
let email_is_valid = false;
let password_is_valid = false;
if (this.state.email === '') {
this.setState({
email_error_text: null,
});
} else if (validateEmail(this.state.email)) {
email_is_valid = true;
this.setState({
email_error_text: null,
});
} else {
this.setState({
email_error_text: 'Sorry, this is not a valid email',
});
}
if (this.state.password === '' || !this.state.password) {
this.setState({
password_error_text: null,
});
} else if (this.state.password.length >= 6) {
password_is_valid = true;
this.setState({
password_error_text: null,
});
} else {
this.setState({
password_error_text: 'Your password must be at least 6 characters',
});
}
if (email_is_valid && password_is_valid) {
this.setState({
disabled: false,
});
}
}
changeValue(e, type) {
const value = e.target.value;
const next_state = {};
next_state[type] = value;
this.setState(next_state, () => {
this.isDisabled();
});
}
_handleKeyPress(e) {
if (e.key === 'Enter') {
if (!this.state.disabled) {
this.login(e);
}
}
}
login(e) {
e.preventDefault();
this.props.registerUser(this.state.email, this.state.password, this.state.redirectTo);
}
render() {
return (
<div className="col-md-6 col-md-offset-3" onKeyPress={(e) => this._handleKeyPress(e)}>
<Paper style={style}>
<div className="text-center">
<h2>Register to view protected content!</h2>
{
this.props.registerStatusText &&
<div className="alert alert-info">
{this.props.registerStatusText}
</div>
}
<div className="col-md-12">
<TextField
hintText="Email"
floatingLabelText="Email"
type="email"
errorText={this.state.email_error_text}
onChange={(e) => this.changeValue(e, 'email')}
/>
</div>
<div className="col-md-12">
<TextField
hintText="Password"
floatingLabelText="Password"
type="password"
errorText={this.state.password_error_text}
onChange={(e) => this.changeValue(e, 'password')}
/>
</div>
<RaisedButton
disabled={this.state.disabled}
style={{ marginTop: 50 }}
label="Submit"
onClick={(e) => this.login(e)}
/>
</div>
</Paper>
</div>
);
}
}
RegisterView.propTypes = {
registerUser: React.PropTypes.func,
registerStatusText: React.PropTypes.string,
};
|
src/svg-icons/content/add-circle.js
|
pradel/material-ui
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ContentAddCircle = (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 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/>
</SvgIcon>
);
ContentAddCircle = pure(ContentAddCircle);
ContentAddCircle.displayName = 'ContentAddCircle';
export default ContentAddCircle;
|
src/layouts/index.js
|
jameslutley/jameslutley.com
|
import React from 'react'
import PropTypes from 'prop-types'
import Link from 'gatsby-link'
import Img from 'gatsby-image'
import Helmet from 'react-helmet'
import { injectGlobal } from 'emotion'
import { ThemeProvider } from 'emotion-theming'
import { normalize } from 'polished'
import t from 'tachyons-js'
import { theme } from '../utils/theme'
import Container from '../components/atoms/container'
import Header from '../components/organisms/header'
import Footer from '../components/organisms/footer'
injectGlobal`
${normalize()}
html {
${t.overflow_y_scroll};
}
html,
body,
div,
article,
section,
main,
footer,
header,
form,
fieldset,
legend,
pre,
code,
a,
h1,h2,h3,h4,h5,h6,
p,
ul,
ol,
li,
dl,
dt,
dd,
textarea,
table,
td,
th,
tr,
input[type="email"],
input[type="number"],
input[type="password"],
input[type="tel"],
input[type="text"],
input[type="url"] {
box-sizing: border-box;
}
*,
*::before,
*::after {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body {
font-family: ${theme.serif};
font-size: ${theme.fontSize6}
line-height: ${theme.lineHeightCopy};
font-kerning: normal;
font-feature-settings: 'kern', 'liga', 'clig', 'calt';
color: ${theme.darkGray};
}
img {
${t.mw_100};
${t.v_mid};
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: ${theme.spacingMediumLarge};
margin-bottom: ${theme.spacingMediumLarge};
font-family: ${theme.sansSerifDisplay};
text-rendering: optimizeLegibility;
letter-spacing: -0.02rem;
color: ${theme.nearBlack};
${theme.Desktop} {
margin-top: ${theme.spacingExtraLarge};
margin-bottom: ${theme.spacingMediumLarge};
}
}
h1 {
font-size: ${theme.fontSize2};
line-height: calc(64 / 48);
${theme.Desktop} {
font-size: ${theme.fontSize1};
line-height: calc(80 / 64);
}
}
h2 {
font-size: ${theme.fontSize3};
line-height: calc(48 / 30);
}
h3 {
font-size: ${theme.fontSize4};
line-height: calc(32 / 24);
}
h4 {
font-size: ${theme.fontSize5};
line-height: calc(24 / 20);
}
h5 {
font-size: ${theme.fontSize6};
line-height: calc(24 / 18);
}
h6 {
font-size: ${theme.fontSize7};
line-height: calc(24 / 16);
}
a {
color: inherit;
text-decoration: underline;
text-decoration-color: ${theme.lightBlue};
text-decoration-skip: ink;
transition: color 0.15s ease-in, text-decoration-color 0.15s ease-in;
&:hover,
&:focus {
color: ${theme.nearBlack};
text-decoration-color: ${theme.blue};
}
}
`
const DefaultLayout = ({ children, data }) =>
<div>
<Helmet
title="James Lutley — Designer, Developer, Maker"
meta={[
{ name: 'description', content: 'Sample' },
{ name: 'keywords', content: 'sample, something' },
]}
link={[
{ rel: 'stylesheet', href: 'https://use.typekit.net/uon4clj.css' }
]}
/>
<ThemeProvider theme={theme}>
<div>
<Header siteTitle={data.site.siteMetadata.title} />
{children()}
<Footer avatar={data.file.childImageSharp.resolutions} siteTitle={data.site.siteMetadata.title} />
</div>
</ThemeProvider>
</div>
export const query = graphql`
query LayoutQuery {
site {
siteMetadata {
title
}
}
file(relativePath: { eq: "images/jameslutley.jpg"}) {
childImageSharp {
resolutions(width: 72, height: 72) {
...GatsbyImageSharpResolutions
}
}
}
},
`
DefaultLayout.propTypes = {
children: PropTypes.oneOfType([
PropTypes.func,
PropTypes.object,
]).isRequired,
data: PropTypes.object.isRequired,
}
export default DefaultLayout
|
src/app/components/loadingSpinner.js
|
nazar/sound-charts-react-spa
|
import React from 'react';
export default React.createClass({
render() {
return (
<div className="loading-spinner">
<i className="fa fa-cog fa-spin"></i>
</div>
);
}
});
|
packages/react-error-overlay/src/components/Collapsible.js
|
viankakrisna/create-react-app
|
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/* @flow */
import React, { Component } from 'react';
import { black } from '../styles';
import type { Element as ReactElement } from 'react';
const _collapsibleStyle = {
color: black,
cursor: 'pointer',
border: 'none',
display: 'block',
width: '100%',
textAlign: 'left',
background: '#fff',
fontFamily: 'Consolas, Menlo, monospace',
fontSize: '1em',
padding: '0px',
lineHeight: '1.5',
};
const collapsibleCollapsedStyle = {
..._collapsibleStyle,
marginBottom: '1.5em',
};
const collapsibleExpandedStyle = {
..._collapsibleStyle,
marginBottom: '0.6em',
};
type Props = {|
children: ReactElement<any>[],
|};
type State = {|
collapsed: boolean,
|};
class Collapsible extends Component<Props, State> {
state = {
collapsed: true,
};
toggleCollapsed = () => {
this.setState(state => ({
collapsed: !state.collapsed,
}));
};
render() {
const count = this.props.children.length;
const collapsed = this.state.collapsed;
return (
<div>
<button
onClick={this.toggleCollapsed}
style={
collapsed ? collapsibleCollapsedStyle : collapsibleExpandedStyle
}
>
{(collapsed ? '▶' : '▼') +
` ${count} stack frames were ` +
(collapsed ? 'collapsed.' : 'expanded.')}
</button>
<div style={{ display: collapsed ? 'none' : 'block' }}>
{this.props.children}
<button
onClick={this.toggleCollapsed}
style={collapsibleExpandedStyle}
>
{`▲ ${count} stack frames were expanded.`}
</button>
</div>
</div>
);
}
}
export default Collapsible;
|
src/components/BreadcrumbItem/BreadcrumbItem.js
|
wfp/ui
|
import PropTypes from 'prop-types';
import React from 'react';
import classnames from 'classnames';
import Link from '../Link';
import settings from '../../globals/js/settings';
const { prefix } = settings;
const newChild = (children, disableLink, href) => {
if (disableLink === true) {
return <span>{children}</span>;
} else if (typeof children === 'string' && !(href === undefined)) {
return <Link href={href}>{children}</Link>;
} else {
return React.cloneElement(React.Children.only(children), {
className: `${prefix}--link`,
});
}
};
const BreadcrumbItem = ({
children,
className,
disableLink,
href,
...other
}) => {
const classNames = classnames(`${prefix}--breadcrumb-item`, className);
return (
<div className={classNames} {...other}>
{newChild(children, disableLink, href)}
</div>
);
};
BreadcrumbItem.propTypes = {
/**
* The children elements, usually a link
*/
children: PropTypes.node,
/**
* Specify an optional className to be added to the `BreadcrumbItem` Icon
*/
className: PropTypes.string,
/**
* Specify an link for the `BreadcrumbItem`
*/
href: PropTypes.string,
/**
* Specify `BreadcrumbItem` to be interactive/enabled or non-interactive/disabled
*/
disableLink: PropTypes.bool,
};
export default BreadcrumbItem;
|
MadWare.Hathor.FrontEnd/src/js/components/server/PlayerControls.js
|
zvizdo/MadWare.Hathor
|
import React from 'react'
class PlayerControls extends React.Component {
onNewPlaylist(e) {
this.props.onNewPlaylistClick();
}
onCleanPlayed(e) {
this.props.onCleanPlayedClick();
}
onRepeatSettingChange (e) {
this.props.onRepeatChange(e.target.checked);
}
onShuffleSettingChange (e) {
this.props.onShuffleChange(e.target.checked);
}
render() {
return (
<div class="row">
<div class="col-md-12">
<div class="bs-component">
<div class="jumbotron">
<a class="btn btn-primary btn-lg" onClick={this.onNewPlaylist.bind(this)} >
NEW PLAYLIST
<div class="ripple-container"></div></a>
<a class="btn btn-primary btn-lg" onClick={this.onCleanPlayed.bind(this)} >
CLEAN PLAYED
<div class="ripple-container"></div></a>
<div class="checkbox">
<label>
<input type="checkbox"
checked={this.props.repeat}
onChange={this.onRepeatSettingChange.bind(this)} />
<span style={{paddingLeft: "10px"}}>repeat</span>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox"
checked={this.props.shuffle}
onChange={this.onShuffleSettingChange.bind(this)} />
<span style={{paddingLeft: "10px"}}>shuffle</span>
</label>
</div>
</div>
</div>
</div>
</div>
);
}
}
PlayerControls.propTypes = {
repeat: React.PropTypes.bool.isRequired,
repeat: React.PropTypes.bool.isRequired,
onNewPlaylistClick: React.PropTypes.func,
onCleanPlayedClick: React.PropTypes.func,
onRepeatChange: React.PropTypes.func,
onShuffleChange: React.PropTypes.func
}
PlayerControls.defaultProps = {
onNewPlaylistClick: () => {},
onCleanPlayedClick: () => {},
onRepeatChange: () => {},
onShuffleChange: () => {}
}
export default PlayerControls;
|
app/admin/dashboard/HomeNavigate.js
|
ecellju/internship-portal
|
import React from 'react';
import PropTypes from 'prop-types';
import { Route } from 'react-router-dom';
import HomeTab from './HomeTab';
import PostView from '../post/PostView';
const HomeNavigate = ({ match }) => (
<div>
<Route exact path={match.url} component={HomeTab} />
<Route path={`${match.url}/:id`} component={PostView} />
</div>
);
HomeNavigate.propTypes = {
match: PropTypes.shape({
url: PropTypes.string.isRequired,
}).isRequired,
};
export default HomeNavigate;
|
admin/client/App/screens/Item/components/EditForm.js
|
w01fgang/keystone
|
import React from 'react';
import moment from 'moment';
import assign from 'object-assign';
import {
Form,
FormField,
FormInput,
Grid,
ResponsiveText,
} from '../../../elemental';
// import { css, StyleSheet } from 'aphrodite/no-important';
import { Fields } from 'FieldTypes';
import { fade } from '../../../../utils/color';
import theme from '../../../../theme';
import { Button, LoadingButton } from '../../../elemental';
import AlertMessages from '../../../shared/AlertMessages';
import ConfirmationDialog from './../../../shared/ConfirmationDialog';
import FormHeading from './FormHeading';
import AltText from './AltText';
import FooterBar from './FooterBar';
import InvalidFieldType from '../../../shared/InvalidFieldType';
import { deleteItem } from '../actions';
import { upcase } from '../../../../utils/string';
function getNameFromData (data) {
if (typeof data === 'object') {
if (typeof data.first === 'string' && typeof data.last === 'string') {
return data.first + ' ' + data.last;
} else if (data.id) {
return data.id;
}
}
return data;
}
function smoothScrollTop () {
if (document.body.scrollTop || document.documentElement.scrollTop) {
window.scrollBy(0, -50);
var timeOut = setTimeout(smoothScrollTop, 20);
} else {
clearTimeout(timeOut);
}
}
var EditForm = React.createClass({
displayName: 'EditForm',
propTypes: {
data: React.PropTypes.object,
list: React.PropTypes.object,
},
getInitialState () {
return {
values: assign({}, this.props.data.fields),
confirmationDialog: null,
loading: false,
lastValues: null, // used for resetting
focusFirstField: !this.props.list.nameField && !this.props.list.nameFieldIsFormHeader,
};
},
componentDidMount () {
this.__isMounted = true;
},
componentWillUnmount () {
this.__isMounted = false;
},
getFieldProps (field) {
const props = assign({}, field);
const alerts = this.state.alerts;
// Display validation errors inline
if (alerts && alerts.error && alerts.error.error === 'validation errors') {
if (alerts.error.detail[field.path]) {
// NOTE: This won't work yet, as ElementalUI doesn't allow
// passed in isValid, only invalidates via internal state.
// PR to fix that: https://github.com/elementalui/elemental/pull/149
props.isValid = false;
}
}
props.value = this.state.values[field.path];
props.values = this.state.values;
props.onChange = this.handleChange;
props.mode = 'edit';
return props;
},
handleChange (event) {
const values = assign({}, this.state.values);
values[event.path] = event.value;
this.setState({ values });
},
toggleDeleteDialog () {
this.setState({
deleteDialogIsOpen: !this.state.deleteDialogIsOpen,
});
},
toggleResetDialog () {
this.setState({
resetDialogIsOpen: !this.state.resetDialogIsOpen,
});
},
handleReset () {
this.setState({
values: assign({}, this.state.lastValues || this.props.data.fields),
resetDialogIsOpen: false,
});
},
handleDelete () {
const { data } = this.props;
this.props.dispatch(deleteItem(data.id, this.props.router));
},
handleKeyFocus () {
const input = this.refs.keyOrIdInput;
input.select();
},
removeConfirmationDialog () {
this.setState({
confirmationDialog: null,
});
},
updateItem () {
const { data, list } = this.props;
const editForm = this.refs.editForm;
const formData = new FormData(editForm);
// Show loading indicator
this.setState({
loading: true,
});
list.updateItem(data.id, formData, (err, data) => {
smoothScrollTop();
if (err) {
this.setState({
alerts: {
error: err,
},
loading: false,
});
} else {
// Success, display success flash messages, replace values
// TODO: Update key value
this.setState({
alerts: {
success: {
success: 'Your changes have been saved successfully',
},
},
lastValues: this.state.values,
values: data.fields,
loading: false,
});
}
});
},
renderKeyOrId () {
var className = 'EditForm__key-or-id';
var list = this.props.list;
if (list.nameField && list.autokey && this.props.data[list.autokey.path]) {
return (
<div className={className}>
<AltText
modified="ID:"
normal={`${upcase(list.autokey.path)}: `}
title="Press <alt> to reveal the ID"
className="EditForm__key-or-id__label" />
<AltText
modified={<input ref="keyOrIdInput" onFocus={this.handleKeyFocus} value={this.props.data.id} className="EditForm__key-or-id__input" readOnly />}
normal={<input ref="keyOrIdInput" onFocus={this.handleKeyFocus} value={this.props.data[list.autokey.path]} className="EditForm__key-or-id__input" readOnly />}
title="Press <alt> to reveal the ID"
className="EditForm__key-or-id__field" />
</div>
);
} else if (list.autokey && this.props.data[list.autokey.path]) {
return (
<div className={className}>
<span className="EditForm__key-or-id__label">{list.autokey.path}: </span>
<div className="EditForm__key-or-id__field">
<input ref="keyOrIdInput" onFocus={this.handleKeyFocus} value={this.props.data[list.autokey.path]} className="EditForm__key-or-id__input" readOnly />
</div>
</div>
);
} else if (list.nameField) {
return (
<div className={className}>
<span className="EditForm__key-or-id__label">ID: </span>
<div className="EditForm__key-or-id__field">
<input ref="keyOrIdInput" onFocus={this.handleKeyFocus} value={this.props.data.id} className="EditForm__key-or-id__input" readOnly />
</div>
</div>
);
}
},
renderNameField () {
var nameField = this.props.list.nameField;
var nameFieldIsFormHeader = this.props.list.nameFieldIsFormHeader;
var wrapNameField = field => (
<div className="EditForm__name-field">
{field}
</div>
);
if (nameFieldIsFormHeader) {
var nameFieldProps = this.getFieldProps(nameField);
nameFieldProps.label = null;
nameFieldProps.size = 'full';
nameFieldProps.autoFocus = true;
nameFieldProps.inputProps = {
className: 'item-name-field',
placeholder: nameField.label,
size: 'large',
};
return wrapNameField(
React.createElement(Fields[nameField.type], nameFieldProps)
);
} else {
return wrapNameField(
<h2>{this.props.data.name || '(no name)'}</h2>
);
}
},
renderFormElements () {
var headings = 0;
return this.props.list.uiElements.map((el, index) => {
// Don't render the name field if it is the header since it'll be rendered in BIG above
// the list. (see renderNameField method, this is the reverse check of the one it does)
if (
this.props.list.nameField
&& el.field === this.props.list.nameField.path
&& this.props.list.nameFieldIsFormHeader
) return;
if (el.type === 'heading') {
headings++;
el.options.values = this.state.values;
el.key = 'h-' + headings;
return React.createElement(FormHeading, el);
}
if (el.type === 'field') {
var field = this.props.list.fields[el.field];
var props = this.getFieldProps(field);
if (typeof Fields[field.type] !== 'function') {
return React.createElement(InvalidFieldType, { type: field.type, path: field.path, key: field.path });
}
props.key = field.path;
if (index === 0 && this.state.focusFirstField) {
props.autoFocus = true;
}
return React.createElement(Fields[field.type], props);
}
}, this);
},
renderFooterBar () {
const { loading } = this.state;
const loadingButtonText = loading ? 'Saving' : 'Save';
// Padding must be applied inline so the FooterBar can determine its
// innerHeight at runtime. Aphrodite's styling comes later...
return (
<FooterBar style={styles.footerbar}>
<div style={styles.footerbarInner}>
<LoadingButton
color="primary"
disabled={loading}
loading={loading}
onClick={this.updateItem}
data-button="update"
>
{loadingButtonText}
</LoadingButton>
<Button disabled={loading} onClick={this.toggleResetDialog} variant="link" color="cancel" data-button="reset">
<ResponsiveText
hiddenXS="reset changes"
visibleXS="reset"
/>
</Button>
{!this.props.list.nodelete && (
<Button disabled={loading} onClick={this.toggleDeleteDialog} variant="link" color="delete" style={styles.deleteButton} data-button="delete">
<ResponsiveText
hiddenXS={`delete ${this.props.list.singular.toLowerCase()}`}
visibleXS="delete"
/>
</Button>
)}
</div>
</FooterBar>
);
},
renderTrackingMeta () {
// TODO: These fields are visible now, so we don't want this. We may revisit
// it when we have more granular control over hiding fields in certain
// contexts, so I'm leaving this code here as a reference for now - JW
if (true) return null; // if (true) prevents unreachable code linter errpr
if (!this.props.list.tracking) return null;
var elements = [];
var data = {};
if (this.props.list.tracking.createdAt) {
data.createdAt = this.props.data.fields[this.props.list.tracking.createdAt];
if (data.createdAt) {
elements.push(
<FormField key="createdAt" label="Created on">
<FormInput noedit title={moment(data.createdAt).format('DD/MM/YYYY h:mm:ssa')}>{moment(data.createdAt).format('Do MMM YYYY')}</FormInput>
</FormField>
);
}
}
if (this.props.list.tracking.createdBy) {
data.createdBy = this.props.data.fields[this.props.list.tracking.createdBy];
if (data.createdBy && data.createdBy.name) {
let createdByName = getNameFromData(data.createdBy.name);
if (createdByName) {
elements.push(
<FormField key="createdBy" label="Created by">
<FormInput noedit>{data.createdBy.name.first} {data.createdBy.name.last}</FormInput>
</FormField>
);
}
}
}
if (this.props.list.tracking.updatedAt) {
data.updatedAt = this.props.data.fields[this.props.list.tracking.updatedAt];
if (data.updatedAt && (!data.createdAt || data.createdAt !== data.updatedAt)) {
elements.push(
<FormField key="updatedAt" label="Updated on">
<FormInput noedit title={moment(data.updatedAt).format('DD/MM/YYYY h:mm:ssa')}>{moment(data.updatedAt).format('Do MMM YYYY')}</FormInput>
</FormField>
);
}
}
if (this.props.list.tracking.updatedBy) {
data.updatedBy = this.props.data.fields[this.props.list.tracking.updatedBy];
if (data.updatedBy && data.updatedBy.name) {
let updatedByName = getNameFromData(data.updatedBy.name);
if (updatedByName) {
elements.push(
<FormField key="updatedBy" label="Updated by">
<FormInput noedit>{data.updatedBy.name.first} {data.updatedBy.name.last}</FormInput>
</FormField>
);
}
}
}
return Object.keys(elements).length ? (
<div className="EditForm__meta">
<h3 className="form-heading">Meta</h3>
{elements}
</div>
) : null;
},
render () {
return (
<form ref="editForm" className="EditForm-container">
{(this.state.alerts) ? <AlertMessages alerts={this.state.alerts} /> : null}
<Grid.Row>
<Grid.Col large="three-quarters">
<Form layout="horizontal" component="div">
{this.renderNameField()}
{this.renderKeyOrId()}
{this.renderFormElements()}
{this.renderTrackingMeta()}
</Form>
</Grid.Col>
<Grid.Col large="one-quarter"><span /></Grid.Col>
</Grid.Row>
{this.renderFooterBar()}
<ConfirmationDialog
confirmationLabel="Reset"
isOpen={this.state.resetDialogIsOpen}
onCancel={this.toggleResetDialog}
onConfirmation={this.handleReset}
>
<p>Reset your changes to <strong>{this.props.data.name}</strong>?</p>
</ConfirmationDialog>
<ConfirmationDialog
confirmationLabel="Delete"
isOpen={this.state.deleteDialogIsOpen}
onCancel={this.toggleDeleteDialog}
onConfirmation={this.handleDelete}
>
Are you sure you want to delete <strong>{this.props.data.name}?</strong>
<br />
<br />
This cannot be undone.
</ConfirmationDialog>
</form>
);
},
});
const styles = {
footerbar: {
backgroundColor: fade(theme.color.body, 93),
boxShadow: '0 -2px 0 rgba(0, 0, 0, 0.1)',
paddingBottom: 20,
paddingTop: 20,
zIndex: 99,
},
footerbarInner: {
height: theme.component.height, // FIXME aphrodite bug
},
deleteButton: {
float: 'right',
},
};
module.exports = EditForm;
|
node_modules/antd/es/breadcrumb/BreadcrumbItem.js
|
prodigalyijun/demo-by-antd
|
import _extends from 'babel-runtime/helpers/extends';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _createClass from 'babel-runtime/helpers/createClass';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
var __rest = this && this.__rest || function (s, e) {
var t = {};
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
}if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];
}return t;
};
import React from 'react';
import PropTypes from 'prop-types';
var BreadcrumbItem = function (_React$Component) {
_inherits(BreadcrumbItem, _React$Component);
function BreadcrumbItem() {
_classCallCheck(this, BreadcrumbItem);
return _possibleConstructorReturn(this, (BreadcrumbItem.__proto__ || Object.getPrototypeOf(BreadcrumbItem)).apply(this, arguments));
}
_createClass(BreadcrumbItem, [{
key: 'render',
value: function render() {
var _a = this.props,
prefixCls = _a.prefixCls,
separator = _a.separator,
children = _a.children,
restProps = __rest(_a, ["prefixCls", "separator", "children"]);
var link = void 0;
if ('href' in this.props) {
link = React.createElement(
'a',
_extends({ className: prefixCls + '-link' }, restProps),
children
);
} else {
link = React.createElement(
'span',
_extends({ className: prefixCls + '-link' }, restProps),
children
);
}
if (children) {
return React.createElement(
'span',
null,
link,
React.createElement(
'span',
{ className: prefixCls + '-separator' },
separator
)
);
}
return null;
}
}]);
return BreadcrumbItem;
}(React.Component);
export default BreadcrumbItem;
BreadcrumbItem.__ANT_BREADCRUMB_ITEM = true;
BreadcrumbItem.defaultProps = {
prefixCls: 'ant-breadcrumb',
separator: '/'
};
BreadcrumbItem.propTypes = {
prefixCls: PropTypes.string,
separator: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
href: PropTypes.string
};
|
test/js/release_test/PhysicsGroupTest.js
|
viromedia/viro
|
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import {
ViroScene,
ViroBox,
ViroMaterials,
ViroNode,
ViroImage,
ViroVideo,
ViroFlexView,
ViroUtils,
ViroText,
ViroQuad,
ViroSkyBox,
ViroSphere,
Viro3DObject,
ViroButton,
ViroSpinner,
ViroOmniLight,
ViroAnimations,
ViroDirectionalLight,
ViroController,
} from 'react-viro';
var createReactClass = require('create-react-class');
var LocalButtonImage = require("./res/icon_live.jpg");
var ReleaseMenu = require("./ReleaseMenu.js");
var GroupTestBasicPhysics = createReactClass({
getInitialState() {
return {
physicsEnabled:false,
gravityEnabled:false,
drawBounds:false,
toggleDraggable:false,
reset:false
};
},
togglePhysicsBody(tag){
return () => {
console.log("Click numeric tag: " + tag);
if (tag == 1){
this.setState({
physicsEnabled:!this.state.physicsEnabled
});
} else if (tag ==2){
this.setState({
gravityEnabled:!this.state.gravityEnabled
});
} else if (tag ==3){
this.setState({
drawBounds:!this.state.drawBounds
});
} else if (tag ==4){
this.setState({
toggleDraggable:!this.state.toggleDraggable
});
}
}
},
onDrag(objectTag){
return (dragtoPos, source) => {
console.log("GroupTest: " + objectTag+ " onDrag dragtoPos" +
dragtoPos[0] +","+ dragtoPos[1]+","+ dragtoPos[2]);
}
},
onReset(){
let that = this;
this.setState({
reset:true
});
setTimeout(function(){
that.setState({
reset:false
});
}, 500);
},
render: function() {
if (this.state.reset){
return (<ViroScene />);
}
return (
<ViroScene physicsWorld={{gravity:[0,-9.81,0],drawBounds:this.state.drawBounds}}>
<ReleaseMenu sceneNavigator={this.props.sceneNavigator}/>
<ViroNode position={[4 , -1, -3]} transformBehaviors={["billboard"]}>
<ViroText fontSize={35} style={styles.centeredText}
position={[0,2, 0]} width={4} height ={2} maxLines={3}
color={this.state.physicsEnabled ? '#0000ff' : '#ffffff'}
text={"Toggle PhysicsBody"} onClick={this.togglePhysicsBody(1)}/>
<ViroText fontSize={35} style={styles.centeredText}
position={[0,1, 0]} width={4} height ={2} maxLines={3}
color={this.state.gravityEnabled ? '#0000ff' : '#ffffff'}
text={"Toggle Gravity"} onClick={this.togglePhysicsBody(2)}/>
<ViroText fontSize={35} style={styles.centeredText}
position={[0,0, 0]} width={4} height ={2} maxLines={3}
color={this.state.drawBounds ? '#0000ff' : '#ffffff'}
text={"Toggle Collision Lines"} onClick={this.togglePhysicsBody(3)}/>
<ViroText fontSize={35} style={styles.centeredText}
position={[0,-1, 0]} width={4} height ={2} maxLines={3}
color={this.state.toggleDraggable ? '#0000ff' : '#ffffff'}
text={"Toggle Interactivity"} onClick={this.togglePhysicsBody(4)}/>
<ViroText fontSize={35} style={styles.centeredText}
position={[0,-2, 0]} width={4} height ={2} maxLines={3}
text={"Hard Reset."} onClick={this.onReset}/>
</ViroNode>
<ViroBox
physicsBody={{
type:'Static',
restitution:0.4
}}
position={[0, -6, -8]}
scale={[30,1,30]}
materials={["box2"]}
rotation={[0,0,0]}
height={1}
width={1}
length={1}
/>
<ViroNode position={[0.8 , 0, -3.5]} >
<Viro3DObject source={require('../res/heart.obj')}
scale={[1.8, 1.8, 1.8]}
position={[-3.2, 2.5, -4.5]}
materials={["heart"]}
type="OBJ"
onDrag={this.state.toggleDraggable ? this.onDrag("Viro3DObject") : undefined}
physicsBody={this.state.physicsEnabled?
{type:'Dynamic', mass:1, enabled:true, useGravity:this.state.gravityEnabled}:undefined}
/>
<ViroBox
position={[-1, 1, 0]}
scale={[0.4, 0.4, 0.4]}
materials={["redColor","blue","redColor","blue","redColor","blue"]}
height={1}
width={1}
length={1}
onDrag={this.state.toggleDraggable ? this.onDrag("ViroBox") : undefined}
physicsBody={this.state.physicsEnabled?
{type:'Dynamic', mass:1, enabled:true, useGravity:this.state.gravityEnabled}:undefined}
/>
<ViroButton
position={[0, 1, 0]}
scale={[0.2, 0.2, 0.1]}
source={LocalButtonImage}
hoverSource={LocalButtonImage}
clickSource={LocalButtonImage}
onDrag={this.state.toggleDraggable ? this.onDrag("ViroButton") : undefined}
physicsBody={this.state.physicsEnabled?
{ shape:{type:'Box', params:[0.2,0.2,0.05]}, type:'Dynamic', mass:1, enabled:true, useGravity:this.state.gravityEnabled}:undefined}
/>
<ViroFlexView
position={[1, 1, 0]}
scale={[0.3, 0.3, 0.1]}
materials={["redColor"]}
width={1}
height={1}
onDrag={this.state.toggleDraggable ? this.onDrag("ViroFlexView") : undefined}
physicsBody={this.state.physicsEnabled?
{type:'Dynamic', mass:1, enabled:true, shape:{type:'Box', params:[0.3,0.3,0.01]},
useGravity:this.state.gravityEnabled}:undefined}
/>
<ViroImage
width={1} height={1}
format="RGBA8" mipmap={true}
position={[-2, 0, 0]}
scale={[0.5, 0.5, 0.1]}
onDrag={this.state.toggleDraggable ? this.onDrag("ViroImage") : undefined}
physicsBody={this.state.physicsEnabled?
{type:'Dynamic', mass:1, enabled:true, useGravity:this.state.gravityEnabled}:undefined}
resizeMode="ScaleToFill"
imageClipMode="ClipToBounds"
source={{uri: "https://upload.wikimedia.org/wikipedia/commons/7/74/Earth_poster_large.jpg"}}/>
<ViroNode
position={[-1, 0, 0]}
scale={[0.5, 0.5, 0.1]}
onDrag={this.state.toggleDraggable ? this.onDrag("ViroNode") : undefined}
physicsBody={this.state.physicsEnabled?
{type:'Dynamic', mass:1, enabled:true, shape:{type:'box', params:[0.6,0.6,0.2]},
useGravity:this.state.gravityEnabled}:undefined}
rotation={[0,0,0]}>
<ViroText
style={styles.baseTextTwo}
text="This is a text in a ViroNode" />
</ViroNode>
<ViroSphere
position={[0, 0, 0]}
scale={[0.3, 0.3, 0.3]}
widthSegmentCount={5}
heightSegmentCount={5}
radius={1}
onDrag={this.state.toggleDraggable ? this.onDrag("ViroSphere") : undefined}
physicsBody={this.state.physicsEnabled?
{type:'Dynamic', mass:1, enabled:true, useGravity:this.state.gravityEnabled}:undefined}
materials={["redColor"]}
/>
<ViroSpinner
onDrag={this.state.toggleDraggable ? this.onDrag("ViroSpinner") : undefined}
physicsBody={this.state.physicsEnabled?
{type:'Dynamic', mass:1, enabled:true, shape:{type:'Box', params:[0.4,0.4,0.2]}, useGravity:this.state.gravityEnabled}:undefined}
position={[1, 0, 0]}
scale={[0.3, 0.3, 0.1]}/>
<ViroQuad
onDrag={this.state.toggleDraggable ? this.onDrag("ViroQuad") : undefined}
physicsBody={this.state.physicsEnabled?
{type:'Dynamic', mass:1, enabled:true, useGravity:this.state.gravityEnabled}:undefined}
position={[-2, -1, 0]}
scale={[0.5, 0.5, 0.1]}
materials={["redColor"]}
width={1}
height={1}/>
<ViroText
onDrag={this.state.toggleDraggable ? this.onDrag("ViroText") : undefined}
physicsBody={this.state.physicsEnabled?
{type:'Dynamic', mass:1, enabled:true, useGravity:this.state.gravityEnabled}:undefined}
position={[-0.5, -1.7, 0]}
width={2} height ={2}
style={styles.baseTextTwo}
text={"This is a Viro Text"}/>
<ViroVideo
onDrag={this.state.toggleDraggable ? this.onDrag("ViroVideo") : undefined}
physicsBody={this.state.physicsEnabled?
{type:'Dynamic', mass:1, enabled:true, useGravity:this.state.gravityEnabled}:undefined}
position={[0 , -1,0]}
scale={[0.1, 0.1, 0.1]}
height={4} width={4}
rotation={[0,0,-45]}
loop={false}
source={{"uri":"https://s3-us-west-2.amazonaws.com/viro/Climber1Top.mp4"}} />
<ViroNode
scale={[0.2, 0.2, 0.2]}
position={[3, -1, 0]}
onDrag={this.state.toggleDraggable ? this.onDrag("CompoundNode") : undefined}
physicsBody={this.state.physicsEnabled?
{type:'Dynamic', mass:1, enabled:true, restitution:1, shape:{type:'Compound'},
useGravity:this.state.gravityEnabled}:undefined}
rotation={[0,0,-90]}>
<ViroBox
position={[-0.5,0,0]}
scale={[1, 1, 1]}
materials={'blue'}
height={1} width={1} length={1}
/>
<ViroBox
position={[0.5,0,0]}
scale={[1, 1, 1]}
materials={'blue'}
height={1} width={1} length={1}
/>
<ViroBox
position={[-1.5,0,0]}
scale={[1, 1, 1]}
materials={'blue'}
height={1} width={1} length={1}
/>
<ViroBox
position={[0,-0.5,0]}
scale={[1, 1, 1]}
materials={'blue'}
height={1} width={1} length={1}
/>
<ViroBox
position={[0,-1.5,0]}
scale={[1, 1, 1]}
materials={'blue'}
height={1} width={1} length={1}
/>
<ViroBox
position={[0,-2.5,0]}
scale={[1, 1, 1]}
materials={'blue'}
height={1} width={1} length={1}
/>
</ViroNode>
</ViroNode>
<ViroOmniLight
position={[0, 0, 0]}
color={"#ffffff"}
attenuationStartDistance={30}
attenuationEndDistance={40}/>
</ViroScene>
);
},
});
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
elementText: {
fontFamily: 'HelveticaNeue-Medium',
fontSize: 30,
color: '#ffffff',
textAlign: 'center',
},
baseTextTwo: {
fontFamily: 'Arial',
color: '#ffffff',
flex: 1,
},
centeredText: {
fontFamily: 'Arial',
flex: 1,
},
});
ViroMaterials.createMaterials({
redColor: {
shininess: 2.0,
diffuseColor: "#ff0000"
},
box2: {
shininess : 2.0,
diffuseColor: "#F0F099",
},
blue: {
shininess: 2.0,
diffuseColor: "#0000ff"
},
heart: {
lightingModel: "Phong",
diffuseTexture: require('../res/heart_d.jpg'),
},
});
module.exports = GroupTestBasicPhysics;
|
lib/components/displayConversation.js
|
jksmall0631/shoot-da-breeze
|
import React from 'react';
import DisplayMessage from './DisplayMessage';
const DisplayConversation = ({messages, userMessages, reverse})=>{
if(userMessages) {
if(reverse){
return (
<ul className="message-container">
{userMessages.reverse().map((message) => {
return (<DisplayMessage key={message.id} timestamp={message.id} title={message.title} user={message.user} />)
})
}
</ul>
)
}
return (
<ul className="message-container">
{userMessages.map((message) => {
return (<DisplayMessage key={message.id} timestamp={message.id} title={message.title} user={message.user} />)
})
}
</ul>
)
}
else if(messages.length > 0) {
if(reverse){
return (
<ul className="message-container">
{messages.reverse().map((message) => {
return (<DisplayMessage key={message.id} timestamp={message.id} title={message.title} user={message.user} />)
})
}
</ul>
)
}
return (
<ul className="message-container">
{messages.map((message) => {
return (<DisplayMessage key={message.id} timestamp={message.id} title={message.title} user={message.user} message={message}/>)
})
}
</ul>
)
}
return(
<div>
<h1></h1>
</div>
)
}
export default DisplayConversation;
|
source/containers/ContentPage/index.js
|
mikey1384/twin-kle
|
import React from 'react';
import PropTypes from 'prop-types';
import { Route, Switch } from 'react-router-dom';
import NotFound from 'components/NotFound';
import { css } from 'emotion';
import { mobileMaxWidth } from 'constants/css';
import Content from './Content';
ContentPage.propTypes = {
match: PropTypes.object.isRequired
};
export default function ContentPage({ match }) {
return (
<div
className={css`
width: 100%;
display: flex;
justify-content: center;
margin-top: 1rem;
margin-bottom: 1rem;
padding-bottom: 20rem;
`}
>
<section
className={css`
width: 65%;
@media (max-width: ${mobileMaxWidth}) {
width: 100%;
min-height: 100vh;
}
`}
>
<Switch>
<Route exact path={`${match.url}/:contentId`} component={Content} />
<Route component={NotFound} />
</Switch>
</section>
</div>
);
}
|
react-ui/src/components/shared/GenericLoader.js
|
EdwinJow/truthindata
|
import React, { Component } from 'react';
import '../../css/shared/generic-loader.min.css';
class GenericLoader extends Component {
constructor(props) {
super(props);
this.state = {
open: props.open
};
}
componentWillReceiveProps(nextProps) {
if (nextProps.open !== this.state.open) {
this.setState({ open: nextProps.open });
}
}
render() {
return (
<div id="generic-loader" className={this.state.open ? '' : 'hidden' }>
<div className="center-element">
<img src={require("../../images/loaders/ripple.svg")} alt="loader"/>
</div>
</div>
);
}
}
export default GenericLoader;
|
src/svg-icons/notification/do-not-disturb.js
|
nathanmarks/material-ui
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let NotificationDoNotDisturb = (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 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"/>
</SvgIcon>
);
NotificationDoNotDisturb = pure(NotificationDoNotDisturb);
NotificationDoNotDisturb.displayName = 'NotificationDoNotDisturb';
NotificationDoNotDisturb.muiName = 'SvgIcon';
export default NotificationDoNotDisturb;
|
beta/frontend-frameworks/calculator/src/main.js
|
GregoryGoncalves/freecodecamp
|
/*
Author: Selhar
Date: 2017
Contact: selhar@protonmail.com
License: GPL
*/
import React from 'react';
import {render} from 'react-dom';
import {Provider} from 'react-redux';
import Index from './components/indexComponent';
import store from './store';
const css = require('./main.scss');
render(
<Provider store={store}>
<Index />
</Provider>,
document.getElementById('main')
);
|
node_modules/react-router/es6/IndexRoute.js
|
laere/country-news
|
'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
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; }
import warning from 'warning';
import invariant from 'invariant';
import React, { Component } from 'react';
import { createRouteFromReactElement } from './RouteUtils';
import { component, components, falsy } from './PropTypes';
var func = React.PropTypes.func;
/**
* An <IndexRoute> is used to specify its parent's <Route indexRoute> in
* a JSX route config.
*/
var IndexRoute = (function (_Component) {
_inherits(IndexRoute, _Component);
function IndexRoute() {
_classCallCheck(this, IndexRoute);
_Component.apply(this, arguments);
}
/* istanbul ignore next: sanity check */
IndexRoute.prototype.render = function render() {
!false ? process.env.NODE_ENV !== 'production' ? invariant(false, '<IndexRoute> elements are for router configuration only and should not be rendered') : invariant(false) : undefined;
};
return IndexRoute;
})(Component);
IndexRoute.propTypes = {
path: falsy,
component: component,
components: components,
getComponent: func,
getComponents: func
};
IndexRoute.createRouteFromReactElement = function (element, parentRoute) {
/* istanbul ignore else: sanity check */
if (parentRoute) {
parentRoute.indexRoute = createRouteFromReactElement(element);
} else {
process.env.NODE_ENV !== 'production' ? warning(false, 'An <IndexRoute> does not make sense at the root of your route config') : undefined;
}
};
export default IndexRoute;
|
src/js/ui/components/tabMenu.js
|
hiddentao/heartnotes
|
import _ from 'lodash';
import React from 'react';
import Classnames from 'classnames';
var Tab = React.createClass({
propTypes: {
data: React.PropTypes.object.isRequired,
onSelect: React.PropTypes.func.isRequired,
active: React.PropTypes.bool,
attention: React.PropTypes.object,
},
render: function() {
let classes = {
'tab': true,
active: !!this.props.active,
attention: null,
};
let attention = null;
if (this.props.attention) {
attention = (
<div className="attention">{this.props.attention}</div>
);
}
return (
<div className={Classnames(classes)} onClick={this._onClick}>
{attention}
<div className="text">{this.props.data.desc}</div>
</div>
);
},
_onClick: function() {
this.props.onSelect(this.props.data);
},
});
module.exports = React.createClass({
propTypes: {
items: React.PropTypes.array.isRequired,
selectedItem: React.PropTypes.string.isRequired,
onSelect: React.PropTypes.func.isRequired,
className: React.PropTypes.string,
},
getDefaultProps: function() {
return {
className: null,
}
},
render: function() {
let { items, className, selectedItem } = this.props;
var primaryLinks = [];
items.forEach((item) => {
let attention = null;
if (item.showIf) {
if (!item.showIf.call(this)) {
return;
}
}
if (item.attention) {
attention = item.attention.call(this);
}
primaryLinks.push(
<Tab
key={item.id}
data={item}
active={item.id === this.props.selectedItem}
attention={attention}
onSelect={this.props.onSelect} />
);
});
let classes = Classnames('tab-menu', className);
return (
<div className={classes}>
{primaryLinks}
</div>
);
},
});
|
src/components/LandingStatic/LandingNavItems.js
|
ortonomy/flingapp-frontend
|
import React from 'react';
// library dependencies
import { Link } from 'react-router-dom';
// styles
import styles from './LandingNav.module.css';
const LandingNavItems = ({ items, ...props}) => {
return (
<div className={styles.NavBarNavItems}>
{
items && items.map( (item, i) => {
return (
<div key={i}>
{ item.href ? (<Link to={item.href} ><span>{item.text}</span></Link>) : (<span>{item.text}</span>)}
</div>
)
})
}
</div>
);
}
export default LandingNavItems;
|
components/person-view.js
|
pho3nixf1re/followupboss-example
|
import React from 'react';
import isEmpty from 'lodash/isEmpty';
import State from 'lib/state';
import {actions as peopleActions} from 'lib/reactions/people';
import Person from 'components/person';
const PersonView = React.createClass({
propTypes: {
state: React.PropTypes.object,
params: React.PropTypes.shape({
id: React.PropTypes.string
}).isRequired
},
componentDidMount() {
let { data, loading, params } = this.props;
let noActivePerson = isEmpty(data) && !loading;
let { id } = params;
if (noActivePerson || data.id != id) {
State.trigger(peopleActions.SET_ACTIVE_PERSON, { id: id });
}
},
render() {
let { data, loading } = this.props.state.activePerson;
return <Person person={data} loading={loading} />;
}
});
export default PersonView;
|
kitsune/sumo/static/sumo/js/tests/crashidtests.js
|
mythmon/kitsune
|
import {default as mochaJsdom, rerequire} from 'mocha-jsdom';
import {expect} from 'chai';
import React from 'react';
import mochaK from './fixtures/mochaK.js';
import mochaJquery from './fixtures/mochaJquery.js';
import mochaGettext from './fixtures/mochaGettext.js';
import mochaMarky from './fixtures/mochaMarky.js';
describe('k', () => {
mochaJsdom({useEach: true});
mochaJquery();
mochaK();
mochaGettext();
mochaMarky();
/* globals window, document, $, k */
describe('linkCrashIds', () => {
beforeEach(() => {
rerequire('../questions.js');
});
afterEach(() => {
React.unmountComponentAtNode(document.body);
});
it('should link one crash ID', () => {
let sandbox = (
<section>
<h1>Firefox keeps crashing</h1>
<p>Firefox keeps crashing</p>
<p>
This is my crash ID:<br/>
bp-6ec83338-f37e-4ee1-aef4-0e66c2120808
</p>
<div className="stem"></div>
</section>
);
React.render(sandbox, document.body);
k.linkCrashIds($('body'));
expect($('.crash-report').length).to.equal(1);
});
it('should link multiple crash IDs', function() {
let sandbox = (
<section>
<h1>Firefox keeps crashing</h1>
<p>Firefox keeps crashing</p>
<p>
Here's a list of my crash IDs (copied directly from about:crashes):<br/>
bp-6ec83338-f37e-4ee1-aef4-0e66c212080808.08.1217:52
bp-d8951614-c928-44ed-902c-6ccb6212080808.08.1217:52
bp-5eb7d4ec-5f9e-4cbf-9335-a574c212071717.07.1211:29
bp-15a73687-dabf-4014-9c03-b97b3212071717.07.1211:27
bp-f894adf7-9ff8-4f21-8564-da425212071111.07.1218:22
</p>
<div className="stem"></div>
</section>
);
React.render(sandbox, document.body);
k.linkCrashIds($('body'));
expect($('.crash-report').length).to.equal(5);
});
it("shouldn't link invalid crash IDs", function() {
let sandbox = (
<section>
<p>The following will look like an invalid crash ID that hasn't been processed yet:</p>
<p>765879E6-CFE7-43A7-BE93-B2F322E67649</p>
</section>
);
React.render(sandbox, document.body);
k.linkCrashIds($('body'));
expect($('.crash-report').length).to.equal(0);
});
it("shouldn't link crash IDs without 'bp-'", function() {
let sandbox = (
<section>
<p>Now, crash IDs without 'bp-' at the beginning shouldn't get linked either</p>
<p>6ec83338-f37e-4ee1-aef4-0e66c2120808</p>
</section>
);
React.render(sandbox, document.body);
k.linkCrashIds($('body'));
expect($('.crash-report').length).to.equal(0);
});
});
});
|
docs/src/app/components/pages/get-started/ServerRendering.js
|
mtsandeep/material-ui
|
import React from 'react';
import Title from 'react-title-component';
import MarkdownElement from '../../MarkdownElement';
import serverRenderingText from './server-rendering.md';
const ServerRendering = () => (
<div>
<Title render={(previousTitle) => `Server Rendering - ${previousTitle}`} />
<MarkdownElement text={serverRenderingText} />
</div>
);
export default ServerRendering;
|
client/components/HomePage.js
|
GO345724/pair-programming
|
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import * as problemsActions from '../actions/problemsActions';
import * as userActions from '../actions/userActions.js';
import ChooseUserName from './ChooseUserName';
import ProblemsList from './ProblemsList';
class HomePage extends Component {
constructor(props) {
super(props);
this.chooseUserName = this.chooseUserName.bind(this);
}
componentDidMount() {
if (this.props.problems.length == 0) {
this.props.actions.getProblems();
}
}
chooseUserName(userName) {
this.props.actions.assignUserName(userName);
}
render() {
return(
<div>
<ChooseUserName userName={this.props.userName} chooseUserName={this.chooseUserName} />
<ProblemsList problems={this.props.problems} />
</div>
)
}
}
HomePage.propTypes = {
userName: PropTypes.string.isRequired,
problems: PropTypes.array.isRequired,
actions: PropTypes.object.isRequired
}
const mapStateToProps = state => {
return {problems: state.problems, userName: state.currentUser}
}
const mapDispatchToProps = dispatch => {
return {actions: bindActionCreators(Object.assign(userActions, problemsActions), dispatch)}
}
export default connect(mapStateToProps, mapDispatchToProps)(HomePage);
|
src/routes/hat/Hat.js
|
macdja38/pvpsite
|
/**
* 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, { Component } from 'react';
import PropTypes from 'prop-types';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import { fabric } from 'fabric-webpack';
import Layout from '../../components/Layout';
import s from './Hat.css';
class Hat extends Component {
static propTypes = {
user: PropTypes.object,
userId: PropTypes.string,
userHash: PropTypes.string,
};
constructor({ user, userId, userHash }) {
super({ user, userId, userHash });
}
componentDidMount() {
let id;
let hash;
if (this.props.userId) {
id = this.props.userId;
} else if (this.props.user) {
id = this.props.user.id;
}
if (this.props.userHash) {
hash = this.props.userHash;
} else if (this.props.user) {
hash = this.props.user.avatar;
}
// const hatURL = 'https://cdn.discordapp.com/attachments/116405078889332743/119653981776642049/hat.png';
// const avatarURL = `https://discordapp.com/api/users/${id}/avatars/${hash}.jpg`;
const hatURL = '/api/v1/attachments/116405078889332743/119653981776642049/hat.png';
const avatarURL = `/api/v1/avatar/${id}/${hash}/`;
var canvas = new fabric.Canvas("profilePicArea");
canvas.setHeight(256).setWidth(256).setZoom(2);
fabric.util.loadImage("${avatarURL}", function(avatarImageElement, error) {
canvas.setBackgroundImage(new fabric.Image(avatarImageElement), (avatarImage) => {
canvas.renderAll.call(canvas);
fabric.util.loadImage("${hatURL}", function(hatImageElement, error) {
var hatImage = new fabric.Image(hatImageElement).scaleToWidth(100).set({
angle: 15,
borderColor: "#2c2f33",
cornerColor: "#2c2f33",
cornerSize: 9,
left: 45,
top: -35
})
canvas.add(hatImage);
});
}, {
width: 128,
height: 128,
originX: 0,
originY: 0
});
});
var downloadButton = document.getElementById("downloadButton");
downloadButton.addEventListener("click", () => {
downloadButton.href = canvas.toDataURL({
format: "jpeg",
height: 256,
multiplier: 0.5,
width: 256
});
downloadButton.download = "avatar.jpg";
}, false);
}
render() {
let id;
let hash;
if (this.props.userId) {
id = this.props.userId;
} else if (this.props.user) {
id = this.props.user.id;
}
if (this.props.userHash) {
hash = this.props.userHash;
} else if (this.props.user) {
hash = this.props.user.avatar;
}
// const hatURL = 'https://cdn.discordapp.com/attachments/116405078889332743/119653981776642049/hat.png';
// const avatarURL = `https://discordapp.com/api/users/${id}/avatars/${hash}.jpg`;
const hatURL = '/api/v1/attachments/116405078889332743/119653981776642049/hat.png';
const avatarURL = `/api/v1/avatar/${id}/${hash}/`;
return (
<Layout user={this.props.user}>
<div className={s.root}>
<div className={s.container}>
<h1 className={s.title}>PvPCraft Discord bot.</h1>
<p>
<canvas
id="profilePicArea"
style={{ position: 'absolute', width: '256px', height: '256px', left: 0, top: 0 }}
width="256" height="256"
/>
<input id="downloadButton" type="button" />
</p>
</div>
</div>
</Layout>
);
}
}
export default withStyles(s)(Hat);
|
src/React/Widgets/NumberSliderWidget/example/index.js
|
Kitware/paraviewweb
|
import 'normalize.css';
import React from 'react';
import ReactDOM from 'react-dom';
import NumberSliderWidget from 'paraviewweb/src/React/Widgets/NumberSliderWidget';
class ColorField extends React.Component {
constructor(props) {
super(props);
this.state = {
r: 30,
g: 60,
b: 90,
};
// Bind callback
this.updateVal = this.updateVal.bind(this);
this.drawColor = this.drawColor.bind(this);
}
componentDidMount() {
this.drawColor();
}
componentDidUpdate() {
this.drawColor();
}
updateVal(e) {
const which = e.target.name;
const newVal = e.target.value;
const toUpdate = {};
toUpdate[which] = newVal;
this.setState(toUpdate);
}
drawColor() {
const ctx = this.canvas.getContext('2d');
const width = ctx.canvas.width;
const height = ctx.canvas.height;
ctx.fillStyle = `rgb(${this.state.r}, ${this.state.g}, ${this.state.b})`;
ctx.rect(0, 0, width, height);
ctx.fill();
}
render() {
const [r, g, b] = [this.state.r, this.state.g, this.state.b];
return (
<section style={{ margin: '20px' }}>
<NumberSliderWidget
value={r}
max="255"
min="0"
onChange={this.updateVal}
name="r"
/>
<NumberSliderWidget
value={g}
max="255"
min="0"
onChange={this.updateVal}
name="g"
/>
<NumberSliderWidget
value={b}
max="255"
min="0"
onChange={this.updateVal}
name="b"
/>
<canvas
ref={(c) => {
this.canvas = c;
}}
width="50"
height="50"
/>
</section>
);
}
}
ReactDOM.render(<ColorField />, document.querySelector('.content'));
|
frontend/src/components/popup/ProductDetails.js
|
jirkae/BeerCheese
|
import React from 'react';
import { Modal, ModalBody, Container, Row, Col } from 'reactstrap';
export default props => {
return (
<Modal isOpen={true} toggle={props.hideModals}>
<ModalBody>
<Container>
<Row>
<Col>
<Row>
{props.data.name}
</Row>
<Row>
<img
src="https://placeholdit.imgix.net/~text?txtsize=33&txt=318%C3%97180&w=318&h=180"
alt="Card cap"
/>
</Row>
<Row>
{props.data.price}
</Row>
</Col>
<Col>
{props.data.description}
</Col>
</Row>
</Container>
</ModalBody>
</Modal>
);
};
|
resource/js/components/Page/PageBody.js
|
kyonmm/crowi
|
import React from 'react';
export default class PageBody extends React.Component {
constructor(props) {
super(props);
this.crowiRenderer = window.crowiRenderer; // FIXME
this.getMarkupHTML = this.getMarkupHTML.bind(this);
}
getMarkupHTML() {
let body = this.props.pageBody;
if (body === '') {
body = this.props.page.revision.body;
}
return { __html: this.crowiRenderer.render(body) };
}
render() {
const parsedBody = this.getMarkupHTML();
return (
<div
className="content"
dangerouslySetInnerHTML={parsedBody}
/>
);
}
}
PageBody.propTypes = {
page: React.PropTypes.object.isRequired,
pageBody: React.PropTypes.string,
};
PageBody.defaultProps = {
page: {},
pageBody: '',
};
|
packages/material-ui-icons/src/CheckCircle.js
|
dsslimshaddy/material-ui
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from 'material-ui/SvgIcon';
let CheckCircle = 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 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" />
</SvgIcon>;
CheckCircle = pure(CheckCircle);
CheckCircle.muiName = 'SvgIcon';
export default CheckCircle;
|
src/svg-icons/notification/sync.js
|
ArcanisCz/material-ui
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let NotificationSync = (props) => (
<SvgIcon {...props}>
<path d="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"/>
</SvgIcon>
);
NotificationSync = pure(NotificationSync);
NotificationSync.displayName = 'NotificationSync';
NotificationSync.muiName = 'SvgIcon';
export default NotificationSync;
|
Realization/frontend/czechidm-core/src/components/basic/Table/LinkCell.js
|
bcvsolutions/CzechIdMng
|
import React from 'react';
import { Link } from 'react-router-dom';
import pathToRegexp from 'path-to-regexp';
import _ from 'lodash';
//
import { SecurityManager } from '../../../redux';
import DefaultCell from './DefaultCell';
import Popover from '../Popover/Popover';
import Button from '../Button/Button';
// TODO: Localization service could not be accessed directly (advadced component)
import { LocalizationService } from '../../../services';
const TARGET_PARAMETER = '_target';
/**
* Fills href parameter values from ginen rowData / entity object.
*
* @param {string} to href
* @param {object} rowData entity
* @return {string} formated href
*
* @author Radek Tomiška
*/
function _resolveToWithParameters(to, rowData, target) {
const parameterNames = pathToRegexp.parse(to);
parameterNames.forEach(parameter => {
if (parameter && parameter.name === TARGET_PARAMETER && target) {
const targetValue = DefaultCell.getPropertyValue(rowData, target);
if (targetValue) {
to = to.replace(`:${TARGET_PARAMETER}`, targetValue);
}
}
});
const thingPath = pathToRegexp.compile(to);
return thingPath(rowData);
}
function _linkFunction(to, rowIndex, data, event) {
if (event) {
event.preventDefault();
}
if (to) {
to({ rowIndex, data, event });
}
}
/**
* Renders cell with link and text content.
* Parametrs are automatically propagated from table / row / column
* @param number rowIndex
* @param array[json] input data
* @param property column key
* @param to - router link
* @param className className
* @param title - html title
* @param target - optional entity property could be used as `_target` property in `to` property.
* @param access - link could be accessed, if current user has access to target agenda. Otherwise propertyValue without link is rendered.
* @param props other optional properties
*
* @author Radek Tomiška
*/
const LinkCell = ({ rowIndex, data, property, to, href, className, title, target, access, ...props }) => {
const propertyValue = DefaultCell.getPropertyValue(data[rowIndex], property);
const accessItems = (access && !Array.isArray(access)) ? [access] : access;
// when is property and accessItems null, then return only default cell
if (!propertyValue) {
return <DefaultCell { ...props }/>;
}
// construct html link href
let _href = '#';
if (_.isFunction(to) && href) {
if (_.isFunction(href)) {
_href = href({ data, rowIndex, property});
} else {
_href = href;
}
}
//
return (
<DefaultCell { ...props }>
{
(accessItems && !SecurityManager.hasAccess(accessItems))
?
<span>
{
SecurityManager.isDenyAll(accessItems)
?
propertyValue
:
<Popover
level="warning"
title={ LocalizationService.i18n('security.access.link.denied') }
value={
<span>
{
[...accessItems.map((accessItem) => {
if (SecurityManager.hasAccess(accessItem)) {
return null;
}
return (
<div>
{/* TODO: make appropriate enum and refactor security service etc. */}
<strong>{ LocalizationService.i18n(`enums.AccessTypeEnum.${accessItem.type}`) }</strong>
{
!accessItem.authorities
||
<span>
: <div>{ accessItem.authorities.join(', ') }</div>
</span>
}
</div>
);
}).values()]
}
</span>
}>
<Button level="link" style={{ padding: 0 }}>{ propertyValue }</Button>
</Popover>
}
</span>
:
<span>
{
_.isFunction(to)
?
<Link
to={ _href }
onClick={ _linkFunction.bind(this, to, rowIndex, data) }
title={ title }>
{ propertyValue }
</Link>
:
<Link to={ _resolveToWithParameters(to, data[rowIndex], target) } title={ title } className={ className }>
{ propertyValue }
</Link>
}
</span>
}
</DefaultCell>
);
};
export default LinkCell;
|
geonode/contrib/monitoring/frontend/src/components/molecules/ws-service-select/index.js
|
timlinux/geonode
|
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import DropDownMenu from 'material-ui/DropDownMenu';
import MenuItem from 'material-ui/MenuItem';
import actions from './actions';
const mapStateToProps = (state) => ({
services: state.wsServices.response,
selected: state.wsService.service,
});
@connect(mapStateToProps, actions)
class WSServiceSelect extends React.Component {
static propTypes = {
selected: PropTypes.string,
services: PropTypes.object,
getServices: PropTypes.func.isRequired,
setService: PropTypes.func.isRequired,
}
constructor(props) {
super(props);
this.handleServiceSelect = (event, index, value) => {
this.props.setService(value);
};
}
componentWillMount() {
this.props.getServices();
}
componentWillReceiveProps(nextProps) {
if (this.props.selected) {return;}
const services = nextProps.services;
if (services && services.ows_services && services.ows_services.length > 0) {
this.props.setService(services.ows_services[0].name);
}
}
render() {
const items = this.props.services
? this.props.services.ows_services.map(service => (
<MenuItem
key={service.name}
value={service.name}
primaryText={service.name}
/>
))
: [];
return (
<DropDownMenu
value={this.props.selected}
onChange={this.handleServiceSelect}
>
{items}
</DropDownMenu>
);
}
}
export default WSServiceSelect;
|
src/components/SurveyPage/__tests__/surveypage-tests.js
|
mattroid/turboiep
|
/* global define, it, describe, expect */
jest.dontMock('../SurveyPage'); // eslint-disable-line no-undef
import React from 'react'
// import ReactDOM from 'react-dom'
import TestUtils from 'react-addons-test-utils'
const SurveyPage = require('../SurveyPage')
describe('profile page', () => {
it('should exist', () => {
const surveyPage = TestUtils.renderIntoDocument(
<SurveyPage />
);
expect(TestUtils.isCompositeComponent(surveyPage)).toBeTruthy()
});
});
|
docs/src/CodeExample.js
|
HorizonXP/react-bootstrap
|
import React from 'react';
export default class CodeExample extends React.Component {
render() {
return (
<pre className="cm-s-solarized cm-s-light">
<code>
{this.props.codeText}
</code>
</pre>
);
}
componentDidMount() {
if (CodeMirror === undefined) {
return;
}
CodeMirror.runMode(
this.props.codeText,
this.props.mode,
React.findDOMNode(this).children[0]
);
}
}
|
packages/mineral-ui-icons/src/IconNearMe.js
|
mineral-ui/mineral-ui
|
/* @flow */
import React from 'react';
import Icon from 'mineral-ui/Icon';
import type { IconProps } from 'mineral-ui/Icon/types';
/* eslint-disable prettier/prettier */
export default function IconNearMe(props: IconProps) {
const iconProps = {
rtl: false,
...props
};
return (
<Icon {...iconProps}>
<g>
<path d="M21 3L3 10.53v.98l6.84 2.65L12.48 21h.98L21 3z"/>
</g>
</Icon>
);
}
IconNearMe.displayName = 'IconNearMe';
IconNearMe.category = 'maps';
|
packages/cf-component-label/example/basic/component.js
|
mdno/mdno.github.io
|
import React from 'react';
import { Label } from 'cf-component-label';
const LabelComponent = () => (
<p>
<Label type="default">Default</Label>
<Label type="info">Info</Label>
<Label type="success">Success</Label>
<Label type="warning">Warning</Label>
<Label type="error">Error</Label>
</p>
);
export default LabelComponent;
|
mla_game/front-end/javascript/components/partials/menu_footer.js
|
WGBH/FixIt
|
import React from 'react'
import Modal from 'react-modal'
import { PopupCenter } from '../../helpers'
import { patchData } from '../../helpers'
class MenuFooter extends React.Component {
constructor(){
super()
this.setModal = this.setModal.bind(this)
this.closeModal = this.closeModal.bind(this)
this.sharePopUp = this.sharePopUp.bind(this)
this.pushComplete = this.pushComplete.bind(this)
this.state = {
modalOpen:false
}
}
setModal(){
let open = this.state.modalOpen
if(open) {
this.setState({modalOpen:false})
} else {
this.setState({modalOpen:true})
}
}
closeModal(){
this.setState({modalOpen:false})
}
sharePopUp(url, id, ){
PopupCenter(url, id, '600', '500')
}
pushComplete(){
if(this.props.endOfRound) {
let user = this.props.user,
data ={
"completed":this.props.endOfRound
}
patchData(`/api/profile/${user}/completed/`, data)
this.props.updateScore(this.props.gameScore)
} else {
return false
}
}
componentDidMount(){
this.pushComplete()
}
render(){
return(
<div className="share-block">
<span className="social-label">Share:</span>
<ul>
<li>
<button onClick={() => this.sharePopUp('https://www.facebook.com/sharer/sharer.php?u=http%3A//fixit.americanarchive.org/', 'Facebook_Share')}>
<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 200 200">
<path className="background" fill="#6d6e71" d="M100 0a100 100 0 1 0 100 100A100 100 0 0 0 100 0z"/>
<path fill="#fff" d="M124.44 67.46H113.3c-4.44 0-5.37 1.86-5.37 6.55v10.3h16.5l-1.72 16.83h-14.75V160H83.17v-58.9h-16.5V84.3h16.5V64.86c0-14.88 7.68-22.65 25-22.65h16.27z"/>
</svg>
</button>
</li>
<li>
<button onClick={() => this.sharePopUp("https://twitter.com/home?status=I'm%20helping%20make%20public%20media's%20archive%20accessible%20by%20playing%20%40amarchivepub's%20FIX%20IT%20game.%20Join%20me%3A%20http%3A//fixit.americanarchive.org%20%23fixitaapb", 'Twitter_Share')}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200">
<path className="background" fill="#6d6e71" d="M100 0a100 100 0 1 0 100 100A100 100 0 0 0 100 0z"/>
<path fill="#fff" d="M150.4 81.58c1.5 33.93-23.4 71.75-67.4 71.75a66.25 66.25 0 0 1-36.34-10.84 47.12 47.12 0 0 0 35.1-10 23.82 23.82 0 0 1-22.16-16.77 23.4 23.4 0 0 0 10.7-.4 24.07 24.07 0 0 1-19-24A23.35 23.35 0 0 0 62 94.4a24.4 24.4 0 0 1-7.34-32.2 66.93 66.93 0 0 0 48.87 25.2c-3.46-15.08 7.8-29.62 23.1-29.62a23.5 23.5 0 0 1 17.37 7.6 46.8 46.8 0 0 0 15-5.84 24.15 24.15 0 0 1-10.43 13.34 46.67 46.67 0 0 0 13.6-3.8 48.06 48.06 0 0 1-11.82 12.5z" className="cls-2"/>
</svg>
</button>
</li>
<li>
<button onClick={() => this.sharePopUp("https://www.linkedin.com/shareArticle?mini=true&url=http%3A//fixit.americanarchive.org/&title=FIX%20IT&summary=I'm%20helping%20make%20public%20media's%20archive%20accessible%20by%20playing%20%40amarchivepub's%20FIX%20IT%20game.%20Join%20me%3A%20http%3A//fixit.americanarchive.org%20%23fixitaapb&source=", 'Linkedin_Share')}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200">
<circle className="background" fill="#6d6e71" cx="100" cy="100" r="100"/>
<path fill="#fff" d="M50.37 79.5h22.38v72H50.37zm11.2-9.85a13 13 0 1 1 13-13 13 13 0 0 1-13 13zm95.03 81.85h-22.4v-35c0-8.34-.15-19.08-11.63-19.08-11.65 0-13.44 9.1-13.44 18.5v35.62H86.8v-72h21.46v9.84h.3c3-5.66 10.3-11.63 21.18-11.63 22.66 0 26.85 14.92 26.85 34.3z" className="cls-2"/>
</svg>
</button>
</li>
</ul>
<a className="terms-link js-terms-link" onClick={() => this.setModal()} href="#js-terms-dialog">Terms of Use</a>
<Modal
isOpen={this.state.modalOpen}
onRequestClose={this.closeModal}
contentLabel="Terms And Conditions"
className="modal-content"
overlayClassName="modal-overlay"
>
<h1>Terms and Conditions</h1>
<button className='modal-close' onClick={this.closeModal}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
<title>Close Modal</title>
<path d="M403.1 108.9c-81.2-81.2-212.9-81.2-294.2 0s-81.2 212.9 0 294.2c81.2 81.2 212.9 81.2 294.2 0s81.2-213 0-294.2zm-12.3 281.9c-74.3 74.3-195.3 74.3-269.6 0-74.3-74.3-74.3-195.3 0-269.6s195.3-74.3 269.6 0c74.4 74.3 74.4 195.3 0 269.6z"/>
<path d="M340.2 160l-84.4 84.2-84-83.8-11.8 11.8 84 83.8-84 83.8 11.8 11.8 84-83.8 84.4 84.2 11.8-11.8-84.4-84.2 84.4-84.2"/>
</svg>
</button>
<p>THE FOLLOWING TERMS AND CONDITIONS GOVERN YOUR USE OF THE SITE. PLEASE READ THESE TERMS OF USE CAREFULLY BEFORE USING THIS SITE.</p>
<p>WGBH Educational Foundation (“WGBH”), on behalf of the American Archive of Public Broadcasting, which is a collaboration between WGBH and the Library of Congress, has created and maintains this FIX IT website (the “Site”). This Site is governed by the <a href="http://americanarchive.org/legal/tou" target="_blank">Terms of Use</a> (the “Terms”) and <a href="http://americanarchive.org/legal/privacy" target="_blank">Privacy Policy</a> (the “Policy”) of the American Archive for Public Broadcasting located at <a href="http://americanarchive.org/" target="_blank">americanarchive.org</a>. By using the Site you agree to be bound by the Terms and Policy. If you do not agree to the Term and Policy you must exit the Site and you may not use the Site or any of its features. Your acceptance of the Terms upon your first visit to the Site constitutes acceptance to the Terms on all of your subsequent visits to the Site.</p>
<p>In addition to the Terms and the Policy, the following additional terms shall apply to the Site (the “Supplemental Terms”). In the event of any conflict between the Supplemental Terms and the Terms or the Policy, then the Supplemental Terms shall take priority, with all other provisions of the Terms and the Policy remaining in full effect.</p>
<h2>A. Registration</h2>
<p>You accept all responsibility for the use of any third party login function or API that you use to register for the Site and consent to information sharing by and between the providers of such services and WGBH which may include your name and contact information. You are solely responsible for all activities that occur through your account. You further acknowledge that you may receive emails pertaining to promotional suggested topics for FIX IT games.</p>
<h2>B. Restrictions on Use of Site and Content</h2>
<ol>
<li>You must be at least thirteen (13) years of age to register for the Site and to submit any User Generated Content (defined by the Terms and below).</li>
<li>You agree that use of the Site’s features and transcription games results in the creation of derivative works and that all rights associated with such transcription and results of said games remains the sole property of WGBH, the contributing station, or other rights holder for the material being transcribed.</li>
</ol>
<h2>C. User Generated Content (UGC):</h2>
<ol>
<li>You acknowledge that WGBH, the contributing station, or other rights holder for the material being transcribed as determined by WGBH, is the owner of all content generated through your use of the transcription games located on the site (“User Generated Content” or “UGC”) and that you may not control WGBH’s use of the content. WGBH is not obligated to use your UGC.</li>
<li>You acknowledge that WGBH assumes no responsibility or liability arising from UGC that unreasonably differs from the source material, or for any error, defamation, libel, omission, obscenity, danger or inaccuracy contained in the same.</li>
<li>You agree to use reasonable effort to ensure accuracy in your use of the transcription games which shall include utilizing the provided instructions for the same, and shall not use the games and UGC as an avenue to engage in any behavior which may be off-topic, contains personal attacks or expletives or is otherwise abusive, threatening, unlawful, harassing, discriminatory, libelous, obscene, false, pornographic, that infringes on the rights of a third party, or as a means of advertising or promoting any off topic matter.</li>
</ol>
<h2>D. Links to Third Party Sites </h2>
<p>This site contains links to affiliated and unaffiliated websites. Such sites are subject to their own terms and conditions. Please review the terms and conditions specific to each website that you intend to make use of and make sure you comply with the applicable rules. You agree that WGBH shall have no liability for damaged, broken, or misleading links. Links are provided for convenience only and WGBH makes no representation or warranty and bears no responsibility for accuracy or content of any externally linked site. Your use of such sites is at your sole risk.</p>
</Modal>
</div>
)
}
}
export default MenuFooter
|
src/routes/error/index.js
|
peeyush1234/react-nodejs-skeleton
|
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react';
import ErrorPage from './ErrorPage';
export default {
path: '/error',
action({ error }) {
return {
title: error.name,
description: error.message,
component: <ErrorPage error={error} />,
status: error.status || 500,
};
},
};
|
src/front/js/routes.js
|
raccoon-app/ui-kit
|
import React from 'react';
import { Route } from 'react-router';
import { IndexRoute } from 'react-router';
import Auth from './containers/Auth';
import ProjectSelection from './containers/ProjectSelection';
import Project from './containers/Project';
export default () => (
<Route path="/" >
<IndexRoute component={Auth} />
<Route path="projects" component={ProjectSelection} />
<Route path="project/:id" component={Project} />
</Route>
);
|
src/svg-icons/navigation/subdirectory-arrow-right.js
|
tan-jerene/material-ui
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let NavigationSubdirectoryArrowRight = (props) => (
<SvgIcon {...props}>
<path d="M19 15l-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9l6 6z"/>
</SvgIcon>
);
NavigationSubdirectoryArrowRight = pure(NavigationSubdirectoryArrowRight);
NavigationSubdirectoryArrowRight.displayName = 'NavigationSubdirectoryArrowRight';
NavigationSubdirectoryArrowRight.muiName = 'SvgIcon';
export default NavigationSubdirectoryArrowRight;
|
src/containers/Asians/Published/Debaters/DebaterRoster/SmallDebaterRoster.js
|
westoncolemanl/tabbr-web
|
import React from 'react'
import { connect } from 'react-redux'
import List, {
ListItem,
ListItemText
} from 'material-ui/List'
import Paper from 'material-ui/Paper'
export default connect(mapStateToProps)(({
debaters,
teamsById,
institutionsById
}) => {
debaters.sort((a, b) => {
if (
teamsById[a.team] &&
teamsById[b.team]
) {
if (
institutionsById[teamsById[a.team].institution] &&
institutionsById[teamsById[b.team].institution]
) {
if (institutionsById[teamsById[a.team].institution].name > institutionsById[teamsById[b.team].institution].name) return 1
if (institutionsById[teamsById[a.team].institution].name < institutionsById[teamsById[b.team].institution].name) return -1
}
if (teamsById[a.team].name > teamsById[b.team].name) return 1
if (teamsById[a.team].name < teamsById[b.team].name) return -1
}
if (a.firstName > b.firstName) return 1
if (a.firstName < b.firstName) return -1
return 0
})
return (
<Paper>
<List>
{debaters.map(debater =>
<ListItem
key={debater._id}
>
<ListItemText
primary={`${debater.firstName} ${debater.lastName}`}
secondary={`${teamsById[debater.team].name} (${institutionsById[teamsById[debater.team].institution].name})`}
/>
</ListItem>
)}
</List>
</Paper>
)
})
function mapStateToProps (state, ownProps) {
return {
debaters: Object.values(state.debaters.data),
teamsById: state.teams.data,
institutionsById: state.institutions.data
}
}
|
src/svg-icons/editor/insert-link.js
|
mmrtnz/material-ui
|
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let EditorInsertLink = (props) => (
<SvgIcon {...props}>
<path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/>
</SvgIcon>
);
EditorInsertLink = pure(EditorInsertLink);
EditorInsertLink.displayName = 'EditorInsertLink';
EditorInsertLink.muiName = 'SvgIcon';
export default EditorInsertLink;
|
node_modules/react-router/es/RouteUtils.js
|
vietvd88/developer-crawler
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
import React from 'react';
function isValidChild(object) {
return object == null || React.isValidElement(object);
}
export function isReactChildren(object) {
return isValidChild(object) || Array.isArray(object) && object.every(isValidChild);
}
function createRoute(defaultProps, props) {
return _extends({}, defaultProps, props);
}
export function createRouteFromReactElement(element) {
var type = element.type;
var route = createRoute(type.defaultProps, element.props);
if (route.children) {
var childRoutes = createRoutesFromReactChildren(route.children, route);
if (childRoutes.length) route.childRoutes = childRoutes;
delete route.children;
}
return route;
}
/**
* Creates and returns a routes object from the given ReactChildren. JSX
* provides a convenient way to visualize how routes in the hierarchy are
* nested.
*
* import { Route, createRoutesFromReactChildren } from 'react-router'
*
* const routes = createRoutesFromReactChildren(
* <Route component={App}>
* <Route path="home" component={Dashboard}/>
* <Route path="news" component={NewsFeed}/>
* </Route>
* )
*
* Note: This method is automatically used when you provide <Route> children
* to a <Router> component.
*/
export function createRoutesFromReactChildren(children, parentRoute) {
var routes = [];
React.Children.forEach(children, function (element) {
if (React.isValidElement(element)) {
// Component classes may have a static create* method.
if (element.type.createRouteFromReactElement) {
var route = element.type.createRouteFromReactElement(element, parentRoute);
if (route) routes.push(route);
} else {
routes.push(createRouteFromReactElement(element));
}
}
});
return routes;
}
/**
* Creates and returns an array of routes from the given object which
* may be a JSX route, a plain object route, or an array of either.
*/
export function createRoutes(routes) {
if (isReactChildren(routes)) {
routes = createRoutesFromReactChildren(routes);
} else if (routes && !Array.isArray(routes)) {
routes = [routes];
}
return routes;
}
|
project/src/pages/Page/components/PageLayout/PageLayout.js
|
boldr/boldr
|
// @flow
import React from 'react';
import type { Node } from 'react';
import { Footer, Container } from '@boldr/ui/Layout';
import styled from 'styled-components';
import View from '@boldr/ui/View';
import Navigation from '../Navigation';
import type { CurrentUser, RouterLocation, MenuType } from '../../../../types/boldr';
const ContentWrapper = styled.main`
width: 100%;
height: 100%;
min-height: 100%;
padding-top: 52px;
padding-bottom: 70px;
`;
type Props = {
currentUser: CurrentUser,
location: RouterLocation,
onClickLogout: () => void,
menu: MenuType,
children: Node,
token: string,
};
const PageLayout = (props: Props) => {
return (
<View>
<Navigation
location={props.location}
onLogout={props.onClickLogout}
token={props.token}
currentUser={props.currentUser}
menu={props.menu}
/>
<ContentWrapper>{props.children}</ContentWrapper>
<Footer id="footer">
<Container>Footer</Container>
</Footer>
</View>
);
};
export default PageLayout;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.