path
stringlengths 5
195
| repo_name
stringlengths 5
79
| content
stringlengths 25
1.01M
|
---|---|---|
app/components/IntroBlock/index.js | daicas/react-boilerplate-examp | import React from 'react';
import { FormattedMessage } from 'react-intl';
import Img from 'components/Img';
import styled from 'styled-components';
import {
IntroBlockWapper,
IntroBlockContent,
Title,
IntroBlockDes,
LinkViewMore,
IntroSlider,
IntroSliderItem
} from './style';
class IntroBlock extends React.Component { // eslint-disable-line react/prefer-stateless-function
render(props) {
return (
<IntroBlockWapper>
<IntroSlider>
<IntroSliderItem><Img src={require('static/images/upload/thumb.jpg')} alt="intro 1"/>
</IntroSliderItem>
</IntroSlider>
<IntroBlockContent>
<Title>Welcome to our Web Site !</Title>
<IntroBlockDes>
<p>Lorem Ipsum consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore Lorem ipsum dolor sit amet, conseter sadipscing elitr, sed diam ipsum dolor sit amet, conseter sadipscing elitr, sed diam Lorem Ipsum consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore Lorem ipsum dolor sit amet, conseter sadipscing elitr, sed diam ipsum dolor sit amet, conseter sadipscing elitr, sed diam invidunt ut labore Lorem ipsum dolor sit amet, conseter sadipscing elitr, sed diam ipsum dolor sit amet, conseter conseter sit...</p>
</IntroBlockDes>
<LinkViewMore href="#">View more</LinkViewMore>
</IntroBlockContent>
</IntroBlockWapper>
);
}
}
export default IntroBlock;
|
src/components/WebView.js | Root-App/react-native-mock-render | import EdgeInsetsPropType from '../propTypes/EdgeInsetsPropType';
import React from 'react';
import PropTypes from 'prop-types';
import createReactClass from 'create-react-class';
import View from './View';
import ScrollView from './ScrollView';
import WebViewManager from '../NativeModules/WebViewManager';
const RCT_WEBVIEW_REF = 'webview';
const NavigationType = {
click: WebViewManager.NavigationType.LinkClicked,
formsubmit: WebViewManager.NavigationType.FormSubmitted,
backforward: WebViewManager.NavigationType.BackForward,
reload: WebViewManager.NavigationType.Reload,
formresubmit: WebViewManager.NavigationType.FormResubmitted,
other: WebViewManager.NavigationType.Other,
};
const JSNavigationScheme = WebViewManager.JSNavigationScheme;
const WebView = createReactClass({
displayName: 'WebView',
propTypes: {
...View.propTypes,
url: PropTypes.string,
html: PropTypes.string,
/**
* Function that returns a view to show if there's an error.
*/
renderError: PropTypes.func, // view to show if there's an error
/**
* Function that returns a loading indicator.
*/
renderLoading: PropTypes.func,
/**
* Invoked when load finish
*/
onLoad: PropTypes.func,
/**
* Invoked when load either succeeds or fails
*/
onLoadEnd: PropTypes.func,
/**
* Invoked on load start
*/
onLoadStart: PropTypes.func,
/**
* Invoked when load fails
*/
onError: PropTypes.func,
/**
* @platform ios
*/
bounces: PropTypes.bool,
/**
* A floating-point number that determines how quickly the scroll view
* decelerates after the user lifts their finger. You may also use string
* shortcuts `"normal"` and `"fast"` which match the underlying iOS settings
* for `UIScrollViewDecelerationRateNormal` and
* `UIScrollViewDecelerationRateFast` respectively.
* - Normal: 0.998
* - Fast: 0.9 (the default for iOS WebView)
* @platform ios
*/
decelerationRate: ScrollView.propTypes.decelerationRate,
/**
* @platform ios
*/
scrollEnabled: PropTypes.bool,
automaticallyAdjustContentInsets: PropTypes.bool,
contentInset: EdgeInsetsPropType,
onNavigationStateChange: PropTypes.func,
startInLoadingState: PropTypes.bool, // force WebView to show loadingView on first load
style: View.propTypes.style,
/**
* Used on Android only, JS is enabled by default for WebView on iOS
* @platform android
*/
javaScriptEnabled: PropTypes.bool,
/**
* Used on Android only, controls whether DOM Storage is enabled or not
* @platform android
*/
domStorageEnabled: PropTypes.bool,
/**
* Sets the JS to be injected when the webpage loads.
*/
injectedJavaScript: PropTypes.string,
/**
* Sets whether the webpage scales to fit the view and the user can change the scale.
* @platform ios
*/
scalesPageToFit: PropTypes.bool,
/**
* Allows custom handling of any webview requests by a JS handler. Return true
* or false from this method to continue loading the request.
* @platform ios
*/
onShouldStartLoadWithRequest: PropTypes.func,
/**
* Determines whether HTML5 videos play inline or use the native full-screen
* controller.
* default value `false`
* **NOTE** : "In order for video to play inline, not only does this
* property need to be set to true, but the video element in the HTML
* document must also include the webkit-playsinline attribute."
* @platform ios
*/
allowsInlineMediaPlayback: PropTypes.bool,
},
statics: {
JSNavigationScheme,
NavigationType,
},
getWebViewHandle() {
// TODO(lmr): React.findNodeHandle
return React.findNodeHandle(this.refs[RCT_WEBVIEW_REF]);
},
reload() {
// do nothing
},
goForward() {
// do nothing
},
goBack() {
// do nothing
},
render() {
return React.createElement('react-native-mock', null, this.props.children);
},
});
module.exports = WebView;
|
src/internal/ClearFix.js | hwo411/material-ui | import React from 'react';
import PropTypes from 'prop-types';
import BeforeAfterWrapper from './BeforeAfterWrapper';
const styles = {
before: {
content: "' '",
display: 'table',
},
after: {
content: "' '",
clear: 'both',
display: 'table',
},
};
const ClearFix = ({style, children, ...other}) => (
<BeforeAfterWrapper
{...other}
beforeStyle={styles.before}
afterStyle={styles.after}
style={style}
>
{children}
</BeforeAfterWrapper>
);
ClearFix.muiName = 'ClearFix';
ClearFix.propTypes = {
children: PropTypes.node,
/**
* Override the inline-styles of the root element.
*/
style: PropTypes.object,
};
export default ClearFix;
|
src/client/components/Utils/ScrollToTopOnMount.js | busyorg/busy | import React from 'react';
import { withRouter } from 'react-router';
class ScrollToTopOnMount extends React.Component {
componentDidMount() {
if (window && window.location.hash === '') {
window.scrollTo(0, 0);
}
}
render() {
return null;
}
}
export default withRouter(ScrollToTopOnMount);
|
src/svg-icons/file/file-download.js | matthewoates/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let FileFileDownload = (props) => (
<SvgIcon {...props}>
<path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/>
</SvgIcon>
);
FileFileDownload = pure(FileFileDownload);
FileFileDownload.displayName = 'FileFileDownload';
FileFileDownload.muiName = 'SvgIcon';
export default FileFileDownload;
|
src/svg-icons/av/video-call.js | lawrence-yu/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let AvVideoCall = (props) => (
<SvgIcon {...props}>
<path d="M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4zM14 13h-3v3H9v-3H6v-2h3V8h2v3h3v2z"/>
</SvgIcon>
);
AvVideoCall = pure(AvVideoCall);
AvVideoCall.displayName = 'AvVideoCall';
AvVideoCall.muiName = 'SvgIcon';
export default AvVideoCall;
|
src/native/app/components/Text.js | robinpokorny/este | import React from 'react';
import theme from '../themes/initial';
import { StyleSheet, Text } from 'react-native';
// https://github.com/facebook/react-native/issues/7877
const round = value => Math.round(value);
const styles = StyleSheet.create({
text: { // eslint-disable-line react-native/no-unused-styles
color: theme.textColor,
fontFamily: theme.fontFamily,
fontSize: theme.fontSize,
lineHeight: round(theme.fontSize * theme.lineHeight),
},
});
// Normalize multiline strings because Text component preserves spaces.
const normalizeMultilineString = message => message.replace(/ +/g, ' ').trim();
class AppText extends React.Component {
static propTypes = {
children: React.PropTypes.node,
style: Text.propTypes.style,
};
onTextRef(text) {
this.text = text;
}
setNativeProps(nativeProps) {
this.text.setNativeProps(nativeProps);
}
getTextStyleWithMaybeComputedLineHeight() {
const { style } = this.props;
if (!style) {
return styles.text;
}
const customFontSize = StyleSheet.flatten(style).fontSize;
if (!Number.isInteger(customFontSize)) {
return [styles.text, style];
}
const lineHeight = round(customFontSize * theme.lineHeight);
return [styles.text, style, { lineHeight }];
}
render() {
const { children } = this.props;
const textStyle = this.getTextStyleWithMaybeComputedLineHeight();
return (
<Text
{...this.props}
ref={text => this.onTextRef(text)}
style={textStyle}
>
{typeof children === 'string'
? normalizeMultilineString(children)
: children
}
</Text>
);
}
}
export default AppText;
|
src/svg-icons/maps/flight.js | barakmitz/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let MapsFlight = (props) => (
<SvgIcon {...props}>
<path d="M10.18 9"/><path d="M21 16v-2l-8-5V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5l8 2.5z"/>
</SvgIcon>
);
MapsFlight = pure(MapsFlight);
MapsFlight.displayName = 'MapsFlight';
MapsFlight.muiName = 'SvgIcon';
export default MapsFlight;
|
packages/wix-style-react/src/FunnelChart/FunnelBar/FunnelBar.js | wix/wix-style-react | import React from 'react';
import { st, classes } from './FunnelBar.st.css';
export const FunnelBar = ({ height, dataHook }) => {
return (
<div className={st(classes.root)} data-hook={dataHook}>
<div style={{ height: `${height}%` }} className={classes.filledBar} />
</div>
);
};
|
frontend/app_v2/src/common/icons/Copy.js | First-Peoples-Cultural-Council/fv-web-ui | import React from 'react'
import PropTypes from 'prop-types'
function Copy({ styling }) {
return (
<svg className={styling} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<title>Copy</title>
<path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" />
</svg>
)
}
// PROPTYPES
const { string } = PropTypes
Copy.propTypes = {
styling: string,
}
export default Copy
|
src/server.js | cbellino/roster | /**
* 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 'babel-polyfill';
import path from 'path';
import express from 'express';
import React from 'react';
import ReactDOM from 'react-dom/server';
import Router from './routes';
import Html from './components/Html';
import assets from './assets';
import { port } from './config';
const server = global.server = express();
//
// Register Node.js middleware
// -----------------------------------------------------------------------------
server.use(express.static(path.join(__dirname, 'public')));
//
// Register server-side rendering middleware
// -----------------------------------------------------------------------------
server.get('*', async (req, res, next) => {
try {
let statusCode = 200;
const data = { title: '', description: '', css: '', body: '', entry: assets.main.js };
const css = [];
const context = {
insertCss: styles => css.push(styles._getCss()),
onSetTitle: value => data.title = value,
onSetMeta: (key, value) => data[key] = value,
onPageNotFound: () => statusCode = 404,
};
await Router.dispatch({ path: req.path, query: req.query, context }, (state, component) => {
data.css = css.join('');
});
const html = ReactDOM.renderToStaticMarkup(<Html {...data} />);
res.status(statusCode).send(`<!doctype html>\n${html}`);
} catch (err) {
next(err);
}
});
//
// Launch the server
// -----------------------------------------------------------------------------
server.listen(port, () => {
/* eslint-disable no-console */
console.log(`The server is running at http://localhost:${port}/`);
});
|
src/Components/BadgeComponent.js | Xeroeta/nkcgo-webapp | import React, { Component } from 'react';
import {
ShareButtons,
ShareCounts,
generateShareIcon,
} from 'react-share';
const {
FacebookShareButton,
GooglePlusShareButton,
LinkedinShareButton,
TwitterShareButton,
PinterestShareButton,
VKShareButton,
OKShareButton,
TelegramShareButton,
WhatsappShareButton,
RedditShareButton,
EmailShareButton,
} = ShareButtons;
const {
FacebookShareCount,
GooglePlusShareCount,
LinkedinShareCount,
PinterestShareCount,
VKShareCount,
OKShareCount,
RedditShareCount,
} = ShareCounts;
const FacebookIcon = generateShareIcon('facebook');
const TwitterIcon = generateShareIcon('twitter');
const GooglePlusIcon = generateShareIcon('google');
const LinkedinIcon = generateShareIcon('linkedin');
const PinterestIcon = generateShareIcon('pinterest');
const VKIcon = generateShareIcon('vk');
const OKIcon = generateShareIcon('ok');
const TelegramIcon = generateShareIcon('telegram');
const WhatsappIcon = generateShareIcon('whatsapp');
const RedditIcon = generateShareIcon('reddit');
const EmailIcon = generateShareIcon('email');
const shareUrl = 'http://nkcgo.com';
const title = 'NKCGo - My Badge';
export default class BadgeComponent extends Component {
constructor(props) {
super(props);
this.state = {
badges: props.badges
};
console.log('initial Props');
console.log(props.badges);
}
componentWillReceiveProps(nextProps) {
console.log('nextProps.VenuesData');
console.log(nextProps.badges);
this.setState({ badges: nextProps.badges });
}
goTo(route) {
// alert(route);
this.props.history.replace(`/${route}`)
}
render() {
return (
<div>
<center>
<p style={styles.introText}> If you see any badge below, you can claim your associated badges from the NKC Business Council at 320 Armour Road (suite 220, 2nd floor) from 8:30 AM to 3:30 PM on Tuesday (12 Sept) to Thursday (14 Sept).</p>
<p style={styles.navigationText}> <a href='https://www.google.com/maps/dir/?api=1&dir_action=navigate&travelmode=walking&destination=320 Armour Road, North Kansas City, MO 64116'>(Navigate to the NKC Business Council building.) </a> </p>
<p> ------------------------------- </p>
</center>
{
this.state.badges.map((mybadge) => (
<div
style={styles.badgeInfo}
key={mybadge.id}
>
<center>
<img style={styles.imageBadge}
alt=""
src={mybadge.image_url}
/>
<p style={styles.badgeTitle}>{mybadge.badgeName}{'\n\n'}</p>
</center>
<div className="Nkcgo_social-network">
<center>
<FacebookShareButton
url={shareUrl}
quote={title}
className="Nkcgo_social-network__share-button">
<FacebookIcon
size={32}
round />
</FacebookShareButton>
<FacebookShareCount
url={shareUrl}
className="Nkcgo_social-network__share-count">
{count => count}
</FacebookShareCount>
<TwitterShareButton
url={shareUrl}
title={title}
className="Nkcgo_social-network__share-button">
<TwitterIcon
size={32}
round />
</TwitterShareButton>
<div className="Nkcgo_social-network__share-count">
</div>
</center>
</div>
</div>
))
}
</div>
);
}
}
const styles = {
imageBadge: {
width: screen.width/4,
height: screen.width/4,
justifyContent: 'center',
alignItems: 'center'
},
badgeTitle: {
fontSize: 20
},
badgeInfo: {
marginBottom: 10
},
introText: {
color: '#000',
fontSize: 20,
fontWeight: 'bold',
},
navigationText: {
color: '#000',
fontSize: 16,
fontWeight: 'bold',
}
};
|
app/components/App/SideBar/index.js | basask/react-router-material-ui-seed | import React from 'react';
import { Drawer, MenuItem, AppBar, IconButton } from 'material-ui';
import { Link } from 'react-router';
import NavigationClose from 'material-ui/svg-icons/navigation/close';
import constants from '../constants';
class SideBar extends React.Component {
constructor(props){
super(props);
this.tap = this.tap.bind(this);
}
tap(path){
if(path)
this.context.router.push(path);
if(this.props.onMenuItemClick)
this.props.onMenuItemClick();
}
render() {
return (
<Drawer open={this.props.drawerOpen}>
<AppBar
title={constants.appTitle}
showMenuIconButton={this.props.showMenuIconButton}
onTitleTouchTap={()=>this.tap('/home')}
iconElementLeft={<IconButton><NavigationClose /></IconButton>}
onLeftIconButtonTouchTap={()=>this.tap()}/>
<MenuItem onTouchTap={()=>this.tap('/home')}>Home</MenuItem>
<MenuItem onTouchTap={()=>this.tap('/theme')}>Theme</MenuItem>
</Drawer>
);
}
}
SideBar.contextTypes = {
router: React.PropTypes.object.isRequired
}
export default SideBar;
|
src/svg-icons/image/filter-tilt-shift.js | rscnt/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageFilterTiltShift = (props) => (
<SvgIcon {...props}>
<path d="M11 4.07V2.05c-2.01.2-3.84 1-5.32 2.21L7.1 5.69c1.11-.86 2.44-1.44 3.9-1.62zm7.32.19C16.84 3.05 15.01 2.25 13 2.05v2.02c1.46.18 2.79.76 3.9 1.62l1.42-1.43zM19.93 11h2.02c-.2-2.01-1-3.84-2.21-5.32L18.31 7.1c.86 1.11 1.44 2.44 1.62 3.9zM5.69 7.1L4.26 5.68C3.05 7.16 2.25 8.99 2.05 11h2.02c.18-1.46.76-2.79 1.62-3.9zM4.07 13H2.05c.2 2.01 1 3.84 2.21 5.32l1.43-1.43c-.86-1.1-1.44-2.43-1.62-3.89zM15 12c0-1.66-1.34-3-3-3s-3 1.34-3 3 1.34 3 3 3 3-1.34 3-3zm3.31 4.9l1.43 1.43c1.21-1.48 2.01-3.32 2.21-5.32h-2.02c-.18 1.45-.76 2.78-1.62 3.89zM13 19.93v2.02c2.01-.2 3.84-1 5.32-2.21l-1.43-1.43c-1.1.86-2.43 1.44-3.89 1.62zm-7.32-.19C7.16 20.95 9 21.75 11 21.95v-2.02c-1.46-.18-2.79-.76-3.9-1.62l-1.42 1.43z"/>
</SvgIcon>
);
ImageFilterTiltShift = pure(ImageFilterTiltShift);
ImageFilterTiltShift.displayName = 'ImageFilterTiltShift';
export default ImageFilterTiltShift;
|
boilerplates/project/pcNative/app/components/Main/Main.js | FuluUE/vd-generator | import React from 'react';
import styles from './less/main.less';
class Main extends React.Component {
render() {
return (
<div className={styles.main}>
aa
</div>
);
}
}
export default Main;
|
src/components/Dot.js | wu0792/gallery-by-react | import React from 'react'
class Dot extends React.Component{
constructor(props){
super(props);
this.state = {};
this.state.reverse = props.reverse || false;
this.state.active = props.active || false;
}
render(){
return (<li className={'nav_dot' + (this.state.active?' active':'')} onClick={this.props.onClick}></li>);
}
}
export default Dot;
|
node_modules/react-bootstrap/es/Tab.js | superKaigon/TheCave | import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
import _extends from 'babel-runtime/helpers/extends';
import React from 'react';
import PropTypes from 'prop-types';
import TabContainer from './TabContainer';
import TabContent from './TabContent';
import TabPane from './TabPane';
var propTypes = _extends({}, TabPane.propTypes, {
disabled: PropTypes.bool,
title: PropTypes.node,
/**
* tabClassName is used as className for the associated NavItem
*/
tabClassName: PropTypes.string
});
var Tab = function (_React$Component) {
_inherits(Tab, _React$Component);
function Tab() {
_classCallCheck(this, Tab);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Tab.prototype.render = function render() {
var props = _extends({}, this.props);
// These props are for the parent `<Tabs>` rather than the `<TabPane>`.
delete props.title;
delete props.disabled;
delete props.tabClassName;
return React.createElement(TabPane, props);
};
return Tab;
}(React.Component);
Tab.propTypes = propTypes;
Tab.Container = TabContainer;
Tab.Content = TabContent;
Tab.Pane = TabPane;
export default Tab; |
src/containers/Router.js | scenario-generator/frontend | import React, { Component } from 'react';
import { StyleRoot } from 'radium';
import { Router } from 'react-router';
import ReactGA from 'react-ga';
// Constants
import Strings from '../constants/strings';
// Components
import routes from '../routes';
import Head from '../components/Head'
/**
* Component is exported for conditional usage in Root.js
*/
class RouterComponent extends Component {
componentDidMount() {
ReactGA.initialize(process.env.REACT_APP_GOOGLE_ANALYTICS_KEY);
}
logPageView() {
ReactGA.set({ page: window.location.pathname });
ReactGA.pageview(window.location.pathname);
}
render() {
var history = this.props.history;
return (
<div>
<Head title={Strings.rootPageTitle} />
<StyleRoot>
<Router
history={history}
onUpdate={this.logPageView}>
{ routes }
</Router>
</StyleRoot>
</div>
);
}
};
export default RouterComponent;
|
src/dumb/editor/custom_field/preview_templates/AssetSelectionPreviewTemplate.js | jeckhummer/wf-constructor | import React from 'react';
import {Form} from "semantic-ui-react";
export const AssetSelectionPreviewTemplate = ({label}) => {
const options = [
{text: 'asset 1', value: 'asset 1'},
{text: 'asset 2', value: 'asset 2'},
{text: 'asset 3', value: 'asset 3'},
{text: '...', value: '...'},
];
return (
<div>
<Form>
<Form.Select label={label || "[NO TEXT PROVIDED]"} options={options} placeholder="--"/>
</Form>
<br/>
<span style={{fontSize: '0.85em'}}>
* Dropdown items will be populated from SPM.
</span>
</div>
);
}; |
test/integration/basic/pages/stateless.js | nikvm/next.js | import React from 'react'
export default () => <h1>My component!</h1>
|
information/blendle-frontend-react-source/app/modules/premiumSignup/components/ResetPassword/index.js | BramscoChill/BlendleParser | import React from 'react';
import PropTypes from 'prop-types';
import ResetPasswordView from 'components/login/ResetPassword';
import CSS from './styles.scss';
const ResetPassword = (props) => {
const { route, onClickLogin } = props;
return (
<div className={CSS.resetPassword}>
<ResetPasswordView showBack active={route.activeStepIndex === 2} onLoginLink={onClickLogin} />
</div>
);
};
ResetPassword.propTypes = {
route: PropTypes.object.isRequired,
onClickLogin: PropTypes.func.isRequired,
disabled: PropTypes.bool,
};
export default ResetPassword;
// WEBPACK FOOTER //
// ./src/js/app/modules/premiumSignup/components/ResetPassword/index.js |
amp-stories/src/component/view/LinkComponentsStoryView/pages/StoryPage3.js | ampproject/samples | import React from 'react';
import styled, {keyframes} from 'styled-components';
import {TextHighlightBanner, Button as SharedButton} from '../shared';
import {BannerWrapper} from '/component/base/TextHighlight';
import AmpStoryPage from '/component/amp/AmpStoryPage';
import AmpImage from '/component/amp/AmpImage';
const tada = keyframes`
from {
transform: scale3d(1, 1, 1);
}
10%,
20% {
transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
}
30%,
50%,
70%,
90% {
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
}
40%,
60%,
80% {
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
}
to {
transform: scale3d(1, 1, 1);
}
`;
const rotate = keyframes`
from {
transform: translate(-63%, -7%) rotate(0deg);
}
to {
transform: translate(-63%, -7%) rotate(360deg);
}
`;
const Button = styled(SharedButton)`
width: 100%;
`;
const ButtonWrapper = styled.div`
display: flex;
justify-content: center;
align-items: center;
padding: 32px;
`;
const trajectory = (rotate, translate) => keyframes`
from {
opacity: 0
}
50% {
opacity: 1;
}
to {
transform: rotate(${rotate}) translate(${translate},0);
opacity: 0;
}
`;
const Exploder = styled.div`
width: 15px
height: 5px;
position: absolute;
background-color: ${({theme}) => theme.colors.storiesLolliPink};
border-radius: 25%;
right: 158px;
bottom: 187px;
`;
const Exploder1 = styled(Exploder)`
opacity: 0;
transform: rotate(45deg) translate(0, 0);
[active] & {
animation: ${trajectory('45deg', '-70px')} 0.3s 0.3s ease-out forwards;
}
`;
const Exploder2 = styled(Exploder)`
opacity: 0;
transform: rotate(-10deg) translate(0, 0);
[active] & {
animation: ${trajectory('-10deg', '-50px')} 0.3s 0.3s ease-out forwards;
}
`;
const Exploder3 = styled(Exploder)`
opacity: 0;
transform: rotate(100deg) translate(0, 0);
[active] & {
animation: ${trajectory('100deg', '-60px')} 0.3s 0.3s ease-out forwards;
}
`;
const draw = keyframes`
to {
stroke-dashoffset: 0;
}
`;
const Arrow = styled((props) => (
<svg
width="184px"
height="202px"
viewBox="0 0 184 202"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<g
id="HiFi-v3"
stroke="none"
strokeWidth="1"
fill="none"
fillRule="evenodd"
strokeLinecap="round"
>
<g id="5C" transform="translate(-176.000000, -394.000000)">
<g
id="Group-3"
transform="translate(196.000000, 280.000000)"
stroke="#FF4F89"
strokeWidth="40"
>
<path
d="M334.343528,376.290966 C364.212765,88.6133172 291.433577,-20.5588405 116.005963,48.7744929"
id="Path-4"
transform="translate(228.434067, 202.434067) rotate(-225.000000) translate(-228.434067, -202.434067) "
/>
<polyline
id="Path-5"
strokeLinejoin="round"
transform="translate(41.711841, 172.500000) scale(-1, 1) rotate(-360.000000) translate(-41.711841, -172.500000) "
points="-5.68434189e-14 134 83.4236811 134 83.4236811 211"
/>
</g>
</g>
</g>
</svg>
))`
position: absolute;
bottom: 0;
right: 0;
z-index: 3;
[active] & path,
[active] & polyline {
stroke-dasharray: 1000;
stroke-dashoffset: -1000;
animation: ${draw} 0.3s linear forwards;
}
`;
const Curve = styled(AmpImage).attrs({
src: '/static/stories/story5/curve.svg',
layout: 'fixed',
width: '434px',
height: '187px',
})`
position: absolute;
left: 0;
bottom: 0;
transform: translate(-63%, -7%) rotate(0deg);
`;
const Page = styled((props) => <AmpStoryPage {...props} />)`
&[active] ${Button} {
animation: ${tada} 0.5s 0.3s ease-in-out;
}
&[active] ${Curve} {
animation: ${rotate} 8s linear infinite;
}
`;
const StoryPage3 = () => (
<Page id="click-cta" backgroundColor="storiesBkLolliPink">
<amp-story-grid-layer template="fill">
<div>
<Exploder1 />
<Exploder2 />
<Exploder3 />
<Arrow />
<Curve />
</div>
</amp-story-grid-layer>
<amp-story-grid-layer template="vertical">
<BannerWrapper>
<TextHighlightBanner>And your CTAs</TextHighlightBanner>
<TextHighlightBanner>can live</TextHighlightBanner>
<TextHighlightBanner>anywhere on</TextHighlightBanner>
<TextHighlightBanner>your pages</TextHighlightBanner>
</BannerWrapper>
</amp-story-grid-layer>
<amp-story-grid-layer template="fill">
<ButtonWrapper>
<Button href="https://amp.dev/about/stories/">You can click me</Button>
</ButtonWrapper>
</amp-story-grid-layer>
</Page>
);
export default StoryPage3;
|
src/Home.js | camposa03/FormDemo | import React, { Component } from 'react';
import { Link } from 'react-router-dom';
class Home extends Component {
render() {
return (
<div>
<h2><Link to="/form">Apply</Link></h2>
</div>
);
}
}
export default Home; |
app/app.js | commanderking/alliancechemistry | /**
* app.js
*
* This is the entry file for the application, only setup and boilerplate
* code.
*/
// Needed for redux-saga es6 generator support
import 'babel-polyfill';
// Import all the third party stuff
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { applyRouterMiddleware, Router, browserHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';
import FontFaceObserver from 'fontfaceobserver';
import { useScroll } from 'react-router-scroll';
import 'sanitize.css/sanitize.css';
// Import root app
import App from 'containers/App';
// Import selector for `syncHistoryWithStore`
import { makeSelectLocationState } from 'containers/App/selectors';
// Import Language Provider
import LanguageProvider from 'containers/LanguageProvider';
// Load the favicon, the manifest.json file and the .htaccess file
/* eslint-disable import/no-webpack-loader-syntax */
import '!file-loader?name=[name].[ext]!./favicon.ico';
import '!file-loader?name=[name].[ext]!./manifest.json';
import 'file-loader?name=[name].[ext]!./.htaccess'; // eslint-disable-line import/extensions
/* eslint-enable import/no-webpack-loader-syntax */
import configureStore from './store';
// Import i18n messages
import { translationMessages } from './i18n';
// Import CSS reset and Global Styles
import './global-styles';
// Import routes
import createRoutes from './routes';
// Observe loading of Open Sans (to remove open sans, remove the <link> tag in
// the index.html file and this observer)
const openSansObserver = new FontFaceObserver('Open Sans', {});
// When Open Sans is loaded, add a font-family using Open Sans to the body
openSansObserver.load().then(() => {
document.body.classList.add('fontLoaded');
}, () => {
document.body.classList.remove('fontLoaded');
});
// Create redux store with history
// this uses the singleton browserHistory provided by react-router
// Optionally, this could be changed to leverage a created history
// e.g. `const browserHistory = useRouterHistory(createBrowserHistory)();`
const initialState = {};
const store = configureStore(initialState, browserHistory);
// Sync history and store, as the react-router-redux reducer
// is under the non-default key ("routing"), selectLocationState
// must be provided for resolving how to retrieve the "route" in the state
const history = syncHistoryWithStore(browserHistory, store, {
selectLocationState: makeSelectLocationState(),
});
// Set up the router, wrapping all Routes in the App component
const rootRoute = {
component: App,
childRoutes: createRoutes(store),
};
const render = (messages) => {
ReactDOM.render(
<Provider store={store}>
<LanguageProvider messages={messages}>
<Router
history={history}
routes={rootRoute}
render={
// Scroll to top when going to a new page, imitating default browser
// behaviour
applyRouterMiddleware(useScroll())
}
/>
</LanguageProvider>
</Provider>,
document.getElementById('app')
);
};
// Hot reloadable translation json files
if (module.hot) {
// modules.hot.accept does not accept dynamic dependencies,
// have to be constants at compile-time
module.hot.accept('./i18n', () => {
render(translationMessages);
});
}
// Chunked polyfill for browsers without Intl support
if (!window.Intl) {
(new Promise((resolve) => {
resolve(import('intl'));
}))
.then(() => Promise.all([
import('intl/locale-data/jsonp/en.js'),
import('intl/locale-data/jsonp/de.js'),
]))
.then(() => render(translationMessages))
.catch((err) => {
throw err;
});
} else {
render(translationMessages);
}
// Install ServiceWorker and AppCache in the end since
// it's not most important operation and if main code fails,
// we do not want it installed
if (process.env.NODE_ENV === 'production') {
require('offline-plugin/runtime').install(); // eslint-disable-line global-require
}
|
src/FlexBox.js | RafalFilipek/just-box | // @flow
import React from 'react';
import omit from 'lodash/omit';
import Box, { type BoxProps } from './Box';
import isReactNative from './isReactNative';
type FlexProps = {
f1?: boolean,
f2?: boolean,
f3?: boolean,
f4?: boolean,
row?: boolean,
column?: boolean,
wrap?: boolean,
alignStart?: boolean,
alignEnd?: boolean,
alignCenter?: boolean,
alignBaseline?: boolean,
alignStretch?: boolean,
selfStart?: boolean,
selfEnd?: boolean,
selfCenter?: boolean,
selfBaseline?: boolean,
selfStretch?: boolean,
justifyStart?: boolean,
justifyEnd?: boolean,
justifyCenter?: boolean,
justifyBetween?: boolean,
justifyAround?: boolean,
contentStart?: boolean,
contentEnd?: boolean,
contentCenter?: boolean,
contentBetween?: boolean,
contentAround?: boolean,
contentStretch?: boolean,
};
const flexMap = {
f1: { name: 'flex', value: 1 },
f2: { name: 'flex', value: 2 },
f3: { name: 'flex', value: 3 },
f4: { name: 'flex', value: 4 },
row: { name: 'flexDirection', value: 'row' },
column: { name: 'flexDirection', value: 'column' },
wrap: { name: 'flexWrap', value: 'wrap' },
alignStart: { name: 'alignItems', value: 'flex-start' },
alignEnd: { name: 'alignItems', value: 'flex-end' },
alignCenter: { name: 'alignItems', value: 'center' },
alignBaseline: { name: 'alignItems', value: 'baseline' },
alignStretch: { name: 'alignItems', value: 'stretch' },
selfStart: { name: 'alignSelf', value: 'flex-start' },
selfEnd: { name: 'alignSelf', value: 'flex-end' },
selfCenter: { name: 'alignSelf', value: 'center' },
selfBaseline: { name: 'alignSelf', value: 'baseline' },
selfStretch: { name: 'alignSelf', value: 'stretch' },
justifyStart: { name: 'justifyContent', value: 'flex-start' },
justifyEnd: { name: 'justifyContent', value: 'flex-end' },
justifyCenter: { name: 'justifyContent', value: 'center' },
justifyBetween: { name: 'justifyContent', value: 'space-between' },
justifyAround: { name: 'justifyContent', value: 'space-around' },
contentStart: { name: 'justifyContent', value: 'flex-end' },
contentEnd: { name: 'alignContent', value: 'flex-start' },
contentCenter: { name: 'alignContent', value: 'center' },
contentBetween: { name: 'alignContent', value: 'flex-end' },
contentAround: { name: 'alignContent', value: 'space-around' },
contentStretch: { name: 'alignContent', value: 'stretch' },
};
const flexKeys = Object.keys(flexMap);
type FlexBoxProps = FlexProps & BoxProps;
const FlexBox = (props: FlexBoxProps) => {
const flex = Object.keys(props).reduce((memo, name) => {
const el = flexMap[name];
if (el) {
memo[el.name] = el.value;
}
return memo;
}, {});
const additionalStyles = isReactNative ? {} : { display: 'flex' };
return <Box {...additionalStyles} {...flex} {...omit(props, flexKeys)} />;
};
FlexBox.displayName = 'Flex(Box)';
export default FlexBox;
|
linksa/CalendarInfo.js | liuhui219/linksa | import React from 'react';
import {
View,
StyleSheet,
Navigator,
TouchableOpacity,
TouchableHighlight,
Text,
ToastAndroid,
ActivityIndicator,
TextInput,
ScrollView,
Dimensions,
BackAndroid,
Image
} from 'react-native';
import Communications from 'react-native-communications';
import Icon from 'react-native-vector-icons/FontAwesome';
import Token from './Token';
export default class ContactInfo extends React.Component {
constructor(props) {
super(props);
this._pressButton = this._pressButton.bind(this);
BackAndroid.addEventListener('hardwareBackPress', this._pressButton);
this.state = {id: '',uid:'',datas:{},dataA:[],imgs:[],textaera:'',loaded: false,};
}
_pressButton() {
const { navigator } = this.props;
if(navigator) {
//很熟悉吧,入栈出栈~ 把当前的页面pop掉,这里就返回到了上一个页面了
navigator.pop();
return true;
}
return false;
}
componentDidMount() {
//这里获取传递过来的参数: name
this.setState({
id: this.props.id,
uid: this.props.uid,
});
this.timer = setTimeout(
() => {this.fetchData('' + data.data.domain + '/index.php?app=Calendar2&m=CalendarApi&a=Calendar_list&uid='+this.props.uid+'&id='+this.props.id+'&access_token=' + data.data.token + '');},800);
}
componentWillUnmount() {
this.timer && clearTimeout(this.timer);
BackAndroid.removeEventListener('hardwareBackPress', this._pressButton);
}
fetchData(url) {
fetch(url)
.then((response) => response.json())
.then((responseData) => {
this.setState({
datas: responseData.array,
dataA : responseData.list,
loaded: true,
});
var aa=[];
var that=this;
if(responseData.list != null){
responseData.list.forEach((img, i) => {
key={i}
var IMG = {uri:data.data.domain.slice(0,-6) + img.src.slice(1)}
aa.push(IMG)
that.setState({
imgs: aa,
});
})
}
})
.done(
);
}
toQueryString(obj) {
return obj ? Object.keys(obj).sort().map(function (key) {
var val = obj[key];
if (Array.isArray(val)) {
return val.sort().map(function (val2) {
return encodeURIComponent(key) + '=' + encodeURIComponent(val2);
}).join('&');
}
return encodeURIComponent(key) + '=' + encodeURIComponent(val);
}).join('&') : '';
}
trim(str)
{
return str.replace(/(^\s*)|(\s*$)/g, "");
}
_send(){
this.setState({
loaded: false,
});
var that = this
if(this.trim(this.state.textaera) == ''){
ToastAndroid.show('评论内容不能为空!!!', ToastAndroid.SHORT)
return false;
}else{
fetch('' + data.data.domain + '/index.php?app=Calendar2&m=CalendarApi&a=answer&access_token=' + data.data.token + '', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: this.toQueryString({
'id': this.props.id,
'uid':this.props.uid,
'comment':this.state.textaera
})
})
.then(function (response) {
return response.json();
})
.then(function (result) {
if(result.statu == 1){
that.setState({
textaera: '',
loaded: true,
});
that.fetchData('' + data.data.domain + '/index.php?app=Calendar2&m=CalendarApi&a=Calendar_list&uid='+that.props.uid+'&id='+that.props.id+'&access_token=' + data.data.token + '');
}
})
}
}
render() {
return (
<View style={{flex:1,flexDirection:'column',}}>
<View style={styles.card}>
<View style={{flex:1,justifyContent:'center'}}>
<TouchableOpacity onPress={this._pressButton.bind(this)}>
<View style={{justifyContent:'flex-start',flexDirection:'row',alignItems:'center',}}>
<Image source={require('./imgs/back.png')} style={{width: 25, height: 25,marginLeft:5,}} />
<Text allowFontScaling={false} adjustsFontSizeToFit={false} style={{color:'white',fontSize:16,marginLeft:-5,}}>返回</Text>
</View>
</TouchableOpacity>
</View>
<View style={{flex:1,alignItems:'center',justifyContent:'center'}}>
<View style={{justifyContent:'center',flexDirection:'row',alignItems:'center'}}>
<Text allowFontScaling={false} adjustsFontSizeToFit={false} style={{color:'white',fontSize:18}}>日程详情</Text>
</View>
</View>
<View style={{flex:1,justifyContent:'center'}}>
</View>
</View>
<ScrollView style={{flex:1,flexDirection:'column',backgroundColor:'#fff'}}>
<View style={{backgroundColor:'#fff',flexDirection:'column',}}>
<View style={{borderBottomWidth:0.5,borderColor:'#bbb',flexDirection:'row',height:50,alignItems:'center',paddingLeft:15,flex:1, }}>
<Icon name="calendar" color="#666"size={20} />
<Text allowFontScaling={false} adjustsFontSizeToFit={false} style={{fontSize:16,paddingLeft:5,}}>{this.state.datas.type}</Text>
</View>
<View style={{borderBottomWidth:0.5,borderColor:'#bbb',flexDirection:'column',height:60,marginLeft:15,justifyContent:'center', }}>
<Text allowFontScaling={false} adjustsFontSizeToFit={false} style={{fontSize:16,}}>
{this.state.datas.title}
</Text>
<Text allowFontScaling={false} adjustsFontSizeToFit={false} style={{fontSize:14,color:'#aaa',paddingTop:5,}}>
{this.state.datas.start}——{this.state.datas.end}
</Text>
</View>
<View style={{marginLeft:15,flexDirection:'row',borderBottomWidth:0.5,borderColor:'#bbb',alignItems:'center',justifyContent:'space-between',height:50,paddingRight:15,}}>
<Text allowFontScaling={false} adjustsFontSizeToFit={false}>优先等级</Text>
<Text allowFontScaling={false} adjustsFontSizeToFit={false}>{this.state.datas.important_name}</Text>
</View>
<View style={{marginLeft:15,flexDirection:'row',borderBottomWidth:0.5,borderColor:'#bbb',alignItems:'center',justifyContent:'space-between',height:50,paddingRight:15,}}>
<Text allowFontScaling={false} adjustsFontSizeToFit={false}>提前通知</Text>
<Text allowFontScaling={false} adjustsFontSizeToFit={false}>{this.state.datas.tixintime}</Text>
</View>
<View style={{flexDirection:'row',borderBottomWidth:1,borderColor:'#bbb',alignItems:'center',paddingRight:15,paddingTop:15,paddingBottom:15,}}>
<Text allowFontScaling={false} adjustsFontSizeToFit={false} style={{width:80,marginLeft:15,alignSelf:'flex-start',}}>内 容</Text>
<Text allowFontScaling={false} adjustsFontSizeToFit={false} style={{flexWrap:'wrap',flex:1,fontSize:14}}>{this.state.datas.contents}</Text>
</View>
</View>
<View style={{height:15,backgroundColor:'#ececec'}}></View>
<View style={{backgroundColor:'#fff',flexDirection:'column',flex:1,}}>
<View style={{borderBottomWidth:0.5,borderColor:'#bbb',flexDirection:'row',height:50,alignItems:'center',paddingLeft:15,paddingRight:15,}}>
<Icon name="comments-o" color="#666"size={20} />
<Text allowFontScaling={false} adjustsFontSizeToFit={false} style={{fontSize:16,paddingLeft:5,}}>评论</Text>
<Text allowFontScaling={false} adjustsFontSizeToFit={false} style={{fontSize:14,paddingLeft:5,paddingLeft:10,color:'#bbb',flex:1,textAlign:'right',}}>共有{this.state.dataA == null ? 0 : this.state.dataA.length}条回复</Text>
</View>
{this.state.dataA == null ? <View style={{height:100,alignItems:'center', justifyContent:'center'}}>
<Text allowFontScaling={false} adjustsFontSizeToFit={false} style={{fontSize:18,}}>暂无评论</Text>
</View> : this.state.dataA.map((tab, i) => {
return <View key={i} style={{flexDirection:'row',paddingTop:15,paddingLeft:15,}}>
<View style={{width: 40, height: 40,borderRadius:20,backgroundColor:'#718DC1',alignItems:'center', justifyContent:'center'}}>
<Image source={this.state.imgs[i]} style={{width: 40, height: 40,borderRadius:20,}} />
</View>
<View style={{flexDirection:'column',marginLeft:15,flex:1, borderBottomWidth:0.5,borderColor:'#aaa',paddingBottom:15,paddingRight:15,}}>
<View style={{flexDirection:'row',alignItems:'center', justifyContent:'space-between'}}>
<Text allowFontScaling={false} adjustsFontSizeToFit={false}>{tab.u_name}</Text>
<Text allowFontScaling={false} adjustsFontSizeToFit={false}>{tab.time}</Text>
</View>
<Text allowFontScaling={false} adjustsFontSizeToFit={false} style={{color:'#aaa',fontSize:14,flexWrap:'wrap',flex:1,}}>{tab.comment}
</Text>
</View>
</View>
})}
</View>
</ScrollView>
{!this.state.loaded ? <View style={{justifyContent: 'center',alignItems: 'center',height:Dimensions.get('window').height,overflow:'hidden',position:'absolute',top:0,left:0,width:Dimensions.get('window').width,}}>
<View style={styles.loading}>
<ActivityIndicator color="white"/>
<Text allowFontScaling={false} adjustsFontSizeToFit={false} style={styles.loadingTitle}>加载中……</Text>
</View>
</View> : <View></View>}
<View style={{height:60,flexDirection:'row',paddingLeft:10,paddingRight:10, backgroundColor:'#ededed',justifyContent:'center',paddingTop:10, }}>
<View style={{flex:1,borderWidth:1,borderColor:'#4385f4',borderRadius:3, height:40, }}>
<TextInput
onChangeText={(textaera) => this.setState({textaera})}
placeholderTextColor={'#999'}
style={{ color:'#666',fontSize:14, height:40,textAlignVertical:'bottom', }}
placeholder='评论内容(必填)'
value={this.state.textaera}
underlineColorAndroid={'transparent'}
/>
</View>
<TouchableOpacity onPress={this._send.bind(this)} style={{backgroundColor:'#4385f4',height:40,width:70,borderRadius:3,marginLeft:10,alignItems:'center',justifyContent:'center',}}>
<Text allowFontScaling={false} adjustsFontSizeToFit={false} style={{color:'#fff',fontSize:16,}}>发送</Text>
</TouchableOpacity>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
tabView: {
flex: 1,
flexDirection: 'column',
backgroundColor:'#fafafa',
},
card: {
height:45,
backgroundColor:'#4385f4',
flexDirection:'row'
},
loading: {
backgroundColor: 'gray',
height: 80,
width: 100,
borderRadius: 10,
justifyContent: 'center',
alignItems: 'center',
},
loadingTitle: {
marginTop: 10,
fontSize: 14,
color: 'white'
},
default: {
height: 37,
borderWidth: 0,
borderColor: 'rgba(0,0,0,0.55)',
flex: 1,
fontSize: 13,
},
}); |
example/src/index.js | topcatcreatives/react-date-scroll | import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(
<App />,
document.getElementById('date-scroll-app')
);
|
client/src/components/Main.js | nickbreaton/spare-page | import React from 'react'
import styled from 'styled-components'
const MainStyles = styled.main`
display: flex;
flex: 1 0 auto;
flex-direction: column;
min-height: 100vh;
flex-basis: 100%;
align-items: flex-start;
margin: auto;
max-width: calc(${props => props.theme.breakpoint} - 4em);
width: 100%;
padding-top: 2em;
@media(max-width: ${props => props.theme.breakpoint}) {
max-width: 100%;
padding-top: 0em;
}
`
// IE 11 flex-box min-heigt fixe
// http://codepen.io/chriswrightdesign/pen/emQNGZ/
const Main = (props) => (
<div style={{ display: 'flex', flexDirection: 'row' }}>
<MainStyles {...props}/>
</div>
)
export default Main
|
js/components/Header.js | SKrishnan602/funnas1.0 | import React from 'react';
import Relay from 'react-relay';
var ReactBootstrap = require('react-bootstrap');
class Header extends React.Component {
onReload() {
this.props.relay.forceFetch();
}
componentWillMount() {
document.body.style.backgroundColor = "#e9ebee";
}
componentWillUnmount(){
document.body.style.backgroundColor = null;
}
render() {
var Navbar = ReactBootstrap.Navbar;
var Nav = ReactBootstrap.Nav;
var NavItem = ReactBootstrap.NavItem;
var DropdownButton = ReactBootstrap.DropdownButton;
var MenuItem = ReactBootstrap.MenuItem;
var NavDropdown = ReactBootstrap.Dropdown;
return (
<div>
<Navbar inverse collapseOnSelect fluid style={{width: "100%", background: "#4267b2"}}>
<Navbar.Header style={{width: "100%" , background: "#4267b2"}}>
<Navbar.Brand>
<span>
<a href="#" style={{width: "100%", backgroundColor: "transparent",fontSize: "14px", fontWeight: "bold",
fontFamily: "Helvetica",color: "white"}}>Funnas - Place for great deals !!!</a>
</span>
</Navbar.Brand>
<Navbar.Toggle />
</Navbar.Header>
</Navbar>
</div>
);
}
}
export default Relay.createContainer(Header, {
fragments: {
},
});
|
src/parser/warrior/arms/modules/core/Execute/Rend.js | ronaldpereira/WoWAnalyzer | import React from 'react';
import { formatPercentage } from 'common/format';
import SPELLS from 'common/SPELLS';
import SpellLink from 'common/SpellLink';
import Analyzer, { SELECTED_PLAYER } from 'parser/core/Analyzer';
import Events from 'parser/core/Events';
import ExecuteRange from './ExecuteRange';
class RendAnalyzer extends Analyzer {
static dependencies = {
executeRange: ExecuteRange,
};
rends = 0;
rendsInExecuteRange = 0;
constructor(...args) {
super(...args);
this.active = this.selectedCombatant.hasTalent(SPELLS.REND_TALENT.id);
this.addEventListener(Events.cast.by(SELECTED_PLAYER).spell(SPELLS.REND_TALENT), this._onRendCast);
}
_onRendCast(event) {
this.rends += 1;
if (this.executeRange.isTargetInExecuteRange(event)) {
this.rendsInExecuteRange += 1;
event.meta = event.meta || {};
event.meta.isInefficientCast = true;
event.meta.inefficientCastReason = 'This Rend was used on a target in Execute range.';
}
}
get executeRendsThresholds() {
return {
actual: this.rendsInExecuteRange / this.rends,
isGreaterThan: {
minor: 0,
average: 0.05,
major: 0.1,
},
style: 'percent',
};
}
suggestions(when) {
when(this.executeRendsThresholds).addSuggestion((suggest, actual, recommended) => {
return suggest(<>Try to avoid using <SpellLink id={SPELLS.REND_TALENT.id} icon /> on a target in <SpellLink id={SPELLS.EXECUTE.id} icon /> range.</>)
.icon(SPELLS.REND_TALENT.icon)
.actual(`Rend was used ${formatPercentage(actual)}% of the time on a target in execute range.`)
.recommended(`${formatPercentage(recommended)}% is recommended`);
});
}
}
export default RendAnalyzer;
|
website/modules/components/Guide.js | asaf/react-router | import React from 'react'
import PropTypes from 'prop-types'
import { Redirect, Route } from 'react-router-dom'
import { Block } from 'jsxstyle'
import ScrollToDoc from './ScrollToDoc'
import MarkdownViewer from './MarkdownViewer'
// almost identical to `API`, but I'm lazy rn
const Guide = ({ match, data }) => {
const { params: { mod, header: headerParam, environment } } = match
const doc = data.guides.find(doc => mod === doc.title.slug)
const header = doc && headerParam ? doc.headers.find(h => h.slug === headerParam) : null
return !doc ? (
<Redirect to={`/${environment}`}/>
) : (
<Block
className="api-doc-wrapper"
fontSize="80%"
>
<Block className="api-doc">
<ScrollToDoc doc={doc} header={header}/>
<MarkdownViewer html={doc.markup}/>
</Block>
<Route
path={`${match.path}/:header`}
render={({ match: { params: { header: slug }}}) => {
const header = doc.headers.find(h => h.slug === slug )
return header ? (
<ScrollToDoc doc={doc} header={header}/>
) : (
<Redirect to={`/${environment}/guides/${mod}`}/>
)
}}
/>
</Block>
)
}
Guide.propTypes = {
match: PropTypes.object,
data: PropTypes.object
}
export default Guide
|
src/svg-icons/communication/invert-colors-off.js | ArcanisCz/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let CommunicationInvertColorsOff = (props) => (
<SvgIcon {...props}>
<path d="M20.65 20.87l-2.35-2.35-6.3-6.29-3.56-3.57-1.42-1.41L4.27 4.5 3 5.77l2.78 2.78c-2.55 3.14-2.36 7.76.56 10.69C7.9 20.8 9.95 21.58 12 21.58c1.79 0 3.57-.59 5.03-1.78l2.7 2.7L21 21.23l-.35-.36zM12 19.59c-1.6 0-3.11-.62-4.24-1.76C6.62 16.69 6 15.19 6 13.59c0-1.32.43-2.57 1.21-3.6L12 14.77v4.82zM12 5.1v4.58l7.25 7.26c1.37-2.96.84-6.57-1.6-9.01L12 2.27l-3.7 3.7 1.41 1.41L12 5.1z"/>
</SvgIcon>
);
CommunicationInvertColorsOff = pure(CommunicationInvertColorsOff);
CommunicationInvertColorsOff.displayName = 'CommunicationInvertColorsOff';
CommunicationInvertColorsOff.muiName = 'SvgIcon';
export default CommunicationInvertColorsOff;
|
src/components/GuestModal/GuestModal.js | joyvuu-dave/comeals-ui-react | // rendered by MealView
import React from 'react'
import Modal from 'react-modal'
type Props = {
data: {
open: boolean,
host: string,
resident_id: number,
multiplier: number,
vegetarian: boolean
},
actions: {
close: Function,
toggleVeg: Function,
toggleMultiplier: Function,
addGuest: Function
}
};
const customStyles = {
content: {
top: '50%',
left: '50%',
right: 'auto',
bottom: 'auto',
marginRight: '-50%',
transform: 'translate(-50%, -50%)'
}
}
export class GuestModal extends React.Component<void, Props, void> {
constructor () {
super()
this.handleAddGuestClick = this.handleAddGuestClick.bind(this)
}
handleAddGuestClick (e) {
this.props.actions.addGuest({
resident_id: this.props.data.resident_id,
multiplier: this.props.data.multiplier,
vegetarian: this.props.data.vegetarian
})
this.props.actions.close()
}
render () {
return (
<Modal
isOpen={this.props.data.open}
onRequestClose={this.props.actions.close}
style={customStyles} >
<h2>{this.props.data.host}'s Guest</h2>
<form>
<input
type='radio'
checked={this.props.data.multiplier === 2}
onChange={this.props.actions.toggleMultiplier}
name='multiplier'
value='2' />{' '}Adult{' '}
<input
type='radio'
checked={this.props.data.multiplier === 1}
onChange={this.props.actions.toggleMultiplier}
name='multiplier'
value='1' />{' '}Child{' '}
<p>{' '}</p>
<section>
<input
type='checkbox'
checked={this.props.data.vegetarian}
onChange={this.props.actions.toggleVeg} />{' '}Veg
</section>
<p>{' '}</p>
<button
type='button'
onClick={this.props.actions.close}>cancel</button>{' '}
<button
type='button'
onClick={this.handleAddGuestClick}>submit
</button>
</form>
</Modal>
)
}
}
export default GuestModal
|
src/client/react/components/presentational/Result.js | nloomans/rooster.hetmml.nl | /**
* Copyright (C) 2018 Noah Loomans
*
* This file is part of rooster.hetmml.nl.
*
* rooster.hetmml.nl is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* rooster.hetmml.nl is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with rooster.hetmml.nl. If not, see <http://www.gnu.org/licenses/>.
*
*/
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import users from '../../users';
import IconFromUserType from './IconFromUserType';
import './Result.scss';
class Result extends React.Component {
static propTypes = {
userId: PropTypes.string.isRequired,
isSelected: PropTypes.bool.isRequired,
onClick: PropTypes.func.isRequired,
};
render() {
const { onClick, isSelected, userId } = this.props;
return (
/* eslint-disable jsx-a11y/click-events-have-key-events */
/* eslint-disable jsx-a11y/no-static-element-interactions */
<div
className={classnames('Result', { isSelected })}
onClick={onClick}
>
<div className="iconWrapper">
<IconFromUserType userType={users.byId[userId].type} />
</div>
<div className="text">
{users.byId[userId].value}
{users.byId[userId].alt && (
<span className="alt">
{` ${users.byId[userId].alt}`}
</span>
)}
</div>
</div>
);
}
}
export default Result;
|
test/deprecate-Link-location-props-test.js | rackt/rackt-codemod | import React from 'react';
const ACTIVE = { color: 'red' };
class App extends React.Component {
render() {
return (
<div>
<h1>APP!</h1>
<ul>
<li><Link to="/" activeStyle={ACTIVE}>/</Link></li>
<li><IndexLink to="/" activeStyle={ACTIVE}>/ IndexLink</IndexLink></li>
<li><Link to="/users" activeStyle={ACTIVE}>/users</Link></li>
<li><IndexLink to="/users" activeStyle={ACTIVE}>/users IndexLink</IndexLink></li>
<li><Link to="/users/ryan" activeStyle={ACTIVE}>/users/ryan</Link></li>
<li><Link to="/users/ryan" query={{ foo: 'bar' }} activeStyle={ACTIVE}>/users/ryan?foo=bar</Link></li>
<li><Link to="/about" activeStyle={ACTIVE}>/about</Link></li>
</ul>
{this.props.children}
</div>
)
}
}
|
src/server.js | HasanSa/hackathon | import Express from 'express';
import React from 'react';
import ReactDOM from 'react-dom/server';
import config from './config';
import favicon from 'serve-favicon';
import compression from 'compression';
import httpProxy from 'http-proxy';
import path from 'path';
import createStore from './redux/create';
import ApiClient from './helpers/ApiClient';
import Html from './helpers/Html';
import PrettyError from 'pretty-error';
import http from 'http';
import { match } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';
import { ReduxAsyncConnect, loadOnServer } from 'redux-async-connect';
import createHistory from 'react-router/lib/createMemoryHistory';
import {Provider} from 'react-redux';
import getRoutes from './routes';
const targetUrl = config.apiHost + ':' + config.apiPort;
const pretty = new PrettyError();
const app = new Express();
const server = new http.Server(app);
const proxy = httpProxy.createProxyServer({
target: targetUrl,
changeOrigin: true,
ws: false
});
function guid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
}
app.use(compression());
app.use(favicon(path.join(__dirname, '..', 'static', 'favicon.ico')));
app.use(Express.static(path.join(__dirname, '..', 'static')));
// Proxy to API server
app.use('/api', (req, res) => {
const reqId = guid();
const requestTimeRecived = (new Date()).getTime();
res.on('finish', () => console.log('Proxy request ID: ' + reqId + ' was processed in ' + ((new Date()).getTime() - requestTimeRecived) + ' milliseconds. Status: 200'));
console.log('Proxy received request id: ' + reqId + ' to URL: ' + req.url);
proxy.web(req, res, {target: targetUrl}, function() {
console.log('Proxy request ID: ' + reqId + ' was processed in ' + ((new Date()).getTime() - requestTimeRecived) + ' milliseconds. Status: error');
});
});
app.use('/ws', (req, res) => {
proxy.web(req, res, {target: targetUrl + '/ws'});
});
server.on('upgrade', (req, socket, head) => {
proxy.ws(req, socket, head);
});
// added the error handling to avoid https://github.com/nodejitsu/node-http-proxy/issues/527
proxy.on('error', (error, req, res) => {
let json;
if (error.code !== 'ECONNRESET') {
console.error('proxy error', error);
}
if (!res.headersSent) {
res.writeHead(500, {'content-type': 'application/json'});
}
console.log('Proxy error for url request: ' + req.url + '. Error is: ' + error.message );
json = {error: 'proxy_error', reason: error.message};
res.end(JSON.stringify(json));
});
app.use((req, res) => {
if (__DEVELOPMENT__) {
// Do not cache webpack stats: the script file would change since
// hot module replacement is enabled in the development env
webpackIsomorphicTools.refresh();
}
const client = new ApiClient(req);
const memoryHistory = createHistory(req.originalUrl);
const store = createStore(memoryHistory, client);
const history = syncHistoryWithStore(memoryHistory, store);
function hydrateOnClient() {
res.send('<!doctype html>\n' +
ReactDOM.renderToString(<Html assets={webpackIsomorphicTools.assets()} store={store}/>));
}
if (__DISABLE_SSR__) {
hydrateOnClient();
return;
}
const reqId = guid();
const requestTimeRecived = (new Date()).getTime();
match({ history, routes: getRoutes(store), location: req.originalUrl }, (error, redirectLocation, renderProps) => {
if (redirectLocation) {
res.redirect(redirectLocation.pathname + redirectLocation.search);
console.log('Request ID: ' + reqId + ' , to URL: ' + req.url + ' was processed in ' + ((new Date()).getTime() - requestTimeRecived) + ' milliseconds. Status: redirect');
} else if (error) {
console.error('ROUTER ERROR:', pretty.render(error));
res.status(500);
hydrateOnClient();
console.log('Request ID: ' + reqId + ' , to URL: ' + req.url + ' was processed in ' + ((new Date()).getTime() - requestTimeRecived) + ' milliseconds. Status: 500');
} else if (renderProps) {
loadOnServer({...renderProps, store, helpers: {client}, filter: item => !item.deferred}).then(() => {
const component = (
<Provider store={store} key="provider">
<ReduxAsyncConnect {...renderProps}/>
</Provider>
);
res.status(200);
global.navigator = {userAgent: req.headers['user-agent']};
res.send('<!doctype html>\n' +
ReactDOM.renderToString(<Html assets={webpackIsomorphicTools.assets()} component={component} store={store}/>));
console.log('Request ID: ' + reqId + ' , to URL: ' + req.url + ' was processed in ' + ((new Date()).getTime() - requestTimeRecived) + ' milliseconds. Status: 200');
});
} else {
res.status(404).send('Not found');
console.log('Request ID: ' + reqId + ' , to URL: ' + req.url + ' was processed in ' + ((new Date()).getTime() - requestTimeRecived) + ' milliseconds. Status: 404');
}
});
});
if (config.port) {
server.listen(config.port, (err) => {
if (err) {
console.error(err);
}
console.info('----\n==> ✅ %s is running, talking to API server on %s.', config.app.title, config.apiPort);
console.info('==> 💻 Open http://%s:%s in a browser to view the app.', config.host, config.port);
});
} else {
console.error('==> ERROR: No PORT environment variable has been specified');
}
|
examples/js/selection/multi-select-table.js | dana2208/react-bootstrap-table | /* eslint max-len: 0 */
import React from 'react';
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';
const products = [];
function addProducts(quantity) {
const startId = products.length;
for (let i = 0; i < quantity; i++) {
const id = startId + i;
products.push({
id: id,
name: 'Item name ' + id,
price: 2100 + i
});
}
}
addProducts(5);
const selectRowProp = {
mode: 'checkbox'
};
export default class MultiSelectTable extends React.Component {
render() {
return (
<BootstrapTable data={ products } selectRow={ selectRowProp }>
<TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn>
<TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn>
<TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
</BootstrapTable>
);
}
}
|
wrappers/md.js | ahonn/gatsby-blog | /* eslint-disable */
import React from 'react'
import Helmet from 'react-helmet'
import { config } from 'config'
import Article from '../src/layouts/Article'
import Page from '../src/layouts/Page'
module.exports = React.createClass({
propTypes () {
return {
router: React.PropTypes.object,
}
},
render () {
const { page } = this.props.route
const { layout } = page.data
if (layout === 'page') {
return <Page {...this.props} />
}
return (
<Article {...this.props} />
)
},
})
|
src/containers/SalesChance/Information/Information.js | UncleYee/crm-ui | import React from 'react';
import ChanceInfo from './ChanceInfo';
export default class Information extends React.Component {
static propTypes = {
dataInfo: React.PropTypes.object,
editFlag: React.PropTypes.string,
updateChanceData: React.PropTypes.func,
updateLogInfo: React.PropTypes.func,
};
constructor(props) {
super(props);
}
render() {
const dataInfo = this.props.dataInfo || {};
// console.log(this.props.chanceInfo);
return (
<div>
{ /* 机会资料 */ }
<ChanceInfo updateLogInfo={this.props.updateLogInfo} updateChanceData={this.props.updateChanceData} editFlag={this.props.editFlag} dataInfo={dataInfo} />
</div>
);
}
}
|
react/react-svg/src/index.js | yuanzhaokang/myAwesomeSimpleDemo | import 'core-js/fn/object/assign';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/Main';
// Render the main component into the dom
ReactDOM.render(<App />, document.getElementById('app'));
|
src/features/movie-detail-tv/index.js | rldona/react-native-tab-view-seed | import React, { Component } from 'react';
import {
Text,
Image,
View,
TouchableOpacity,
ScrollView,
StyleSheet,
Dimensions,
Share,
InteractionManager
} from 'react-native';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import * as historialActions from '../../redux/actions/historialActions';
import * as firebase from 'firebase';
import * as userService from '../../services/user-service';
import * as themoviedb from '../../services/movies-service';
import * as colors from '../../common/colors';
import Icon from 'react-native-vector-icons/MaterialIcons';
import Header from '../../common/header';
import Loading from '../../common/loading';
import Score from '../../common/score';
import SwitchLists from '../../common/switch-lists';
import MoviesListHorizontal from '../../common/movie-list-horizontal';
const { width, height } = Dimensions.get('window');
class MovieDetailTv extends Component {
constructor(props) {
super(props);
this.state = {
// movie: null,
// loaded: false,
movie: themoviedb.getCurrentMovie(),
loaded: true,
cast: {
director: '-',
writer: '-',
actors: []
},
overviewNumberLines: 2
}
}
componentWillMount() {
InteractionManager.runAfterInteractions(() => {
themoviedb.getMovie('tv', themoviedb.getCurrentMovie().id).then((data) => {
this.setState({
movie: data,
loaded: true
});
});
themoviedb.getCredits('tv', themoviedb.getCurrentMovie().id).then((data) => {
let cast = {
actors: [
data.cast[0].name,
data.cast[1].name,
data.cast[2].name,
data.cast[3].name,
data.cast[4].name
]
};
this.setState({cast: cast});
}).catch((error) => {
console.log(error);
});
});
}
_onActionSelected = (action) => {
switch (action) {
case 'left':
themoviedb.getNavigator().pop();
break;
case 'right':
this.share();
break;
}
}
share() {
Share.share({
message: 'Te recomiendo esta serie: https://filmist.es/movies/' + this.state.movie.id
})
.then(() => console.log('ok'))
.catch((error) => this.setState({result: 'error: ' + error.message}));
}
_onExtendOverview = () => {
if (this.state.overviewNumberLines <= 2) {
this.setState({overviewNumberLines: 100});
} else {
this.setState({overviewNumberLines: 2});
}
}
_renderMoreLinesText = () => {
if (this.state.overviewNumberLines <= 2) {
return 'LEER MÁS';
} else {
return 'LEER MENOS';
}
}
_renderMoreLinesIcon = () => {
if (this.state.overviewNumberLines <= 2) {
return 'expand-more';
} else {
return 'expand-less';
}
}
renderSwitchLists() {
let currentUser = userService.getCurrentUser();
return (
<SwitchLists user={currentUser} />
);
}
renderInfoPlus() {
if (this.state.cast.actors.length === 0) {
return (
<View style={{paddingHorizontal: 15, paddingVertical: 10, backgroundColor: colors.getList().secondary}}>
<View style={{flexDirection: 'row', alignItems: 'flex-start', justifyContent: 'space-between', marginBottom: 15}}>
<View>
<Text style={{fontSize: 15, color: "#FFF", marginBottom: 10, fontWeight: '400', backgroundColor: '#333', paddingVertical: 5, width: 150}}></Text>
<Text style={{fontSize: 12, color: "#CCC", marginBottom: 0, fontWeight: '400', backgroundColor: '#333', paddingVertical: 5, width: width - 50}}></Text>
</View>
</View>
<View>
<Text style={{fontSize: 15, color: "#FFF", marginBottom: 10, fontWeight: '400', backgroundColor: '#333', paddingVertical: 5, width: 150}}></Text>
<Text style={{fontSize: 12, color: "#CCC", marginBottom: 0, fontWeight: '400', backgroundColor: '#333', paddingVertical: 5, width: width - 50}}></Text>
</View>
</View>
);
}
return (
<View style={{paddingHorizontal: 15, paddingVertical: 15, backgroundColor: colors.getList().secondary}}>
<View style={{flexDirection: 'row', alignItems: 'flex-start', justifyContent: 'space-between', marginBottom: 10}}>
<View>
<Text style={{fontSize: 15, color: "#FFF", marginBottom: 3, fontWeight: '400'}}>Temporadas</Text>
<Text style={{fontSize: 12, color: "#CCC", marginBottom: 8, fontWeight: '400'}}>{this.state.movie.number_of_seasons}</Text>
</View>
<View style={{minWidth: 100}}>
<Text style={{fontSize: 15, color: "#FFF", marginBottom: 3, fontWeight: '400'}}>Capítulos</Text>
<Text style={{fontSize: 12, color: "#CCC", marginBottom: 8, fontWeight: '400'}}>{this.state.movie.number_of_episodes}</Text>
</View>
<View style={{minWidth: 60}}>
<Text style={{fontSize: 15, color: "#FFF", marginBottom: 3, fontWeight: '400'}}>Año</Text>
<Text style={{fontSize: 12, color: "#CCC", marginBottom: 0, fontWeight: '400'}}>{this.state.movie.first_air_date.split('-')[0]}</Text>
</View>
</View>
<View>
<Text style={{fontSize: 15, color: "#FFF", marginBottom: 3, fontWeight: '400'}}>Reparto</Text>
<Text style={{fontSize: 12, color: "#CCC", marginBottom: 8, fontWeight: '400'}}>{this.state.cast.actors[0]}, {this.state.cast.actors[1]}, {this.state.cast.actors[2]}, {this.state.cast.actors[3]}, {this.state.cast.actors[4]}</Text>
</View>
</View>
);
}
render() {
if (!this.state.loaded) {
return (
<View style={{backgroundColor: colors.getList().primary, height: height}}>
<View style={{backgroundColor: colors.getList().secondary, height: 190}}>
<Header
isTransparent={true}
title=""
actions={{ left: { icon: 'arrow-back' }, right: { icon: 'share' } }}
onActionSelected={this._onActionSelected.bind(this)} />
</View>
<View style={{padding: 0, marginTop: 0}}>
<View style={{padding: 15}}>
<View style={{marginVertical: 10, marginBottom: 20}}>
<Text style={{width: width-200, height: 20, backgroundColor: '#222'}}></Text>
</View>
<View>
<Text style={{width: width-150, height: 20, backgroundColor: colors.getList().secondary, marginBottom: 10}}></Text>
<Text style={{width: width-40, height: 20, backgroundColor: colors.getList().secondary, marginBottom: 10}}></Text>
<Text style={{width: width-40, height: 20, backgroundColor: colors.getList().secondary, marginBottom: 10}}></Text>
<Text style={{width: width-40, height: 20, backgroundColor: colors.getList().secondary, marginBottom: 10}}></Text>
</View>
</View>
<View style={{height: height, backgroundColor: '#000', paddingHorizontal: 15, paddingVertical: 20}}>
<Text style={{width: width-150, height: 20, backgroundColor: '#111', marginBottom: 10}}></Text>
<Text style={{width: width-150, height: 20, backgroundColor: '#111', marginBottom: 10}}></Text>
<Text style={{width: width-150, height: 20, backgroundColor: '#111', marginBottom: 10}}></Text>
<Text style={{width: width-150, height: 20, backgroundColor: '#111', marginBottom: 10}}></Text>
</View>
</View>
</View>
);
}
return (
<ScrollView
renderToHardwareTextureAndroid={true}
showsVerticalScrollIndicator={false}
style={{ backgroundColor: colors.getList().primary, height: height }}>
<View>
<Image
resizeMode={'cover'}
style={{height: 200, backfaceVisibility: 'hidden', borderBottomWidth: 0, borderColor: colors.getList().app}}
source={{uri: 'http://image.tmdb.org/t/p/w500' + this.state.movie.backdrop_path}}>
<View style={{position: 'absolute', top: 0, left:0 , width: width, height: 200, backgroundColor: 'rgba(0, 0, 0, 0.25)'}}></View>
<Header
isTransparent={true}
title=""
actions={{ left: { icon: 'arrow-back' }, right: { icon: 'share' } }}
onActionSelected={this._onActionSelected.bind(this)} />
</Image>
</View>
<View style={{padding: 0, marginTop: 0}}>
<View style={{padding: 15, paddingBottom: 10}}>
<Text style={{fontSize: 18, fontWeight: '600', color: '#FFF', marginBottom: 2}}>
{this.state.movie.name}
</Text>
<View style={{marginTop: 5}}>
<Score score={this.state.movie.vote_average} />
</View>
<Text
numberOfLines={this.state.overviewNumberLines}
style={{fontSize: 15, lineHeight: 26, fontWeight: '300', color: '#FFF', marginTop: 0, marginBottom: 0, textAlign: 'auto' }}>
{this.state.movie.overview ? this.state.movie.overview : 'Sinopsis no disponible'}
</Text>
<View style={{paddingVertical: 5}}></View>
{
this.state.movie.overview ?
<TouchableOpacity
style={{flexDirection: 'row', alignItems: 'center', alignSelf: 'center', marginBottom: 0}}
onPress={this._onExtendOverview}
activeOpacity={0.9}>
<Text style={{textAlign: 'center', color: '#666', fontSize: 12}}>
{this._renderMoreLinesText()}
</Text>
<Icon color='#666' name={this._renderMoreLinesIcon()} style={{fontSize: 25}} />
</TouchableOpacity> : null
}
</View>
</View>
<SwitchLists movie={this.state.movie} />
{this.renderInfoPlus()}
<MoviesListHorizontal
title="Descubre del mismo género"
type="tv"
collection="similar"
position="horizontal"
{...this.props} />
<View style={{paddingVertical: 10}}></View>
</ScrollView>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
bgFake: {
height: 220,
},
button: {
backgroundColor: '#AAA',
padding: 20
},
infoContainer: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
width: 200,
position: 'absolute',
top: -48,
left: 140,
},
infoItem: {
fontSize: 15,
marginBottom: 10,
backgroundColor: colors.getList().secondary,
padding: 10,
color: '#FFF',
minWidth: 60,
textAlign: 'center',
marginRight: 10,
borderRadius: 3
},
infoItemFake: {
fontSize: 15,
marginBottom: 10,
backgroundColor: colors.getList().secondary,
padding: 10,
color: colors.getList().secondary,
minWidth: 60,
textAlign: 'center',
marginRight: 10,
borderRadius: 3
},
extendInfo: {
elevation: 10,
backgroundColor: '#171717',
padding: 15,
marginBottom: 10
},
extendInfoRow: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-start',
paddingVertical: 5
},
extendInfoTitle: {
color: '#999',
minWidth: 130
},
extendInfoText: {
color: '#FFF'
}
});
function mapStateToProps(state, ownProps) {
return {
historial: state.historial
};
}
function mapDispatchToProps(dispatch) {
return {
actions: {
historial: bindActionCreators(historialActions, dispatch)
}
};
}
export default connect(mapStateToProps, mapDispatchToProps)(MovieDetailTv);
|
src/Containers/NotificationsContainer.js | sashasushko/moira-front | // @flow
import React from 'react';
import type { ContextRouter } from 'react-router-dom';
import type { IMoiraApi } from '../Api/MoiraAPI';
import type { Notification } from '../Domain/Notification';
import { withMoiraApi } from '../Api/MoiraApiInjection';
import Layout from '../Components/Layout/Layout';
type Props = ContextRouter & { moiraApi: IMoiraApi };
type State = {|
loading: boolean;
error: boolean;
list: ?Array<Notification>;
total: number;
|};
class NotificationsContainer extends React.Component {
props: Props;
state: State = {
loading: true,
error: true,
list: null,
total: 0,
};
componentDidMount() {
this.getData();
}
async getData(): Promise<void> {
const { moiraApi } = this.props;
try {
const notifications = await moiraApi.getNotificationList();
this.setState({ loading: false, ...notifications });
}
catch (error) {
this.setState({ error: true });
}
}
render(): React.Element<*> {
const { loading, error, list } = this.state;
return (
<Layout loading={loading} loadingError={error}>
<Layout.Content>
<pre>{JSON.stringify(list, null, 2)}</pre>
</Layout.Content>
</Layout>
);
}
}
export default withMoiraApi(NotificationsContainer);
|
src/components/ui/FeatureList.js | meetfranz/franz | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { defineMessages, intlShape } from 'react-intl';
import { FeatureItem } from './FeatureItem';
import { PLANS } from '../../config';
const messages = defineMessages({
availableRecipes: {
id: 'pricing.features.recipes',
defaultMessage: '!!!Choose from more than 70 Services',
},
accountSync: {
id: 'pricing.features.accountSync',
defaultMessage: '!!!Account Synchronisation',
},
desktopNotifications: {
id: 'pricing.features.desktopNotifications',
defaultMessage: '!!!Desktop Notifications',
},
unlimitedServices: {
id: 'pricing.features.unlimitedServices',
defaultMessage: '!!!Add unlimited services',
},
upToThreeServices: {
id: 'pricing.features.upToThreeServices',
defaultMessage: '!!!Add up to 3 services',
},
upToSixServices: {
id: 'pricing.features.upToSixServices',
defaultMessage: '!!!Add up to 6 services',
},
spellchecker: {
id: 'pricing.features.spellchecker',
defaultMessage: '!!!Spellchecker support',
},
workspaces: {
id: 'pricing.features.workspaces',
defaultMessage: '!!!Workspaces',
},
customWebsites: {
id: 'pricing.features.customWebsites',
defaultMessage: '!!!Add Custom Websites',
},
onPremise: {
id: 'pricing.features.onPremise',
defaultMessage: '!!!On-premise & other Hosted Services',
},
thirdPartyServices: {
id: 'pricing.features.thirdPartyServices',
defaultMessage: '!!!Install 3rd party services',
},
serviceProxies: {
id: 'pricing.features.serviceProxies',
defaultMessage: '!!!Service Proxies',
},
teamManagement: {
id: 'pricing.features.teamManagement',
defaultMessage: '!!!Team Management',
},
appDelays: {
id: 'pricing.features.appDelays',
defaultMessage: '!!!No Waiting Screens',
},
adFree: {
id: 'pricing.features.adFree',
defaultMessage: '!!!Forever ad-free',
},
appDelayEnabled: {
id: 'pricing.features.appDelaysEnabled',
defaultMessage: '!!!Occasional Waiting Screens',
},
});
export class FeatureList extends Component {
static propTypes = {
className: PropTypes.string,
featureClassName: PropTypes.string,
plan: PropTypes.oneOf(Object.keys(PLANS)),
};
static defaultProps = {
className: '',
featureClassName: '',
plan: false,
}
static contextTypes = {
intl: intlShape,
};
render() {
const {
className,
featureClassName,
plan,
} = this.props;
const { intl } = this.context;
const features = [];
if (plan === PLANS.FREE) {
features.push(
messages.appDelayEnabled,
messages.upToThreeServices,
messages.availableRecipes,
messages.accountSync,
messages.desktopNotifications,
);
} else if (plan === PLANS.PERSONAL) {
features.push(
messages.upToSixServices,
messages.spellchecker,
messages.appDelays,
messages.adFree,
);
} else if (plan === PLANS.PRO) {
features.push(
messages.unlimitedServices,
messages.workspaces,
messages.customWebsites,
// messages.onPremise,
messages.thirdPartyServices,
// messages.serviceProxies,
);
} else {
features.push(
messages.unlimitedServices,
messages.spellchecker,
messages.workspaces,
messages.customWebsites,
messages.onPremise,
messages.thirdPartyServices,
messages.serviceProxies,
messages.teamManagement,
messages.appDelays,
messages.adFree,
);
}
return (
<ul className={className}>
{features.map(feature => <FeatureItem name={intl.formatMessage(feature)} className={featureClassName} />)}
</ul>
);
}
}
export default FeatureList;
|
src/interface/icons/Intellect.js | fyruna/WoWAnalyzer | import React from 'react';
const icon = props => (
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="16 17 32 32" className="icon" {...props}>
<path d="M28.832,44.802h6.559v-1.101h-6.559V44.802z M29.91,47.004h4.402v-1.101H29.91V47.004z M32.156,18.379c-0.012,0-0.031,0-0.045,0c-0.014,0-0.033,0-0.045,0c-1.078,0-9.704,0.127-9.704,11.01 c0,2.696,1.5,4.496,2.949,6.234c1.255,1.507,2.442,2.928,2.442,4.776V42.6h8.715v-2.202c0-1.848,1.187-3.269,2.442-4.776 c1.449-1.737,2.949-3.537,2.949-6.234C41.86,18.506,33.235,18.379,32.156,18.379z" />
</svg>
);
export default icon;
|
storybook/container.js | Byndyusoft/ui.molecules | import React from 'react';
export default story => <div style={{ padding: 16 }}>{ story() }</div>;
|
src/components/Icons.js | stefcot/react-design-easier | import React from 'react';
import * as ActionTypes from './../actions/ActionTypes';
const Icons = {};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.SELECT] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color} fillOpacity={0.5} stroke="none" d="
M 6 2
L 5 2 5 12 6 12 6 2 Z"/>
<path fill={this.props.color} stroke="none" d="
M 6 2
L 6 1 5 1 5 0 4 0 4 14 5 14 5 13 6 13 6 12 5 12 5 2 6 2
M 12 8
L 12 7 11 7 11 6 10 6 10 5 9 5 9 4 8 4 8 3 7 3 7 2 6 2
6 12 7 12 7 11 8 11 8 13 9 13 9 15 10 15 10 17 12 17 12
14 11 14 11 12 10 12 10 10 14 10 14 9 13 9 13 8 12 8 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef}/>
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.SEND_TO_BACK] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color} stroke="none" d="
M 9 11
L 7 11 7 12 9 12 9 11
M 10 12
L 9 12 9 13 10 13 10 12
M 5 10
L 5 11 7 11 7 10 5 10
M 1 9
L 0 9 0 10 1 10 1 9
M 1 7
L 0 7 0 8 1 8 1 7
M 3 9
L 3 8 1 8 1 9 3 9
M 5 9
L 3 9 3 10 5 10 5 9
M 4 4
L 3 4 3 5 4 5 4 4
M 2 6
L 1 6 1 7 2 7 2 6
M 2 5
L 2 6 3 6 3 5 2 5
M 5 3
L 4 3 4 4 5 4 5 3
M 6 3
L 6 2 5 2 5 3 6 3
M 7 2
L 7 1 6 1 6 2 7 2
M 8 1
L 8 0 7 0 7 1 8 1
M 10 2
L 10 1 8 1 8 2 10 2
M 16 7
L 16 6 15 6 15 7 16 7
M 16 7
L 16 8 17 8 17 7 16 7
M 12 9
L 12 10 13 10 13 9 12 9
M 12 11
L 12 10 11 10 11 11 12 11
M 11 12
L 11 11 10 11 10 12 11 12
M 13 8
L 13 9 14 9 14 10 13 10 13 11 12 11 12 12 11 12 11 13 10 13 10 14 9 14 9 13 7 13 7 12 5 12 5 11 3 11 3 10 1 10 1 11 0 11 0 12 1 12 1 13 3 13 3 14 5 14 5 15 7 15 7 16 9 16 9 17 10 17 10 16 11 16 11 15 12 15 12 14 13 14 13 13 14 13 14 12 15 12 15 11 16 11 16 10 17 10 17 9 16 9 16 8 15 8 15 8.95 14 8.95 14 8 13 8
M 15 7
L 14 7 14 8 15 8 15 7
M 12 3
L 12 2 10 2 10 3 12 3
M 14 4
L 14 3 12 3 12 4 14 4
M 16 5
L 16 4 14 4 14 5 16 5
M 17 5
L 16 5 16 6 17 6 17 5 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.SEND_TO_FRONT] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color} stroke="none" d="
M 11 14
L 11 15 12 15 12 14 11 14
M 13 14
L 13 13 12 13 12 14 13 14
M 3 14
L 5 14 5 13 3 13 3 14
M 10 15
L 10 16 11 16 11 15 10 15
M 7 16
L 9 16 9 15 7 15 7 16
M 10 16
L 9 16 9 17 10 17 10 16
M 7 15
L 7 14 5 14 5 15 7 15
M 9 14
L 9 15 10 15 10 14 9 14
M 9 14
L 9 13 7 13 7 14 9 14
M 10 13
L 10 14 11 14 11 13 10 13
M 7 12
L 5 12 5 13 7 13 7 12
M 3 12
L 1 12 1 13 3 13 3 12
M 5 12
L 5 11 3 11 3 12 5 12
M 1 12
L 1 11 0 11 0 12 1 12
M 1 10
L 1 11 3 11 3 10 1 10
M 1 9
L 0 9 0 10 1 10 1 9
M 17 9
L 16 9 16 10 17 10 17 9
M 16 7
L 16 8 17 8 17 7 16 7
M 14 12
L 13 12 13 13 14 13 14 12
M 15 10
L 15 11 16 11 16 10 15 10
M 13 11
L 14 11 14 10 13 10 13 11
M 14 11
L 14 12 15 12 15 11 14 11
M 12 11
L 12 12 13 12 13 11 12 11
M 12 12
L 11 12 11 13 12 13 12 12
M 15 8
L 15 9 16 9 16 8 15 8
M 15 9
L 14 9 14 10 15 10 15 9
M 16 5
L 16 4 14 4 14 3 12 3 12 2 10 2 10 1 8 1 8 0 7 0 7 1 6 1 6 2 5 2 5 3 4 3 4 4 3 4 3 5 2 5 2 6 1 6 1 7 0 7 0 8 1 8 1 9 3 9 3 10 5 10 5 11 7 11 7 12 9 12 9 13 10 13 10 12 11 12 11 11 12 11 12 10 13 10 13 9 14 9 14 8 15 8 15 7 16 7 16 6 17 6 17 5 16 5 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.SAVE] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 2 16
L 2 17 17 17 17 0 0 0 0 15 1 15 1 16 2 16
M 14 1
L 14 6 3 6 3 1 14 1
M 15 1
L 16 1 16 2 15 2 15 1
M 4 12
L 13 12 13 16 4 16 4 12
M 7 13
L 5 13 5 15 7 15 7 13 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.ERASE] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 6 6
L 5 6 5 7 6 7 6 6
M 10 12
L 9 12 9 13 10 13 10 12
M 1 12
L 0 12 0 14 9 14 9 13 8 13 8 12 7 12 7 13 1 13 1 12
M 2 12
L 2 10 1 10 1 12 2 12
M 4 8
L 3 8 3 9 2 9 2 10 8 10 8 12 9 12 9 10 10 10 10 9 4 9 4 8
M 5 8
L 5 7 4 7 4 8 5 8
M 7 4
L 7 5 8 5 8 4 7 4
M 7 6
L 7 5 6 5 6 6 7 6
M 9 3
L 8 3 8 4 9 4 9 3
M 16 5
L 15 5 15 7 16 7 16 5
M 12 10
L 13 10 13 9 12 9 12 10
M 12 10
L 11 10 11 11 12 11 12 10
M 11 12
L 11 11 10 11 10 12 11 12
M 12 7
L 11 7 11 8 12 8 12 7
M 11 9
L 11 8 10 8 10 9 11 9
M 14 8
L 13 8 13 9 14 9 14 8
M 14 7
L 14 8 15 8 15 7 14 7
M 13 6
L 12 6 12 7 13 7 13 6
M 15 5
L 15 4 14 4 14 5 15 5
M 13 6
L 14 6 14 5 13 5 13 6
M 17 5
L 17 2 9 2 9 3 15 3 15 4 16 4 16 5 17 5 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.UNDO] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 5.1 6.95
L 5.75 3 0 8.5 6.75 13 5.15 9.4
Q 11.7 7.9 17 11.4
L 17 10.25
Q 12.1 6.3 5.1 6.95 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.REDO] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 11.9 6.95
Q 4.9 6.3 0 10.25
L 0 11.4
Q 5.3 7.9 11.85 9.4
L 10.25 13 17 8.5 11.25 3 11.9 6.95 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.HELP] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 9.55 13.55
Q 9.55 12.9 9.15 12.5 8.7 12.05 8.1 12.05 7.55 12.05 7.1 12.5 6.65 12.9 6.65 13.55 6.65 14.2 7.1 14.65 7.55 15 8.1 15 8.7 15 9.15 14.65 9.55 14.2 9.55 13.55
M 11.5 6.5
Q 12 5.8 12 4.9 12 3.7 11.1 2.85 10.15 2 8.45 2 6.8 2 5.95 2.85 5 3.65 5 4.75 5 5.35 5.3 5.7 5.65 6.05 6.15 6.05 6.6 6.05 6.95 5.75 7.2 5.45 7.2 5 7.2 4.5 6.8 3.8 6.65 3.45 6.65 3.35 6.65 3.15 6.9 2.9 7.25 2.65 7.75 2.65 8.3 2.65 8.8 3.25 9.3 3.8 9.3 5 9.3 5.8 9.15 6.35 9 6.9 8.5 7.8 8.05 8.7 7.95 9.2 7.8 9.7 7.8 10.75
L 8.2 10.75
Q 8.25 9.75 8.55 9.3 8.8 8.8 9.7 8.2 11.1 7.3 11.5 6.5 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.RECT] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 17 2
L 0 2 0 15 17 15 17 2 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.WHITE_RECT] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path stroke={this.props.color}
strokeWidth="1"
strokeLinejoin="miter"
strokeLinecap="square"
fill="none" d="
M 17.5 2.5
L 17.5 14.5 0.5 14.5 0.5 2.5 17.5 2.5"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.CIRCLE] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 16 8.5
Q 16 5.35 13.8 3.15 12.15 1.55 9.95 1.15 9.25 1 8.5 1
8.45 1 8.4 1 5.3 1 3.15 3.15 1 5.3 1 8.4 1 8.45 1 8.5
1 9.25 1.15 9.95 1.55 12.15 3.15 13.8 5.35 16 8.5 16
11.65 16 13.8 13.8 16 11.65 16 8.5 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.WHITE_CIRCLE] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path stroke={this.props.color}
strokeWidth="1"
strokeLinejoin="round"
strokeLinecap="round"
fill="none" d="
M 15.5 8.5
Q 15.5 11.45 13.45 13.45 11.45 15.5 8.5 15.5 5.55 15.5 3.5
13.45 2 11.9 1.65 9.85 1.5 9.2 1.5 8.5 1.5 8.45 1.5 8.4 1.5
5.5 3.5 3.5 5.5 1.5 8.4 1.5 8.45 1.5 8.5 1.5 9.2 1.5 9.85 1.65
11.9 2 13.45 3.5 15.5 5.55 15.5 8.5 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.ARC] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 3 3
L 3 0 0 0 0 3 1 3
Q 1.1 5.5 2.15 7.9 3.2 10.35 4.95 12.05 6.65 13.8 9.1 14.85 11.5 15.85 14 15.95
L 14 16.95 17 16.95 17 13.95 14 13.95 14 14.95
Q 11.75 14.85 9.5 13.9 7.2 12.95 5.65 11.35 4.05 9.8 3.1 7.5 2.1 5.25 2 3
L 3 3
M 1 1
L 2 1 2 2 1 2 1 1
M 16 14.95
L 16 15.95 15 15.95 15 14.95 16 14.95 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.PLAIN_STROKE] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 14 14
L 14 15 15 15 15 14 14 14
M 13 14
L 14 14 14 13 13 13 13 14
M 16 16
L 16 15 15 15 15 16 16 16
M 16 16
L 16 17 17 17 17 16 16 16
M 10 9
L 9 9 9 10 10 10 10 9
M 8 9
L 9 9 9 8 8 8 8 9
M 8 8
L 8 7 7 7 7 8 8 8
M 4 4
L 4 5 5 5 5 4 4 4
M 1 2
L 2 2 2 1 1 1 1 2
M 0 1
L 1 1 1 0 0 0 0 1
M 3 3
L 3 2 2 2 2 3 3 3
M 4 3
L 3 3 3 4 4 4 4 3
M 6 6
L 6 5 5 5 5 6 6 6
M 7 6
L 6 6 6 7 7 7 7 6
M 11 11
L 11 10 10 10 10 11 11 11
M 13 12
L 12 12 12 13 13 13 13 12
M 11 11
L 11 12 12 12 12 11 11 11 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.DOTTED_STROKE] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 14 15
L 15 15 15 14 14 14 14 15
M 16 16
L 16 17 17 17 17 16 16 16
M 8 9
L 9 9 9 8 8 8 8 9
M 4 4
L 4 5 5 5 5 4 4 4
M 0 0
L 0 1 1 1 1 0 0 0
M 3 3
L 3 2 2 2 2 3 3 3
M 7 6
L 6 6 6 7 7 7 7 6
M 11 11
L 11 10 10 10 10 11 11 11
M 13 12
L 12 12 12 13 13 13 13 12 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.DASHED_STROKE] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 16 16
L 16 15 15 15 15 16 16 16
M 16 16
L 16 17 17 17 17 16 16 16
M 0 1
L 1 1 1 0 0 0 0 1
M 1 2
L 2 2 2 1 1 1 1 2
M 4 4
L 4 5 5 5 5 4 4 4
M 4 3
L 3 3 3 4 4 4 4 3
M 8 8
L 8 7 7 7 7 8 8 8
M 7 6
L 6 6 6 7 7 7 7 6
M 10 9
L 9 9 9 10 10 10 10 9
M 11 11
L 11 10 10 10 10 11 11 11
M 14 13
L 13 13 13 14 14 14 14 13
M 13 12
L 12 12 12 13 13 13 13 12 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.PEN] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 1 15
L 1 13 0 13 0 17 4 17 4 16 2 16 2 15 1 15
M 4 14
L 3 14 3 15 4 15 4 14
M 3 14
L 3 13 2 13 2 14 3 14
M 5 15
L 4 15 4 16 5 16 5 15
M 7 14
L 7 13 6 13 6 14 7 14
M 6 15
L 6 14 5 14 5 15 6 15
M 8 12
L 7 12 7 13 8 13 8 12
M 10 10
L 9 10 9 11 10 11 10 10
M 9 11
L 8 11 8 12 9 12 9 11
M 6 7
L 6 8 7 8 7 7 6 7
M 3 11
L 4 11 4 10 3 10 3 11
M 2 11
L 2 12 3 12 3 11 2 11
M 2 12
L 1 12 1 13 2 13 2 12
M 5 8
L 5 9 6 9 6 8 5 8
M 5 9
L 4 9 4 10 5 10 5 9
M 8 6
L 7 6 7 7 8 7 8 6
M 9 6
L 9 5 8 5 8 6 9 6
M 10 5
L 10 4 9 4 9 5 10 5
M 11 10
L 11 9 10 9 10 10 11 10
M 11 8
L 11 9 12 9 12 8 11 8
M 13 8
L 13 7 12 7 12 8 13 8
M 12 3
L 12 2 11 2 11 3 10 3 10 4 11 4 11 5 12 5 12 6 13 6 13 7 14 7 14 6 15 6 15 5 14 5 14 4 13 4 13 3 12 3
M 13 2
L 13 1 12 1 12 2 13 2
M 15 1
L 14 1 14 2 15 2 15 1
M 14 1
L 14 0 13 0 13 1 14 1
M 16 3
L 16 2 15 2 15 3 16 3
M 17 3
L 16 3 16 4 17 4 17 3
M 16 5
L 16 4 15 4 15 5 16 5 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.TEXTFIELD] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 13 17
L 14 17 14 16 13 16 13 17
M 11 17
L 12 17 12 16 11 16 11 17
M 16 17
L 16 16 15 16 15 17 16 17
M 16 15
L 16 14 15 14 15 15 16 15
M 4 16
L 3 16 3 17 4 17 4 16
M 1 16
L 1 17 2 17 2 16 1 16
M 2 15
L 2 14 1 14 1 15 2 15
M 10 16
L 9 16 9 17 10 17 10 16
M 6 17
L 6 16 5 16 5 17 6 17
M 7 16
L 7 17 8 17 8 16 7 16
M 1 10
L 1 11 2 11 2 10 1 10
M 2 12
L 1 12 1 13 2 13 2 12
M 2 9
L 2 8 1 8 1 9 2 9
M 1 5
L 2 5 2 4 1 4 1 5
M 2 6
L 1 6 1 7 2 7 2 6
M 2 0
L 1 0 1 1 2 1 2 0
M 1 3
L 2 3 2 2 1 2 1 3
M 4 1
L 4 0 3 0 3 1 4 1
M 6 1
L 6 0 5 0 5 1 6 1
M 10 1
L 10 0 9 0 9 1 10 1
M 8 1
L 8 0 7 0 7 1 8 1
M 16 7
L 16 6 15 6 15 7 16 7
M 16 12
L 15 12 15 13 16 13 16 12
M 15 10
L 15 11 16 11 16 10 15 10
M 15 8
L 15 9 16 9 16 8 15 8
M 12 4
L 12 5 13 5 13 3 4 3 4 5 5 5 5 4 8 4 8 13 7 13 7 14 10 14 10 13 9 13 9 4 12 4
M 12 0
L 11 0 11 1 12 1 12 0
M 14 0
L 13 0 13 1 14 1 14 0
M 16 5
L 16 4 15 4 15 5 16 5
M 16 3
L 16 2 15 2 15 3 16 3
M 16 1
L 16 0 15 0 15 1 16 1 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.DIMENSION] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 6 4
L 6 5 7.95 5 7.95 3 6.95 3 6.95 4 6 4
M 6.95 3
L 6.95 2 5 2 5 3 6.95 3
M 10 3
L 9 3 9 4 10 4 10 3
M 11 5
L 11 4 10 4 10 5 11 5
M 11 3
L 11 2 10 2 10 3 11 3
M 12 3
L 11 3 11 4 12 4 12 3
M 3 8
L 3 9 4 9 4 8 3 8
M 4 5
L 4 4 3 4 3 5 4 5
M 13 9
L 14 9 14 8 13 8 13 9
M 13 4
L 13 5 14 5 14 4 13 4
M 17 3
L 16 3 16 6 15 6 15 5 14 5 14 6 3 6 3 5 2 5 2 6 1 6 1 3 0 3 0 15 1 15 1 7 2 7 2 8 3 8 3 7 14 7 14 8 15 8 15 7 16 7 16 15 17 15 17 3 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.WINDOW] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 16 11
L 17 11 17 6 16 6 16 7 1 7 1 6 0 6 0 11 1 11 1 10 16 10 16 11
M 16 8
L 16 9 1 9 1 8 16 8 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.DOOR] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 1 4
L 1 3 0 3 0 14 1 14 1 4
M 17 3
L 16 3 16 4 16 14 17 14 17 3 Z"/>
<path fill={this.props.color}
fillOpacity={0.5}
stroke="none" d="
M 16 3
Q 12.8 3.2 10.5 5.75 9.1 7.25 8.5 9.1 7.9 7.25 6.55 5.75
L 6.55 5.8
Q 4.3 3.2 1.1 3
L 1 3 1 4 1.05 4
Q 3.85 4.2 5.8 6.45 7.95 8.8 8 12.2
L 8.05 13.7 8.95 13.7 9 12.2
Q 9.05 8.8 11.25 6.45 13.25 4.2 16 4
L 16 3 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.DOUBLE_DOOR] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 1 1.05
L 1 0.05
Q 0.75 0 0.5 0
L 0 0 0 17 1 17 1 1.05 Z"/>
<path fill={this.props.color}
fillOpacity={0.5}
stroke="none" d="
M 1 1.05
Q 1.15 1.05 1.35 1.05
L 1.4 1.05
Q 7.2 1.35 11.45 5.4 16 9.65 16 15.75
L 16 17 17 17 17 15.75
Q 17 9.25 12.15 4.65 7.6 0.35 1.45 0.05 1.2 0.05 1 0.05
L 1 1.05 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.BIDET] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 12 15
L 11 15 11 16 13 16 13 14 12 14 12 15
M 6 16
L 6 17 11 17 11 16 6 16
M 6 16
L 6 15 5 15 5 14 4 14 4 16 6 16
M 4 11
L 3 11 3 14 4 14 4 11
M 3 6
L 2 6 2 11 3 11 3 6
M 4 6
L 4 5 3 5 3 6 4 6
M 4 1
L 3 1 3 4 4 4 4 1
M 14 11
L 13 11 13 14 14 14 14 11
M 10 12
L 10 14 11 14 11 12 10 12
M 10 15
L 10 14 7 14 7 15 10 15
M 7 12
L 6 12 6 14 7 14 7 12
M 5 7
L 5 12 6 12 6 7 5 7
M 11 7
L 11 6 6 6 6 7 11 7
M 7 10
L 8 10 8 9 7 9 7 10
M 8 11
L 9 11 9 10 8 10 8 11
M 10 9
L 9 9 9 10 10 10 10 9
M 8 8
L 8 9 9 9 9 8 8 8
M 11 12
L 12 12 12 7 11 7 11 12
M 14 5
L 13 5 13 6 14 6 14 5
M 13 5
L 13 4 4 4 4 5 13 5
M 15 6
L 14 6 14 11 15 11 15 6
M 14 1
L 13 1 13 4 14 4 14 1
M 13 1
L 13 0 4 0 4 1 13 1 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.SHOWER] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 0 16.95
L 17 16.95 17 0 0 0 0 16.95
M 16 15.95
L 1 15.95 1 1 16 1 16 15.95
M 12 8.95
L 11 8.95 11 9.95 12 9.95 12 8.95
M 11 8.95
L 11 7.95 10 7.95 10 8.95 11 8.95
M 11 7.95
L 12 7.95 12 6.95 11 6.95 11 7.95
M 13 8.95
L 13 7.95 12 7.95 12 8.95 13 8.95
M 3 13.95
L 3 14.95 14 14.95 14 13.95 3 13.95
M 3 2.95
L 2 2.95 2 13.95 3 13.95 3 2.95
M 14 2.95
L 14 1.95 3 1.95 3 2.95 14 2.95
M 15 2.95
L 14 2.95 14 13.95 15 13.95 15 2.95 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.BATH] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 2 12
L 2 11 1 11 1 13 3 13 3 12 2 12
M 3 3
L 3 4 16 4 16 13 3 13 3 14 17 14 17 3 3 3
M 1 6
L 2 6 2 5 3 5 3 4 1 4 1 6
M 11 9
L 11 8 10 8 10 9 11 9
M 12 9
L 11 9 11 10 12 10 12 9
M 12 7
L 11 7 11 8 12 8 12 7
M 13 9
L 13 8 12 8 12 9 13 9
M 1 6
L 0 6 0 11 1 11 1 6 Z"/>
<path fill={this.props.color}
fillOpacity={0.5}
stroke="none" d="
M 3 10
L 3 7 2 7 2 10 3 10
M 4 11
L 4 10 3 10 3 11 4 11
M 4 6
L 3 6 3 7 4 7 4 6
M 15 12
L 15 5 4 5 4 6 14 6 14 11 4 11 4 12 15 12 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.WASHBASIN] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 11 15
L 13 15 13 14 11 14 11 15
M 6 15
L 6 16 11 16 11 15 6 15
M 4 14
L 4 15 6 15 6 14 4 14
M 3 12
L 2 12 2 14 4 14 4 13 3 13 3 12
M 2 9
L 1 9 1 12 2 12 2 9
M 1 4
L 0 4 0 9 1 9 1 4
M 2 3
L 1 3 1 4 2 4 2 3
M 15 9
L 15 12 16 12 16 9 15 9
M 15 12
L 14 12 14 13 13 13 13 14 15 14 15 12
M 15 3
L 15 2 2 2 2 3 15 3
M 11 12
L 6 12 6 13 11 13 11 12
M 5 11
L 5 10 4 10 4 12 6 12 6 11 5 11
M 4 7
L 3 7 3 10 4 10 4 7
M 13 7
L 13 6 4 6 4 7 13 7
M 11 11
L 11 12 13 12 13 10 12 10 12 11 11 11
M 8 9
L 9 9 9 8 8 8 8 9
M 14 7
L 13 7 13 10 14 10 14 7
M 17 4
L 16 4 16 9 17 9 17 4
M 16 4
L 16 3 15 3 15 4 16 4 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.COOKER] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 3.55 16
L 3.55 17 13.55 17 13.55 16 17 16 17 0 0 0 0 16 3.55 16
M 16 15
L 1 15 1 1 16 1 16 15
M 4 13
L 4 14 6 14 6 13 4 13
M 7 11
L 6 11 6 13 7 13 7 11
M 4 10
L 4 11 6 11 6 10 4 10
M 4 11
L 3 11 3 13 4 13 4 11
M 4 7
L 4 8 6 8 6 7 4 7
M 4 6
L 3 6 3 7 4 7 4 6
M 2 4
L 2 6 3 6 3 4 2 4
M 4 3
L 3 3 3 4 4 4 4 3
M 7 4
L 7 6 8 6 8 4 7 4
M 7 6
L 6 6 6 7 7 7 7 6
M 7 3
L 6 3 6 4 7 4 7 3
M 6 3
L 6 2 4 2 4 3 6 3
M 14 13
L 12 13 12 14 14 14 14 13
M 15 11
L 14 11 14 13 15 13 15 11
M 12 11
L 11 11 11 13 12 13 12 11
M 14 10
L 12 10 12 11 14 11 14 10
M 14 6
L 12 6 12 7 14 7 14 6
M 14 4
L 14 3 12 3 12 4 14 4
M 14 4
L 14 6 15 6 15 4 14 4
M 12 4
L 11 4 11 6 12 6 12 4 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
/**
*
* @type {React.Component}
*/
Icons[ActionTypes.SINK] = class extends React.Component {
render() {
let iconId = `${this.props.name}_Icon`;
let fillId = `${this.props.name}_FILL`;
let fillIdRef = `#${fillId}`;
return React.createElement('g', null, <g id={iconId} transform="matrix( 1, 0, 0, 1, 0, 0)">
<defs>
<g id={fillId}>
<path fill={this.props.color}
stroke="none" d="
M 17 3
L 0 3 0 14 17 14 17 3
M 16 13
L 1 13 1 4 16 4 16 13
M 5 7
L 5 8 6 8 6 7 5 7
M 3 11
L 3 12 8 12 8 11 3 11
M 3 6
L 2 6 2 11 3 11 3 6
M 9 6
L 8 6 8 11 9 11 9 6
M 8 6
L 8 5 3 5 3 6 8 6
M 15 7
L 15 6 10 6 10 7 15 7
M 15 9
L 15 8 10 8 10 9 15 9
M 15 11
L 15 10 10 10 10 11 15 11 Z"/>
</g>
</defs>
<g transform="matrix( 1, 0, 0, 1, 0, 0)">
<use xlinkHref={fillIdRef} />
</g>
</g>);
}
};
export default Icons; |
app/javascript/mastodon/features/ui/util/react_router_helpers.js | rainyday/mastodon | import React from 'react';
import PropTypes from 'prop-types';
import { Switch, Route } from 'react-router-dom';
import ColumnLoading from '../components/column_loading';
import BundleColumnError from '../components/bundle_column_error';
import BundleContainer from '../containers/bundle_container';
// Small wrapper to pass multiColumn to the route components
export class WrappedSwitch extends React.PureComponent {
render () {
const { multiColumn, children } = this.props;
return (
<Switch>
{React.Children.map(children, child => React.cloneElement(child, { multiColumn }))}
</Switch>
);
}
}
WrappedSwitch.propTypes = {
multiColumn: PropTypes.bool,
children: PropTypes.node,
};
// Small Wrapper to extract the params from the route and pass
// them to the rendered component, together with the content to
// be rendered inside (the children)
export class WrappedRoute extends React.Component {
static propTypes = {
component: PropTypes.func.isRequired,
content: PropTypes.node,
multiColumn: PropTypes.bool,
componentParams: PropTypes.object,
};
static defaultProps = {
componentParams: {},
};
renderComponent = ({ match }) => {
const { component, content, multiColumn, componentParams } = this.props;
return (
<BundleContainer fetchComponent={component} loading={this.renderLoading} error={this.renderError}>
{Component => <Component params={match.params} multiColumn={multiColumn} {...componentParams}>{content}</Component>}
</BundleContainer>
);
}
renderLoading = () => {
return <ColumnLoading />;
}
renderError = (props) => {
return <BundleColumnError {...props} />;
}
render () {
const { component: Component, content, ...rest } = this.props;
return <Route {...rest} render={this.renderComponent} />;
}
}
|
website/pages/404.js | rofrischmann/fela | import React from 'react'
import { Box } from 'kilvin'
import Head from 'next/head'
import { useFela } from 'react-fela'
import Layout from '../components/Layout'
import Button from '../components/Button'
export default function Page() {
const { theme } = useFela()
return (
<>
<Layout>
<Box space={4} paddingTop={10} paddingBottom={10}>
<h1>Not Found!</h1>
<Box as="p" extend={{ fontSize: 20 }}>
Sorry, the page your looking for could not be found.
</Box>
<br />
<Box as="p">
Are you searching for a specific documentation page?
<br />
We recently rewrote the whole website and sadly the links have
changed. <br />
But, the documentation structure mostly remained the same!
<br />
</Box>
<Box alignSelf="flex-start" paddingTop={2} space={2} direction="row">
<Button href="/docs">Documentation</Button>
<Button
href="https://github.com/robinweser/fela/discussions"
variant="secondary">
Ask For Help
</Button>
</Box>
</Box>
</Layout>
</>
)
}
|
examples/3-complex/src/index/home/App.js | chikara-chan/react-power | import React from 'react'
import styles from './App.scss'
function App() {
return (
<div>
<h1 className={styles.title}>Home</h1>
</div>
)
}
export default App
|
actor-apps/app-web/src/app/components/modals/CreateGroup.react.js | JeeLiu/actor-platform | import React from 'react';
import CreateGroupActionCreators from 'actions/CreateGroupActionCreators';
import CreateGroupStore from 'stores/CreateGroupStore';
import CreateGroupForm from './create-group/Form.react';
import Modal from 'react-modal';
import { KeyCodes } from 'constants/ActorAppConstants';
const appElement = document.getElementById('actor-web-app');
Modal.setAppElement(appElement);
const getStateFromStores = () => {
return {
isShown: CreateGroupStore.isModalOpen()
};
};
class CreateGroup extends React.Component {
constructor(props) {
super(props);
this.state = getStateFromStores();
CreateGroupStore.addChangeListener(this.onChange);
document.addEventListener('keydown', this.onKeyDown, false);
}
componentWillUnmount() {
CreateGroupStore.removeChangeListener(this.onChange);
document.removeEventListener('keydown', this.onKeyDown, false);
}
render() {
const isShown = this.state.isShown;
return (
<Modal className="modal-new modal-new--create-group" closeTimeoutMS={150} isOpen={isShown}>
<header className="modal-new__header">
<a className="modal-new__header__close material-icons" onClick={this.onClose}>clear</a>
<h3 className="modal-new__header__title">Create group</h3>
</header>
<CreateGroupForm/>
</Modal>
);
}
onChange = () => {
this.setState(getStateFromStores());
}
onClose = () => {
CreateGroupActionCreators.closeModal();
}
onKeyDown = (event) => {
if (event.keyCode === KeyCodes.ESC) {
event.preventDefault();
this.onClose();
}
}
}
CreateGroup.displayName = 'CreateGroup';
export default CreateGroup;
|
src/components/CountyMap/CountyMap.js | Swizec/h1b-software-salaries |
import React, { Component } from 'react';
import * as d3 from 'd3';
import * as topojson from 'topojson';
import _ from 'lodash';
import County from './County';
class CountyMap extends Component {
// Setup default D3 objects
// projection - defines our geo projection, how the map looks
// geoPath - calculates d attribute of <path> so it looks like a map
// quantize - threshold scale with 9 buckets
constructor(props) {
super(props);
this.projection = d3.geoAlbersUsa()
.scale(1280);
this.geoPath = d3.geoPath()
.projection(this.projection);
this.quantize = d3.scaleQuantize()
.range(d3.range(9));
this.updateD3(props);
}
// update D3 objects when props update
componentWillReceiveProps(newProps) {
this.updateD3(newProps);
}
// Re-center the geo projection
// Update domain of quantize scale
updateD3(props) {
this.projection
.translate([props.width / 2, props.height / 2])
.scale(props.width*1.3);
if (props.zoom && props.usTopoJson) {
const us = props.usTopoJson,
statePaths = topojson.feature(us, us.objects.states).features,
id = _.find(props.USstateNames, {code: props.zoom}).id;
this.projection.scale(props.width*4.5);
const centroid = this.geoPath.centroid(_.find(statePaths, {id: id})),
translate = this.projection.translate();
this.projection.translate([
translate[0] - centroid[0] + props.width / 2,
translate[1] - centroid[1] + props.height / 2
]);
}
if (props.values) {
this.quantize.domain([d3.quantile(props.values, 0.15, d => d.value),
d3.quantile(props.values, 0.85, d => d.value)]);
}
}
// If no data, do nothing (we might mount before data loads into props)
render() {
if (!this.props.usTopoJson) {
return null;
}else{
// Translate topojson data into geojson data for drawing
// Prepare a mesh for states and a list of features for counties
const us = this.props.usTopoJson,
statesMesh = topojson.mesh(us, us.objects.states, (a, b) => a !== b),
counties = topojson.feature(us, us.objects.counties).features;
const countyValueMap = _.fromPairs(this.props.values
.map(d => [d.countyID, d.value]));
// Loop through counties and draw <County> components
// Add a single <path> for state borders
return (
<g>
{counties.map((feature) => (
<County geoPath={this.geoPath}
feature={feature}
zoom={this.props.zoom}
key={feature.id}
quantize={this.quantize}
value={countyValueMap[feature.id]} />
))}
<path d={this.geoPath(statesMesh)} style={{fill: 'none',
stroke: '#fff',
strokeLinejoin: 'round'}} />
</g>
);
}
}
}
export default CountyMap;
|
src/svg-icons/action/settings-applications.js | kasra-co/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionSettingsApplications = (props) => (
<SvgIcon {...props}>
<path d="M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm7-7H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-1.75 9c0 .23-.02.46-.05.68l1.48 1.16c.13.11.17.3.08.45l-1.4 2.42c-.09.15-.27.21-.43.15l-1.74-.7c-.36.28-.76.51-1.18.69l-.26 1.85c-.03.17-.18.3-.35.3h-2.8c-.17 0-.32-.13-.35-.29l-.26-1.85c-.43-.18-.82-.41-1.18-.69l-1.74.7c-.16.06-.34 0-.43-.15l-1.4-2.42c-.09-.15-.05-.34.08-.45l1.48-1.16c-.03-.23-.05-.46-.05-.69 0-.23.02-.46.05-.68l-1.48-1.16c-.13-.11-.17-.3-.08-.45l1.4-2.42c.09-.15.27-.21.43-.15l1.74.7c.36-.28.76-.51 1.18-.69l.26-1.85c.03-.17.18-.3.35-.3h2.8c.17 0 .32.13.35.29l.26 1.85c.43.18.82.41 1.18.69l1.74-.7c.16-.06.34 0 .43.15l1.4 2.42c.09.15.05.34-.08.45l-1.48 1.16c.03.23.05.46.05.69z"/>
</SvgIcon>
);
ActionSettingsApplications = pure(ActionSettingsApplications);
ActionSettingsApplications.displayName = 'ActionSettingsApplications';
ActionSettingsApplications.muiName = 'SvgIcon';
export default ActionSettingsApplications;
|
examples/demos/dndOutsideSource.js | TeaBough/react-big-calendar | import React from 'react'
import events from '../events'
import { Calendar, Views } from 'react-big-calendar'
import withDragAndDrop from 'react-big-calendar/lib/addons/dragAndDrop'
import Layout from 'react-tackle-box/Layout'
import Card from '../Card'
import 'react-big-calendar/lib/addons/dragAndDrop/styles.scss'
const DragAndDropCalendar = withDragAndDrop(Calendar)
const formatName = (name, count) => `${name} ID ${count}`
class Dnd extends React.Component {
constructor(props) {
super(props)
this.state = {
events: events,
draggedEvent: null,
counters: {
item1: 0,
item2: 0,
},
displayDragItemInCell: true,
}
}
handleDragStart = event => {
this.setState({ draggedEvent: event })
}
handleDisplayDragItemInCell = () => {
this.setState({
displayDragItemInCell: !this.state.displayDragItemInCell,
})
}
dragFromOutsideItem = () => {
return this.state.draggedEvent
}
customOnDragOver = event => {
// check for undroppable is specific to this example
// and not part of API. This just demonstrates that
// onDragOver can optionally be passed to conditionally
// allow draggable items to be dropped on cal, based on
// whether event.preventDefault is called
if (this.state.draggedEvent !== 'undroppable') {
console.log('preventDefault')
event.preventDefault()
}
}
onDropFromOutside = ({ start, end, allDay }) => {
const { draggedEvent, counters } = this.state
const event = {
title: formatName(draggedEvent.name, counters[draggedEvent.name]),
start,
end,
isAllDay: allDay,
}
const updatedCounters = {
...counters,
[draggedEvent.name]: counters[draggedEvent.name] + 1,
}
this.setState({ draggedEvent: null, counters: updatedCounters })
this.newEvent(event)
}
moveEvent = ({ event, start, end, isAllDay: droppedOnAllDaySlot }) => {
const { events } = this.state
const idx = events.indexOf(event)
let allDay = event.allDay
if (!event.allDay && droppedOnAllDaySlot) {
allDay = true
} else if (event.allDay && !droppedOnAllDaySlot) {
allDay = false
}
const updatedEvent = { ...event, start, end, allDay }
const nextEvents = [...events]
nextEvents.splice(idx, 1, updatedEvent)
this.setState({
events: nextEvents,
})
// alert(`${event.title} was dropped onto ${updatedEvent.start}`)
}
resizeEvent = ({ event, start, end }) => {
const { events } = this.state
const nextEvents = events.map(existingEvent => {
return existingEvent.id == event.id
? { ...existingEvent, start, end }
: existingEvent
})
this.setState({
events: nextEvents,
})
//alert(`${event.title} was resized to ${start}-${end}`)
}
newEvent = event => {
let idList = this.state.events.map(a => a.id)
let newId = Math.max(...idList) + 1
let hour = {
id: newId,
title: event.title,
allDay: event.isAllDay,
start: event.start,
end: event.end,
}
this.setState({
events: this.state.events.concat([hour]),
})
}
render() {
return (
<div>
<Card className="examples--header" style={{ display: 'flex' }}>
<div
style={{
display: 'flex',
flex: 1,
justifyContent: 'center',
flexWrap: 'wrap',
}}
>
<h4 style={{ color: 'gray', width: '100%' }}>
Outside Drag Sources
</h4>
{Object.entries(this.state.counters).map(([name, count]) => (
<div
style={{
border: '2px solid gray',
borderRadius: '4px',
width: '100px',
margin: '10px',
}}
draggable="true"
key={name}
onDragStart={() =>
this.handleDragStart({ title: formatName(name, count), name })
}
>
{formatName(name, count)}
</div>
))}
<div
style={{
border: '2px solid gray',
borderRadius: '4px',
width: '100px',
margin: '10px',
}}
draggable="true"
key={name}
onDragStart={() => this.handleDragStart('undroppable')}
>
Draggable but not for calendar.
</div>
</div>
<div>
<label>
<input
style={{ marginRight: 5 }}
type="checkbox"
checked={this.state.displayDragItemInCell}
onChange={this.handleDisplayDragItemInCell}
/>
Display dragged item in cell while dragging over
</label>
</div>
</Card>
<DragAndDropCalendar
selectable
localizer={this.props.localizer}
events={this.state.events}
onEventDrop={this.moveEvent}
dragFromOutsideItem={
this.state.displayDragItemInCell ? this.dragFromOutsideItem : null
}
onDropFromOutside={this.onDropFromOutside}
onDragOver={this.customOnDragOver}
resizable
onEventResize={this.resizeEvent}
onSelectSlot={this.newEvent}
onD
defaultView={Views.MONTH}
defaultDate={new Date(2015, 3, 12)}
/>
</div>
)
}
}
export default Dnd
|
client/extensions/woocommerce/app/dashboard/setup/notices.js | Automattic/woocommerce-connect-client | /** @format */
/**
* External dependencies
*/
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { get } from 'lodash';
import { localize } from 'i18n-calypso';
/**
* Internal dependencies
*/
import { getCurrentUser, isCurrentUserEmailVerified } from 'state/current-user/selectors';
import Notice from 'components/notice';
class SetupNotices extends Component {
static propTypes = {
currentUserEmail: PropTypes.string,
currentUserEmailVerified: PropTypes.bool,
translate: PropTypes.func,
};
possiblyRenderEmailWarning = () => {
const { currentUserEmail, currentUserEmailVerified, translate } = this.props;
if ( ! currentUserEmail || currentUserEmailVerified ) {
return null;
}
return (
<Notice
status="is-warning"
showDismiss={ false }
text={ translate(
"You need to confirm your email address to activate your account. We've sent " +
'an email to {{strong}}%(email)s{{/strong}} with instructions for you to follow.',
{
components: {
strong: <strong />,
},
args: {
email: currentUserEmail,
},
}
) }
/>
);
};
render = () => {
return <div>{ this.possiblyRenderEmailWarning() }</div>;
};
}
function mapStateToProps( state ) {
const currentUser = getCurrentUser( state );
const currentUserEmail = get( currentUser, 'email', '' );
const currentUserEmailVerified = isCurrentUserEmailVerified( state );
return {
currentUserEmail,
currentUserEmailVerified,
};
}
export default connect( mapStateToProps )( localize( SetupNotices ) );
|
submissions/pasieronen/client.js | gterzian/flux-challenge | import React from 'react';
import Dispatcher from './Dispatcher';
import * as JediConstants from './JediConstants';
import JediApp from './JediApp';
import * as JediStore from './JediStore';
window.onload = () =>
Dispatcher.dispatch(JediConstants.START, {
firstJediId: 3616,
firstJediUrl: "http://localhost:3000/dark-jedis/3616",
websocketUrl: "ws://localhost:4000"
});
React.render(
<JediApp stateObservable={JediStore.state} />,
document.getElementById("content")
);
|
src/client/time.js | dvorakjan/noderunner-gui | import React from 'react';
export default class Time extends React.Component {
constructor(props) {
super(props);
this.state = this.update();
setInterval(() => self.update(), 1000);
}
update() {
var state = {delta: this.props.started > 0 ? Math.round((Date.now()/1000 - this.props.started)) : 0};
this.setState(state);
return state;
}
render() {
return (
<div>{this.state.delta}</div>
);
}
}
|
app/javascript/mastodon/features/notifications/components/clear_column_button.js | MitarashiDango/mastodon | import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import Icon from 'mastodon/components/icon';
export default class ClearColumnButton extends React.PureComponent {
static propTypes = {
onClick: PropTypes.func.isRequired,
};
render () {
return (
<button className='text-btn column-header__setting-btn' tabIndex='0' onClick={this.props.onClick}><Icon id='eraser' /> <FormattedMessage id='notifications.clear' defaultMessage='Clear notifications' /></button>
);
}
}
|
src/routes/blog/BlogContent.js | yvanwangl/UniversalBlog | import React from 'react';
import PropTypes from 'prop-types';
import ReadEditor from '../../components/ReadEditor/ReadEditor';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import s from './index.css';
class BlogContent extends React.Component {
constructor(props) {
super(props);
}
render() {
let {content, title} = this.props.blog;
return (
<div className={s.container}>
<h1>{title}</h1>
<ReadEditor id={'blogContent'} content={content}/>
</div>
);
}
}
export default withStyles(s)(BlogContent); |
local-cli/templates/HelloNavigation/views/welcome/WelcomeScreen.js | disparu86/react-native | 'use strict';
import React, { Component } from 'react';
import {
Image,
Platform,
StyleSheet,
} from 'react-native';
import ListItem from '../../components/ListItem';
import WelcomeText from './WelcomeText';
export default class WelcomeScreen extends Component {
static navigationOptions = {
title: 'Welcome',
header: {
visible: Platform.OS === 'ios',
},
tabBar: {
icon: ({ tintColor }) => (
<Image
// Using react-native-vector-icons works here too
source={require('./welcome-icon.png')}
style={[styles.icon, {tintColor: tintColor}]}
/>
),
},
}
render() {
return (
<WelcomeText />
);
}
}
const styles = StyleSheet.create({
icon: {
width: 30,
height: 26,
},
});
|
src/components/Tabs/Tabs-story.js | jzhang300/carbon-components-react | import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import Tabs from '../Tabs';
import Tab from '../Tab';
const props = {
tabs: {
className: 'some-class',
triggerHref: '#anotherAnchor',
},
tab: {
className: 'another-class',
onClick: action('onClick'),
onKeyDown: action('onKeyDown'),
},
};
storiesOf('Tabs', module)
.addWithInfo(
'Default',
`
Tabs are used to quickly navigate between views within the same context. Create individual
Tab components for each item in the Tabs list.
`,
() => (
<Tabs {...props.tabs}>
<Tab {...props.tab} label="Tab label 1">
<div className="some-content">Content for first tab goes here.</div>
</Tab>
<Tab {...props.tab} label="Tab label 2">
<div className="some-content">Content for second tab goes here.</div>
</Tab>
<Tab {...props.tab} label="Tab label 3">
<div className="some-content">Content for third tab goes here.</div>
</Tab>
<Tab {...props.tab} label="Tab label 4">
<div className="some-content">Content for fourth tab goes here.</div>
</Tab>
</Tabs>
)
)
.addWithInfo(
'Selected Example',
`
By using the selected prop on the Tabs component, you can switch which Tab gets
rendered by default
`,
() => (
<Tabs {...props.tabs} selected={3}>
<Tab {...props.tab} label="Tab label 1">
<div className="some-content">Content for first tab goes here.</div>
</Tab>
<Tab {...props.tab} label="Tab label 2">
<div className="some-content">Content for second tab goes here.</div>
</Tab>
<Tab {...props.tab} label="Tab label 3">
<div className="some-content">Content for third tab goes here.</div>
</Tab>
<Tab {...props.tab} label="Tab label 4">
<div className="some-content">ontent for fourth tab goes here.</div>
</Tab>
</Tabs>
)
);
|
actor-apps/app-web/src/app/components/modals/CreateGroup.react.js | darioajr/actor-platform | import React from 'react';
import CreateGroupActionCreators from 'actions/CreateGroupActionCreators';
import CreateGroupStore from 'stores/CreateGroupStore';
import CreateGroupForm from './create-group/Form.react';
import Modal from 'react-modal';
import { KeyCodes } from 'constants/ActorAppConstants';
const appElement = document.getElementById('actor-web-app');
Modal.setAppElement(appElement);
const getStateFromStores = () => {
return {
isShown: CreateGroupStore.isModalOpen()
};
};
class CreateGroup extends React.Component {
constructor(props) {
super(props);
this.state = getStateFromStores();
CreateGroupStore.addChangeListener(this.onChange);
document.addEventListener('keydown', this.onKeyDown, false);
}
componentWillUnmount() {
CreateGroupStore.removeChangeListener(this.onChange);
document.removeEventListener('keydown', this.onKeyDown, false);
}
render() {
const isShown = this.state.isShown;
return (
<Modal className="modal-new modal-new--create-group" closeTimeoutMS={150} isOpen={isShown}>
<header className="modal-new__header">
<a className="modal-new__header__close modal-new__header__icon material-icons" onClick={this.onClose}>clear</a>
<h3 className="modal-new__header__title">Create group</h3>
</header>
<CreateGroupForm/>
</Modal>
);
}
onChange = () => {
this.setState(getStateFromStores());
}
onClose = () => {
CreateGroupActionCreators.closeModal();
}
onKeyDown = (event) => {
if (event.keyCode === KeyCodes.ESC) {
event.preventDefault();
this.onClose();
}
}
}
CreateGroup.displayName = 'CreateGroup';
export default CreateGroup;
|
client/src/components/employer/whyHireGrads.js | Siyanda-Mzam/hire-grad | import React from 'react';
const WhyHireGrads = () => {
return (
<div className="section">
<div className="container">
<div className="columns">
<div className="column is-7 is-half content">
<h1>Access a curated list of graduates</h1>
<br />
<h4><strong>Only the best</strong></h4>
<p>Our team curates the graduates who apply to GenZ
and you’ll only see top candidates.</p>
<br/>
<h4><strong>Ready to move</strong></h4>
<p>Discover talented graduates ready to grow their careers</p>
</div>
<div className="section column is-5 is-half content">
<div className="card">
<div className="card-content">
<div className="media">
<div className="media-left">
<figure id="sample-image" className="image is-100x100">
<img src="https://placehold.it/280"
alt="Placeholder image" />
</figure>
</div>
<div className="media-content">
<p className="title is-4">Brand New</p>
<p className="subtitle is-6">M.A. Political Studies</p>
<span className="media-details">
<table className="table is-narrow">
<tbody>
<tr>
<td>
<i className="fa fa-map-marker" aria-hidden="true">
</i>
</td>
<td>
<span className=" subtitle is-6 card-text-pull">
Johannesburg
</span>
</td>
</tr>
<tr>
<td>
<i className="fa fa-money" aria-hidden="true"></i>
</td>
<td>
<span className=" subtitle is-6 card-text-pull">
R55 000/month
</span>
</td>
</tr>
<tr>
<td>
<i className="fa fa-graduation-cap"
aria-hidden="true"></i>
</td>
<td>
<span className=" subtitle is-6 card-text-pull">
Rhodes University
</span>
</td>
</tr>
</tbody>
</table>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
);
}
export default WhyHireGrads;
|
src/pages/chocris.js | vitorbarbosa19/ziro-online | import React from 'react'
import BrandGallery from '../components/BrandGallery'
export default () => (
<BrandGallery brand='Chocris' />
)
|
app/components/DataRangeForm.js | seungha-kim/grade-sms | // @flow
import React, { Component } from 'react';
import RaisedButton from 'material-ui/RaisedButton';
import type { Map as IMap } from 'immutable';
import { Card, CardTitle, CardText, CardActions } from 'material-ui/Card';
import FlatButton from 'material-ui/FlatButton';
import { basename } from 'path';
import s from './DataRangeForm.css';
import cs from './commonStyles.css';
import DataRangeField from './DataRangeField';
import HelpText from './HelpText';
type Props = {
formData: IMap<string, any>,
filePath: string,
nextStep: () => void,
previousStep: () => void,
updateRangeThunk: (string, string) => void,
addTest: () => void,
removeTest: (string) => void,
addHomework: () => void,
removeHomework: (string) => void
};
const buttonStyle = {
marginLeft: 12
};
const cardStyle = {
marginTop: 30
};
const cardTitleStyle = {
display: 'flex',
alignItems: 'center'
};
const rangeHintText = 'X10:X100';
// const target = e.target;
// if (!(target instanceof HTMLInputElement)) return;
// const dataRange = target.value;
export default class DataRangeForm extends Component {
props: Props;
render() {
const {
formData,
filePath,
// onError,
nextStep,
previousStep,
updateRangeThunk,
addTest,
removeTest,
addHomework,
removeHomework
} = this.props;
// onError('haha');
return (
<div className={s.wrap}>
<div className={s.content}>
<HelpText>
성적표 생성에 사용될 데이터 범위를 입력하는 과정입니다. <br />
각 항목에 해당하는 데이터 범위를 입력해주세요. (예: <code>X15:X1000</code>)
</HelpText>
<Card style={cardStyle}>
<CardTitle title="기본 사항" subtitle={basename(filePath)} />
<CardText>
<DataRangeField
hintText={rangeHintText}
floatingLabelText="이름"
fieldData={formData.getIn(['privacyRangeSet', 'name'])}
updateRangeThunk={updateRangeThunk}
/>
<DataRangeField
hintText={rangeHintText}
floatingLabelText="학교"
fieldData={formData.getIn(['privacyRangeSet', 'school'])}
updateRangeThunk={updateRangeThunk}
/>
<DataRangeField
hintText={rangeHintText}
floatingLabelText="원번"
fieldData={formData.getIn(['privacyRangeSet', 'id'])}
updateRangeThunk={updateRangeThunk}
/>
<DataRangeField
hintText={rangeHintText}
floatingLabelText="부모님 연락처"
fieldData={formData.getIn(['privacyRangeSet', 'phone'])}
updateRangeThunk={updateRangeThunk}
/>
</CardText>
</Card>
<div>
{formData.get('testRangeSets').map((fieldSet, i) => <Card key={fieldSet.get('setKey')} style={cardStyle}>
<CardTitle title={`시험 ${i + 1}`} style={cardTitleStyle} />
<CardText>
<DataRangeField
hintText={rangeHintText}
floatingLabelText="반"
fieldData={fieldSet.getIn(['fields', 'class'])}
updateRangeThunk={updateRangeThunk}
/>
<DataRangeField
hintText={rangeHintText}
floatingLabelText="출결"
fieldData={fieldSet.getIn(['fields', 'attendance'])}
updateRangeThunk={updateRangeThunk}
/>
<DataRangeField
hintText={rangeHintText}
floatingLabelText="점수"
fieldData={fieldSet.getIn(['fields', 'grade'])}
updateRangeThunk={updateRangeThunk}
/>
</CardText>
<CardActions>
<FlatButton
disabled={formData.get('testRangeSets').size <= 1}
secondary
label="삭제"
onClick={() => removeTest(fieldSet.get('setKey'))}
/>
</CardActions>
</Card>)}
</div>
<div>
{formData.get('homeworkRangeSets').map((fieldSet, i) => <Card key={fieldSet.get('setKey')} style={cardStyle}>
<CardTitle title={`숙제 ${i + 1}`} style={cardTitleStyle} />
<CardText>
<DataRangeField
hintText={rangeHintText}
floatingLabelText="반"
fieldData={fieldSet.getIn(['fields', 'class'])}
updateRangeThunk={updateRangeThunk}
/>
<DataRangeField
hintText={rangeHintText}
floatingLabelText="점수"
fieldData={fieldSet.getIn(['fields', 'grade'])}
updateRangeThunk={updateRangeThunk}
/>
</CardText>
<CardActions>
<FlatButton secondary label="삭제" onClick={() => removeHomework(fieldSet.get('setKey'))} />
</CardActions>
</Card>)}
</div>
</div>
<div className={cs.buttonWrap}>
<RaisedButton label="시험 추가" onClick={addTest} style={buttonStyle} />
<RaisedButton label="숙제 추가" onClick={addHomework} style={buttonStyle} />
<RaisedButton label="뒤로" secondary onClick={previousStep} style={buttonStyle} />
<RaisedButton label="다음" primary disabled={!formData.get('allRangesValid')} onClick={nextStep} style={buttonStyle} />
</div>
</div>
);
}
}
|
react-router-tutorial/lessons/07-more-nesting/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 path="/about" component={About}/>
</Route>
</Router>
), document.getElementById('app'))
|
client/src/components/systems/Container.js | DjLeChuck/recalbox-manager | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { translate } from 'react-i18next';
import { grep, translatableConf, save } from '../../api';
import { promisifyData, cancelPromises } from '../../utils';
import Systems from './Systems';
class SystemContainer extends Component {
static propTypes = {
t: PropTypes.func.isRequired,
};
constructor(props) {
super(props);
this.state = {
loaded: false,
saving: false,
stickyContent: null,
stickyStyle: 'danger',
};
}
async componentWillMount() {
const state = await promisifyData(
translatableConf(['recalbox.systems.ratio', 'recalbox.systems.shaderset']),
grep([
'global.ratio',
'global.shaderset',
'global.smooth',
'global.rewind',
'global.autosave',
'global.integerscale',
'global.retroachievements',
'global.retroachievements.hardcore',
'global.retroachievements.username',
'global.retroachievements.password',
])
);
state.loaded = true;
this.setState(state);
}
componentWillUnmount() {
cancelPromises();
}
onSubmit = (values) => {
const { t } = this.props;
this.setState({ saving: true });
save(values).then(() => (
this.setState({
saving: false,
stickyContent: t('La configuration a bien été sauvegardée.'),
stickyStyle: 'success',
})
), () => (
this.setState({
saving: false,
stickyContent: t('Une erreur est survenue lors de la sauvegarde de la configuration.'),
stickyStyle: 'danger',
})
));
};
render() {
return (
<Systems {...this.state} onSubmit={this.onSubmit} dataset={{
ratioList: this.state['recalbox.systems.ratio'],
shadersets: this.state['recalbox.systems.shaderset'],
}} defaultValues={{
'global.ratio': this.state['global.ratio'],
'global.shaderset': this.state['global.shaderset'],
'global.smooth': this.state['global.smooth'],
'global.rewind': this.state['global.rewind'],
'global.autosave': this.state['global.autosave'],
'global.integerscale': this.state['global.integerscale'],
'global.retroachievements': this.state['global.retroachievements'],
'global.retroachievements.hardcore': this.state['global.retroachievements.hardcore'],
'global.retroachievements.username': this.state['global.retroachievements.username'],
'global.retroachievements.password': this.state['global.retroachievements.password'],
}} />
);
}
}
export default translate()(SystemContainer);
|
assets/javascripts/archon/pages/AppDetailPage.js | panli889/archon | import React from 'react';
import {History} from 'react-router';
import * as AppActions from '../models/actions/Apps';
import MDL from '../components/MdlComponents';
import AppSummaryCard from '../components/AppSummaryCard';
import CreateAppCard from '../components/CreateAppCard';
import AppProcDetailCard from '../components/AppProcDetailCard';
import AppServicePortalCard from '../components/AppServicePortalCard';
import LoadHud from '../components/LoadHud';
import NoticeInforCard from '../components/NoticeInforCard';
import AuthorizeMixin from '../mixins/AuthorizeMixin';
import FlashMessageMixin from '../mixins/FlashMessageMixin';
import ApiMixin from '../mixins/ApiMixin';
import AppView from '../models/views/App';
import ProcView from '../models/views/Proc';
let AppDetailPage = React.createClass({
mixins: [History, AuthorizeMixin, FlashMessageMixin, ApiMixin],
componentDidMount() {
this.authorize(() => {
this.refreshApp();
});
},
componentWillReceiveProps(nextProps) {
const name = this.getAppName();
const newName = nextProps.params.name;
if (newName !== name) {
this.authorize(() => {
this.refreshApp(nextProps);
});
} else {
const request = this.getRequestFromProps(nextProps, 'DELETE_APP_REQUEST');
if (request.statusCode === 202) {
// app got deleted
this.history.pushState(null, '/archon/apps');
}
}
},
render() {
const name = this.getAppName();
const { requests, isFetching, error } =
this.getPageRequests(['GET_APP_REQUEST', 'UPGRADE_APP_REQUEST', 'DELETE_APP_REQUEST', 'ROLLBACK_APP_REQUEST']);
const [request, upgradeReq, deleteReq, rollbackReq] = requests;
return (
<MDL.Grid>
<MDL.GridCell col={8}>
{ this.renderFlash(upgradeReq.opFlash, AppActions.resetApiFlash('UPGRADE_APP_REQUEST')) }
{
!error ? null :
<NoticeInforCard title='请求出错了'
noticeType='error'
buttons={[
{ title: '刷新', color: 'colored', onClick: this.refreshApp },
]}
message={`应用操作 - ${name} 失败:${error}`} />
}
{ this.renderApp(request) }
</MDL.GridCell>
<MDL.GridCell col={4}>
<CreateAppCard />
{
error || isFetching ? null :
<NoticeInforCard title={`升级应用`}
noticeType='info'
buttons={[
{ title: '升级', icon: 'trending_up', color: 'accent', onClick: (evt) => this.upgradeApp(name) },
]}
message={`推送最新版的应用Image之后,可以点击升级按钮对本应用进行升级。`} />
}
{
error || isFetching ? null :
<NoticeInforCard title={`回滚应用`}
noticeType='info'
buttons={[
{ title: '回滚', icon: 'trending_up', color: 'accent', onClick: (evt) => this.rollbackApp(name) },
]}
message={`回滚应用将会使用用户指定的应用版本进行部署。`} />
}
{
error || isFetching ? null :
<NoticeInforCard title={`删除应用`}
noticeType='error'
buttons={[
{ title: '删除', icon: 'highlight_remove', color: 'accent', onClick: (evt) => this.deleteApp(name) },
]}
message={`删除应用将会移除所有本App在集群中的运行容器,但是会保留本应用的注册信息,之后还可以重新部署。`} />
}
</MDL.GridCell>
{ isFetching ? <LoadHud /> : null }
</MDL.Grid>
);
},
renderApp(request) {
const appName = this.getAppName();
if (request.statusCode !== 200) {
return null;
}
const app = request.data;
return (
<div>
<AppSummaryCard app={app} inDetail={true} onRefreshClick={this.refreshApp} />
{
app.procs.map((proc, index) =>
<AppProcDetailCard proc={ProcView(proc)} app={AppView(app)} key={index} />) }
{
app.useservices.map((us, index) => {
const service = us.service;
if (!service.portals) {
return null;
}
return (
<div key={index}>
{ service.portals.map((portal, pIndex) =>
<AppServicePortalCard service={service} app={AppView(app)} portal={ProcView(portal)} key={pIndex} />) }
</div>
);
})
}
</div>
);
},
refreshApp(props = this.props) {
const {dispatch} = props;
const name = this.getAppName(props);
if (name) {
dispatch(AppActions.resetApiCall('UPGRADE_APP_REQUEST'));
dispatch(AppActions.resetApiCall('DELETE_APP_REQUEST'));
dispatch(AppActions.resetApiCall('ROLLBACK_APP_REQUEST'));
dispatch(AppActions.get(name));
} else {
this.history.replaceState(null, '/archon');
}
},
upgradeApp(name) {
if (confirm(`确定要升级应用-${name}吗?`)) {
const {dispatch} = this.props;
dispatch(AppActions.resetApiCall('UPGRADE_APP_REQUEST'));
dispatch(AppActions.resetApiCall('DELETE_APP_REQUEST'));
dispatch(AppActions.resetApiCall('ROLLBACK_APP_REQUEST'));
name && dispatch(AppActions.upgrade(name));
}
},
deleteApp(name) {
if (confirm(`确定要删除应用-${name}吗?`)) {
const {dispatch} = this.props;
dispatch(AppActions.resetApiCall('UPGRADE_APP_REQUEST'));
dispatch(AppActions.resetApiCall('DELETE_APP_REQUEST'));
dispatch(AppActions.resetApiCall('ROLLBACK_APP_REQUEST'));
name && dispatch(AppActions.remove(name));
}
},
rollbackApp(name){
const {dispatch} = this.props;
dispatch(AppActions.resetApiCall('UPGRADE_APP_REQUEST'));
dispatch(AppActions.resetApiCall('DELETE_APP_REQUEST'));
dispatch(AppActions.resetApiCall('ROLLBACK_APP_REQUEST'));
this.history.pushState(null, `/archon/apps/${name}/versions`);
},
getAppName(props = this.props) {
return props.params.name;
},
});
export default AppDetailPage;
|
src/components/Header/index.js | jahammo2/portfolio-web_client | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './index.scss';
import MenuBar from '../../components/MenuBar';
import { Link } from 'react-router';
const propTypes = {
children: PropTypes.node,
handleOpenSideBar: PropTypes.func,
sideBarShown: PropTypes.func,
sideBarShowing: PropTypes.bool
};
class Header extends Component {
title () {
if (window.innerWidth > 768) {
return 'projects';
}
return 'menu';
}
iconClassName () {
if (this.props.sideBarShowing) {
return 'times';
}
return 'bars';
}
render () {
return (
<div className='header column-between'>
<div className='header__container row-between'>
<Link
className='header__name'
onClick={this.props.handleOpenSideBar}
to='/'
>
Jordan Hammond
</Link>
<div className='header__vertical-line mobile' />
<MenuBar
handleOpenSideBar={this.props.handleOpenSideBar}
sideBarShown={this.props.sideBarShown}
sideBarShowing={this.props.sideBarShowing}
title={this.title()}
/>
</div>
<hr className='header__line line' />
</div>
);
}
}
Header.propTypes = propTypes;
export default Header;
|
src/svg-icons/content/text-format.js | mtsandeep/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ContentTextFormat = (props) => (
<SvgIcon {...props}>
<path d="M5 17v2h14v-2H5zm4.5-4.2h5l.9 2.2h2.1L12.75 4h-1.5L6.5 15h2.1l.9-2.2zM12 5.98L13.87 11h-3.74L12 5.98z"/>
</SvgIcon>
);
ContentTextFormat = pure(ContentTextFormat);
ContentTextFormat.displayName = 'ContentTextFormat';
ContentTextFormat.muiName = 'SvgIcon';
export default ContentTextFormat;
|
react/src/components/dashboard/tools/toolsTxPush.js | pbca26/EasyDEX-GUI | import React from 'react';
import translate from '../../../translate/translate';
import addCoinOptionsCrypto from '../../addcoin/addcoinOptionsCrypto';
import addCoinOptionsAC from '../../addcoin/addcoinOptionsAC';
import Select from 'react-select';
import {
triggerToaster,
copyString,
apiToolsBalance,
apiToolsBuildUnsigned,
apiToolsPushTx,
apiToolsSeedToWif,
apiToolsWifToKP,
apiElectrumListunspent,
apiCliPromise,
apiElectrumSplitUtxoPromise,
} from '../../../actions/actionCreators';
import Store from '../../../store';
import QRCode from 'qrcode.react';
import QRModal from '../qrModal/qrModal';
import { explorerList } from 'agama-wallet-lib/src/coin-helpers';
import devlog from '../../../util/devlog';
const { shell } = window.require('electron');
class ToolsTxPush extends React.Component {
constructor() {
super();
this.state = {
sendFrom: '',
sendTo: '',
amount: 0,
selectedCoin: '',
balance: null,
tx2qr: null,
utxo: null,
rawTx2Push: null,
txPushResult: null,
};
this.updateInput = this.updateInput.bind(this);
this.updateSelectedCoin = this.updateSelectedCoin.bind(this);
this.sendTx = this.sendTx.bind(this);
this.copyTx = this.copyTx.bind(this);
}
copyTx() {
Store.dispatch(copyString(this.state.txPushResult, translate('TOOLS.TXID_COPIED')));
}
sendTx() {
apiToolsPushTx(
this.state.selectedCoin.split('|')[0].toLowerCase(),
this.state.rawTx2Push
)
.then((res) => {
devlog(res);
this.setState({
txPushResult: res.result,
});
});
}
renderCoinOption(option) {
return (
<div>
<img
src={ `assets/images/cryptologo/${option.icon.toLowerCase()}.png` }
alt={ option.label }
width="30px"
height="30px" />
<span className="margin-left-10">{ option.label }</span>
</div>
);
}
updateSelectedCoin(e, propName) {
if (e &&
e.value &&
e.value.indexOf('|')) {
this.setState({
[propName]: e.value,
});
}
}
updateInput(e) {
this.setState({
[e.target.name]: e.target.value,
});
}
openExplorerWindow(txid) {
const _coin = this.state.selectedCoin.split('|')[0].toUpperCase();
const url = explorerList[_coin].split('/').length - 1 > 2 ? `${explorerList[_coin]}${txid}` : `${explorerList[_coin]}/tx/${txid}`;
return shell.openExternal(url);
}
render() {
return (
<div className="row margin-left-10">
<div className="col-xlg-12 form-group form-material no-padding-left padding-bottom-10">
<h4>{ translate('TOOLS.PUSH_RAW_TX') }</h4>
</div>
<div className="col-xlg-12 form-group form-material no-padding-left padding-top-20 padding-bottom-50">
<label
className="control-label col-sm-1 no-padding-left"
htmlFor="kmdWalletSendTo">
{ translate('TOOLS.COIN') }
</label>
<Select
name="selectedCoin"
className="col-sm-3"
value={ this.state.selectedCoin }
onChange={ (event) => this.updateSelectedCoin(event, 'selectedCoin') }
optionRenderer={ this.renderCoinOption }
valueRenderer={ this.renderCoinOption }
options={
addCoinOptionsCrypto('skip', true, false)
.concat(addCoinOptionsAC('skip'))
} />
</div>
<div className="col-sm-12 form-group form-material no-padding-left margin-top-20">
<textarea
rows="5"
cols="20"
name="rawTx2Push"
className="col-sm-7 no-padding-left"
placeholder={ translate('TOOLS.TX_TO_PUSH') }
onChange={ this.updateInput }
value={ this.state.rawTx2Push }></textarea>
</div>
<div className="col-sm-12 form-group form-material no-padding-left margin-top-10 padding-bottom-10">
<button
type="button"
className="btn btn-info col-sm-2"
onClick={ this.sendTx }>
{ translate('TOOLS.PUSH') }
</button>
</div>
{ this.state.txPushResult &&
<div className="col-sm-12 form-group form-material no-padding-left margin-top-20">
{ this.state.txPushResult.length === 64 &&
<div>
<div className="margin-bottom-15">
{ this.state.selectedCoin.split('|')[0].toUpperCase() } { translate('TOOLS.TX_PUSHED') }!
</div>
<div>
{ translate('KMD_NATIVE.TXID') }:
<div className="blur selectable word-break--all margin-left-5">
{ this.state.txPushResult }
<button
className="btn btn-default btn-xs clipboard-edexaddr margin-left-20"
title={ translate('INDEX.COPY_TO_CLIPBOARD') }
onClick={ this.copyTx }>
<i className="icon wb-copy"></i> { translate('INDEX.COPY') }
</button>
</div>
<div className="margin-top-10">
<button
type="button"
className="btn btn-sm white btn-dark waves-effect waves-light pull-left"
onClick={ () => this.openExplorerWindow(this.state.txPushResult) }>
<i className="icon fa-external-link"></i> { translate('INDEX.OPEN_TRANSACTION_IN_EPLORER', this.state.selectedCoin.split('|')[0].toUpperCase()) }
</button>
</div>
</div>
</div>
}
{ this.state.txPushResult.length !== 64 &&
<div>
<strong>{ translate('TOOLS.ERROR') }:</strong>
<div className="selectable word-break--all">{ JSON.stringify(this.state.txPushResult) }</div>
</div>
}
</div>
}
</div>
);
}
}
export default ToolsTxPush; |
src/svg-icons/content/send.js | manchesergit/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ContentSend = (props) => (
<SvgIcon {...props}>
<path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/>
</SvgIcon>
);
ContentSend = pure(ContentSend);
ContentSend.displayName = 'ContentSend';
ContentSend.muiName = 'SvgIcon';
export default ContentSend;
|
app/scripts/TilesetFinder.js | hms-dbmi/higlass | import React from 'react';
import PropTypes from 'prop-types';
import slugid from 'slugid';
import CheckboxTree from 'react-checkbox-tree';
import { tileProxy } from './services';
import '../styles/TilesetFinder.css';
import withPubSub from './hocs/with-pub-sub';
// Configs
import { TRACKS_INFO } from './configs';
class TilesetFinder extends React.Component {
constructor(props) {
super(props);
// this.localTracks = TRACKS_INFO.filter
// local tracks are ones that don't have a filetype associated with them
this.localTracks = TRACKS_INFO.filter((x) => x.local && !x.hidden).map(
(x) => {
const y = Object.assign({}, x);
y.datatype = x.datatype[0];
return y;
},
);
this.augmentedTracksInfo = TRACKS_INFO;
if (window.higlassTracksByType) {
Object.keys(window.higlassTracksByType).forEach((pluginTrackType) => {
this.augmentedTracksInfo.push(
window.higlassTracksByType[pluginTrackType].config,
);
});
}
if (props.datatype) {
this.localTracks = this.localTracks.filter(
(x) => x.datatype[0] === props.datatype,
);
} else {
this.localTracks = this.localTracks.filter(
(x) => x.orientation === this.props.orientation,
);
}
this.localTracks.forEach((x) => {
x.uuid = slugid.nice();
});
const newOptions = this.prepareNewEntries('', this.localTracks, {});
const availableTilesetKeys = Object.keys(newOptions);
const selectedUuid = availableTilesetKeys.length
? [availableTilesetKeys[0]]
: null;
this.mounted = false;
this.state = {
selectedUuid,
options: newOptions,
filter: '',
checked: [],
expanded: [],
};
this.requestTilesetLists();
}
componentDidMount() {
// we want to query for a list of tracks that are compatible with this
// track orientation
this.mounted = true;
this.requestTilesetLists();
this.searchBox.focus();
}
componentWillUnmount() {
this.mounted = false;
}
prepareNewEntries(sourceServer, newEntries, existingOptions) {
/**
* Add meta data to new tileset entries before adding
* them to the list of available options.
*/
const newOptions = existingOptions;
const entries = newEntries.map((ne) => {
const ane = Object.assign({}, ne, {
server: sourceServer,
tilesetUid: ne.uuid,
serverUidKey: this.serverUidKey(sourceServer, ne.uuid),
datatype: ne.datatype,
name: ne.name,
uid: slugid.nice(),
});
return ane;
});
entries.forEach((ne) => {
newOptions[ne.serverUidKey] = ne;
});
return newOptions;
}
serverUidKey(server, uid) {
/**
* Create a key for a server and uid
*/
return `${server}/${uid}`;
}
requestTilesetLists() {
let datatypesQuery = null;
if (this.props.datatype) {
datatypesQuery = `dt=${this.props.datatype}`;
} else {
const datatypes = new Set(
[].concat(
...this.augmentedTracksInfo
.filter((x) => x.datatype)
.filter((x) => {
return (
x.orientation === this.props.orientation ||
(this.props.orientation === '1d-vertical' &&
x.orientation === '1d-horizontal')
);
})
.map((x) => x.datatype),
),
);
datatypesQuery = [...datatypes].map((x) => `dt=${x}`).join('&');
}
if (!this.props.trackSourceServers) {
console.warn('No track source servers specified in the viewconf');
return;
}
this.props.trackSourceServers.forEach((sourceServer) => {
tileProxy.json(
`${sourceServer}/tilesets/?limit=10000&${datatypesQuery}`,
(error, data) => {
if (error) {
console.error('ERROR:', error);
} else {
const newOptions = this.prepareNewEntries(
sourceServer,
data.results,
this.state.options,
);
const availableTilesetKeys = Object.keys(newOptions);
let { selectedUuid } = this.state;
// if there isn't a selected tileset, select the first received one
if (!selectedUuid) {
selectedUuid = availableTilesetKeys.length
? [availableTilesetKeys[0]]
: null;
const selectedTileset = this.state.options[selectedUuid[0]];
this.props.selectedTilesetChanged([selectedTileset]);
}
if (this.mounted) {
this.setState({
selectedUuid,
options: newOptions,
});
}
}
},
this.props.pubSub,
);
});
}
/**
* Double clicked on an element. Should be selected
* and this window will be closed.
*/
handleOptionDoubleClick(x /* , y */) {
const value = this.state.options[x.target.value];
this.props.onDoubleClick(value);
}
handleSelectedOptions(selectedOptions) {
const selectedValues = [];
const selectedTilesets = [];
// I don't know why selectedOptions.map doesn't work
for (let i = 0; i < selectedOptions.length; i++) {
selectedValues.push(selectedOptions[i]);
selectedTilesets.push(this.state.options[selectedOptions[i]]);
}
this.props.selectedTilesetChanged(selectedTilesets);
this.setState({ selectedUuid: selectedValues });
}
handleSelect() {
const { selectedOptions } = this.multiSelect;
const selectedOptionsList = [];
for (let i = 0; i < selectedOptions.length; i++) {
const selectedOption = selectedOptions[i];
selectedOptionsList.push(selectedOption.value);
}
this.handleSelectedOptions(selectedOptionsList);
}
handleSearchChange() {
const domElement = this.searchBox;
this.setState({ filter: domElement.value });
}
/*
* Create the nested checkbox tree by partitioning the
* list of available datasets according to their group
*
* @param {object} datasetsDict A dictionary of id -> tileset
* def mappings
* @param {string} filter A string to filter the results by
* @returns {array} A list of items that define the nested checkbox
* structure
* {
* 'name': 'blah',
* 'value': 'blah',
* 'children': [],
* }
*/
partitionByGroup(datasetsDict, filter) {
const itemsByGroup = {
'': {
name: '',
value: '',
children: [],
},
};
for (const uuid of Object.keys(datasetsDict)) {
const item = datasetsDict[uuid];
if (!item.name.toLowerCase().includes(filter)) {
continue;
}
if ('project_name' in item) {
const group = item.project_name;
if (!(group in itemsByGroup)) {
itemsByGroup[group] = {
value: group,
label: group,
children: [],
};
}
itemsByGroup[group].children.push({
label: item.name,
value: uuid,
});
} else {
itemsByGroup[''].children.push({
label: item.name,
value: uuid,
});
}
}
const allItems = itemsByGroup[''].children;
// coollapse the group lists into one list of objects
for (const group of Object.keys(itemsByGroup)) {
if (group !== '') {
itemsByGroup[group].children.sort((a, b) =>
a.label.toLowerCase().localeCompare(b.label.toLowerCase(), 'en'),
);
allItems.push(itemsByGroup[group]);
}
}
allItems.sort((a, b) =>
a.label.toLowerCase().localeCompare(b.label.toLowerCase(), 'en'),
);
return allItems;
}
handleChecked(checked) {
this.handleSelectedOptions(checked);
this.setState({ checked });
}
handleExpanded(expanded) {
this.setState({ expanded });
}
render() {
const optionsList = [];
for (const key in this.state.options) {
optionsList.push(this.state.options[key]);
}
const nestedItems = this.partitionByGroup(
this.state.options,
this.state.filter,
);
const svgStyle = {
width: 15,
height: 15,
top: 2,
right: 2,
position: 'relative',
};
const halfSvgStyle = JSON.parse(JSON.stringify(svgStyle));
halfSvgStyle.opacity = 0.5;
const form = (
<form
onSubmit={(evt) => {
evt.preventDefault();
}}
>
<div className="tileset-finder-search-bar">
<span className="tileset-finder-label">Select tileset:</span>
<input
ref={(c) => {
this.searchBox = c;
}}
className="tileset-finder-search-box"
onChange={this.handleSearchChange.bind(this)}
placeholder="Search Term"
type="text"
/>
</div>
<div
className="tileset-finder-checkbox-tree"
styleName="tileset-finder-checkbox-tree"
>
<CheckboxTree
checked={this.state.checked}
expanded={this.state.expanded}
icons={{
uncheck: (
<svg style={svgStyle}>
<use xlinkHref="#square_o" />
</svg>
),
check: (
<svg style={svgStyle}>
<use xlinkHref="#check_square_o" />
</svg>
),
halfCheck: (
<svg style={halfSvgStyle}>
<use xlinkHref="#check_square_o" />
</svg>
),
leaf: (
<svg style={svgStyle}>
<use xlinkHref="#file_o" />
</svg>
),
expandClose: (
<svg style={svgStyle}>
<use xlinkHref="#chevron_right" />
</svg>
),
expandOpen: (
<svg style={svgStyle}>
<use xlinkHref="#chevron_down" />
</svg>
),
parentClose: (
<svg style={svgStyle}>
<use xlinkHref="#folder_o" />
</svg>
),
parentOpen: (
<svg style={svgStyle}>
<use xlinkHref="#folder_open_o" />
</svg>
),
}}
nodes={nestedItems}
onCheck={this.handleChecked.bind(this)}
onExpand={this.handleExpanded.bind(this)}
/>
</div>
</form>
);
return <div>{form}</div>;
}
}
TilesetFinder.propTypes = {
datatype: PropTypes.string,
orientation: PropTypes.string,
onDoubleClick: PropTypes.func,
pubSub: PropTypes.object.isRequired,
selectedTilesetChanged: PropTypes.func,
trackSourceServers: PropTypes.array,
};
export default withPubSub(TilesetFinder);
|
packages/flow-upgrade/src/upgrades/0.53.0/ReactComponentExplicitTypeArgs/__tests__/fixtures/DefaultPropsInferred.js | mroch/flow | // @flow
import React from 'react';
class MyComponent extends React.Component {
static defaultProps = {};
props: Props;
defaultProps: T;
static props: T;
static state: T;
a: T;
b = 5;
c: T = 5;
method() {}
}
const expression = () =>
class extends React.Component {
static defaultProps = {};
props: Props;
defaultProps: T;
static props: T;
static state: T;
a: T;
b = 5;
c: T = 5;
method() {}
}
|
sms_sponsorship/webapp/src/components/Message.js | maxime-beck/compassion-modules | import React from 'react';
export default class extends React.Component {
render() {
let styles = {
loadingContainer: {
verticalAlign: 'middle',
marginTop: '120px',
textAlign: 'center'
},
loadingTextContainer: {
width: '80%',
textAlign: 'center',
margin: 'auto'
},
};
return (
<div style={styles.loadingContainer}>
<div style={styles.loadingTextContainer} dangerouslySetInnerHTML={{__html: this.props.text}}/>
</div>
)
}
} |
src/layouts/index.js | H3yfinn/finbarmaunsell.com | import React from 'react'
import PropTypes from 'prop-types'
import Link from 'gatsby-link'
import Helmet from 'react-helmet'
import './index.css'
const Header = () => (
<div
style={{
background: '#2452c2',
marginBottom: '1.45rem',
}}
>
<div
style={{
display: '-ms-flexbox',
display: 'flex',
flexDirection: 'row',
margin: '0 auto',
maxWidth: 1200,
padding: '1.45rem 1.0875rem',
}}
>
<h1 style={{ paddingTop: '10px', flex: 1, margin: 0 }}>
<Link
to="/"
style={{
color: 'white',
textDecoration: 'none',
}}
>
Finn
</Link>
</h1>
<h3
className=''
style={{
paddingTop: '20px'
}}
>
<Link
className='navLink'
to="/about"
style={{
paddingLeft: '20px',
float: 'right',
color: 'white',
textDecoration: 'none',
}}
>
About
</Link>
<Link
className='navLink'
to="/resume"
style={{
paddingLeft: '20px',
float: 'right',
color: 'white',
textDecoration: 'none',
}}
>
Resume
</Link>
<Link
className='navLink'
to="/books"
style={{
paddingLeft: '20px',
float: 'right',
color: 'white',
textDecoration: 'none',
}}
>
Bookshelf
</Link>
</h3>
</div>
</div>
)
const TemplateWrapper = ({ children }) => (
<div>
<Helmet
title="Finbar Maunsell"
meta={[
{ name: 'description', content: 'Personal website' },
{ name: 'keywords', content: 'personal, website, blog' },
]}
/>
<Header />
<div
style={{
margin: '0 auto',
maxWidth: 960,
padding: '0px 1.0875rem 1.45rem',
paddingTop: '20px',
}}
>
{children()}
</div>
</div>
)
TemplateWrapper.propTypes = {
children: PropTypes.func,
}
export default TemplateWrapper
|
src/components/EditCheckInItem/messages.links.js | transitlinks/web-app | import React from 'react';
import { defineMessages } from 'react-intl';
export default defineMessages({
'links-title': {
id: 'account.links.linksTitle',
defaultMessage: 'User links',
description: 'User links'
}
});
|
src/svg-icons/action/track-changes.js | pomerantsev/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionTrackChanges = (props) => (
<SvgIcon {...props}>
<path d="M19.07 4.93l-1.41 1.41C19.1 7.79 20 9.79 20 12c0 4.42-3.58 8-8 8s-8-3.58-8-8c0-4.08 3.05-7.44 7-7.93v2.02C8.16 6.57 6 9.03 6 12c0 3.31 2.69 6 6 6s6-2.69 6-6c0-1.66-.67-3.16-1.76-4.24l-1.41 1.41C15.55 9.9 16 10.9 16 12c0 2.21-1.79 4-4 4s-4-1.79-4-4c0-1.86 1.28-3.41 3-3.86v2.14c-.6.35-1 .98-1 1.72 0 1.1.9 2 2 2s2-.9 2-2c0-.74-.4-1.38-1-1.72V2h-1C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-2.76-1.12-5.26-2.93-7.07z"/>
</SvgIcon>
);
ActionTrackChanges = pure(ActionTrackChanges);
ActionTrackChanges.displayName = 'ActionTrackChanges';
ActionTrackChanges.muiName = 'SvgIcon';
export default ActionTrackChanges;
|
frontend/src/components/controls/SidebarUI/index.js | webrecorder/webrecorder | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { dispatchEvent, inStorage, getStorage, setStorage } from 'helpers/utils';
import Resizable from 'components/Resizable';
import './style.scss';
class SidebarUI extends Component {
static propTypes = {
children: PropTypes.node,
defaultExpanded: PropTypes.bool,
expanded: PropTypes.bool,
resizing: PropTypes.bool,
setSidebarResizing: PropTypes.func,
storageKey: PropTypes.string,
toggleSidebar: PropTypes.func
};
static defaultProps = {
defaultExpanded: true,
storageKey: 'sidebarDisplay'
};
constructor(props) {
super(props);
this.closedWidth = 1;
this.state = { initTimeout: false };
}
componentDidMount() {
const { defaultExpanded, storageKey, toggleSidebar } = this.props;
let expanded = defaultExpanded;
if (inStorage(storageKey)) {
try {
expanded = JSON.parse(getStorage(storageKey));
} catch (e) {
console.log(`Wrong '${storageKey}' storage value`);
}
}
toggleSidebar(expanded);
// allow Resizable to retreive stored width before animating
setTimeout(() => this.setState({ initTimeout: true }), 100);
}
componentDidUpdate(prevProps) {
const { expanded, storageKey } = this.props;
if (prevProps.expanded !== expanded) {
setStorage(storageKey, expanded);
dispatchEvent('resize');
}
}
render() {
const { children, expanded, resizing, storageKey } = this.props;
const { initTimeout } = this.state;
const classes = classNames('wr-sidebar', {
animate: initTimeout && !resizing,
expanded
});
return (
<Resizable
classes={classes}
flexGrow={0}
resizeState={this.props.setSidebarResizing}
storageKey={`${storageKey}Width`}
overrideWidth={!expanded && this.closedWidth}
minWidth={175}>
<div className="wr-sidebar-stretch">
{
expanded && children
}
</div>
</Resizable>
);
}
}
export default SidebarUI;
|
packages/ringcentral-widgets-docs/src/app/pages/Components/AlertDisplay/Demo.js | u9520107/ringcentral-js-widget | import React from 'react';
// eslint-disable-next-line
import AlertDisplay from 'ringcentral-widgets/components/AlertDisplay';
import styles from './styles.scss';
const props = {};
props.dismiss = () => null;
props.currentLocale = 'en-US';
props.messages = [
{
id: '111',
level: 'success',
message: 'success message',
},
{
id: '222',
level: 'info',
message: 'info message',
},{
id: '333',
level: 'warning',
message: 'warning message',
}, {
id: '444',
level: 'danger',
message: 'danger',
}
];
// eslint-disable-next-line
function MessageRender({ message }) {
return (
<span>{ message.message }</span>
);
}
props.getRenderer = () => MessageRender;
/**
* A example of `AlertDisplay`
*/
const AlertDisplayDemo = () => (
<div className={styles.root}>
<AlertDisplay
messages={props.messages}
{...props}
/>
</div>
);
export default AlertDisplayDemo;
|
js/components/deckswiper/index.js | LetsBuildSomething/vmag_mobile |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Image, View } from 'react-native';
import { Container, Header, Title, Button, IconNB, DeckSwiper, Card, CardItem, Icon, Thumbnail, Text, Left, Right, Body, Content } from 'native-base';
import { openDrawer } from '../../actions/drawer';
import styles from './styles';
const cardOne = require('../../../img/swiper-1.png');
const cardTwo = require('../../../img/swiper-2.png');
const cardThree = require('../../../img/swiper-3.png');
const cardFour = require('../../../img/swiper-4.png');
const cards = [
{
text: 'Card One',
name: 'One',
image: cardOne,
},
{
text: 'Card Two',
name: 'Two',
image: cardTwo,
},
{
text: 'Card Three',
name: 'Three',
image: cardThree,
},
{
text: 'Card Four',
name: 'Four',
image: cardFour,
},
];
class NHDeckSwiper extends Component { // eslint-disable-line
static propTypes = {
openDrawer: React.PropTypes.func,
}
render() {
return (
<Container style={styles.container}>
<Header>
<Left>
<Button transparent onPress={this.props.openDrawer}>
<Icon name="menu" />
</Button>
</Left>
<Body>
<Title>Deck Swiper</Title>
</Body>
<Right />
</Header>
<View style={{ flex: 1, padding: 12 }}>
<DeckSwiper
dataSource={cards}
renderItem={item =>
<Card style={{ elevation: 3 }}>
<CardItem>
<Left>
<Thumbnail source={item.image} />
<Body>
<Text>{item.text}</Text>
<Text note>NativeBase</Text>
</Body>
</Left>
</CardItem>
<CardItem cardBody>
<Image style={{ resizeMode: 'cover', width: null, flex: 1, height: 300 }} source={item.image} />
</CardItem>
<CardItem>
<IconNB name={'ios-heart'} style={{ color: '#ED4A6A' }} />
<Text>{item.name}</Text>
</CardItem>
</Card>
}
/>
</View>
</Container>
);
}
}
function bindAction(dispatch) {
return {
openDrawer: () => dispatch(openDrawer()),
};
}
const mapStateToProps = state => ({
navigation: state.cardNavigation,
themeState: state.drawer.themeState,
});
export default connect(mapStateToProps, bindAction)(NHDeckSwiper);
|
examples/3-complex/src/login/index.js | chikara-chan/react-power | import React from 'react'
import { render } from 'react-dom'
import { AppContainer } from 'react-hot-loader'
import App from './components/App'
function renderHTML() {
render(
<AppContainer>
<App />
</AppContainer>,
document.getElementById('root')
)
}
renderHTML()
if (module.hot) {
module.hot.accept('./components/App', () => {
renderHTML()
})
}
|
app/components/IssueIcon/index.js | Zurico/t7 | import React from 'react';
function IssueIcon(props) {
return (
<svg
height="1em"
width="0.875em"
className={props.className}
>
<path d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7S10.14 13.7 7 13.7 1.3 11.14 1.3 8s2.56-5.7 5.7-5.7m0-1.3C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7S10.86 1 7 1z m1 3H6v5h2V4z m0 6H6v2h2V10z" />
</svg>
);
}
IssueIcon.propTypes = {
className: React.PropTypes.string,
};
export default IssueIcon;
|
src/Main/PlayerSelecter.js | enragednuke/WoWAnalyzer | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import ReactTooltip from 'react-tooltip';
import { getReport } from 'selectors/report';
import { getCombatants } from 'selectors/combatants';
import PlayerSelectionList from './PlayerSelectionList';
class PlayerSelecter extends Component {
static propTypes = {
report: PropTypes.shape({
code: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
friendlies: PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.number.isRequired,
type: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
})),
}).isRequired,
combatants: PropTypes.array,
};
componentWillUnmount() {
ReactTooltip.hide();
}
render() {
const { report, combatants } = this.props;
if (!combatants) {
return (
<div className="container">
<div>
<h1>Fetching players...</h1>
<div className="spinner" />
</div>
</div>
);
}
return (
<div className="container">
<h1>
<div className="back-button">
<Link to={`/report/${report.code}`} data-tip="Back to fight selection">
<span className="glyphicon glyphicon-chevron-left" aria-hidden="true" />
</Link>
</div>
Player selection
</h1>
<div className="panel">
<div className="panel-heading">
<h2>Select the player you wish to analyze</h2>
</div>
<div className="panel-body" style={{ padding: 0 }}>
<PlayerSelectionList />
</div>
</div>
</div>
);
}
}
const mapStateToProps = state => ({
report: getReport(state),
combatants: getCombatants(state),
});
export default connect(mapStateToProps)(PlayerSelecter);
|
app/App.js | albybarber/blackpanda | import React from 'react'
import Hello from './components/hello/hello'
import Grid from './components/grid/grid'
// import IconPage from './atoms/icons/docs/IconPage'
export default class App extends React.Component {
render () {
return (
<div>
<Hello />
<grid />
</div>
)
}
}
|
node_modules/react-bootstrap/es/DropdownToggle.js | chenjic215/search-doctor | import _extends from 'babel-runtime/helpers/extends';
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Button from './Button';
import SafeAnchor from './SafeAnchor';
import { bsClass as setBsClass } from './utils/bootstrapUtils';
var propTypes = {
noCaret: PropTypes.bool,
open: PropTypes.bool,
title: PropTypes.string,
useAnchor: PropTypes.bool
};
var defaultProps = {
open: false,
useAnchor: false,
bsRole: 'toggle'
};
var DropdownToggle = function (_React$Component) {
_inherits(DropdownToggle, _React$Component);
function DropdownToggle() {
_classCallCheck(this, DropdownToggle);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
DropdownToggle.prototype.render = function render() {
var _props = this.props,
noCaret = _props.noCaret,
open = _props.open,
useAnchor = _props.useAnchor,
bsClass = _props.bsClass,
className = _props.className,
children = _props.children,
props = _objectWithoutProperties(_props, ['noCaret', 'open', 'useAnchor', 'bsClass', 'className', 'children']);
delete props.bsRole;
var Component = useAnchor ? SafeAnchor : Button;
var useCaret = !noCaret;
// This intentionally forwards bsSize and bsStyle (if set) to the
// underlying component, to allow it to render size and style variants.
// FIXME: Should this really fall back to `title` as children?
return React.createElement(
Component,
_extends({}, props, {
role: 'button',
className: classNames(className, bsClass),
'aria-haspopup': true,
'aria-expanded': open
}),
children || props.title,
useCaret && ' ',
useCaret && React.createElement('span', { className: 'caret' })
);
};
return DropdownToggle;
}(React.Component);
DropdownToggle.propTypes = propTypes;
DropdownToggle.defaultProps = defaultProps;
export default setBsClass('dropdown-toggle', DropdownToggle); |
src/server/html.js | matystl/shopping_list | import React from 'react';
export default class Html extends React.Component {
render() {
// Only for production. For dev, it's handled by webpack with livereload.
const linkStyles = this.props.isProduction &&
<link
href={`/build/app.css?v=${this.props.version}`}
rel="stylesheet"
/>;
// TODO: Add favicon.
const linkFavicon = false && <link
href={`/build/img/favicon.icon?v=${this.props.version}`}
rel="shortcut icon"
/>;
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
<title>{this.props.title}</title>
{linkStyles}
{linkFavicon}
</head>
<body dangerouslySetInnerHTML={{__html: this.props.bodyHtml}} />
</html>
);
}
}
Html.propTypes = {
bodyHtml: React.PropTypes.string.isRequired,
isProduction: React.PropTypes.bool.isRequired,
title: React.PropTypes.string.isRequired,
version: React.PropTypes.string.isRequired
};
|
app/routes.js | ayqy/ready-to-work | import React from 'react';
import { Switch, Route } from 'react-router';
import MainPage from './containers/MainPage';
import LoginPage from './containers/LoginPage';
import HistoryPage from './containers/HistoryPage';
import SettingPage from './containers/SettingPage';
export default (
<Switch>
<Route exact path="/" component={MainPage} />
<Route exact path="/loggedin" component={MainPage} />
<Route exact path="/login" component={LoginPage} />
<Route exact path="/history" component={HistoryPage} />
<Route exact path="/setting" render={() => <SettingPage/>} />
</Switch>
);
|
src/components/RestaurantList.js | rgdelato/instantly-lunch | import React, { Component } from 'react';
import { TransitionMotion, spring } from 'react-motion';
import RestaurantItem from '../containers/RestaurantItem';
import RestaurantAdd from '../containers/RestaurantAdd';
export default class RestaurantList extends Component {
constructor (props) {
super(props);
this.getStyles = this.getStyles.bind(this);
this.willEnterOrLeave = this.willEnterOrLeave.bind(this);
}
getStyles (restaurants, editing) {
return restaurants.reduce((acc, restaurant) => {
acc[restaurant.id] = {
opacity: spring(1),
maxHeight: spring(300),
marginBottom: spring(24),
borderWidth: 1,
padding: spring(12),
restaurant,
editing
};
return acc;
}, {});
}
willEnterOrLeave (key, style) {
return {
opacity: spring(0),
maxHeight: spring(0),
marginBottom: spring(0),
borderWidth: 0,
padding: spring(0),
restaurant: style.restaurant,
editing: style.editing
};
}
render () {
const { restaurants, editing } = this.props;
return (
<div className="restaurant-list">
<TransitionMotion
styles={this.getStyles(restaurants, editing)}
willEnter={this.willEnterOrLeave}
willLeave={this.willEnterOrLeave}
>
{(styles) =>
<div>
{Object.keys(styles).map((id) => {
const { restaurant, editing, ...style } = styles[id];
return (
<RestaurantItem
key={restaurant.id}
restaurant={(editing.id === restaurant.id) ? editing : restaurant}
editing={editing.id === restaurant.id}
style={style}
/>
);
})}
</div>
}
</TransitionMotion>
<RestaurantAdd />
</div>
);
}
}
|
src/App.js | michael-lowe-nz/trigMeOnce | import React, { Component } from 'react';
import Main from './components/Main'
import Nav from './components/Nav'
class App extends Component {
render() {
return (
<div className="App">
<Nav />
<Main state={this.props.state} dispatch={this.props.dispatch}/>
</div>
)
}
}
export default App;
|
src/containers/DevTools.js | oldsaratov/postcards-spa | import React from 'react';
import { createDevTools } from 'redux-devtools';
import LogMonitor from 'redux-devtools-log-monitor';
import DockMonitor from 'redux-devtools-dock-monitor';
export default createDevTools(
<DockMonitor
toggleVisibilityKey='ctrl-h'
changePositionKey='ctrl-q' >
<LogMonitor />
</DockMonitor>
);
|
examples/03 Nesting/Drag Sources/Container.js | longlho/react-dnd | import React, { Component } from 'react';
import SourceBox from './SourceBox';
import TargetBox from './TargetBox';
import Colors from './Colors';
import { DragDropContext } from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';
@DragDropContext(HTML5Backend)
export default class Container extends Component {
render() {
return (
<div style={{ overflow: 'hidden', clear: 'both', margin: '-.5rem' }}>
<div style={{ float: 'left' }}>
<SourceBox color={Colors.BLUE}>
<SourceBox color={Colors.YELLOW}>
<SourceBox color={Colors.YELLOW} />
<SourceBox color={Colors.BLUE} />
</SourceBox>
<SourceBox color={Colors.BLUE}>
<SourceBox color={Colors.YELLOW} />
</SourceBox>
</SourceBox>
</div>
<div style={{ float: 'left', marginLeft: '5rem', marginTop: '.5rem' }}>
<TargetBox />
</div>
</div>
);
}
} |
src/js/Root.js | nekuno/client | import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { Router, Route, applyRouterMiddleware } from 'react-router';
import { useScroll } from 'react-router-scroll';
import App from './App';
import HomePage from './pages/HomePage';
import AnswerUsernamePage from './pages/AnswerUsernamePage';
import ProfessionalProfilePage from './pages/ProfessionalProfilePage';
import ProfessionalProfileIndustryPage from './pages/ProfessionalProfileIndustryPage';
import ProfessionalProfileSkillsPage from './pages/ProfessionalProfileSkillsPage';
import LeisureProfilePage from './pages/LeisureProfilePage';
import LeisureProfileSportsPage from './pages/LeisureProfileSportsPage';
import LeisureProfileHobbiesPage from './pages/LeisureProfileHobbiesPage';
import LeisureProfileGamesPage from './pages/LeisureProfileGamesPage';
import ExplorerProfilePage from './pages/ExplorerProfilePage';
import ExplorerProfileCostPage from './pages/ExplorerProfileCostPage';
import ExplorerProfileEventsPage from './pages/ExplorerProfileEventsPage';
import ExplorerProfileRestaurantsPage from './pages/ExplorerProfileRestaurantsPage';
import ExplorerProfilePlansPage from './pages/ExplorerProfilePlansPage';
import AvailabilityPage from './pages/AvailabilityPage';
import AvailabilityEditOnSignUpPage from './pages/AvailabilityEditOnSignUpPage';
import AvailabilityEditPage from './pages/AvailabilityEditPage';
import ConnectFacebookPage from './pages/ConnectFacebookPage';
import ConnectingFacebookPage from './pages/ConnectingFacebookPage';
import ProposalsPage from './pages/Proposals/Recommendation/ProposalsPage';
import PersonsPage from './pages/PersonsPage';
import PersonsAllPage from './pages/PersonsAllPage';
import PersonsFilterPage from './pages/PersonsFilterPage';
import OwnProposalsPage from './pages/OwnProposalsPage';
import ExplorePage from './pages/ExplorePage';
import ChatThreadsPage from './pages/ChatThreadsPage';
import ChatMessagesPage from './pages/ChatMessagesPage';
import OwnUserInterestsPage from './pages/OwnUser/InterestsPage';
import GalleryPage from './pages/GalleryPage';
import OtherGalleryPage from './pages/OtherGalleryPage';
import GalleryPhotoPage from './pages/GalleryPhotoPage';
import OtherGalleryPhotoPage from './pages/OtherGalleryPhotoPage';
import GalleryProfilePhotoPage from './pages/GalleryProfilePhotoPage';
import GalleryAlbumsPage from './pages/GalleryAlbumsPage';
import GalleryAlbumPhotosPage from './pages/GalleryAlbumPhotosPage';
import QuestionsPage from './pages/QuestionsPage';
import OtherQuestionsPage from './pages/OtherQuestionsPage';
import AnswerQuestionPage from './pages/AnswerQuestionPage';
import AnswerNextQuestionPage from './pages/AnswerNextQuestionPage';
import AnswerNextOtherQuestionPage from './pages/AnswerNextOtherQuestionPage';
import QuestionStatsPage from './pages/QuestionStatsPage';
import QuestionEditedStatsPage from './pages/QuestionEditedStatsPage';
import QuestionOtherStatsPage from './pages/QuestionOtherStatsPage';
import LoginPage from './pages/LoginPage';
import RegisterPage from './pages/RegisterPage';
import RegisterQuestionsLandingPage from './pages/RegisterQuestionLandingPage';
import AnswerUserFieldPage from './pages/AnswerUserFieldPage';
import AnswerProfileFieldPage from './pages/AnswerProfileFieldPage';
import ProfilePage from './pages/ProfilePage';
import DiscoverPage from './pages/DiscoverPage';
import RecommendationPage from './pages/RecommendationPage';
import InvitationsPage from './pages/InvitationsPage';
import ConnectSocialNetworksOnSignUpPage from './pages/ConnectSocialNetworksOnSignUpPage';
import ConnectSocialNetworksPage from './pages/ConnectSocialNetworksPage';
import EditThreadLitePage from './pages/EditThreadLitePage';
import GroupPage from './pages/GroupPage';
import SettingsPage from './pages/SettingsPage';
import RouterActionCreators from './actions/RouterActionCreators';
import LoginStore from './stores/LoginStore';
import ProposalsProjectIntroductionPage from "./pages/Proposals/Project/IntroductionPage";
import ProposalsLeisureIntroductionPage from "./pages/Proposals/Leisure/IntroductionPage";
import ProposalsExperienceIntroductionPage from "./pages/Proposals/Experience/IntroductionPage";
import ProposalBasicEditPage from "./pages/Proposals/Edit/BasicPage";
import ProposalTypeEditPage from "./pages/Proposals/Edit/TypePage";
import ProposalProfessionEditPage from "./pages/Proposals/Edit/ProfessionPage";
import ProposalAvailabilityEditPage from "./pages/Proposals/Edit/AvailabilityPage";
import ProposalAvailabilityDatesEditPage from "./pages/Proposals/Edit/AvailabilityDatesPage";
import ProposalFeaturesPage from "./pages/Proposals/Edit/FeaturesPage";
import ProposalPreviewPage from "./pages/Proposals/Edit/PreviewPage";
import OtherUserProposalsPage from "./pages/OtherUser/ProposalsPage";
import OtherUserAboutMePage from "./pages/OtherUser/AboutMePage";
import OtherUserAnswersPage from "./pages/OtherUser/AnswersPage";
import OtherUserProposalDetailPage from "./pages/OtherUserProposalDetailPage";
import OtherUserInterestsPage from './pages/OtherUser/InterestsPage';
import ProposalDetailPage from "./pages/ProposalDetailPage";
import ProposalDetailMatchesPage from "./pages/ProposalDetailMatchesPage";
import OwnUserAboutMePage from "./pages/OwnUser/AboutMePage";
import OwnUserAnswersPage from "./pages/OwnUser/AnswersPage";
import FriendsPage from "./pages/OwnUser/FriendsPage";
import NetworksPage from "./pages/OwnUser/NetworksPage";
import EditProfilePage from "./pages/OwnUser/EditProfilePage";
function requireAuth(nextState, replaceState) {
if (!LoginStore.isLoggedIn()) {
let transitionPath = nextState.location.pathname;
RouterActionCreators.storeRouterTransitionPath(transitionPath);
console.log('Unauthorized path ', transitionPath, ' stored, redirecting to login now...');
replaceState({nextPathname: nextState.location.pathname}, '/')
}
}
export default class Root extends Component {
static propTypes = {
history: PropTypes.object.isRequired
};
render() {
const {history} = this.props;
return (
<Router history={history} render={applyRouterMiddleware(useScroll())}>
<Route name="home" path="/" component={App}>
<Route name="splash" path="/splash" component={HomePage}/>
<Route name="answer-username" path="/answer-username" component={AnswerUsernamePage}/>
<Route name="professional-profile" path="/professional-profile" component={ProfessionalProfilePage}/>
<Route name="professional-profile-industry" path="/professional-profile-industry" component={ProfessionalProfileIndustryPage}/>
<Route name="professional-profile-skills" path="/professional-profile-skills" component={ProfessionalProfileSkillsPage}/>
<Route name="leisure-profile" path="/leisure-profile" component={LeisureProfilePage}/>
<Route name="leisure-profile-sports" path="/leisure-profile-sports" component={LeisureProfileSportsPage}/>
<Route name="leisure-profile-hobbies" path="/leisure-profile-hobbies" component={LeisureProfileHobbiesPage}/>
<Route name="leisure-profile-games" path="/leisure-profile-games" component={LeisureProfileGamesPage}/>
<Route name="explorer-profile" path="/explorer-profile" component={ExplorerProfilePage}/>
<Route name="explorer-profile-cost" path="/explorer-profile-cost" component={ExplorerProfileCostPage}/>
<Route name="explorer-profile-events" path="/explorer-profile-events" component={ExplorerProfileEventsPage}/>
<Route name="explorer-profile-restaurants" path="/explorer-profile-restaurants" component={ExplorerProfileRestaurantsPage}/>
<Route name="explorer-profile-plans" path="/explorer-profile-plans" component={ExplorerProfilePlansPage}/>
<Route name="availability" path="/availability" component={AvailabilityPage}/>
<Route name="availability-edit-on-sign-up" path="/availability-edit-on-sign-up" component={AvailabilityEditOnSignUpPage}/>
<Route name="connect-facebook" path="/connect-facebook" component={ConnectFacebookPage}/>
<Route name="login" path="/login" component={LoginPage}/>
<Route name="register" path="/register" component={RegisterPage}/>
<Route onEnter={requireAuth}>
<Route name="connecting-facebook" path="/connecting-facebook" component={ConnectingFacebookPage}/>
<Route name="proposals" path="/proposals" component={ProposalsPage}/>
<Route name="proposals-project-introduction" path="/proposals-project-introduction" component={ProposalsProjectIntroductionPage}/>
<Route name="proposals-leisure-introduction" path="/proposals-leisure-introduction" component={ProposalsLeisureIntroductionPage}/>
<Route name="proposals-experience-introduction" path="/proposals-experience-introduction" component={ProposalsExperienceIntroductionPage}/>
<Route name="proposal-basic-edit" path="/proposal-basic-edit/:proposalId" component={ProposalBasicEditPage}/>
<Route name="proposal-basic-create" path="/proposal-basic-edit" component={ProposalBasicEditPage}/>
<Route name="proposal-type-edit" path="/proposal-type-edit/:proposalId" component={ProposalTypeEditPage}/>
<Route name="proposal-type-create" path="/proposal-type-edit" component={ProposalTypeEditPage}/>
<Route name="proposal-profession-edit" path="/proposal-profession-edit/:proposalId" component={ProposalProfessionEditPage}/>
<Route name="proposal-profession-create" path="/proposal-profession-edit" component={ProposalProfessionEditPage}/>
<Route name="proposal-availability-edit" path="/proposal-availability-edit/:proposalId" component={ProposalAvailabilityEditPage}/>
<Route name="proposal-availability-create" path="/proposal-availability-edit" component={ProposalAvailabilityEditPage}/>
<Route name="proposal-availability-dates-edit" path="/proposal-availability-dates-edit/:proposalId" component={ProposalAvailabilityDatesEditPage}/>
<Route name="proposal-availability-dates-create" path="/proposal-availability-dates-edit" component={ProposalAvailabilityDatesEditPage}/>
<Route name="proposal-features-edit" path="/proposal-features-edit/:proposalId" component={ProposalFeaturesPage}/>
<Route name="proposal-features-create" path="/proposal-features-edit" component={ProposalFeaturesPage}/>
<Route name="proposal-preview-edit" path="/proposal-preview/:proposalId" component={ProposalPreviewPage}/>
<Route name="proposal-preview-create" path="/proposal-preview" component={ProposalPreviewPage}/>
<Route name="other-user-proposals" path="/p/:slug/proposals" component={OtherUserProposalsPage}/>
<Route name="other-user-answers" path="/p/:slug/answers" component={OtherUserAnswersPage}/>
<Route name="other-user-interests" path="/p/:slug/interests" component={OtherUserInterestsPage}/>
<Route name="other-user-proposal-detail" path="/p/:slug/proposal/:proposalId" component={OtherUserProposalDetailPage}/>
<Route name="profile" path="/p/:slug" component={ProfilePage}/>
<Route name="own-profile-edit" path="/p/:slug/edit" component={EditProfilePage}/>
<Route name="persons" path="/persons" component={PersonsPage}/>
<Route name="persons-all" path="/persons-all" component={PersonsAllPage}/>
<Route name="persons-filter" path="/persons-filter/:threadId" component={PersonsFilterPage}/>
<Route name="friends" path="/friends" component={FriendsPage}/>
<Route name="networks" path="/networks" component={NetworksPage}/>
<Route name="plans" path="/plans" component={OwnProposalsPage}/>
<Route name="proposal-detail" path="/proposal/:proposalId" component={ProposalDetailPage}/>
<Route name="proposal-detail-matches" path="/proposal/:proposalId/matches" component={ProposalDetailMatchesPage}/>
{/*<Route name="about-me" path="/about-me" component={OwnUserAboutMePage}/>*/}
<Route name="answers" path="/answers" component={OwnUserAnswersPage}/>
<Route name="availability-edit" path="/availability-edit" component={AvailabilityEditPage}/>
{/*<Route name="explore" path="/explore" component={ExplorePage}/>*/}
{/*<Route name="register-questions-landing" path="/register-questions-landing" component={RegisterQuestionsLandingPage}/>*/}
{/*<Route name="answer-user-fields" path="/answer-user-fields" component={AnswerUserFieldPage}/>*/}
{/*<Route name="answer-profile-fields" path="/answer-profile-fields" component={AnswerProfileFieldPage}/>*/}
<Route name="notifications" path="/conversations" component={ChatThreadsPage}/>
<Route name="messages" path="/p/:slug/conversations" component={ChatMessagesPage}/>
<Route name="interests" path="/interests" component={OwnUserInterestsPage}/>
{/*<Route name="other-interests" path="/users/:slug/other-interests" component={OtherInterestsPage}/>*/}
{/*<Route name="gallery" path="/gallery" component={GalleryPage}/>*/}
{/*<Route name="other-gallery" path="/users/:slug/other-gallery/:photoId" component={OtherGalleryPage}/>*/}
{/*<Route name="gallery-photo" path="/gallery-photo" component={GalleryPhotoPage}/>*/}
{/*<Route name="other-gallery-photo" path="/users/:userId/other-gallery-photo" component={OtherGalleryPhotoPage}/>*/}
{/*<Route name="gallery-profile-photo" path="/gallery-profile-photo" component={GalleryProfilePhotoPage}/>*/}
{/*<Route name="gallery-albums" path="/gallery-albums" component={GalleryAlbumsPage}/>*/}
{/*<Route name="gallery-album-photos" path="/gallery-album-photos" component={GalleryAlbumPhotosPage}/>*/}
{/*<Route name="questions" path="/questions" component={QuestionsPage}/>*/}
{/*<Route name="other-questions" path="/users/:slug/other-questions" component={OtherQuestionsPage}/>*/}
<Route name="answer-question" path="/answer-question/:questionId/:from" component={AnswerQuestionPage}/>
<Route name="answer-question-next" path="/answer-question/next" component={AnswerNextQuestionPage}/>
<Route name="answer-other-question-next" path="/answer-other-question/:slug/next" component={AnswerNextOtherQuestionPage}/>
{/*<Route name="question-stats" path="/question-stats" component={QuestionStatsPage}/>*/}
<Route name="question-stats-from" path="/question-stats/:from" component={QuestionEditedStatsPage}/>
{/*<Route name="question-stats-other" path="/question-other-stats/:slug" component={QuestionOtherStatsPage}/>*/}
{/*<Route name="invitations" path="/invitations" component={InvitationsPage}/>*/}
{/*<Route name="discover" path="/discover" component={DiscoverPage}/>*/}
{/*<Route name="recommendations" path="/recommendations/:threadId" component={RecommendationPage}/>*/}
{/*<Route name="social-networks-on-sign-up" path="/social-networks-on-sign-up" component={ConnectSocialNetworksOnSignUpPage}/>*/}
{/*<Route name="social-networks" path="/social-networks" component={ConnectSocialNetworksPage}/>*/}
{/*<Route name="edit-thread" path="/edit-thread/:threadId" component={EditThreadLitePage}/>*/}
{/*<Route name="groups" path="/badges" component={GroupPage}/>*/}
{/*<Route name="group-discover" path="/badges/:groupId/discover" component={DiscoverPage}/>*/}
{/*<Route name="group-stats" path="/badges/:groupId" component={GroupStatsPage}/>
<Route name="group-members" path="/badges/:groupId/members" component={GroupMembersPage}/>
<Route name="group-contents" path="/badges/:groupId/contents" component={GroupContentsPage}/>*/}
{/*<Route name="settings" path="/settings" component={SettingsPage}/>*/}
</Route>
</Route>
</Router>
);
}
}
|
src/page/Contacts.js | munyrasirio/mss-chat | import React, { Component } from 'react';
import { StyleSheet, Text, View, Image, TouchableOpacity, FlatList } from 'react-native';
import { Menu, Name, MenuItem, Contact } from '../component';
import logo from '../img/icon.png';
import avatar2 from '../img/avatar2.jpg';
import avatar1 from '../img/avatar1.jpg';
export default class Contacts extends Component {
/*proximo() {
this.props.navigation.navigate('chat', {contact: 'Thiago'})
}*/
config() {
this.props.navigation.navigate('config')
}
contact(item) {
this.props.navigation.navigate('chat', item)
}
render() {
let data = []
for (var i = 0; i < 10; i++) {
data.push({name: 'Guy', source: avatar2, chat: []});
data.push({name: 'Girl', source: avatar1, chat: []});
}
return (
<View style={styles.page}>
<Menu>
<View style={styles.logo}>
<Image style={styles.img} source={logo}/>
</View>
<Name name='MSS Chat'/>
<MenuItem name='magnifying-glass' onPress={() => {}}/>
<MenuItem name='cog' onPress={this.config.bind(this)}/>
</Menu>
<View style={styles.contactList}>
<FlatList
data={data}
renderItem={({item, index}) => {
return <Contact
key={index}
source={item.source}
name={item.name}
date='23:00'
lastMessage='Lorem ipsum dolor sit amet.'
onPress={() => {this.contact(item)}}
/>
}}
/>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
page: {
flex: 1
},
contactList: {
flex: 1,
backgroundColor: 'white',
flexDirection: 'column'
},
//LOGO//
logo: {
width: 60,
alignItems: 'center',
justifyContent: 'center',
padding: 2
},
img: {
flex: 1,
resizeMode: 'contain',
borderRadius: 150
}
}); |
react-router/components/Routes.js | JonnyCheng/flux-examples | import React from 'react';
import { DefaultRoute, Route } from 'react-router';
import Application from './Application';
import Home from './Home';
import About from './About';
const routes = (
<Route name="app" path="/" handler={Application}>
<Route name="about" handler={About}/>
<DefaultRoute name="home" handler={Home}/>
</Route>
);
export default routes;
|
src/Parser/DeathKnight/Blood/Modules/Features/WastedDeathAndDecay.js | enragednuke/WoWAnalyzer | import React from 'react';
import Analyzer from 'Parser/Core/Analyzer';
import SPELLS from 'common/SPELLS';
import SpellIcon from 'common/SpellIcon';
import AbilityTracker from 'Parser/Core/Modules/AbilityTracker';
import StatisticBox, { STATISTIC_ORDER } from 'Main/StatisticBox';
import Combatants from 'Parser/Core/Modules/Combatants';
class WastedDeathAndDecay extends Analyzer {
static dependencies = {
abilityTracker: AbilityTracker,
combatants: Combatants,
};
CrimsonScourgeProcsCounter = 0;
FreeDeathAndDecayCounter = 0;
DeathAndDecayCounter = 0;
WastedDeathAndDecays = 0;
on_byPlayer_cast(event) {
const spellId = event.ability.guid;
if (spellId !== SPELLS.DEATH_AND_DECAY.id) {
return;
}
if (this.combatants.selected.hasBuff(SPELLS.CRIMSON_SCOURGE.id, event.timestamp)) {
this.FreeDeathAndDecayCounter += 1;
} else {
this.DeathAndDecayCounter += 1;
}
}
on_byPlayer_applybuff(event) {
const spellId = event.ability.guid;
if (spellId === SPELLS.CRIMSON_SCOURGE.id) {
this.CrimsonScourgeProcsCounter += 1;
}
}
statistic() {
this.WastedDeathAndDecays = this.CrimsonScourgeProcsCounter - this.FreeDeathAndDecayCounter;
return (
<StatisticBox
icon={<SpellIcon id={SPELLS.CRIMSON_SCOURGE.id} />}
value={this.WastedDeathAndDecays}
label="Wasted Death and Decays"
tooltip="You let a Crimson Scourge proc expire without casting Death and Decay."
/>
);
}
statisticOrder = STATISTIC_ORDER.CORE(5);
}
export default WastedDeathAndDecay;
|
src/cms/preview-templates/post-preview.js | bapti/blog | // @flow strict
import React from 'react';
import type { Entry, WidgetFor } from '../../types';
type Props = {
entry: Entry,
widgetFor: WidgetFor
};
const PostPreview = ({ entry, widgetFor }: Props) => {
const body = widgetFor('body');
const title = entry.getIn(['data', 'title']);
return (
<div className="post">
<h1 className="post__title">{title}</h1>
<div className="post__body">{body}</div>
</div>
);
};
export default PostPreview;
|
src/parser/priest/shadow/modules/spells/Dispersion.js | sMteX/WoWAnalyzer | import React from 'react';
import SPELLS from 'common/SPELLS';
import Analyzer from 'parser/core/Analyzer';
import SpellLink from 'common/SpellLink';
import { formatPercentage } from 'common/format';
import calculateMaxCasts from 'parser/core/calculateMaxCasts';
import Voidform from './Voidform';
const DISPERSION_BASE_CD = 90;
const DISPERSION_UPTIME_MS = 6000;
class Disperion extends Analyzer {
static dependencies = {
voidform: Voidform,
};
_dispersions = {};
_previousDispersionCast = null;
get dispersions() {
return Object.keys(this._dispersions).map(key => this._dispersions[key]);
}
startDispersion(event) {
this._dispersions[event.timestamp] = {
start: event.timestamp,
};
this._previousDispersionCast = event;
}
endDispersion(event) {
this._dispersions[this._previousDispersionCast.timestamp] = {
...this._dispersions[this._previousDispersionCast.timestamp],
end: event.timestamp,
};
if(this.voidform.inVoidform){
this.voidform.addVoidformEvent(SPELLS.DISPERSION.id, {
start: this.voidform.normalizeTimestamp({timestamp: this._previousDispersionCast.timestamp}),
end: this.voidform.normalizeTimestamp(event),
});
}
this._previousDispersionCast = null;
}
on_byPlayer_applybuff(event) {
const spellId = event.ability.guid;
if (spellId === SPELLS.DISPERSION.id) this.startDispersion(event);
}
on_byPlayer_removebuff(event) {
const spellId = event.ability.guid;
if (spellId === SPELLS.DISPERSION.id) this.endDispersion(event);
}
suggestions(when) {
const dispersionUptime = this.selectedCombatant.getBuffUptime(SPELLS.DISPERSION.id);
const maxDispersiontime = Math.floor(calculateMaxCasts(DISPERSION_BASE_CD, this.owner.fightDuration)) * DISPERSION_UPTIME_MS;
const dispersedTime = dispersionUptime / this.maxUptime;
when(dispersedTime).isGreaterThan(0.20)
.addSuggestion((suggest, actual, recommended) => {
return suggest(<span>You spent {Math.round(dispersionUptime / 1000)} seconds (out of a possible {Math.round(maxDispersiontime / 1000)} seconds) in <SpellLink id={SPELLS.DISPERSION.id} />. Consider using <SpellLink id={SPELLS.DISPERSION.id} /> less or cancel it early.</span>)
.icon(SPELLS.DISPERSION.icon)
.actual(`${formatPercentage(actual)}% Dispersion uptime`)
.recommended(`<${formatPercentage(recommended)}% is recommended, unless the encounter requires it.`)
.regular(recommended + 0.05).major(recommended + 0.15);
});
}
}
export default Disperion;
|
step7-unittest/node_modules/react-router/es6/Lifecycle.js | jintoppy/react-training | 'use strict';
import warning from './routerWarning';
import React from 'react';
import invariant from 'invariant';
var object = React.PropTypes.object;
/**
* The Lifecycle mixin adds the routerWillLeave lifecycle method to a
* component that may be used to cancel a transition or prompt the user
* for confirmation.
*
* On standard transitions, routerWillLeave receives a single argument: the
* location we're transitioning to. To cancel the transition, return false.
* To prompt the user for confirmation, return a prompt message (string).
*
* During the beforeunload event (assuming you're using the useBeforeUnload
* history enhancer), routerWillLeave does not receive a location object
* because it isn't possible for us to know the location we're transitioning
* to. In this case routerWillLeave must return a prompt message to prevent
* the user from closing the window/tab.
*/
var Lifecycle = {
contextTypes: {
history: object.isRequired,
// Nested children receive the route as context, either
// set by the route component using the RouteContext mixin
// or by some other ancestor.
route: object
},
propTypes: {
// Route components receive the route object as a prop.
route: object
},
componentDidMount: function componentDidMount() {
process.env.NODE_ENV !== 'production' ? warning(false, 'the `Lifecycle` mixin is deprecated, please use `context.router.setRouteLeaveHook(route, hook)`. http://tiny.cc/router-lifecyclemixin') : undefined;
!this.routerWillLeave ? process.env.NODE_ENV !== 'production' ? invariant(false, 'The Lifecycle mixin requires you to define a routerWillLeave method') : invariant(false) : undefined;
var route = this.props.route || this.context.route;
!route ? process.env.NODE_ENV !== 'production' ? invariant(false, 'The Lifecycle mixin must be used on either a) a <Route component> or ' + 'b) a descendant of a <Route component> that uses the RouteContext mixin') : invariant(false) : undefined;
this._unlistenBeforeLeavingRoute = this.context.history.listenBeforeLeavingRoute(route, this.routerWillLeave);
},
componentWillUnmount: function componentWillUnmount() {
if (this._unlistenBeforeLeavingRoute) this._unlistenBeforeLeavingRoute();
}
};
export default Lifecycle; |
app/pages/resource/resource-header/ResourceHeader.js | fastmonkeys/respa-ui | import PropTypes from 'prop-types';
import React from 'react';
import Button from 'react-bootstrap/lib/Button';
import Grid from 'react-bootstrap/lib/Grid';
import { FormattedNumber } from 'react-intl';
import round from 'lodash/round';
import injectT from '../../../i18n/injectT';
import FavoriteButton from '../../../shared/favorite-button/FavoriteButtonContainer';
import { getPrice, getMaxPeriodText } from '../../../utils/resourceUtils';
import iconHome from '../../../assets/icons/home.svg';
import iconMapMarker from '../../../assets/icons/map-marker.svg';
import iconTicket from '../../../assets/icons/ticket.svg';
import iconUser from '../../../assets/icons/user-o.svg';
import iconClock from '../../../assets/icons/clock-o.svg';
import iconMap from '../../../assets/icons/map.svg';
function ResourceHeader({
onBackClick,
onMapClick,
isLoggedIn,
resource,
showBackButton,
showMap,
unit,
t,
}) {
const formatDistance = (distance) => {
if (!distance) {
return '';
}
const km = distance / 1000;
const formattedDistance = km < 10 ? round(km, 1) : round(km);
return (
<span>
<FormattedNumber value={formattedDistance} />
{' km'}
</span>
);
};
const peopleCapacityText = t('ResourceCard.peopleCapacity', { people: resource.peopleCapacity });
const maxPeriodText = getMaxPeriodText(t, resource);
const priceText = getPrice(t, resource);
const typeName = resource.type ? resource.type.name : '\u00A0';
const distance = formatDistance(resource.distance);
return (
<section className="app-ResourceHeader">
<Grid>
<div className="app-ResourceHeader__content">
{showBackButton && (
<Button
bsStyle="link"
className="app-ResourceHeader__back-button"
onClick={onBackClick}
>
{t('ResourceHeader.backButton')}
</Button>
)}
<h1>{resource.name}</h1>
<div className="app-ResourceHeader__info-wrapper">
<div className="app-ResourceHeader__info">
<img alt={t('ResourceHeader.purpose')} className="app-ResourceHeader__info-icon" src={iconHome} />
<span className="app-ResourceHeader__info-label">{typeName}</span>
</div>
<div className="app-ResourceHeader__info">
<img
alt={t('ResourceHeader.capacity')}
className="app-ResourceHeader__info-icon"
src={iconUser}
/>
<span className="app-ResourceHeader__info-label">{peopleCapacityText}</span>
</div>
<div className="app-ResourceHeader__info">
<img alt={t('ResourceHeader.maxTime')} className="app-ResourceHeader__info-icon" src={iconClock} />
<span className="app-ResourceHeader__info-label">{maxPeriodText}</span>
</div>
<div className="app-ResourceHeader__info">
<img alt={t('ResourceHeader.price')} className="app-ResourceHeader__info-icon" src={iconTicket} />
<span className="app-ResourceHeader__info-label">{priceText}</span>
</div>
<div className="app-ResourceHeader__info" id="app-ResourceHeader__info--unit-name">
<img
alt={distance ? t('ResourceHeader.distanceAndPremise') : t('ResourceHeader.premise')}
className="app-ResourceHeader__info-icon"
src={iconMapMarker}
/>
<span className="app-ResourceHeader__info-label">
{distance}
{distance && ', '}
{unit.name}
</span>
</div>
<br />
<div className="app-ResourceHeader__buttons">
{!showMap && (
<Button className="app-ResourceHeader__map-button" onClick={onMapClick}>
<img alt="" src={iconMap} />
<span>{t('ResourceHeader.mapButton')}</span>
</Button>
)}
{showMap && (
<Button className="app-ResourceHeader__map-button" onClick={onMapClick}>
<img alt="" src={iconMap} />
<span>{t('ResourceHeader.resourceButton')}</span>
</Button>
)}
{isLoggedIn && <FavoriteButton resource={resource} />}
</div>
</div>
</div>
</Grid>
</section>
);
}
ResourceHeader.propTypes = {
isLoggedIn: PropTypes.bool.isRequired,
onBackClick: PropTypes.func.isRequired,
onMapClick: PropTypes.func.isRequired,
resource: PropTypes.object.isRequired,
showBackButton: PropTypes.bool.isRequired,
showMap: PropTypes.bool.isRequired,
t: PropTypes.func.isRequired,
unit: PropTypes.object.isRequired,
};
ResourceHeader = injectT(ResourceHeader); // eslint-disable-line
export default ResourceHeader;
|
src/components/articles.js | mazairaj/thejulianmaz | import React from 'react';
const Articles = function () {
return (
<div style={{ backgroundColor: 'orange', flex: 1 }}>
<h1>My Articles</h1>
</div>
);
};
export default Articles;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.