code stringlengths 26 5k | intent stringlengths 3 2.56k |
|---|---|
import React, { Component } from 'react';
import {StatusBar ,View,StyleSheet,Text,TouchableHighlight,Image} from 'react-native';
/*
*iconSrcLeft 左侧图标路径 参考iconSrcLeft = require('路径') 传参
*iconOnPressLeft 左侧图标按下响应函数
*iconSrcRight 右侧图标路径 参考iconSrcLeft = require('路径') 传参
*iconOnPressRight 右侧图标按下响应函数
*titleColor 标题演示
*t... | Header class. |
import React from 'react'
// EVENTS
export class Increment {
constructor(step) {
this.step = step
}
update(model) {
return { model: model + this.step }
}
}
// APP
export default {
init() {
return { model: 0 }
},
update(model, event) {
return event.update(model)
},
view(model) {
... | Component that exports a sequence of increments. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionOpenInBrowser = (props) => (
<SvgIcon {...props}>
<path d="M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h4v-2H5V8h14v10h-4v2h4c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm-7 6l-4 4h3v6h2v-6h3l-4-4z"/>
</SvgIcon>
);
... | ActionOpenInBrowser - A function to open a node in the browser. |
import React from 'react';
import {Link} from 'react-router';
import {getTopicList} from '../lib/client';
export default class TopicList extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
componentDidMount() {
getTopicList({})
.then(ret => this.setState({list: ret... | The TopicList component which is a list of topics. |
// @flow
import React from 'react';
import DialogPortal from './DialogPortal';
type Props = {
/**
* The component(s) to be displayed within the drawer portal.
*/
children: React$Node,
/**
* Class name used to add custom styles to the portal.
*/
className?: string
};
/**
* Compo... | The JitsiPortal component that is used to display a component in the drawer portal. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageHdrOff = (props) => (
<SvgIcon {...props}>
<path d="M17.5 15v-2h1.1l.9 2H21l-.9-2.1c.5-.2.9-.8.9-1.4v-1c0-.8-.7-1.5-1.5-1.5H16v4.9l1.1 1.1h.4zm0-4.5h2v1h-2v-1zm-4.5 0v.4l1.5 1.5v-1.9c0-.8-.7-1.5-1.5-1.5h-1... | A component that renders a series of icons that can be used to show a series of icons. |
import React from 'react';
class App extends React.Component {
constructor(){
super();
this.state = {
input: '/* add your jsx here */',
output: '',
err: ''
}
this.update = this.update.bind(this);
}
update(e){
let code = e.target.value;
try{
this.setState({
output: babel.transform(code,... | The base class for the missing - jsx app. |
// @flow
import React from 'react';
class Foo extends React.Component<{}, void> {}
class Bar extends React.Component<{}, void> {}
<Foo />; // OK
<Foo ref="foo" />; // OK
<Foo ref={null} />; // OK
<Foo ref={undefined} />; // OK
<Foo ref={(foo: number) => {}} />; // Error: `Foo` is not a `number`.
<Foo ref={foo => (fo... | Throws if a component is missing a sequence of children. |
import React from 'react';
var { object, string, func } = React.PropTypes;
function isLeftClickEvent(event) {
return event.button === 0;
}
function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
}
/**
* <Link> components are used to create an <a> element t... | Creates a link component that links to a route. |
import React from 'react';
import Anchor from 'grommet/components/Anchor';
import Box from 'grommet/components/Box';
import Button from 'grommet/components/Button';
import Heading from 'grommet/components/Heading';
import Paragraph from 'grommet/components/Paragraph';
import MapIcon from 'grommet/components/icons/base/... | Imports a single node of a sequence of nodes with a single header and a footer. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let SocialPartyMode = (props) => (
<SvgIcon {...props}>
<path d="M20 4h-3.17L15 2H9L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 3c1.63 0 3.06.79 3.98 2H12c-1.66 0-3 1.34-3 3 0 .... | A component that renders a Navitia - style tag |
import React from 'react';
import PropTypes from 'prop-types';
import { Player } from '@meedan/check-ui';
import AspectRatio from '../layout/AspectRatio';
const MediaPlayerCard = props => (
<article className="video-media-card" style={{ position: 'relative' }}>
<AspectRatio
key={props.contentWarning}
... | The video - media - card component that displays a single chunk of video. |
import React from 'react'
import {findDOMNode} from 'react-dom'
import Dropzone from 'dropzone'
Dropzone.autoDiscover = false;
export default class DropzoneInput extends React.Component {
componentDidMount() {
let element = $(findDOMNode(this));
let options = this.props.options || {};
element.dropzone(o... | The DropzoneInput class is used to provide a dropzone for a component. |
import React from 'react';
import PropTypes from 'prop-types';
import Toggle from 'react-toggle';
import { Link } from 'react-router-dom';
import { Trans, t } from '@lingui/macro';
import { i18n } from 'interface/RootLocalizationProvider';
import makeAnalyzerUrl from 'interface/common/makeAnalyzerUrl';
import FightSe... | A component that displays a single single - field fight in a panel. |
import React from 'react'
export default class Wizard extends React.Component {
componentDidMount() {
let self = this;
let element = $(this.refs.wizard);
var stepsCount = $('[data-smart-wizard-tab]').length;
var currentStep = 1;
var validSteps = [];
var $form = element.closest('form');
... | A component that displays a smart wizard. |
import React from 'react';
import {
View,
Image,
ListView,
TouchableOpacity,
} from 'react-native';
import friendsListStyles from '../../styles/create/friendsListStyles';
import TextOpenSans from '../utils/TextOpenSans';
const FriendsListView = (props) => {
const listContainerStyle = props.friends.getRow... | export default FriendsListView |
import React from 'react'
import FilterLink from '../containers/FilterLink'
const Footer = () => (
<p>
Show:
{" "}
<FilterLink filter="SHOW_ALL">
All
</FilterLink>
{", "}
<FilterLink filter="SHOW_ACTIVE">
Active
</FilterLink>
{", "}
<FilterLink filter="SHOW_COMPLETED">... | export Footer |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let HardwareGamepad = (props) => (
<SvgIcon {...props}>
<path d="M15 7.5V2H9v5.5l3 3 3-3zM7.5 9H2v6h5.5l3-3-3-3zM9 16.5V22h6v-5.5l-3-3-3 3zM16.5 9l-3 3 3 3H22V9h-5.5z"/>
</SvgIcon>
);
HardwareGamepad = pure(Hardw... | Hardware Gamepad. |
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import UploadProgressContainer from '../containers/upload_progress_container';
import ImmutablePureComponent from 'react-immutable-pure-component';
import UploadContainer from '../containers/upload_container';
export default class U... | The base class for the upload form. |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { inject, observer } from 'mobx-react';
import Signup from '../../components/auth/Signup';
import UserStore from '../../stores/UserStore';
import FeaturesStore from '../../stores/FeaturesStore';
import { globalError as globalErrorPro... | The signup screen component is a component that can be used to sign up a user. |
import React from 'react';
import PropTypes from 'prop-types';
import serialize from 'serialize-javascript';
import Helmet from 'react-helmet';
import config from 'config';
/**
* Wrapper component containing HTML metadata and boilerplate tags.
* Used in server-side code only to wrap the string output of the
* rende... | The main component of the Helmet component. |
/* eslint quote-props: ["error", "as-needed"] */
import React from 'react';
import { css, StyleSheet } from 'aphrodite/no-important';
import Button from '../Button';
function DropdownButton ({ children, ...props }) {
return (
<Button {...props}>
{children}
<span className={css(classes.arrow)} />
</Button>
... | The DropdownButton class is a class that can be used to display a dropdown button with a single child. |
import React from 'react'
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
const FormFieldVariationsExamples = () => (
<ExampleSection title='Field Variations'>
<ComponentExample
title='Inline'
... | The FormFieldVariationsExamples module provides a function to generate a form field from a sequence of sequence of strings. |
import React from 'react'
import { Dropdown, Header, Icon } from 'shengnian-ui-react'
const options = [
{
key: 'today',
text: 'today',
value: 'today',
content: 'Today',
},
{
key: 'this week',
text: 'this week',
value: 'this week',
content: 'This Week',
},
{
key: 'this mont... | Example of how to show a dropdown for a single |
import React from 'react';
import styles from './Footer.css';
export default class Footer extends React.Component {
render() {
return (
<footer className={styles.footer}>
<p>2015 © Hal Henke</p>
</footer>
);
}
}
| Footer class for Hal Henke |
import React from 'react';
import Collapsible from '../src/Collapsible';
import CollapsibleItem from '../src/CollapsibleItem';
export default
<Collapsible accordion defaultActiveKey={1}>
<CollapsibleItem header='First' icon='filter_drama' eventKey={1}>
Lorem ipsum dolor sit amet.
</CollapsibleItem>
<Collapsi... | export default |
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import KillopComponent from '../src/components/killop';
import ConnectedKillopComponent from '../src/components/';
storiesOf('KillopComponent', module)
.add('connected to store', () => <ConnectedKillopComponent />)
.add('enabled', () => <Kil... | Imports a Killop component. |
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
View,
Button
} from 'react-native';
import Camera from 'react-native-camera-android-simple';
const Type = {
FRONT: 'front',
BACK: 'back'
};
const styles = StyleSheet.create({
container: {
flex: 1
},
preview: {
flex:... | Component that is rendered on a view with a single type - of - unknown state. |
import React from 'react';
import jQuery from 'jquery';
class ProjectInput extends React.Component {
constructor() {
super();
}
onSubmitForm(event) {
event.preventDefault();
let component = this;
let title = this.refs.newProjectTitle.value;
let description = this.refs.newProjectDescription.... | Example of how to add a new node - input to a project. |
/**
* React App SDK (https://github.com/kriasoft/react-app)
*
* Copyright © 2015-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react';
import Layout from '../../c... | A component that can be rendered in a page in the browser. |
/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */
import React, { Component } from 'react';
import styles from './Header.css';
import withStyles from '../../decorators/withStyles';
import Link from '../Link';
import Navigation from '../Navigation';
@withStyles(styles)
class Header extends Compo... | Demonstrates how to render a single missing - node header. |
import React from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { browserHistory } from 'react-router';
import * as actionCreators from '../actions/auth';
function mapStateToProps(state) {
return {
token: state.auth.token,
userName: state.auth.us... | A component that requires a user to login via a token. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImagePhotoSizeSelectActual = (props) => (
<SvgIcon {...props}>
<path d="M21 3H3C2 3 1 4 1 5v14c0 1.1.9 2 2 2h18c1 0 2-1 2-2V5c0-1-1-2-2-2zM5 17l3.5-4.5 2.5 3.01L14.5 11l4.5 6H5z"/>
</SvgIcon>
);
ImagePhotoSiz... | A component that renders a series of icons that can be selected by a user. |
import React from 'react';
import serialize from 'form-serialize';
import {Form, FormGroup, Input, Label, Button, Row, Col} from 'reactstrap';
import MemberSelect from 'components/Form/Select/MemberSelect';
import SubscriptionStatusSelect from 'components/Form/Select/SubscriptionStatusSelect';
import PackageSelect fro... | A component that exports a single nix sequence of non - hidden |
'use strict'
import React, { Component } from 'react';
import {
Text,StyleSheet,View
} from 'react-native';
class Test extends React.Component {
render(){
return(
<View style={styles.content}>
<Text> Hello Test !</Text>
</View>
);
}
}
const styles = StyleSheet.create({
content:{
... | A component that can be rendered by a component in a view. |
import PropTypes from 'prop-types';
import React from 'react';
import { FormattedMessage, injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { push } from 'react-router-redux';
import { Grid, Row, Col } from 'react-flexbox-grid/lib';
import { pagedAndSortedLocation } from '../../util/location... | The base component for the missing link - ids |
import _ from 'lodash'
import React from 'react'
import { Label } from 'semantic-ui-react'
const sizes = ['mini', 'tiny', 'small', 'medium', 'large', 'big', 'huge', 'massive']
const LabelExampleSize = () => (
<div>
{sizes.map(size => (
<Label key={size} size={size}>
{_.capitalize(size)}
</La... | Generate a label example for a sequence of unique keys. |
import React from 'react';
import _ from 'lodash';
import { Tooltip, OverlayTrigger } from 'react-bootstrap';
export default function(props){
const id = _.uniqueId('tooltip_');
const tooltip = <Tooltip id={id}>{ props.text }</Tooltip>;
return (
<OverlayTrigger trigger={ props.trigger || ['hover', 'focus'] } ... | export default component |
// @flow
import React from 'react';
import ReadFileDialog from './ReadFileDialog';
export default function NavBar(props: {
resetBoard: (void) => void,
readFile: (string) => void
}): React.Element<*> {
return (
<div id="navBar" >
<button type="reset" onClick={props.resetBoard}>New Game</button>
<... | Navigation bar for FEN and README dialog |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageLooks = (props) => (
<SvgIcon {...props}>
<path d="M12 10c-3.86 0-7 3.14-7 7h2c0-2.76 2.24-5 5-5s5 2.24 5 5h2c0-3.86-3.14-7-7-7zm0-4C5.93 6 1 10.93 1 17h2c0-4.96 4.04-9 9-9s9 4.04 9 9h2c0-6.07-4.93-11-11-1... | A component that exports a series of images in a sequence of icons. |
import React from 'react';
import Line from './index';
export default () => (
<div style={{ padding: '20px' }}>
<Line animate />
<Line animate layer="success" />
<Line animate layer="alert" />
</div>
);
| A default function to export a object. |
import React from 'react';
import BaseComponent from 'lex/libs/base/component';
import Spinner from 'react-spinner-material';
export default class MaterialSpinner extends BaseComponent {
render() {
this.decorateStyle();
const { show } = this.props;
return (
<Spinner
size={200}
spi... | A component that spins a MaterialSpinner with a custom Spinner. |
import React, { Component } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import Tooltip from 'rc-tooltip';
import * as showActions from 'actions/show';
import Spinner from 'components/Spinner';
import './styles';
@connect(
state => ({
auth: state.auth,
... | A component that watches a user s users. |
import React from 'react';
class EstadoTarea extends React.Component {
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
}
handleChange(e) {
this.props.estadoChange(this.props.indice,e.target.name,e.target.value);
}
render(){
return (
<sel... | The EstadoTarea component is a component that can be rendered in a form that has a value of Estado. |
import React from 'react';
import { PaginationBuilder } from 'cf-builder-pagination';
function getStartAndEnd(page, pageSize) {
const start = (page - 1) * pageSize;
const end = start + pageSize - 1;
return [start, end];
}
function hasAllItems(items, start, end) {
for (let i = start; i <= end; i++) {
if (!... | The base class for pagination - related components. |
/* eslint react/prop-types: 0 */
import React from 'react';
import ReactDOM from 'react-dom';
import Select from 'react-select';
import Contributors from './components/Contributors';
import CustomKeysField from './components/CustomKeysField';
import CustomRenderField from './components/CustomRenderField';
import Disa... | The main entry point for the missing module. |
import React from 'react'
import lo from 'lodash'
import sa from 'superagent';
var Elem = function({table}){
var renderHead = (fields) => {
var fieldDoms = lo.map(fields, k=> (
<th>{k}</th>
));
return <thead>
<tr>
{fieldDoms}
</tr>
... | Generate Eliminary HTML for a single . |
import React, { Component } from 'react';
import PostMeta from '../../components/post/meta';
import { renderHtml } from '../../utils/render';
export default class ContentPost extends Component {
render () {
const { content } = this.props;
console.log('content.data.data', content.data.data)
return (
... | The content post component |
import React, { Component } from 'react';
import {
AppRegistry,
Button,
Text
} from 'react-native';
import { Col, Grid } from "react-native-easy-grid";
/**
* A single target for displaying its progress in the darts game. Shows a button that can hit next
* to its progress.
*/
export default class TargetProgr... | A component that displays a progress bar when a single target is hit. |
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
StyleSheet,
Navigator
} from 'react-native';
import {Router, routerReducer, Route, Container, Animations, Schema} from 'react-native-redux-router';
import { createStore, comb... | Micro - browser app |
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'));
| Renders the main component into the main DOM. |
import React from 'react'
import ReactDOM from 'react-dom'
import createStore from './store/createStore'
import AppContainer from './containers/AppContainer'
// ========================================================
// Store Instantiation
// ========================================================
const initialState... | Initialize a single node in the DOM |
import React from 'react'
import ACTIONS from '../actions.js'
import STORE from '../store.js'
import NavBar from './components/navBar'
import Header from './components/header'
var ReclaimPage = React.createClass({
render: function(){
return(
<div className = 'reclaim-page-wrapper'>
<Header />
<NavBar /... | Imports the missing components |
import React from 'react';
import RenameForm from './RenameForm';
import PropTypes from 'prop-types';
const File = ({
file,
dblClickHandler,
selectedItem,
id,
clickHandler,
renameFlag,
renameHandler
}) => {
return (
<li
className={selectedItem.id === id ? 'list-item selected' : 'list-... | A file that displays a single missing relation. |
import React from 'react';
export default class TopBar extends React.Component {
render() {
return !this.props.loggedIn ? null :
<header style={styles.header}>
<nav style={styles.nav}>
{this.iconLink('/mushishi78/content-editor/docs', icons.docs)}
{this.iconLink('https://github.... | TopBar is a base class for all top - level components that are rendered in a tree. |
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { secondary, secondaryDark, blackLight, blackLessLight, black, white } from '../styles/color';
const Button = styled.button`
padding: 16px;
font-size: 16px;
color: ${black};
background-color: ${blackLi... | export default component |
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
if(process.env.WEBPACK) require('./Buttress.css');
const Buttress = (props) => {
const {
children,
className,
size,
blend,
image,
style,
alt,
...other
} = props;
const renderImg... | The Buttress component that renders a series of nodes with a series of children. |
import React from 'react';
import Icon from 'mastodon/components/icon';
import Button from 'mastodon/components/button';
import IconButton from 'mastodon/components/icon_button';
import { requestBrowserPermission } from 'mastodon/actions/notifications';
import { changeSetting } from 'mastodon/actions/settings';
import ... | The default NotificationsPermissionBanner component |
import React from 'react'
import Link from 'next/link'
export default () => (
<ul>
<li>
<Link href='/b' as='/a'>
<a>a</a>
</Link>
</li>
<li>
<Link href='/a' as='/b'>
<a>b</a>
</Link>
</li>
</ul>
)
| default export function |
import React, { Component } from 'react';
import RaisedButton from 'material-ui/RaisedButton';
import PropTypes from 'prop-types';
import TextField from 'material-ui/TextField';
import Paper from 'material-ui/Paper';
import * as Actions from '../../actions/';
import UserPreferencesStore from '../../stores/UserPreferenc... | A component that can be used to enter a server URL on a WebSocket connection. |
// external imports
import React from 'react'
// --- ChildrenUtils ------------------------------------------------
const ChildrenUtils = {
forEach: React.Children.forEach,
toArray: React.Children.toArray,
count: React.Children.count
}
// --- exports ------------------------------------------------------
expo... | External implementation of count . |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let MapsLocalCarWash = (props) => (
<SvgIcon {...props}>
<path d="M17 5c.83 0 1.5-.67 1.5-1.5 0-1-1.5-2.7-1.5-2.7s-1.5 1.7-1.5 2.7c0 .83.67 1.5 1.5 1.5zm-5 0c.83 0 1.5-.67 1.5-1.5 0-1-1.5-2.7-1.5-2.7s-1.5 1.7-1.5 2... | A component that renders a missing - |
/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import { settings } from 'carbon-componen... | The base class for all of the JSX functions that create the n - node control |
import React from 'react';
import PropTypes from 'prop-types';
import styled, { css } from 'styled-components';
import R from 'ramda';
import isString from '../utils/isString';
const getBaseComponent = R.ifElse(isString, R.always('p'), R.always('div'));
const Component = ({ children, ...otherProps }) =>
React.creat... | A component that can be rendered by a component that has no children. |
import React from 'react';
import ReactDOM from 'react-dom';
import Docs from "./docs/Docs";
import './index.css';
import '../node_modules/highlight.js/styles/ocean.css';
ReactDOM.render(<Docs />, document.getElementById('root'));
| Imports a single React component. |
import React from 'react';
import Title from 'react-title-component';
import CodeExample from '../../../CodeExample';
import PropTypeDescription from '../../../PropTypeDescription';
import MarkdownElement from '../../../MarkdownElement';
import iconMenuReadmeText from './README';
import IconMenuExampleSimple from './... | The default implementation of the icons menu. |
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 ... | A component that renders a list of media items. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let NotificationWifi = (props) => (
<SvgIcon {...props}>
<path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3c-1.65-1.66-4.34-1.66-6 0zm-4-4l2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9... | A component that exports a single component with a single notification wifi. |
import Field from '../Field';
import React from 'react';
import { FormInput } from 'elemental';
/**
* TODO:
* - Remove dependency on jQuery
*/
// Scope jQuery and the bootstrap-markdown editor so it will mount
var $ = require('jquery');
require('./lib/bootstrap-markdown');
// Append/remove ### surround the select... | The actual component that is rendered in the component s input field. |
import React from 'react';
import Box from 'components/box';
import Layout from 'components/layout';
const NotFound = () => (
<Layout>
<Box>Not found.</Box>
</Layout>
);
export default NotFound;
| Imports a from React and returns a NotFound error. |
import React from 'react'
export default () => (
<>
<h3 className="section-header">Site Info</h3>
<p>Click <a className="fancy-link" href="https://github.com/mattschwartz/www">here</a> to see the source code</p>
<p>Powered by React and served fresh by AWS</p>
<p>Written by Matt Sch... | A function that returns a function that returns a warning if a component is not available in the system. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageCrop = (props) => (
<SvgIcon {...props}>
<path d="M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"/>
</SvgIcon>
);
ImageCrop = pure(ImageCrop);
ImageCrop.displayNam... | A component that exports a series of icons that can be used to crop a series of images. |
import React from 'react'
import { Paper } from 'material-ui'
import classNames from 'classnames'
export default class FloatPaper extends React.Component {
render() {
return (
<Paper
className={classNames('float-paper', this.props.className)}
circle={this.props.circle}
style={{boxSh... | The FloatPaper component which is rendered when a node is missing a node. |
import React, { Component } from 'react';
require('../css/ProfileIntro.scss');
/**
* Header component in index page.
*/
const Introduction = () => (
<section className="profile-intro">
<h3>关于我</h3>
<p>大家好,我叫杨雯杰。本科毕业与成都信息工程大学,现就读于电子科技大学计算机科学与工程学院。</p>
<p>我觉得前端是一门多性质的工作,从本科开始就对前端有很大的兴趣。但是很... | ProfileIntro. js |
import React from 'react';
class ServerFetchProvider extends React.Component {
static childContextTypes = {
serverFetchPromises: React.PropTypes.array,
};
getChildContext() {
return {
serverFetchPromises: this.props.promises,
};
}
props: {
// github.com/facebook/flow/issues/1964
chi... | The default ServerFetchProvider class. |
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<g><path d="M18 2h-8L4.02 8 4 20c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-5 15h-2v-2h2v2zm0-4h-2V8h2v5z" /></g>
, 'SimCardAlert');
| Create a series of icons for a single unknown element. |
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import TopNavBar from '../components/ui/TopNavBar';
import SocialBox from '../components/ui/SocialBox';
import translate from '../i18n/Translate';
import LoginActionCreators from '../actions/LoginActionCreators';
import LoginStore from '../st... | A login page that displays a user in the login screen. |
import React from 'react';
import { Link } from 'react-router';
const RouteFilterLink = ({ filter, children }) => (
<Link
to={filter === 'all' ? '' : filter}
activeStyle={{
textDecoration: 'none',
color: 'black',
}}
>
{children}
</Link>
);
export default RouteFilterLink;
| RouteFilterLink - a filter function for a sequence of children |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Box from '../box';
import Icon from '../icon';
import cx from 'classnames';
import theme from './theme.css';
import { IconLockSmallFilled } from '@teamleader/ui-icons';
import { UITextBody, UITextSmall } from '../typography';
class Ma... | A component that renders a marketing status label. |
import React, { Component } from 'react';
import MusicPlayer from './MusicPlayer/MusicPlayer';
export default class App extends Component {
constructor(props){
super(props);
this.state = {
"Albums":[
{
"artist": "Trinit... | Component class which extends the base class which contains all of the components that are not part of the app. |
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import Video from 'mastodon/features/video';
import ImmutablePureComponent from 'react-immutable-pure-component';
import Footer from 'mastodon/features/picture_in_picture/components/footer';
import... | A component that opens a video modal. |
import React, { Component } from 'react';
export default class App extends Component {
render() {
return (
<h1>Hello, world.</h1>
);
}
}
| The default component class for a component that can be rendered by a component. |
import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let EditorFormatAlignCenter = (props) => (
<SvgIcon {...props}>
<path d="M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"/>
</SvgIcon>
);
EditorFormatAlignCenter = pure(EditorFormatAli... | A component that exports a sequence of components in a sequence of icons. |
import React from 'react';
import PropTypes from 'prop-types';
import { render, Artboard, Text, View, StyleSheet } from 'react-sketchapp';
const API_ENDPOINT_URL =
'https://api.airtable.com/v0/appFs7J3WdgHYCDxD/Features?api_key=keyu4dudakWLI0vAh&&sort%5B0%5D%5Bfield%5D=Target+Launch+Date&sort%5B0%5D%5Bdirection%5D=a... | Provides a view to render a single single node of a . |
import React, { Component } from 'react';
import { reduxForm } from 'redux-form';
import * as actions from '../../actions';
class SignUp extends Component {
handleFormSubmit({ email, password }) {
this.props.signupUser(email, password);
}
renderErrorMessage(subject) {
return subject.touche... | A component that can be used to sign up a user. |
import React from 'react';
import {any, oneOf, string} from 'prop-types';
import omit from 'omit';
import classNames from 'classnames';
import WixComponent from '../../BaseComponents/WixComponent';
import tpaStyleInjector from '../TpaStyleInjector';
let styles = {locals: {}};
try {
styles = require('!css-loader?modu... | Button component that renders a button with a button children. |
import React from 'react';
import styles from './style';
const SubHeader = ({children}) => {
return <h2 className={styles.tagline}>
{children.split(' ').map((word,idx) => {
const arr = word.split('');
return (<span key={idx}><strong>{arr.shift()}</strong>{arr.join('')} </span>);
})}
</h2>;
};
... | Exports a subheader for a node |
import React, { Component } from 'react';
import './App.css';
import RouteMap from "./RouteMap";
class App extends Component {
render() {
return (
<div>
<RouteMap />
</div>
);
}
}
export default App;
| The base class for all App components. |
import React from 'react';
import { ErrorMessage } from 'formik';
const Error = props => (
<ErrorMessage component="div" className="form-error" {...props} />
);
export default Error;
| export Error class |
import React from 'react'
import PropTypes from 'prop-types'
import { BrowserRouter, Route } from 'react-router-dom'
import GeneSearch from './GeneSearch'
const GeneSearchRouter = ({atlasUrl, basename}) =>
<BrowserRouter basename={basename}>
<Route
path={`/search`}
render={
({match, location... | Imports a single from React. |
/**
* Function to get the shallow output for a given component
* As we are using phantom.js, we also need to include the fn.proto.bind shim!
*
* @see http://simonsmith.io/unit-testing-react-components-without-a-dom/
* @author somonsmith
*/
import React from 'react';
import TestUtils from 'react-addons-test-utils'... | Get the shallow rendered component |
import React from 'react';
import { useTranslation } from '../../helpers/translation';
import { dispatchApplication } from '../../store';
import SearchBar from '../../components/searchbar';
import ZoneList from '../../components/zonelist';
import InfoText from './infotext';
const documentSearchKeyUpHandler = (key, ... | export ZoneListPanel default function |
/**
* Created by liu_k on 2015/11/24.
*/
import React, { Component } from 'react';
import { Icon,Menu, Breadcrumb,Affix } from 'antd';
const SubMenu = Menu.SubMenu;
import App from './App';
import styles from "./page1.css";
//import astyles1 from "./css/test.scss";
class Page1 extends Component {
render() {... | Component that is a page that has a single key in a menu. |
import React from 'react';
import { Switch, Route, Redirect } from 'react-router-dom';
import { hasToken } from 'common/utils/auth';
import LandingPage from 'pages/LandingPage/Loadable';
import HomePage from 'pages/HomePage/Loadable';
import VocabLevelsPage from 'pages/VocabLevelsPage/Loadable';
import VocabLevelPage... | The default routes generator for all components. |
import React, { Component } from 'react';
// eslint-disable-next-line
import TabNavigationView from 'ringcentral-widgets/components/TabNavigationView';
import DialPadIcon from 'ringcentral-widgets/assets/images/DialPadNav.svg';
import CallsIcon from 'ringcentral-widgets/assets/images/Calls.svg';
import MessageIcon from... | The TabNavigationViewDemo class |
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
export default class ColumnHeader extends React.PureComponent {
static propTypes = {
icon: PropTypes.string,
type: PropTypes.string,
active: PropTypes.bool,
onClick: PropTypes.func,
columnHeaderId... | A component that renders a column header when a button is clicked on a column. |
import React from 'react';
import ReactDOM from 'react-dom';
import { browserHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';
import Root from './containers/Root/Root';
import configureStore from './store/configureStore';
import { authLoginUserSuccess } from './actions/auth';
... | Imports a single node in the DOM. |
import React, { Component } from 'react';
import './Card.css';
export default class Card extends Component {
constructor(props) {
super(props)
this.clickHandler = this.clickHandler.bind(this)
}
clickHandler() {
this.props.selectedCard(this.props)
}
render() {
return (
<div className... | A component that is rendered when a card is selected. |
/*
* Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/li... | This function is exported to the JSR - 89 module. It is exported to the JSR - 89 module. |
// @flow
import type { State, User } from '../../common/types';
import React from 'react';
import linksMessages from '../../common/app/linksMessages';
import { Box } from '../../common/components';
import { FormattedMessage } from 'react-intl';
import { Link } from '../components';
import { compose } from 'ramda';
impo... | A non - standard library that imports a bunch of modules into a single module. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.