commit
stringlengths 40
40
| old_file
stringlengths 4
150
| new_file
stringlengths 4
150
| old_contents
stringlengths 0
3.26k
| new_contents
stringlengths 1
4.43k
| subject
stringlengths 15
501
| message
stringlengths 15
4.06k
| lang
stringclasses 4
values | license
stringclasses 13
values | repos
stringlengths 5
91.5k
| diff
stringlengths 0
4.35k
|
---|---|---|---|---|---|---|---|---|---|---|
21bca52b7118cfa03ab6b64a091e7b41d404a70c | public/components/QueryArea.jsx | public/components/QueryArea.jsx | import React from 'react';
class QueryArea extends React.Component {
constructor(props){
super(props);
this.handleBeerClick = this.handleBeerClick.bind(this);
}
handleBeerClick(e) {
e.preventDefault();
const targetBeer = this.props.beerList[e.target.value];
this.props.handleIndividalBeerSearch(targetBeer);
}
render(){
return(
<div>
{
this.props.beerList && this.props.beerList.length > 1 ?
<div>
<h4>Did you mean...</h4>
<ul>
{this.props.beerList.map((item, index) => {
return <li value={index} key={index} onClick={this.handleBeerClick}>{item['name']}</li>
})}
</ul></div> : ''
}
</div>
)
}
}
export default QueryArea; | import React from 'react';
const QueryArea = (props) => {
const handleBeerClick = (e) => {
e.preventDefault();
const targetBeer = props.beerList[e.target.value];
props.handleIndividalBeerSearch(targetBeer);
}
return (
<div>
{
props.beerList && props.beerList.length > 1 ?
<div>
<h4>Did you mean...</h4>
<ul>
{props.beerList.map((item, index) => {
return <li value={index} key={index} onClick={handleBeerClick}>{item['name']}</li>
})}
</ul></div> : ''
}
</div>
)
}
export default QueryArea; | Refactor query area component to stateless component | Refactor query area component to stateless component
| JSX | mit | joeylaguna/tankard.io,joeylaguna/tankard.io | ---
+++
@@ -1,34 +1,26 @@
import React from 'react';
-class QueryArea extends React.Component {
- constructor(props){
- super(props);
- this.handleBeerClick = this.handleBeerClick.bind(this);
- }
-
- handleBeerClick(e) {
- e.preventDefault();
- const targetBeer = this.props.beerList[e.target.value];
- this.props.handleIndividalBeerSearch(targetBeer);
+const QueryArea = (props) => {
+ const handleBeerClick = (e) => {
+ e.preventDefault();
+ const targetBeer = props.beerList[e.target.value];
+ props.handleIndividalBeerSearch(targetBeer);
}
-
- render(){
- return(
- <div>
- {
- this.props.beerList && this.props.beerList.length > 1 ?
- <div>
- <h4>Did you mean...</h4>
- <ul>
- {this.props.beerList.map((item, index) => {
- return <li value={index} key={index} onClick={this.handleBeerClick}>{item['name']}</li>
- })}
- </ul></div> : ''
- }
- </div>
- )
- }
+
+ return (
+ <div>
+ {
+ props.beerList && props.beerList.length > 1 ?
+ <div>
+ <h4>Did you mean...</h4>
+ <ul>
+ {props.beerList.map((item, index) => {
+ return <li value={index} key={index} onClick={handleBeerClick}>{item['name']}</li>
+ })}
+ </ul></div> : ''
+ }
+ </div>
+ )
}
-
export default QueryArea; |
007f65f02c6f6ddc07b1fb9a97f398c3db5d8c1f | src/components/FilterSuggester/FilterSuggester.jsx | src/components/FilterSuggester/FilterSuggester.jsx | const React = require('react')
class FilterSuggester extends React.Component {
onChange(event) {
event.target.blur()
if (this.props.onChange) {
this.props.onChange(event)
}
}
render() {
const inputClass = this.props.className || ''
const value = this.props.value || ''
return (
<div>
<input
type="text"
className={inputClass}
name="filterValue"
value={value}
onChange={e => this.onChange(e)}
placeholder="e.g., team:org/team-name is:open sort:updated-desc"
/>
</div>
)
}
}
FilterSuggester.propTypes = {
className: React.PropTypes.string,
onChange: React.PropTypes.func,
value: React.PropTypes.string,
}
module.exports = FilterSuggester
| const React = require('react')
class FilterSuggester extends React.Component {
constructor(props) {
super(props)
this.state = { value: props.value || '' }
}
onChange(event) {
this.setState({ value: event.target.value })
if (this.props.onChange) {
this.props.onChange(event)
}
}
render() {
const inputClass = this.props.className || ''
return (
<div>
<input
type="text"
className={inputClass}
name="filterValue"
value={this.state.value}
onChange={e => this.onChange(e)}
placeholder="e.g., team:org/team-name is:open sort:updated-desc"
/>
</div>
)
}
}
FilterSuggester.propTypes = {
className: React.PropTypes.string,
onChange: React.PropTypes.func,
value: React.PropTypes.string,
}
module.exports = FilterSuggester
| Fix not being able to type in 'new filter' query field | Fix not being able to type in 'new filter' query field
| JSX | mit | cheshire137/gh-notifications-snoozer,cheshire137/gh-notifications-snoozer | ---
+++
@@ -1,8 +1,13 @@
const React = require('react')
class FilterSuggester extends React.Component {
+ constructor(props) {
+ super(props)
+ this.state = { value: props.value || '' }
+ }
+
onChange(event) {
- event.target.blur()
+ this.setState({ value: event.target.value })
if (this.props.onChange) {
this.props.onChange(event)
}
@@ -10,14 +15,13 @@
render() {
const inputClass = this.props.className || ''
- const value = this.props.value || ''
return (
<div>
<input
type="text"
className={inputClass}
name="filterValue"
- value={value}
+ value={this.state.value}
onChange={e => this.onChange(e)}
placeholder="e.g., team:org/team-name is:open sort:updated-desc"
/> |
172786be0182117fe2893dcf9bde25cf80e6dac0 | src/components/organisms/todo-list/todo-list.jsx | src/components/organisms/todo-list/todo-list.jsx | require('./todo-list.scss');
var React = require('react/addons');
var Card = require('../../molecules/card/card.jsx');
var TodoItem = require('../../molecules/todo-item/todo-item.jsx');
var TodoForm = require('../../molecules/todo-form/todo-form.jsx');
var TodoList = React.createClass({
propTypes: {
todos: React.PropTypes.object,
},
getDefaultProps: function() {
return {
todos: {}
};
},
render: function() {
var todos = Object.keys(this.props.todos).map(function(todo_id) {
var todo = this.props.todos[todo_id];
return (
<Card>
<TodoItem key={todo._id} todo={todo} />
</Card>
);
}.bind(this));
return (
<div className="todoList">
{todos}
<Card>
<TodoForm />
</Card>
</div>
);
}
});
module.exports = TodoList;
| require('./todo-list.scss');
var React = require('react/addons');
var Card = require('../../molecules/card/card.jsx');
var TodoItem = require('../../molecules/todo-item/todo-item.jsx');
var TodoForm = require('../../molecules/todo-form/todo-form.jsx');
var TodoList = React.createClass({
propTypes: {
todos: React.PropTypes.object,
},
getDefaultProps: function() {
return {
todos: {}
};
},
render: function() {
var todos = Object.keys(this.props.todos).map(function(todo_id) {
var todo = this.props.todos[todo_id];
return (
<Card key={todo._id}>
<TodoItem todo={todo} />
</Card>
);
}.bind(this));
return (
<div className="todoList">
{todos}
<Card>
<TodoForm />
</Card>
</div>
);
}
});
module.exports = TodoList;
| Add React unique keys to Cards | Add React unique keys to Cards
| JSX | mit | mattpetrie/React-Node-Project-Seed,haner199401/React-Node-Project-Seed,haner199401/React-Node-Project-Seed,mattpetrie/React-Node-Project-Seed | ---
+++
@@ -22,8 +22,8 @@
var todos = Object.keys(this.props.todos).map(function(todo_id) {
var todo = this.props.todos[todo_id];
return (
- <Card>
- <TodoItem key={todo._id} todo={todo} />
+ <Card key={todo._id}>
+ <TodoItem todo={todo} />
</Card>
);
}.bind(this)); |
4860b128c18a4a595efb6237cff4d6e5a83f9fb0 | src/components/ExtraInfo.jsx | src/components/ExtraInfo.jsx | // @flow
import React from 'react';
import get from 'lodash/get';
import { translateWithObject } from '../i18n/translate';
import type { PlaceInfoRelated } from '../model/PlaceInfo';
type Props = {
related: PlaceInfoRelated,
sourceId: string,
locale: string,
};
export default function ExtraInfo(props: Props) {
const key = `sources.${props.sourceId}.translations.additionalAccessibilityInformation`;
const translations = get(props.related, key);
if (translations) {
return (<header className="ac-result-extra-info">
{translateWithObject(translations, props.locale)}
</header>);
}
return null;
}
| // @flow
import React from 'react';
import get from 'lodash/get';
import { translateWithObject } from '../i18n/translate';
import type { PlaceInfoRelated } from '../model/PlaceInfo';
type Props = {
related: PlaceInfoRelated,
sourceId: string,
locale: string,
};
export default function ExtraInfo(props: Props) {
const key = `sources.${props.sourceId}.translations.additionalAccessibilityInformation`;
const translations = get(props.related, key);
if (translations) {
return (<header className="ac-result-extra-info" aria-hidden>
{translateWithObject(translations, props.locale)}
</header>);
}
return null;
}
| Hide repetitive extra info from screen readers | Hide repetitive extra info from screen readers
There is a trade-off here:
- The information might be lost for people using screen readers
- As it has kind of a small-print character, the widget is more usable if the info not repeated for every list item a screen reader user switches to.
| JSX | mit | sozialhelden/accessibility-cloud-js,sozialhelden/accessibility-cloud-js | ---
+++
@@ -16,7 +16,7 @@
const translations = get(props.related, key);
if (translations) {
- return (<header className="ac-result-extra-info">
+ return (<header className="ac-result-extra-info" aria-hidden>
{translateWithObject(translations, props.locale)}
</header>);
} |
63bfbf0c986cb07b710ac55980420b093d9bd7ee | src/components/home/home.jsx | src/components/home/home.jsx | import React from 'react';
var LogoVerticalWhite = require('../logo/logo');
var Geolocalizer = require('../geolocalizer/geolocalizer');
var Slider = require('../slider/slider');
var Home = React.createClass ({
render: function () {
return (
<main className="ktg-home">
<header className="ktg-home__header">
<h1 className="ktg-home__title">katanga</h1>
<LogoVerticalWhite />
</header>
<form id="ktg-form-metersAround">
<Slider meters="50"/>
<Geolocalizer />
</form>
</main>
);
}
});
module.exports = Home; | import React from 'react';
var LogoVerticalWhite = require('../logo/logo');
var Geolocalizer = require('../geolocalizer/geolocalizer');
var Slider = require('../slider/slider');
var Home = React.createClass ({
render: function () {
return (
<main className="ktg-home">
<header className="ktg-home__header">
<LogoVerticalWhite />
</header>
<form id="ktg-form-metersAround">
<Slider meters="50"/>
<Geolocalizer />
</form>
</main>
);
}
});
module.exports = Home; | Change markup in header removing h1 not needed | Change markup in header removing h1 not needed
| JSX | apache-2.0 | swcraftersclm/katangapp-frontend,swcraftersclm/katangapp-frontend,swcraftersclm/katangapp-frontend | ---
+++
@@ -9,8 +9,7 @@
return (
<main className="ktg-home">
<header className="ktg-home__header">
- <h1 className="ktg-home__title">katanga</h1>
- <LogoVerticalWhite />
+ <LogoVerticalWhite />
</header>
<form id="ktg-form-metersAround">
<Slider meters="50"/> |
a3bb8baaa90c65cfd695c34118e33590725e170b | src/containers/Timeline.jsx | src/containers/Timeline.jsx | import React, { Component } from 'react'
import { connect } from 'react-redux'
import { fetchPhotos } from '../actions/photos'
import PhotosList from '../components/PhotosList'
import Topbar from '../components/Topbar'
import Viewer from '../components/Viewer'
export class Timeline extends Component {
constructor (props) {
super(props)
this.state = { isFirstFetch: true }
}
componentWillReceiveProps (nextProps) {
/* istanbul ignore else */
if (!nextProps.isIndexing && this.state.isFirstFetch) {
this.props.onFirstFetch(nextProps.mangoIndexByDate)
this.setState({ isFirstFetch: false })
}
}
render (props, state) {
return (
<div>
<Topbar viewName='photos' />
<PhotosList {...props} {...state} />
{props && props.params && props.params.photoId &&
<Viewer photoId={props.params.photoId} />
}
</div>
)
}
}
const mapStateToProps = (state, ownProps) => ({
isFetching: state.ui.isFetching,
isIndexing: state.ui.isIndexing,
isWorking: state.ui.isWorking,
photos: state.photos,
mangoIndexByDate: state.mangoIndexByDate
})
export const mapDispatchToProps = (dispatch, ownProps) => ({
onFirstFetch: (mangoIndexByDate) => {
dispatch(fetchPhotos(mangoIndexByDate))
}
})
export default connect(
mapStateToProps,
mapDispatchToProps
)(Timeline)
| import React, { Component } from 'react'
import { connect } from 'react-redux'
import { fetchPhotos } from '../actions/photos'
import PhotosList from '../components/PhotosList'
import Topbar from '../components/Topbar'
import Viewer from '../components/Viewer'
export class Timeline extends Component {
constructor (props) {
super(props)
this.state = { isFirstFetch: true }
}
componentWillReceiveProps (nextProps) {
/* istanbul ignore else */
if (!nextProps.isIndexing && this.state.isFirstFetch) {
this.props.onFirstFetch(nextProps.mangoIndexByDate)
this.setState({ isFirstFetch: false })
}
}
render () {
return (
<div>
<Topbar viewName='photos' />
<PhotosList {...this.props} {...this.state} />
{this.props && this.props.params && this.props.params.photoId &&
<Viewer photoId={this.props.params.photoId} />
}
</div>
)
}
}
const mapStateToProps = (state, ownProps) => ({
isFetching: state.ui.isFetching,
isIndexing: state.ui.isIndexing,
isWorking: state.ui.isWorking,
photos: state.photos,
mangoIndexByDate: state.mangoIndexByDate
})
export const mapDispatchToProps = (dispatch, ownProps) => ({
onFirstFetch: (mangoIndexByDate) => {
dispatch(fetchPhotos(mangoIndexByDate))
}
})
export default connect(
mapStateToProps,
mapDispatchToProps
)(Timeline)
| Use `this` for props and state in the timeline render function | [fix] Use `this` for props and state in the timeline render function
| JSX | agpl-3.0 | nono/cozy-photos-v3,enguerran/cozy-drive,cozy/cozy-files-v3,enguerran/cozy-drive,y-lohse/cozy-drive,goldoraf/cozy-photos-v3,cozy/cozy-photos-v3,cozy/cozy-files-v3,goldoraf/cozy-drive,y-lohse/cozy-drive,enguerran/cozy-files-v3,nono/cozy-files-v3,enguerran/cozy-drive,cozy/cozy-files-v3,enguerran/cozy-files-v3,y-lohse/cozy-drive,nono/cozy-files-v3,y-lohse/cozy-files-v3,y-lohse/cozy-files-v3,nono/cozy-files-v3,nono/cozy-photos-v3,cozy/cozy-files-v3,y-lohse/cozy-photos-v3,nono/cozy-files-v3,goldoraf/cozy-drive,cozy/cozy-photos-v3,y-lohse/cozy-drive,goldoraf/cozy-drive,goldoraf/cozy-drive,enguerran/cozy-files-v3,goldoraf/cozy-photos-v3,y-lohse/cozy-photos-v3,y-lohse/cozy-files-v3,enguerran/cozy-drive,enguerran/cozy-files-v3 | ---
+++
@@ -21,13 +21,13 @@
}
}
- render (props, state) {
+ render () {
return (
<div>
<Topbar viewName='photos' />
- <PhotosList {...props} {...state} />
- {props && props.params && props.params.photoId &&
- <Viewer photoId={props.params.photoId} />
+ <PhotosList {...this.props} {...this.state} />
+ {this.props && this.props.params && this.props.params.photoId &&
+ <Viewer photoId={this.props.params.photoId} />
}
</div>
) |
b92330aebb35893cdc5e36094d6ec73ba98b3176 | web/app/components/Modal/BrowserSupportModal.jsx | web/app/components/Modal/BrowserSupportModal.jsx | import React, {PropTypes} from "react";
import ZfApi from "react-foundation-apps/src/utils/foundation-api";
import Modal from "react-foundation-apps/src/modal";
import Trigger from "react-foundation-apps/src/trigger";
import Translate from "react-translate-component";
export default class BrowserSupportModal extends React.Component {
show() {
ZfApi.publish("browser_modal", "open");
}
_openLink() {
window.open("https://www.google.com/chrome/browser/desktop/", "_blank");
}
render() {
return (
<Modal id="browser_modal" overlay={true} ref="browser_modal">
<Trigger close="browser_modal">
<a href="#" className="close-button">×</a>
</Trigger>
<div className="grid-block vertical no-overflow">
<Translate component="h3" content="init_error.browser"/>
<Translate component="p" content="init_error.browser_text"/>
<br/>
<p><a href onClick={this._openLink}>Google Chrome</a></p>
<div className="button-group no-overflow" style={{paddingTop: "0"}}>
<Trigger close="browser_modal">
<div href onClick={this._openLink} className="button"><Translate content="init_error.understand" /></div>
</Trigger>
</div>
</div>
</Modal>
);
}
}
| import React, {PropTypes} from "react";
import ZfApi from "react-foundation-apps/src/utils/foundation-api";
import Modal from "react-foundation-apps/src/modal";
import Trigger from "react-foundation-apps/src/trigger";
import Translate from "react-translate-component";
export default class BrowserSupportModal extends React.Component {
show() {
ZfApi.publish("browser_modal", "open");
}
_openLink() {
window.open("https://www.google.com/chrome/browser/desktop/", "_blank");
}
render() {
return (
<Modal id="browser_modal" overlay={true} ref="browser_modal">
<Trigger close="browser_modal">
<a href="#" className="close-button">×</a>
</Trigger>
<div className="grid-block vertical no-overflow">
<Translate component="h3" content="init_error.browser"/>
<Translate component="p" content="init_error.browser_text"/>
<br/>
<p><a href onClick={this._openLink}>Google Chrome</a></p>
<div className="button-group no-overflow" style={{paddingTop: 0}}>
<Trigger close="browser_modal">
<div href onClick={this._openLink} className="button"><Translate content="init_error.understand" /></div>
</Trigger>
</div>
</div>
</Modal>
);
}
}
| Change padding as string to int | Change padding as string to int
| JSX | mit | trendever/bitshares-ui,trendever/bitshares-ui,BitSharesEurope/graphene-ui-testnet,trendever/bitshares-ui,bitshares/bitshares-ui,BunkerChainLabsInc/freedomledger-wallet,bitshares/bitshares-2-ui,bitshares/bitshares-2-ui,BitSharesEurope/graphene-ui-testnet,BitSharesEurope/wallet.bitshares.eu,BitSharesEurope/graphene-ui-testnet,merivercap/bitshares-2-ui,BunkerChainLabsInc/freedomledger-wallet,bitshares/bitshares-ui,openledger/graphene-ui,merivercap/bitshares-2-ui,bitshares/bitshares-2-ui,merivercap/bitshares-2-ui,bitshares/bitshares-ui,openledger/graphene-ui,poqdavid/graphene-ui,BunkerChainLabsInc/freedomledger-wallet,trendever/bitshares-ui,merivercap/bitshares-2-ui,cryptonomex/graphene-ui,cryptonomex/graphene-ui,BitSharesEurope/wallet.bitshares.eu,BunkerChainLabsInc/freedomledger-wallet,BitSharesEurope/wallet.bitshares.eu,bitshares/bitshares-ui,BitSharesEurope/testnet.bitshares.eu,BitSharesEurope/testnet.bitshares.eu,BitSharesEurope/graphene-ui-testnet,BitSharesEurope/wallet.bitshares.eu,openledger/graphene-ui,poqdavid/graphene-ui,poqdavid/graphene-ui,poqdavid/graphene-ui,BitSharesEurope/testnet.bitshares.eu,cryptonomex/graphene-ui,BitSharesEurope/testnet.bitshares.eu | ---
+++
@@ -27,7 +27,7 @@
<p><a href onClick={this._openLink}>Google Chrome</a></p>
- <div className="button-group no-overflow" style={{paddingTop: "0"}}>
+ <div className="button-group no-overflow" style={{paddingTop: 0}}>
<Trigger close="browser_modal">
<div href onClick={this._openLink} className="button"><Translate content="init_error.understand" /></div>
</Trigger> |
dd71ebb21900e7961bec22901452bcf8daac421b | web/static/js/components/high_contrast_button.jsx | web/static/js/components/high_contrast_button.jsx | import React from "react"
import PropTypes from "prop-types"
import * as AppPropTypes from "../prop_types"
const HighContrastButton = props => {
const {actions, userOptions, className} = props
return (
<div className={className}>
<button
className="fluid ui left button"
onClick={actions.toggleHighContrastOn}
type="button"
>
{`Turn High Contrast ${userOptions.highContrastOn ? "Off" : "On"}`}
</button>
</div>
)
}
HighContrastButton.propTypes = {
actions: PropTypes.object.isRequired,
userOptions: AppPropTypes.userOptions.isRequired,
className: PropTypes.string
}
export default HighContrastButton
| import React from "react"
import PropTypes from "prop-types"
import * as AppPropTypes from "../prop_types"
const HighContrastButton = props => {
const {actions, userOptions, className} = props
return (
<div className={className}>
<button
className="ui right labeled icon button"
onClick={actions.toggleHighContrastOn}
type="button"
>
{`Turn High Contrast ${userOptions.highContrastOn ? "Off" : "On"}`}
<i className="ui low vision icon" />
</button>
</div>
)
}
HighContrastButton.propTypes = {
actions: PropTypes.object.isRequired,
userOptions: AppPropTypes.userOptions.isRequired,
className: PropTypes.string
}
export default HighContrastButton
| Add low-vision icon to high-contrast toggle button | Add low-vision icon to high-contrast toggle button
| JSX | mit | stride-nyc/remote_retro,stride-nyc/remote_retro,stride-nyc/remote_retro | ---
+++
@@ -8,11 +8,12 @@
return (
<div className={className}>
<button
- className="fluid ui left button"
+ className="ui right labeled icon button"
onClick={actions.toggleHighContrastOn}
type="button"
>
- {`Turn High Contrast ${userOptions.highContrastOn ? "Off" : "On"}`}
+ {`Turn High Contrast ${userOptions.highContrastOn ? "Off" : "On"}`}
+ <i className="ui low vision icon" />
</button>
</div>
) |
137bbd36f29d5b2b9e30f26adc112660d99a28c0 | www_src/pages/discover/discover.jsx | www_src/pages/discover/discover.jsx | var React = require('react/addons');
var ImageLoader = require('react-imageloader');
var api = require('../../lib/api.js');
var render = require('../../lib/render.jsx');
var Link = require('../../components/link/link.jsx');
var Discover = React.createClass({
mixins: [],
getInitialState: function () {
this.list = require('./mock.json');
return {
list: this.list,
offset: 0,
limit: 10,
locale: {
language: 'en',
country: 'us'
}
};
},
render: function () {
var cards = this.state.list.map( project => {
return (
<Link url={"/map/" + project.id} href="/pages/map" key={project.id} className="card">
<div className="thumbnail">
<ImageLoader src={project.thumbnail[480]}>
// @todo Show image error icon / graphic
</ImageLoader>
</div>
<div className="meta">
<div className="title">{project.title}</div>
<div className="author">{project.author.username}</div>
</div>
</Link>
);
});
return (
<div id="discover">
{cards}
</div>
);
}
});
render(Discover);
| var React = require('react/addons');
var ImageLoader = require('react-imageloader');
var api = require('../../lib/api.js');
var render = require('../../lib/render.jsx');
var Link = require('../../components/link/link.jsx');
var Discover = React.createClass({
mixins: [],
getInitialState: function () {
this.list = require('./mock.json');
return {
list: this.list
};
},
render: function () {
var cards = this.state.list.map( project => {
return (
<Link url={"/map/" + project.id} href="/pages/map" key={project.id} className="card">
<div className="thumbnail">
<ImageLoader src={project.thumbnail[480]}>
// @todo Show image error icon / graphic
</ImageLoader>
</div>
<div className="meta">
<div className="title">{project.title}</div>
<div className="author">{project.author.username}</div>
</div>
</Link>
);
});
return (
<div id="discover">
{cards}
</div>
);
}
});
render(Discover);
| Remove unused items from state | Remove unused items from state
| JSX | mpl-2.0 | gvn/webmaker-android,alanmoo/webmaker-android,bolaram/webmaker-android,alicoding/webmaker-android,k88hudson/webmaker-android,rodmoreno/webmaker-android,adamlofting/webmaker-android,j796160836/webmaker-android,alanmoo/webmaker-android,alicoding/webmaker-android,bolaram/webmaker-android,mozilla/webmaker-android,rodmoreno/webmaker-android,mozilla/webmaker-android,j796160836/webmaker-android,gvn/webmaker-android,k88hudson/webmaker-android | ---
+++
@@ -11,13 +11,7 @@
this.list = require('./mock.json');
return {
- list: this.list,
- offset: 0,
- limit: 10,
- locale: {
- language: 'en',
- country: 'us'
- }
+ list: this.list
};
},
render: function () { |
ed95af23f79c95da7591966baeaa0f90a83018b5 | src/app/components/simple-editable-list/SimpleEditableListItem.jsx | src/app/components/simple-editable-list/SimpleEditableListItem.jsx | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router';
const propTypes = {
// title: PropTypes.string.isRequired,
// id: PropTypes.string.isRequired,
// url: PropTypes.string.isRequired,
// details: PropTypes.arrayOf(PropTypes.string)
}
export default class SimpleEditableListItemItem extends Component {
constructor(props) {
super(props);
}
handleEditClick = () => {
this.props.handleEditClick(this.props.field)
}
handleDeleteClick = () => {
this.props.handleDeleteClick(this.props.field)
}
render() {
return (
<li className="simple-select-list__item grid">
<div className="grid__col-lg-3">
<p>{this.props.field.type}</p>
</div>
<div className="grid__col-lg-7">
<p>{this.props.field.description}</p>
</div>
<div className="grid__col-lg-2">
<p style={{"textAlign": "right"}}>
<span className="btn--link" onClick={this.handleEditClick}>Edit</span> |
<span className="btn--link" onClick={this.handleDeleteClick}>Delete</span>
</p>
</div>
</li>
)
}
}
SimpleEditableListItemItem.propTypes = propTypes; | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router';
const propTypes = {
// title: PropTypes.string.isRequired,
// id: PropTypes.string.isRequired,
// url: PropTypes.string.isRequired,
// details: PropTypes.arrayOf(PropTypes.string)
}
export default class SimpleEditableListItemItem extends Component {
constructor(props) {
super(props);
}
handleEditClick = () => {
this.props.handleEditClick(this.props.field)
}
handleDeleteClick = () => {
this.props.handleDeleteClick(this.props.field)
}
render() {
return (
<li className="simple-select-list__item grid">
<div className="grid__col-lg-10">
<p className="font-weight--600">{this.props.field.type || this.props.field.title}</p>
<p>{this.props.field.description}</p>
</div>
<div className="grid__col-lg-2">
<p style={{"textAlign": "right"}}>
<button type="button" className="btn btn--link" onClick={this.handleEditClick}>Edit</button> |
<button type="button" className="btn btn--link" onClick={this.handleDeleteClick}>Delete</button>
</p>
</div>
</li>
)
}
}
SimpleEditableListItemItem.propTypes = propTypes; | Use buttons and bold font | Use buttons and bold font
| JSX | mit | ONSdigital/florence,ONSdigital/florence,ONSdigital/florence,ONSdigital/florence | ---
+++
@@ -25,16 +25,14 @@
render() {
return (
<li className="simple-select-list__item grid">
- <div className="grid__col-lg-3">
- <p>{this.props.field.type}</p>
- </div>
- <div className="grid__col-lg-7">
+ <div className="grid__col-lg-10">
+ <p className="font-weight--600">{this.props.field.type || this.props.field.title}</p>
<p>{this.props.field.description}</p>
</div>
<div className="grid__col-lg-2">
<p style={{"textAlign": "right"}}>
- <span className="btn--link" onClick={this.handleEditClick}>Edit</span> |
- <span className="btn--link" onClick={this.handleDeleteClick}>Delete</span>
+ <button type="button" className="btn btn--link" onClick={this.handleEditClick}>Edit</button> |
+ <button type="button" className="btn btn--link" onClick={this.handleDeleteClick}>Delete</button>
</p>
</div>
|
61c18de197b07f7fb65c8ecd7d9e56e86ead3dd8 | client/src/components/Main.jsx | client/src/components/Main.jsx | import React from 'react';
import DebateItem from './DebateItem.jsx';
import {
BrowserRouter as Router,
Route,
Link,
Switch
} from 'react-router-dom';
import DebateFloor from './debate/DebateFloor.jsx';
import axios from 'axios';
class Main extends React.Component {
constructor(props) {
super(props);
this.state = {
debates: []
}
this.getAllActive = () => {
axios.get('http://localhost:3000/debates/api/get')
.then(response => {
console.log('[Main] Get debates success:', response);
this.setState({
debates: response.data.data
})
})
.catch(err => {
console.log('[Main] Get debates ERROR:', err);
})
}
}
componentDidMount() {
this.getAllActive();
}
render() {
return (
<div>
<h4>List of Debates</h4>
{ this.state.debates.map( (item, i) => <DebateItem debate = {item} key= {i}/> )}
<Switch>
<Route path='/debates/gun-control-in-america' component={DebateFloor} />
</Switch>
</div>
)
}
}
export default Main;
| import React from 'react';
import DebateItem from './DebateItem.jsx';
import {
BrowserRouter as Router,
Route,
Link,
Switch
} from 'react-router-dom';
import DebateFloor from './debate/DebateFloor.jsx';
import axios from 'axios';
class Main extends React.Component {
constructor(props) {
super(props);
this.state = {
debates: []
}
this.getAllActive = () => {
axios.get('http://localhost:3000/debates/api/get')
.then(response => {
console.log('[Main] Get debates success:', response);
this.setState({
debates: response.data.data
})
})
.catch(err => {
console.log('[Main] Get debates ERROR:', err);
})
}
this.testGetArgs = () => {
console.log('GET ARGS TEST')
axios.get('http://localhost:3000/debates/api/getArgs', {
params: {
topic: 'Gun control in America',
side: 'against'
}
})
.then(response => {
console.log('RESPONSE', response);
})
}
}
componentDidMount() {
this.getAllActive();
this.testGetArgs();
}
render() {
return (
<div>
<h4>List of Debates</h4>
{ this.state.debates.map( (item, i) => <DebateItem debate = {item} key= {i}/> )}
<Switch>
<Route path='/debates/gun-control-in-america' component={DebateFloor} />
</Switch>
</div>
)
}
}
export default Main;
| Add query to increase points for debate side and increase votes for an argument | Add query to increase points for debate side and increase votes for an argument
| JSX | mit | garrulous-gorillas/garrulous-gorillas,garrulous-gorillas/garrulous-gorillas | ---
+++
@@ -32,10 +32,25 @@
console.log('[Main] Get debates ERROR:', err);
})
}
+
+ this.testGetArgs = () => {
+ console.log('GET ARGS TEST')
+ axios.get('http://localhost:3000/debates/api/getArgs', {
+ params: {
+ topic: 'Gun control in America',
+ side: 'against'
+ }
+ })
+ .then(response => {
+ console.log('RESPONSE', response);
+ })
+
+ }
}
componentDidMount() {
this.getAllActive();
+ this.testGetArgs();
}
render() { |
83a35078bf6beedd2fe8659c25e4f1fe0fc58cfc | dashboard-gui/src/javascripts/pages/not_found.jsx | dashboard-gui/src/javascripts/pages/not_found.jsx | import React from 'react'
import I18n from 'i18n-js'
import PropTypes from 'prop-types'
import stopEvent from '../utils/stop'
class NotFound extends React.Component {
login = (e) => {
stopEvent(e)
window.location.href = `/login?redirect_url=${encodeURIComponent(window.location.href)}`
}
render() {
const { currentUser } = this.context
return (
<div className="mod-not-found">
<h1>{I18n.t('not_found.title')}</h1>
<h2 className="sub-title">{I18n.t('not_found.subTitle')}</h2>
<ul>
{currentUser.guest && (
<li>
<span>{I18n.t('not_found.reasonLoginPre')}</span>
<a href="/login" onClick={this.login}>
Login
</a>
<span>{I18n.t('not_found.reasonLoginPost')}</span>
</li>
)}
<li dangerouslySetInnerHTML={{ __html: I18n.t('not_found.reasonHelp') }}></li>
<li dangerouslySetInnerHTML={{ __html: I18n.t('not_found.reasonRemoved') }}></li>
<li dangerouslySetInnerHTML={{ __html: I18n.t('not_found.reasonUnknown') }}></li>
</ul>
</div>
)
}
}
NotFound.contextTypes = {
currentUser: PropTypes.object,
}
export default NotFound
| import React from 'react'
import I18n from 'i18n-js'
import PropTypes from 'prop-types'
import stopEvent from '../utils/stop'
class NotFound extends React.Component {
login = (e) => {
stopEvent(e)
window.location.href = `/login?redirect_url=${encodeURIComponent(window.location.href)}`
}
render() {
const { currentUser } = this.context
return (
<div className="mod-not-found">
<div className="container">
<h1>{I18n.t('not_found.title')}</h1>
<h2 className="sub-title">{I18n.t('not_found.subTitle')}</h2>
<ul>
{currentUser.guest && (
<li>
<span>{I18n.t('not_found.reasonLoginPre')}</span>
<a href="/login" onClick={this.login}>
Login
</a>
<span>{I18n.t('not_found.reasonLoginPost')}</span>
</li>
)}
<li dangerouslySetInnerHTML={{ __html: I18n.t('not_found.reasonHelp') }}></li>
<li dangerouslySetInnerHTML={{ __html: I18n.t('not_found.reasonRemoved') }}></li>
<li dangerouslySetInnerHTML={{ __html: I18n.t('not_found.reasonUnknown') }}></li>
</ul>
</div>
</div>
)
}
}
NotFound.contextTypes = {
currentUser: PropTypes.object,
}
export default NotFound
| Add page not found to container | Add page not found to container
| JSX | apache-2.0 | OpenConext/OpenConext-dashboard,OpenConext/OpenConext-dashboard,OpenConext/OpenConext-dashboard,OpenConext/OpenConext-dashboard | ---
+++
@@ -13,22 +13,24 @@
const { currentUser } = this.context
return (
<div className="mod-not-found">
- <h1>{I18n.t('not_found.title')}</h1>
- <h2 className="sub-title">{I18n.t('not_found.subTitle')}</h2>
- <ul>
- {currentUser.guest && (
- <li>
- <span>{I18n.t('not_found.reasonLoginPre')}</span>
- <a href="/login" onClick={this.login}>
- Login
- </a>
- <span>{I18n.t('not_found.reasonLoginPost')}</span>
- </li>
- )}
- <li dangerouslySetInnerHTML={{ __html: I18n.t('not_found.reasonHelp') }}></li>
- <li dangerouslySetInnerHTML={{ __html: I18n.t('not_found.reasonRemoved') }}></li>
- <li dangerouslySetInnerHTML={{ __html: I18n.t('not_found.reasonUnknown') }}></li>
- </ul>
+ <div className="container">
+ <h1>{I18n.t('not_found.title')}</h1>
+ <h2 className="sub-title">{I18n.t('not_found.subTitle')}</h2>
+ <ul>
+ {currentUser.guest && (
+ <li>
+ <span>{I18n.t('not_found.reasonLoginPre')}</span>
+ <a href="/login" onClick={this.login}>
+ Login
+ </a>
+ <span>{I18n.t('not_found.reasonLoginPost')}</span>
+ </li>
+ )}
+ <li dangerouslySetInnerHTML={{ __html: I18n.t('not_found.reasonHelp') }}></li>
+ <li dangerouslySetInnerHTML={{ __html: I18n.t('not_found.reasonRemoved') }}></li>
+ <li dangerouslySetInnerHTML={{ __html: I18n.t('not_found.reasonUnknown') }}></li>
+ </ul>
+ </div>
</div>
)
} |
0e4ed32b50fb23ea6df9b0a3ed38e3f23a68659e | src/components/TopBar/CurrentUser.jsx | src/components/TopBar/CurrentUser.jsx | import classnames from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
import {t} from 'i18next';
import CurrentUserMenu from './CurrentUserMenu';
export default function CurrentUser({
user,
onLogOut,
onStartLogIn,
}) {
if (user.authenticated) {
return <CurrentUserMenu user={user} onLogOut={onLogOut} />;
}
return (
<div
className={classnames('top-bar__current-user',
'top-bar__menu-button',
'top-bar__menu-button_primary',
)}
>
<span
className="top-bar__log-in-prompt"
onClick={onStartLogIn}
>
{t('top-bar.session.log-in-prompt')}
</span>
</div>
);
}
CurrentUser.propTypes = {
user: PropTypes.shape({
authenticated: PropTypes.boolean,
}).isRequired,
onLogOut: PropTypes.func.isRequired,
onStartLogIn: PropTypes.func.isRequired,
};
| import classnames from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
import {t} from 'i18next';
import CurrentUserMenu from './CurrentUserMenu';
export default function CurrentUser({
user,
onLogOut,
onStartLogIn,
}) {
if (user.authenticated) {
return <CurrentUserMenu user={user} onLogOut={onLogOut} />;
}
return (
<div
className={classnames('top-bar__current-user',
'top-bar__menu-button',
'top-bar__menu-button_primary',
)}
onClick={onStartLogIn}
>
{t('top-bar.session.log-in-prompt')}
</div>
);
}
CurrentUser.propTypes = {
user: PropTypes.shape({
authenticated: PropTypes.boolean,
}).isRequired,
onLogOut: PropTypes.func.isRequired,
onStartLogIn: PropTypes.func.isRequired,
};
| Enlarge log-in button click target | Enlarge log-in button click target
Remove login `<span>`. Move its `onClick` listener and log-in toggler
into parent `div`. Issue #1222
| JSX | mit | popcodeorg/popcode,popcodeorg/popcode,popcodeorg/popcode,jwang1919/popcode,jwang1919/popcode,outoftime/learnpad,jwang1919/popcode,popcodeorg/popcode,jwang1919/popcode,outoftime/learnpad | ---
+++
@@ -18,13 +18,9 @@
'top-bar__menu-button',
'top-bar__menu-button_primary',
)}
+ onClick={onStartLogIn}
>
- <span
- className="top-bar__log-in-prompt"
- onClick={onStartLogIn}
- >
- {t('top-bar.session.log-in-prompt')}
- </span>
+ {t('top-bar.session.log-in-prompt')}
</div>
);
} |
c569d8a52c150204f10ed9a8304a327da546af1b | app/javascript/CmsAdmin/CmsContentGroupsAdmin/index.jsx | app/javascript/CmsAdmin/CmsContentGroupsAdmin/index.jsx | import React from 'react';
import { Switch, Route } from 'react-router-dom';
import CmsContentGroupsAdminTable from './CmsContentGroupsAdminTable';
import EditCmsContentGroup from './EditCmsContentGroup';
import NewCmsContentGroup from './NewCmsContentGroup';
import ViewCmsContentGroup from './ViewCmsContentGroup';
function CmsContentGroupsAdmin() {
return (
<Switch>
<Route path="/cms_content_groups/:id/edit" component={EditCmsContentGroup} />
<Route path="/cms_content_groups/:id" component={ViewCmsContentGroup} />
<Route path="/cms_content_groups/new" component={NewCmsContentGroup} />
<Route path="/cms_content_groups" component={CmsContentGroupsAdminTable} />
</Switch>
);
}
export default CmsContentGroupsAdmin;
| import React from 'react';
import { Switch, Route } from 'react-router-dom';
import CmsContentGroupsAdminTable from './CmsContentGroupsAdminTable';
import EditCmsContentGroup from './EditCmsContentGroup';
import NewCmsContentGroup from './NewCmsContentGroup';
import ViewCmsContentGroup from './ViewCmsContentGroup';
function CmsContentGroupsAdmin() {
return (
<Switch>
<Route path="/cms_content_groups/:id/edit" component={EditCmsContentGroup} />
<Route path="/cms_content_groups/new" component={NewCmsContentGroup} />
<Route path="/cms_content_groups/:id" component={ViewCmsContentGroup} />
<Route path="/cms_content_groups" component={CmsContentGroupsAdminTable} />
</Switch>
);
}
export default CmsContentGroupsAdmin;
| Fix rendering the new content group page | Fix rendering the new content group page
| JSX | mit | neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode | ---
+++
@@ -10,8 +10,8 @@
return (
<Switch>
<Route path="/cms_content_groups/:id/edit" component={EditCmsContentGroup} />
+ <Route path="/cms_content_groups/new" component={NewCmsContentGroup} />
<Route path="/cms_content_groups/:id" component={ViewCmsContentGroup} />
- <Route path="/cms_content_groups/new" component={NewCmsContentGroup} />
<Route path="/cms_content_groups" component={CmsContentGroupsAdminTable} />
</Switch>
); |
1a2db65f254237f3800ba09486f794e45553101d | imports/modules/documents/components/documents.jsx | imports/modules/documents/components/documents.jsx | import React from 'react';
import { Link } from 'react-router-dom';
import Row from 'react-bootstrap/lib/Row';
import Col from 'react-bootstrap/lib/Col';
import Button from 'react-bootstrap/lib/Button';
import Glyphicon from 'react-bootstrap/lib/Glyphicon';
import DocumentsList from './documentsList';
const Documents = () => (
<div className="Documents">
<Row>
<Col xs={12}>
<div className="page-header clearfix">
<h4 className="pull-left">Documents</h4>
<Link to="/documents/new">
<Button bsStyle="success" className="pull-right">
<span className="visible-lg-block">Nouveau document</span>
<span className="visible-md-block visible-sm-block">Nouveau</span>
<span className="visible-xs-block"><Glyphicon glyph="plus" /></span>
</Button>
</Link>
</div>
<DocumentsList />
</Col>
</Row>
</div>
);
export default Documents;
| import React from 'react';
import { Link } from 'react-router-dom';
import Row from 'react-bootstrap/lib/Row';
import Col from 'react-bootstrap/lib/Col';
import Button from 'react-bootstrap/lib/Button';
import Glyphicon from 'react-bootstrap/lib/Glyphicon';
import DocumentsList from './documentsList';
const Documents = () => (
<div className="Documents">
<Row>
<Col xs={12}>
<div className="page-header clearfix">
<h4 className="pull-left">Documents</h4>
<Link to="/documents/new">
<Button bsStyle="success" bsSize="small" className="pull-right">
<span className="visible-lg-block visible-md-block">Nouveau document</span>
<span className="visible-sm-block">Nouveau</span>
<span className="visible-xs-block"><Glyphicon glyph="plus" /></span>
</Button>
</Link>
</div>
<DocumentsList />
</Col>
</Row>
</div>
);
export default Documents;
| Update Documents, component Document, fix size of button and display breackpoint | Update Documents, component Document, fix size of button and display breackpoint
| JSX | mit | ggallon/rock,ggallon/rock | ---
+++
@@ -13,9 +13,9 @@
<div className="page-header clearfix">
<h4 className="pull-left">Documents</h4>
<Link to="/documents/new">
- <Button bsStyle="success" className="pull-right">
- <span className="visible-lg-block">Nouveau document</span>
- <span className="visible-md-block visible-sm-block">Nouveau</span>
+ <Button bsStyle="success" bsSize="small" className="pull-right">
+ <span className="visible-lg-block visible-md-block">Nouveau document</span>
+ <span className="visible-sm-block">Nouveau</span>
<span className="visible-xs-block"><Glyphicon glyph="plus" /></span>
</Button>
</Link> |
af52a4e7aefa99a094afabe71b1f8af3731b381d | src/templates/app/resources/economic_calendar.jsx | src/templates/app/resources/economic_calendar.jsx | import React from 'react';
import Loading from '../../_common/components/loading.jsx';
import SeparatorLine from '../../_common/components/separator_line.jsx';
const EconomicCalendar = () => (
<div id='economic_calendar' className='static_full'>
<div className='economic-calendar-header'>
<h1>{it.L('Economic Calendar')}</h1>
<p>{it.L('Check out the latest economic events and indicators from all over the world. All data are collected and updated in real time.')}</p>
<p>{it.L('You can monitor macroeconomic indicators straight from the MetaTrader 5 platform using release time labels displayed on [_1]financial symbol charts[_2].', '<a href="https://www.metatrader5.com/en/terminal/help/fundamental#chart" target="_blank" rel="noopener">','</a>')}</p>
<p>{it.L('With the Economic Calendar, you can see a breakdown of all the scheduled economic events due to take place on any given day.')}</p>
<p>{it.L('Click on an individual event to be presented with further information and links to more in-depth data about it. The information provided by the Economic Calendar will help you make more informed trading decisions.')}</p>
</div>
<div className='gr-padding-10'>
<div id='economicCalendarWidget'>
<Loading />
</div>
</div>
<p className='hint'>
* {it.L('Disclaimer: The Economic Calendar tool is a third-party application developed by MetaQuotes Software Corp. and its data can change without prior notice. [_1] is not responsible for the content or accuracy of its data, or for any loss or damage of any sort resulting from its data.', it.website_name)}
</p>
<SeparatorLine className='gr-padding-10' invisible />
</div>
);
export default EconomicCalendar;
| import React from 'react';
import Loading from '../../_common/components/loading.jsx';
import SeparatorLine from '../../_common/components/separator_line.jsx';
const EconomicCalendar = () => (
<div id='economic_calendar' className='static_full'>
<div className='gr-padding-10'>
<h1>{it.L('Economic Calendar')}</h1>
<div id='economicCalendarWidget'>
<Loading />
</div>
</div>
<p className='hint'>
* {it.L('Disclaimer: The Economic Calendar tool is a third-party application developed by MetaQuotes Software Corp. and its data can change without prior notice. [_1] is not responsible for the content or accuracy of its data, or for any loss or damage of any sort resulting from its data.', it.website_name)}
</p>
<SeparatorLine className='gr-padding-10' invisible />
</div>
);
export default EconomicCalendar;
| Remove text from Economic Calendar page | Remove text from Economic Calendar page
| JSX | apache-2.0 | 4p00rv/binary-static,4p00rv/binary-static,negar-binary/binary-static,binary-com/binary-static,kellybinary/binary-static,binary-static-deployed/binary-static,kellybinary/binary-static,ashkanx/binary-static,binary-static-deployed/binary-static,negar-binary/binary-static,kellybinary/binary-static,negar-binary/binary-static,binary-com/binary-static,ashkanx/binary-static,binary-static-deployed/binary-static,binary-com/binary-static,ashkanx/binary-static,4p00rv/binary-static | ---
+++
@@ -4,14 +4,8 @@
const EconomicCalendar = () => (
<div id='economic_calendar' className='static_full'>
- <div className='economic-calendar-header'>
+ <div className='gr-padding-10'>
<h1>{it.L('Economic Calendar')}</h1>
- <p>{it.L('Check out the latest economic events and indicators from all over the world. All data are collected and updated in real time.')}</p>
- <p>{it.L('You can monitor macroeconomic indicators straight from the MetaTrader 5 platform using release time labels displayed on [_1]financial symbol charts[_2].', '<a href="https://www.metatrader5.com/en/terminal/help/fundamental#chart" target="_blank" rel="noopener">','</a>')}</p>
- <p>{it.L('With the Economic Calendar, you can see a breakdown of all the scheduled economic events due to take place on any given day.')}</p>
- <p>{it.L('Click on an individual event to be presented with further information and links to more in-depth data about it. The information provided by the Economic Calendar will help you make more informed trading decisions.')}</p>
- </div>
- <div className='gr-padding-10'>
<div id='economicCalendarWidget'>
<Loading />
</div> |
a2e9d0150ee3e411a53af683bdf1645848c72154 | src/drive/web/modules/trash/components/DestroyConfirm.jsx | src/drive/web/modules/trash/components/DestroyConfirm.jsx | import React from 'react'
import classNames from 'classnames'
import Modal from 'cozy-ui/transpiled/react/Modal'
import { translate } from 'cozy-ui/transpiled/react/I18n'
import styles from 'drive/styles/confirms.styl'
const DestroyConfirm = ({ t, fileCount, confirm, onClose }) => {
const confirmationTexts = ['forbidden', 'restore'].map(type => (
<p
className={classNames(styles['fil-confirm-text'], styles[`icon-${type}`])}
key={`key_destroy_${type}`}
>
{t(`destroyconfirmation.${type}`, fileCount)}
</p>
))
return (
<Modal
title={t('destroyconfirmation.title', fileCount)}
description={confirmationTexts}
secondaryType="secondary"
secondaryText={t('destroyconfirmation.cancel')}
secondaryAction={onClose}
primaryType="danger"
primaryText={t('destroyconfirmation.delete')}
primaryAction={() =>
confirm()
.then(onClose)
.catch(onClose)
}
/>
)
}
export default translate()(DestroyConfirm)
| import React from 'react'
import classNames from 'classnames'
import Modal from 'cozy-ui/transpiled/react/Modal'
import { translate } from 'cozy-ui/transpiled/react/I18n'
import styles from 'drive/styles/confirms.styl'
const DestroyConfirm = ({ t, fileCount, confirm, onClose }) => {
const confirmationTexts = ['forbidden', 'restore'].map(type => (
<p
className={classNames(styles['fil-confirm-text'], styles[`icon-${type}`])}
key={`key_destroy_${type}`}
>
{t(`destroyconfirmation.${type}`, fileCount)}
</p>
))
return (
<Modal
title={t('destroyconfirmation.title', fileCount)}
description={confirmationTexts}
secondaryType="secondary"
secondaryText={t('destroyconfirmation.cancel')}
secondaryAction={onClose}
primaryType="danger"
primaryText={t('destroyconfirmation.delete')}
primaryAction={async () => {
try {
await confirm()
onClose()
} catch {
onClose()
}
}}
/>
)
}
export default translate()(DestroyConfirm)
| Use async instead of then/catch | refactor: Use async instead of then/catch
| JSX | agpl-3.0 | nono/cozy-files-v3,nono/cozy-files-v3,nono/cozy-files-v3,nono/cozy-files-v3 | ---
+++
@@ -24,11 +24,14 @@
secondaryAction={onClose}
primaryType="danger"
primaryText={t('destroyconfirmation.delete')}
- primaryAction={() =>
- confirm()
- .then(onClose)
- .catch(onClose)
- }
+ primaryAction={async () => {
+ try {
+ await confirm()
+ onClose()
+ } catch {
+ onClose()
+ }
+ }}
/>
)
} |
d8995b55b1ac4df64b68ce10e6db5708c1b0d7dd | app/assets/javascripts/components/GroupShow.js.jsx | app/assets/javascripts/components/GroupShow.js.jsx | class GroupShow extends React.Component {
constructor() {
super();
this.state = {
title: null,
admin_id: null,
members: null
}
}
showMembers(){
if(this.state.members != null){
return(
this.state.members.map((member) => {
return(
<div>{member}</div>
)
})
)
}
}
componentDidMount() {
let form = this
$.ajax ({
url: '/groups/'+ this.props.groupId,
type: 'GET',
}).done(function(response){
var groupMemberNames = []
response.groupMembers.map((member) => {
return(
groupMemberNames.push(member.name)
)
})
form.setState({
title: response.groupTitle,
admin_id: response.groupAdminId,
members: groupMemberNames
})
})
}
render() {
return (
<div className="card">
<div className="card-body">
<div className='card group-content' >
<div className='card-header'>
<h3>Group Name</h3>
</div>
<div className="card-body text-center">
{this.state.title}
</div>
</div>
<div className='card group-content' >
<div className='card-header'>
<h3>Members</h3>
</div>
<div className="card-body text-center">
{this.showMembers()}
</div>
</div>
</div>
</div>
)
}
}
| class GroupShow extends React.Component {
constructor() {
super();
this.state = {
title: null,
admin_id: null,
members: null
}
}
showMembers(){
if(this.state.members != null){
let n = 0
return(
this.state.members.map((member, n) => {
n++
return(
<div key={this.state.title + n}>{member}</div>
)
})
)
}
}
componentDidMount() {
let form = this
$.ajax ({
url: '/groups/'+ this.props.groupId,
type: 'GET',
}).done(function(response){
var groupMemberNames = []
response.groupMembers.map((member) => {
return(
groupMemberNames.push(member.name)
)
})
form.setState({
title: response.groupTitle,
admin_id: response.groupAdminId,
members: groupMemberNames
})
})
}
render() {
return (
<div className="card">
<div className="card-body">
<div className='card group-content' >
<div className='card-header'>
<h3>Group Name</h3>
</div>
<div className="card-body text-center">
{this.state.title}
</div>
</div>
<div className='card group-content' >
<div className='card-header'>
<h3>Members</h3>
</div>
<div className="card-body text-center">
{this.showMembers()}
</div>
</div>
</div>
</div>
)
}
}
| Add unique keys to group members | Add unique keys to group members
| JSX | mit | mattgfisch/meal,mattgfisch/meal,mattgfisch/meal | ---
+++
@@ -10,10 +10,12 @@
showMembers(){
if(this.state.members != null){
+ let n = 0
return(
- this.state.members.map((member) => {
+ this.state.members.map((member, n) => {
+ n++
return(
- <div>{member}</div>
+ <div key={this.state.title + n}>{member}</div>
)
})
) |
2eebf681c2c6cad994321dc55b081b39c00b00b6 | src/sentry/static/sentry/app/components/timeSince.jsx | src/sentry/static/sentry/app/components/timeSince.jsx | import React from "react";
import moment from "moment";
import PureRenderMixin from 'react-addons-pure-render-mixin';
var TimeSince = React.createClass({
mixins: [
PureRenderMixin
],
propTypes: {
date: React.PropTypes.any.isRequired,
suffix: React.PropTypes.string
},
getDefaultProps() {
return {
suffix: 'ago'
};
},
componentDidMount() {
var delay = 2600;
this.ticker = setInterval(this.ensureValidity, delay);
},
componentWillUnmount() {
if (this.ticker) {
clearInterval(this.ticker);
this.ticker = null;
}
},
ensureValidity() {
// TODO(dcramer): this should ensure we actually *need* to update the value
this.forceUpdate();
},
render() {
var date = this.props.date;
if (typeof date === "string" || typeof date === "number") {
date = new Date(date);
}
return (
<time
dateTime={date.toISOString()}
title={date.toString()}>{moment(date).fromNow(true)} {this.props.suffix || ''}</time>
);
}
});
export default TimeSince;
| import React from "react";
import moment from "moment";
import PureRenderMixin from 'react-addons-pure-render-mixin';
var TimeSince = React.createClass({
mixins: [
PureRenderMixin
],
statics: {
getDateObj(date) {
if (typeof date === "string" || typeof date === "number") {
date = new Date(date);
}
return date;
}
},
propTypes: {
date: React.PropTypes.any.isRequired,
suffix: React.PropTypes.string
},
getDefaultProps() {
return {
suffix: 'ago'
};
},
getInitialState() {
return {
relative: this.getRelativeDate()
};
},
componentDidMount() {
this.setRelativeDateTicker();
},
setRelativeDateTicker() {
const ONE_MINUTE_IN_MS = 3600;
this.ticker = setTimeout(() => {
this.setState({
relative: this.getRelativeDate()
});
this.setRelativeDateTicker();
}, ONE_MINUTE_IN_MS);
},
getRelativeDate() {
let date = TimeSince.getDateObj(this.props.date);
return moment(date).fromNow(true);
},
componentWillUnmount() {
if (this.ticker) {
clearTimeout(this.ticker);
this.ticker = null;
}
},
render() {
let date = TimeSince.getDateObj(this.props.date);
return (
<time
dateTime={date.toISOString()}
title={date.toString()}>{this.state.relative} {this.props.suffix || ''}</time>
);
}
});
export default TimeSince;
| Drop forceUpdate from TimeSince; use state/props changes instead | Drop forceUpdate from TimeSince; use state/props changes instead
| JSX | bsd-3-clause | gencer/sentry,BuildingLink/sentry,ifduyue/sentry,zenefits/sentry,jean/sentry,JackDanger/sentry,JackDanger/sentry,zenefits/sentry,mvaled/sentry,daevaorn/sentry,gencer/sentry,jean/sentry,jean/sentry,fotinakis/sentry,jean/sentry,JamesMura/sentry,alexm92/sentry,looker/sentry,daevaorn/sentry,mvaled/sentry,gencer/sentry,zenefits/sentry,BuildingLink/sentry,alexm92/sentry,looker/sentry,mvaled/sentry,beeftornado/sentry,zenefits/sentry,nicholasserra/sentry,ifduyue/sentry,mitsuhiko/sentry,ifduyue/sentry,gencer/sentry,nicholasserra/sentry,mvaled/sentry,daevaorn/sentry,JamesMura/sentry,looker/sentry,alexm92/sentry,zenefits/sentry,ifduyue/sentry,BuildingLink/sentry,fotinakis/sentry,BuildingLink/sentry,fotinakis/sentry,mvaled/sentry,JackDanger/sentry,mitsuhiko/sentry,beeftornado/sentry,JamesMura/sentry,mvaled/sentry,ifduyue/sentry,looker/sentry,JamesMura/sentry,gencer/sentry,jean/sentry,looker/sentry,JamesMura/sentry,fotinakis/sentry,nicholasserra/sentry,beeftornado/sentry,daevaorn/sentry,BuildingLink/sentry | ---
+++
@@ -6,6 +6,15 @@
mixins: [
PureRenderMixin
],
+
+ statics: {
+ getDateObj(date) {
+ if (typeof date === "string" || typeof date === "number") {
+ date = new Date(date);
+ }
+ return date;
+ }
+ },
propTypes: {
date: React.PropTypes.any.isRequired,
@@ -18,35 +27,46 @@
};
},
+ getInitialState() {
+ return {
+ relative: this.getRelativeDate()
+ };
+ },
+
componentDidMount() {
- var delay = 2600;
+ this.setRelativeDateTicker();
+ },
- this.ticker = setInterval(this.ensureValidity, delay);
+ setRelativeDateTicker() {
+ const ONE_MINUTE_IN_MS = 3600;
+
+ this.ticker = setTimeout(() => {
+ this.setState({
+ relative: this.getRelativeDate()
+ });
+ this.setRelativeDateTicker();
+ }, ONE_MINUTE_IN_MS);
+ },
+
+ getRelativeDate() {
+ let date = TimeSince.getDateObj(this.props.date);
+ return moment(date).fromNow(true);
},
componentWillUnmount() {
if (this.ticker) {
- clearInterval(this.ticker);
+ clearTimeout(this.ticker);
this.ticker = null;
}
},
- ensureValidity() {
- // TODO(dcramer): this should ensure we actually *need* to update the value
- this.forceUpdate();
- },
-
render() {
- var date = this.props.date;
-
- if (typeof date === "string" || typeof date === "number") {
- date = new Date(date);
- }
+ let date = TimeSince.getDateObj(this.props.date);
return (
<time
dateTime={date.toISOString()}
- title={date.toString()}>{moment(date).fromNow(true)} {this.props.suffix || ''}</time>
+ title={date.toString()}>{this.state.relative} {this.props.suffix || ''}</time>
);
}
}); |
f6dfe8da383e48d9cd6f73faf2556e5559d577d8 | src/components/crash-message/crash-message.jsx | src/components/crash-message/crash-message.jsx | import PropTypes from 'prop-types';
import React from 'react';
import Box from '../box/box.jsx';
import {FormattedMessage} from 'react-intl';
import styles from './crash-message.css';
import reloadIcon from './reload.svg';
const CrashMessage = props => (
<div className={styles.crashWrapper}>
<Box className={styles.body}>
<img
className={styles.reloadIcon}
src={reloadIcon}
/>
<h2>
<FormattedMessage
defaultMessage="Oops! Something went wrong."
description="Unhandled error title"
id="gui.crashMessage.title"
/>
</h2>
<p>
{ /* eslint-disable max-len */ }
<FormattedMessage
defaultMessage="We are so sorry, but it looks like Scratch has crashed. This bug has been automatically reported to the Scratch Team. Please refresh your page to try again."
description="Unhandled error description"
id="gui.crashMessage.description"
/>
{ /* eslint-enable max-len */ }
</p>
<button
className={styles.reloadButton}
onClick={props.onReload}
>
Reload
</button>
</Box>
</div>
);
CrashMessage.propTypes = {
onReload: PropTypes.func.isRequired
};
export default CrashMessage;
| import PropTypes from 'prop-types';
import React from 'react';
import Box from '../box/box.jsx';
import styles from './crash-message.css';
import reloadIcon from './reload.svg';
const CrashMessage = props => (
<div className={styles.crashWrapper}>
<Box className={styles.body}>
<img
className={styles.reloadIcon}
src={reloadIcon}
/>
<h2>
Oops! Something went wrong.
</h2>
<p>
We are so sorry, but it looks like Scratch has crashed. This bug has been
automatically reported to the Scratch Team. Please refresh your page to try
again.
</p>
<button
className={styles.reloadButton}
onClick={props.onReload}
>
Reload
</button>
</Box>
</div>
);
CrashMessage.propTypes = {
onReload: PropTypes.func.isRequired
};
export default CrashMessage;
| Revert localization of crash message. | Revert localization of crash message.
It doesn't work without an intl provider, which is mounted inside the error boundary.
| JSX | bsd-3-clause | cwillisf/scratch-gui,LLK/scratch-gui,cwillisf/scratch-gui,LLK/scratch-gui,cwillisf/scratch-gui | ---
+++
@@ -1,7 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import Box from '../box/box.jsx';
-import {FormattedMessage} from 'react-intl';
import styles from './crash-message.css';
import reloadIcon from './reload.svg';
@@ -14,20 +13,13 @@
src={reloadIcon}
/>
<h2>
- <FormattedMessage
- defaultMessage="Oops! Something went wrong."
- description="Unhandled error title"
- id="gui.crashMessage.title"
- />
+ Oops! Something went wrong.
</h2>
<p>
- { /* eslint-disable max-len */ }
- <FormattedMessage
- defaultMessage="We are so sorry, but it looks like Scratch has crashed. This bug has been automatically reported to the Scratch Team. Please refresh your page to try again."
- description="Unhandled error description"
- id="gui.crashMessage.description"
- />
- { /* eslint-enable max-len */ }
+ We are so sorry, but it looks like Scratch has crashed. This bug has been
+ automatically reported to the Scratch Team. Please refresh your page to try
+ again.
+
</p>
<button
className={styles.reloadButton} |
dff656a69714bc9c13c02960b80fd9668d147a6b | web/static/js/components/stage_change_info_voting.jsx | web/static/js/components/stage_change_info_voting.jsx | import React from "react"
export default () => (
<React.Fragment>
The skinny on Labeling + Voting:
<div className="ui basic segment">
<ul className="ui list">
<li>Work as a team to arrive at a sensible label for each group <span className="optional">(optional)</span></li>
<li>Apply votes to the items you feel are <strong>most important</strong> to discuss.
<p className="list-item-note">
<strong>Note: </strong>voting is blind.
Totals will be revealed when the facilitator advances the retro.
</p>
</li>
</ul>
</div>
</React.Fragment>
)
| import React from "react"
export default () => (
<React.Fragment>
The skinny on Labeling + Voting:
<div className="ui basic segment">
<ul className="ui list">
<li>Work as a team to arrive at a sensible label for each group <span className="optional">(optional)</span></li>
<li>Apply votes to the items you feel are <strong>most important</strong> to discuss.
<p className="list-item-note"><strong>Note: </strong>voting is blind.
Totals will be revealed when the facilitator advances the retro.
</p>
</li>
</ul>
</div>
</React.Fragment>
)
| Remove unnecessary whitespace from 'Note:' bullet point | Remove unnecessary whitespace from 'Note:' bullet point
| JSX | mit | stride-nyc/remote_retro,stride-nyc/remote_retro,stride-nyc/remote_retro | ---
+++
@@ -7,8 +7,7 @@
<ul className="ui list">
<li>Work as a team to arrive at a sensible label for each group <span className="optional">(optional)</span></li>
<li>Apply votes to the items you feel are <strong>most important</strong> to discuss.
- <p className="list-item-note">
- <strong>Note: </strong>voting is blind.
+ <p className="list-item-note"><strong>Note: </strong>voting is blind.
Totals will be revealed when the facilitator advances the retro.
</p>
</li> |
bbe1f52130253064b4cefb177a48412494a010e1 | lib/search-bar.jsx | lib/search-bar.jsx | var React = require('react');
var debounce = require('debounce');
var SearchBar = React.createClass({
getDefaultProps: function() {
return {
minlength: 2,
timeout: 100,
onChange: function() {}
};
},
render: function() {
return <input type='text' placeholder='Search' ref='query' onInput={ debounce(this.update, this.props.timeout) } />;
},
update: function() {
var value = this.refs.query.getDOMNode().value;
if (value.length >= this.props.minlength || value.length === 0) {
this.props.onChange(value);
}
}
});
module.exports = SearchBar; | var React = require('react');
var debounce = require('debounce');
var SearchBar = React.createClass({
getDefaultProps: function() {
return {
minlength: 2,
timeout: 300,
onChange: function() {}
};
},
render: function() {
return <input type='text' placeholder='Search' ref='query' onInput={ debounce(this.update, this.props.timeout) } />;
},
update: function() {
var value = this.refs.query.getDOMNode().value;
if (value.length >= this.props.minlength || value.length === 0) {
this.props.onChange(value);
}
}
});
module.exports = SearchBar; | Increase default debounce timeout to 300 ms | Increase default debounce timeout to 300 ms
| JSX | mit | meirwah/react-json-inspector,meirwah/react-json-inspector | ---
+++
@@ -5,7 +5,7 @@
getDefaultProps: function() {
return {
minlength: 2,
- timeout: 100,
+ timeout: 300,
onChange: function() {}
};
}, |
219e06070c1c85cc893e1fbfb889d7e6abaaeee6 | app/assets/javascripts/components/overview/my_exercises/components/Header.jsx | app/assets/javascripts/components/overview/my_exercises/components/Header.jsx | import React from 'react';
import PropTypes from 'prop-types';
import { NavLink } from 'react-router-dom';
export const Header = ({ completed = false, course, remaining = [], text }) => (
<header className="header">
<h3 className={completed ? 'completed' : ''}>
{ text }
{
remaining.length
? <small>{remaining.length} additional exercises remaining.</small>
: null
}
</h3>
<NavLink to={`../../${course.slug}/resources`} className="resources-link">
View all exercises
</NavLink>
</header>
);
Header.propTypes = {
course: PropTypes.shape({
slug: PropTypes.string.isRequired
}).isRequired,
remaining: PropTypes.array,
text: PropTypes.string.isRequired
};
export default Header;
| import React from 'react';
import PropTypes from 'prop-types';
import { NavLink } from 'react-router-dom';
export const Header = ({ completed = false, course, remaining = [], text }) => (
<header className="header">
<h3 className={completed ? 'completed' : ''}>
{ text }
{
remaining.length
? <small>{remaining.length} additional exercises remaining.</small>
: null
}
</h3>
<NavLink exact to={`/courses/${course.slug}/resources`} className="resources-link">
View all exercises
</NavLink>
</header>
);
Header.propTypes = {
course: PropTypes.shape({
slug: PropTypes.string.isRequired
}).isRequired,
remaining: PropTypes.array,
text: PropTypes.string.isRequired
};
export default Header;
| Change Exercise link to exact path | Change Exercise link to exact path
| JSX | mit | WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard | ---
+++
@@ -12,7 +12,7 @@
: null
}
</h3>
- <NavLink to={`../../${course.slug}/resources`} className="resources-link">
+ <NavLink exact to={`/courses/${course.slug}/resources`} className="resources-link">
View all exercises
</NavLink>
</header> |
e906677092ca2f38abd918436ea5967c096d555f | app/assets/javascripts/components/components/icon_button.jsx | app/assets/javascripts/components/components/icon_button.jsx | import PureRenderMixin from 'react-addons-pure-render-mixin';
const IconButton = React.createClass({
propTypes: {
title: React.PropTypes.string.isRequired,
icon: React.PropTypes.string.isRequired,
onClick: React.PropTypes.func.isRequired,
size: React.PropTypes.number,
active: React.PropTypes.bool
},
getDefaultProps () {
return {
size: 18,
active: false
};
},
mixins: [PureRenderMixin],
handleClick (e) {
e.preventDefault();
this.props.onClick();
},
render () {
return (
<a href='#' title={this.props.title} className={`icon-button ${this.props.active ? 'active' : ''}`} onClick={this.handleClick} style={{ display: 'inline-block', fontSize: `${this.props.size}px`, width: `${this.props.size}px`, height: `${this.props.size}px`, lineHeight: `${this.props.size}px`}}>
<i className={`fa fa-fw fa-${this.props.icon}`}></i>
</a>
);
}
});
export default IconButton;
| import PureRenderMixin from 'react-addons-pure-render-mixin';
const IconButton = React.createClass({
propTypes: {
title: React.PropTypes.string.isRequired,
icon: React.PropTypes.string.isRequired,
onClick: React.PropTypes.func.isRequired,
size: React.PropTypes.number,
active: React.PropTypes.bool
},
getDefaultProps () {
return {
size: 18,
active: false
};
},
mixins: [PureRenderMixin],
handleClick (e) {
e.preventDefault();
this.props.onClick();
e.stopPropagation();
},
render () {
return (
<a href='#' title={this.props.title} className={`icon-button ${this.props.active ? 'active' : ''}`} onClick={this.handleClick} style={{ display: 'inline-block', fontSize: `${this.props.size}px`, width: `${this.props.size}px`, height: `${this.props.size}px`, lineHeight: `${this.props.size}px`}}>
<i className={`fa fa-fw fa-${this.props.icon}`}></i>
</a>
);
}
});
export default IconButton;
| Stop event propagation after IconButton onClick | Stop event propagation after IconButton onClick | JSX | agpl-3.0 | riku6460/chikuwagoddon,hugogameiro/mastodon,WitchesTown/mastodon,imomix/mastodon,TheInventrix/mastodon,hugogameiro/mastodon,riku6460/chikuwagoddon,RobertRence/Mastodon,amazedkoumei/mastodon,cobodo/mastodon,theoria24/mastodon,h-izumi/mastodon,salvadorpla/mastodon,masarakki/mastodon,sinsoku/mastodon,WitchesTown/mastodon,corzntin/mastodon,ikuradon/mastodon,pointlessone/mastodon,mimumemo/mastodon,mosaxiv/mastodon,thnkrs/mastodon,Kyon0000/mastodon,kagucho/mastodon,rutan/mastodon,MitarashiDango/mastodon,clworld/mastodon,mhffdq/mastodon,foozmeat/mastodon,h3zjp/mastodon,amazedkoumei/mastodon,Arukas/mastodon,mecab/mastodon,tateisu/mastodon,NS-Kazuki/mastodon,thnkrs/mastodon,ambition-vietnam/mastodon,gol-cha/mastodon,honpya/taketodon,imas/mastodon,5thfloor/ichiji-social,pso2club/mastodon,sinsoku/mastodon,saggel/mastodon,rekif/mastodon,yukimochi/mastodon,ashfurrow/mastodon,hyuki0000/mastodon,abcang/mastodon,kirakiratter/mastodon,foozmeat/mastodon,glitch-soc/mastodon,alarky/mastodon,moeism/mastodon,mosaxiv/mastodon,palon7/mastodon,KnzkDev/mastodon,haleyashleypraesent/ProjectPrionosuchus,koba-lab/mastodon,h-izumi/mastodon,mhffdq/mastodon,ineffyble/mastodon,summoners-riftodon/mastodon,Monappy/mastodon,tri-star/mastodon,yi0713/mastodon,infinimatix/infinimatix.net,masarakki/mastodon,havicon/mastodon,yi0713/mastodon,salvadorpla/mastodon,3846masa/mastodon,mosaxiv/mastodon,blackle/mastodon,d6rkaiz/mastodon,kibousoft/mastodon,3846masa/mastodon,pixiv/mastodon,TheInventrix/mastodon,res-ac/mstdn.res.ac,clworld/mastodon,lynlynlynx/mastodon,tootcafe/mastodon,unarist/mastodon,NS-Kazuki/mastodon,5thfloor/ichiji-social,masto-donte-com-br/mastodon,ykzts/mastodon,danhunsaker/mastodon,imas/mastodon,masto-donte-com-br/mastodon,ambition-vietnam/mastodon,pfm-eyesightjp/mastodon,maa123/mastodon,HogeTatu/mastodon,hugogameiro/mastodon,RobertRence/Mastodon,yukimochi/mastodon,kibousoft/mastodon,robotstart/mastodon,cobodo/mastodon,Kirishima21/mastodon,5thfloor/ichiji-social,rekif/mastodon,verniy6462/mastodon,kazh98/social.arnip.org,pixiv/mastodon,koba-lab/mastodon,maa123/mastodon,ashfurrow/mastodon,res-ac/mstdn.res.ac,tootsuite/mastodon,PlantsNetwork/mastodon,MastodonCloud/mastodon,glitch-soc/mastodon,Monappy/mastodon,vahnj/mastodon,SerCom-KC/mastodon,librize/mastodon,YuyaYokosuka/mastodon_animeclub,mecab/mastodon,anon5r/mastonon,SerCom-KC/mastodon,blackle/mastodon,Nyoho/mastodon,riku6460/chikuwagoddon,pixiv/mastodon,robotstart/mastodon,lindwurm/mastodon,librize/mastodon,masarakki/mastodon,mimumemo/mastodon,lindwurm/mastodon,nclm/mastodon,Kirishima21/mastodon,cobodo/mastodon,corzntin/mastodon,MitarashiDango/mastodon,yukimochi/mastodon,librize/mastodon,tootcafe/mastodon,glitch-soc/mastodon,ms2sato/mastodon,abcang/mastodon,gol-cha/mastodon,im-in-space/mastodon,d6rkaiz/mastodon,nonoz/mastodon,nonoz/mastodon,Monappy/mastodon,tri-star/mastodon,esetomo/mastodon,dunn/mastodon,NS-Kazuki/mastodon,foozmeat/mastodon,Chronister/mastodon,nonoz/mastodon,anon5r/mastonon,unarist/mastodon,ykzts/mastodon,saggel/mastodon,clworld/mastodon,lynlynlynx/mastodon,imomix/mastodon,thnkrs/mastodon,res-ac/mstdn.res.ac,3846masa/mastodon,hugogameiro/mastodon,koteitan/googoldon,MastodonCloud/mastodon,developer-mstdn18/mstdn18,MastodonCloud/mastodon,increments/mastodon,mhffdq/mastodon,YuyaYokosuka/mastodon_animeclub,vahnj/mastodon,ebihara99999/mastodon,rainyday/mastodon,pinfort/mastodon,tootcafe/mastodon,foozmeat/mastodon,amazedkoumei/mastodon,sylph-sin-tyaku/mastodon,mstdn-jp/mastodon,Craftodon/Craftodon,vahnj/mastodon,rekif/mastodon,nonoz/mastodon,gol-cha/mastodon,Gargron/mastodon,pinfort/mastodon,Toootim/mastodon,masarakki/mastodon,rainyday/mastodon,summoners-riftodon/mastodon,lindwurm/mastodon,cybrespace/mastodon,Ryanaka/mastodon,mhffdq/mastodon,corzntin/mastodon,masto-donte-com-br/mastodon,ms2sato/mastodon,kirakiratter/mastodon,HogeTatu/mastodon,pfm-eyesightjp/mastodon,thor-the-norseman/mastodon,pointlessone/mastodon,jukper/mastodon,d6rkaiz/mastodon,Toootim/mastodon,primenumber/mastodon,increments/mastodon,TootCat/mastodon,theoria24/mastodon,musashino205/mastodon,danhunsaker/mastodon,mstdn-jp/mastodon,dunn/mastodon,infinimatix/infinimatix.net,tootcafe/mastodon,developer-mstdn18/mstdn18,hyuki0000/mastodon,Craftodon/Craftodon,dwango/mastodon,mecab/mastodon,verniy6462/mastodon,anon5r/mastonon,koteitan/googoldon,cybrespace/mastodon,kirakiratter/mastodon,KnzkDev/mastodon,pixiv/mastodon,sylph-sin-tyaku/mastodon,TootCat/mastodon,pfm-eyesightjp/mastodon,YuyaYokosuka/mastodon_animeclub,dwango/mastodon,pointlessone/mastodon,esetomo/mastodon,ykzts/mastodon,imomix/mastodon,ineffyble/mastodon,dwango/mastodon,Arukas/mastodon,mimumemo/mastodon,Gargron/mastodon,yi0713/mastodon,anon5r/mastonon,h3zjp/mastodon,hyuki0000/mastodon,pinfort/mastodon,WitchesTown/mastodon,unarist/mastodon,musashino205/mastodon,kagucho/mastodon,ikuradon/mastodon,koteitan/googoldon,alarky/mastodon,infinimatix/infinimatix.net,thor-the-norseman/mastodon,koteitan/googoldon,ebihara99999/mastodon,dunn/mastodon,RobertRence/Mastodon,glitch-soc/mastodon,Craftodon/Craftodon,blackle/mastodon,jukper/mastodon,palon7/mastodon,Nyoho/mastodon,8796n/mastodon,increments/mastodon,Kirishima21/mastodon,alarky/mastodon,kirakiratter/mastodon,KnzkDev/mastodon,primenumber/mastodon,verniy6462/mastodon,ms2sato/mastodon,dwango/mastodon,Kyon0000/mastodon,imas/mastodon,summoners-riftodon/mastodon,tateisu/mastodon,nclm/mastodon,8796n/mastodon,narabo/mastodon,narabo/mastodon,heropunch/mastodon-ce,salvadorpla/mastodon,robotstart/mastodon,im-in-space/mastodon,ambition-vietnam/mastodon,WitchesTown/mastodon,alimony/mastodon,Kirishima21/mastodon,kagucho/mastodon,Toootim/mastodon,hyuki0000/mastodon,mecab/mastodon,tri-star/mastodon,gol-cha/mastodon,mstdn-jp/mastodon,Craftodon/Craftodon,dissolve/mastodon,amazedkoumei/mastodon,saggel/mastodon,YuyaYokosuka/mastodon_animeclub,bureaucracy/mastodon,honpya/taketodon,palon7/mastodon,Kyon0000/mastodon,vahnj/mastodon,imas/mastodon,heropunch/mastodon-ce,h-izumi/mastodon,thor-the-norseman/mastodon,abcang/mastodon,havicon/mastodon,5thfloor/ichiji-social,alimony/mastodon,honpya/taketodon,tcitworld/mastodon,tcitworld/mastodon,h3zjp/mastodon,TootCat/mastodon,esetomo/mastodon,corzntin/mastodon,sinsoku/mastodon,PlantsNetwork/mastodon,ambition-vietnam/mastodon,kibousoft/mastodon,ashfurrow/mastodon,Chronister/mastodon,Nyoho/mastodon,Monappy/mastodon,alarky/mastodon,narabo/mastodon,d6rkaiz/mastodon,moeism/mastodon,tootsuite/mastodon,Arukas/mastodon,palon7/mastodon,Nyoho/mastodon,cybrespace/mastodon,honpya/taketodon,kazh98/social.arnip.org,rutan/mastodon,im-in-space/mastodon,pointlessone/mastodon,TheInventrix/mastodon,codl/mastodon,Chronister/mastodon,TheInventrix/mastodon,bureaucracy/mastodon,kagucho/mastodon,im-in-space/mastodon,tootsuite/mastodon,bureaucracy/mastodon,3846masa/mastodon,masto-donte-com-br/mastodon,kazh98/social.arnip.org,cybrespace/mastodon,clworld/mastodon,alimony/mastodon,codl/mastodon,HogeTatu/mastodon,dissolve/mastodon,Ryanaka/mastodon,ebihara99999/mastodon,ashfurrow/mastodon,developer-mstdn18/mstdn18,maa123/mastodon,pso2club/mastodon,MastodonCloud/mastodon,h-izumi/mastodon,Chronister/mastodon,primenumber/mastodon,PlantsNetwork/mastodon,ykzts/mastodon,codl/mastodon,res-ac/mstdn.res.ac,cobodo/mastodon,narabo/mastodon,sylph-sin-tyaku/mastodon,salvadorpla/mastodon,mstdn-jp/mastodon,SerCom-KC/mastodon,Toootim/mastodon,moeism/mastodon,ikuradon/mastodon,tateisu/mastodon,jukper/mastodon,TootCat/mastodon,mosaxiv/mastodon,Ryanaka/mastodon,Arukas/mastodon,TheInventrix/mastodon,abcang/mastodon,pfm-eyesightjp/mastodon,tootsuite/mastodon,lynlynlynx/mastodon,yi0713/mastodon,musashino205/mastodon,heropunch/mastodon-ce,sylph-sin-tyaku/mastodon,h3zjp/mastodon,unarist/mastodon,mimumemo/mastodon,haleyashleypraesent/ProjectPrionosuchus,danhunsaker/mastodon,primenumber/mastodon,haleyashleypraesent/ProjectPrionosuchus,KnzkDev/mastodon,rutan/mastodon,rutan/mastodon,MitarashiDango/mastodon,havicon/mastodon,Gargron/mastodon,SerCom-KC/mastodon,kibousoft/mastodon,theoria24/mastodon,theoria24/mastodon,riku6460/chikuwagoddon,rainyday/mastodon,summoners-riftodon/mastodon,dissolve/mastodon,tcitworld/mastodon,dunn/mastodon,haleyashleypraesent/ProjectPrionosuchus,tateisu/mastodon,ebihara99999/mastodon,ikuradon/mastodon,NS-Kazuki/mastodon,blackle/mastodon,rekif/mastodon,Ryanaka/mastodon,tri-star/mastodon,increments/mastodon,koba-lab/mastodon,imomix/mastodon,vahnj/mastodon,maa123/mastodon,koba-lab/mastodon,8796n/mastodon,pso2club/mastodon,MitarashiDango/mastodon,esetomo/mastodon,codl/mastodon,PlantsNetwork/mastodon,musashino205/mastodon,verniy6462/mastodon,danhunsaker/mastodon,lynlynlynx/mastodon,RobertRence/Mastodon,pinfort/mastodon,lindwurm/mastodon,pso2club/mastodon,nclm/mastodon,yukimochi/mastodon,ineffyble/mastodon,kazh98/social.arnip.org,rainyday/mastodon | ---
+++
@@ -22,6 +22,7 @@
handleClick (e) {
e.preventDefault();
this.props.onClick();
+ e.stopPropagation();
},
render () { |
d20d5218d25bd7b3c91d615d7c42d2bf90d70757 | plugins/plugin-site/src/components/ReportAProblem.jsx | plugins/plugin-site/src/components/ReportAProblem.jsx | import React from 'react';
import PropTypes from 'prop-types';
function ReportAProblem({reportProblemTitle, reportProblemUrl, reportProblemRelativeSourcePath}) {
const title = `Report a problem with ${reportProblemRelativeSourcePath}`;
const body = `Problem with the [${reportProblemTitle}](https://plugins.jenkins.io${reportProblemUrl}) page, [source file](https://github.com/jenkins-infra/plugin-site/tree/master/src/${reportProblemRelativeSourcePath})
TODO: Describe the expected and actual behavior here
%23%23 Screenshots
TODO: Add screenshots if possible
%23%23 Possible Solution
%3C!-- If you have suggestions on a fix for the bug, please describe it here. --%3E
N/A`.replace(/\n */g, '%0A');
const pluginSiteReportUrl = `https://github.com/jenkins-infra/plugin-site/issues/new?labels=bug&template=4-bug.md&title=${reportProblemTitle} page - TODO: Put a summary here&body=${body}`;
return !reportProblemTitle ? '' : (
<p className="box">
<a href={pluginSiteReportUrl} title={title}>
<ion-icon class="report" name="warning" />
Report a problem
</a>
</p>
);
}
ReportAProblem.propTypes = {
reportProblemTitle: PropTypes.string.isRequired,
reportProblemUrl: PropTypes.string.isRequired,
reportProblemRelativeSourcePath: PropTypes.string.isRequired
};
export default ReportAProblem;
| import React from 'react';
import PropTypes from 'prop-types';
function ReportAProblem({reportProblemTitle, reportProblemUrl, reportProblemRelativeSourcePath}) {
const title = `Report a problem with ${reportProblemRelativeSourcePath}`;
const body = `Problem with the [${reportProblemTitle}](https://plugins.jenkins.io${reportProblemUrl}) page, [source file](https://github.com/jenkins-infra/plugin-site/tree/master/src/${reportProblemRelativeSourcePath})
TODO: Describe the expected and actual behavior here
%23%23 Screenshots
TODO: Add screenshots if possible
%23%23 Possible Solution
%3C!-- If you have suggestions on a fix for the bug, please describe it here. --%3E
N/A`.replace(/\n */g, '%0A');
const pluginSiteReportUrl = `https://github.com/jenkins-infra/plugin-site/issues/new?labels=bug&template=4-bug.md&title=${reportProblemTitle} page - TODO: Put a summary here&body=${body}`;
return !reportProblemTitle ? '' : (
<p className="box">
<a href={pluginSiteReportUrl} title={title}>
<ion-icon class="report" name="warning" />
Report a problem
</a>
</p>
);
}
ReportAProblem.propTypes = {
reportProblemTitle: PropTypes.string,
reportProblemUrl: PropTypes.string,
reportProblemRelativeSourcePath: PropTypes.string
};
export default ReportAProblem;
| Mark properties as not required | Mark properties as not required
| JSX | mit | jenkins-infra/plugin-site | ---
+++
@@ -27,9 +27,9 @@
}
ReportAProblem.propTypes = {
- reportProblemTitle: PropTypes.string.isRequired,
- reportProblemUrl: PropTypes.string.isRequired,
- reportProblemRelativeSourcePath: PropTypes.string.isRequired
+ reportProblemTitle: PropTypes.string,
+ reportProblemUrl: PropTypes.string,
+ reportProblemRelativeSourcePath: PropTypes.string
};
export default ReportAProblem; |
b8a0d52d9721809006d91ec858a9f68bd8528619 | app/assets/javascripts/components/ui/accordion.js.jsx | app/assets/javascripts/components/ui/accordion.js.jsx | 'use strict'
const Icon = require('./icon.js.jsx')
const Accordion = React.createClass({
propTypes: {
title: React.PropTypes.string.isRequired,
},
getInitialState() {
return {
open: true
}
},
render() {
let content
let chevron
if (this.state.open) {
content = <div className="px3">{this.props.children}</div>
}
if (this.state.open) {
chevron = <Icon icon="chevron-up" />
} else {
chevron = <Icon icon="chevron-down" />
}
return (
<div>
<a className="pill block black black-hover pointer px3 py1 mb1 h5 mt0 mb0 bg-gray-5-hover" onClick={this.toggleOpen}>
<div className="right gray-2">{chevron}</div>
<strong>{this.props.title}</strong>
</a>
{content}
</div>
)
},
toggleOpen() {
this.setState({open: !this.state.open})
}
})
module.exports = window.Accordion = Accordion
| 'use strict'
import Icon from './icon.js.jsx'
const Accordion = React.createClass({
propTypes: {
title: React.PropTypes.string.isRequired,
},
getInitialState() {
return {
open: true
}
},
render() {
let content = null,
chevron = null
if (this.state.open) {
content = <div className="px3">{this.props.children}</div>
}
if (this.state.open) {
chevron = <Icon icon="angle-up" />
} else {
chevron = <Icon icon="angle-down" />
}
return (
<div>
<a className="pill block black black-hover pointer px3 py1 mb1 h5 mt0 mb0 visible-hover-wrapper" onClick={this.toggleOpen}>
<div className="visible-hover right gray-2">
{chevron}
</div>
{this.props.title}
</a>
{content}
</div>
)
},
toggleOpen() {
this.setState({open: !this.state.open})
}
})
export default Accordion
window.Accordion = Accordion
| Make the accordions less obnoxious | Make the accordions less obnoxious
| JSX | agpl-3.0 | assemblymade/meta,lachlanjc/meta,lachlanjc/meta,assemblymade/meta,assemblymade/meta,lachlanjc/meta,lachlanjc/meta,assemblymade/meta | ---
+++
@@ -1,6 +1,6 @@
'use strict'
-const Icon = require('./icon.js.jsx')
+import Icon from './icon.js.jsx'
const Accordion = React.createClass({
@@ -15,24 +15,26 @@
},
render() {
- let content
- let chevron
+ let content = null,
+ chevron = null
if (this.state.open) {
content = <div className="px3">{this.props.children}</div>
}
if (this.state.open) {
- chevron = <Icon icon="chevron-up" />
+ chevron = <Icon icon="angle-up" />
} else {
- chevron = <Icon icon="chevron-down" />
+ chevron = <Icon icon="angle-down" />
}
return (
<div>
- <a className="pill block black black-hover pointer px3 py1 mb1 h5 mt0 mb0 bg-gray-5-hover" onClick={this.toggleOpen}>
- <div className="right gray-2">{chevron}</div>
- <strong>{this.props.title}</strong>
+ <a className="pill block black black-hover pointer px3 py1 mb1 h5 mt0 mb0 visible-hover-wrapper" onClick={this.toggleOpen}>
+ <div className="visible-hover right gray-2">
+ {chevron}
+ </div>
+ {this.props.title}
</a>
{content}
</div>
@@ -44,4 +46,5 @@
}
})
-module.exports = window.Accordion = Accordion
+export default Accordion
+window.Accordion = Accordion |
31655d7f11954b3daacdbc4601cedd389b581d00 | src/components/overflow-menu/overflow-menu.jsx | src/components/overflow-menu/overflow-menu.jsx | /* eslint-disable react/jsx-no-bind */
import React, {useState} from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Dropdown from '../dropdown/dropdown.jsx';
import overflowIcon from './overflow-icon.svg';
import './overflow-menu.scss';
const OverflowMenu = ({children, dropdownAs, className}) => {
const [open, setOpen] = useState(false);
return (
<div className={classNames('overflow-menu-container', className)}>
<button
className="overflow-menu-trigger ignore-react-onclickoutside"
onClick={() => setOpen(!open)}
>
<img src={overflowIcon} />
</button>
{open && <Dropdown
isOpen
as={dropdownAs}
className="overflow-menu-dropdown"
onRequestClose={() => setOpen(false)}
>
{children}
</Dropdown>}
</div>
);
};
OverflowMenu.propTypes = {
children: PropTypes.node,
dropdownAs: PropTypes.string,
className: PropTypes.string
};
OverflowMenu.defaultProps = {
dropdownAs: 'ul'
};
export default OverflowMenu;
| /* eslint-disable react/jsx-no-bind */
import React, {useState} from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Dropdown from '../dropdown/dropdown.jsx';
import overflowIcon from './overflow-icon.svg';
import './overflow-menu.scss';
const OverflowMenu = ({children, dropdownAs, className}) => {
const [open, setOpen] = useState(false);
return (
<div className={classNames('overflow-menu-container', className)}>
<button
className={classNames('overflow-menu-trigger', {
'ignore-react-onclickoutside': open
})}
onClick={() => setOpen(!open)}
>
<img src={overflowIcon} />
</button>
{open && <Dropdown
isOpen
as={dropdownAs}
className="overflow-menu-dropdown"
onRequestClose={() => setOpen(false)}
>
{children}
</Dropdown>}
</div>
);
};
OverflowMenu.propTypes = {
children: PropTypes.node,
dropdownAs: PropTypes.string,
className: PropTypes.string
};
OverflowMenu.defaultProps = {
dropdownAs: 'ul'
};
export default OverflowMenu;
| Fix issue where multiple overflow menus could be opened at once | Fix issue where multiple overflow menus could be opened at once
| JSX | bsd-3-clause | LLK/scratch-www,LLK/scratch-www | ---
+++
@@ -13,7 +13,9 @@
return (
<div className={classNames('overflow-menu-container', className)}>
<button
- className="overflow-menu-trigger ignore-react-onclickoutside"
+ className={classNames('overflow-menu-trigger', {
+ 'ignore-react-onclickoutside': open
+ })}
onClick={() => setOpen(!open)}
>
<img src={overflowIcon} /> |
551a4ac89334941ab75ba911d2da299c9251acec | src/barchart/BarContainer.jsx | src/barchart/BarContainer.jsx | 'use strict';
const React = require('react');
const Bar = require('./Bar');
const shade = require('../utils').shade;
module.exports = React.createClass({
propTypes: {
fill: React.PropTypes.string,
onMouseOver: React.PropTypes.func,
onMouseLeave: React.PropTypes.func,
dataPoint: React.PropTypes.any, // TODO: prop types?
},
getDefaultProps() {
return {
fill: '#3182BD',
};
},
getInitialState() {
return {
// fill is named as fill instead of initialFill to avoid
// confusion when passing down props from top parent
fill: this.props.fill,
};
},
_animateBar() {
const rect = this.getDOMNode().getBoundingClientRect();
this.props.onMouseOver.call(this, rect.right, rect.top, this.props.dataPoint);
this.setState({
fill: shade(this.props.fill, 0.2),
});
},
_restoreBar() {
this.props.onMouseLeave.call(this);
this.setState({
fill: this.props.fill,
});
},
render() {
const props = this.props;
return (
<Bar
{...props}
fill={this.state.fill}
handleMouseOver={props.hoverAnimation ? this._animateBar : null}
handleMouseLeave={props.hoverAnimation ? this._restoreBar : null}
/>
);
},
});
| 'use strict';
const React = require('react');
const { findDOMNode } = require('react-dom');
const Bar = require('./Bar');
const shade = require('../utils').shade;
module.exports = React.createClass({
propTypes: {
fill: React.PropTypes.string,
onMouseOver: React.PropTypes.func,
onMouseLeave: React.PropTypes.func,
dataPoint: React.PropTypes.any, // TODO: prop types?
},
getDefaultProps() {
return {
fill: '#3182BD',
};
},
getInitialState() {
return {
// fill is named as fill instead of initialFill to avoid
// confusion when passing down props from top parent
fill: this.props.fill,
};
},
_animateBar() {
const rect = findDOMNode(this).getBoundingClientRect();
this.props.onMouseOver.call(this, rect.right, rect.top, this.props.dataPoint);
this.setState({
fill: shade(this.props.fill, 0.2),
});
},
_restoreBar() {
this.props.onMouseLeave.call(this);
this.setState({
fill: this.props.fill,
});
},
render() {
const props = this.props;
return (
<Bar
{...props}
fill={this.state.fill}
handleMouseOver={props.hoverAnimation ? this._animateBar : null}
handleMouseLeave={props.hoverAnimation ? this._restoreBar : null}
/>
);
},
});
| Make test pass by updating code to latest | Make test pass by updating code to latest
| JSX | mit | yang-wei/rd3 | ---
+++
@@ -1,6 +1,7 @@
'use strict';
const React = require('react');
+const { findDOMNode } = require('react-dom');
const Bar = require('./Bar');
const shade = require('../utils').shade;
@@ -29,7 +30,7 @@
},
_animateBar() {
- const rect = this.getDOMNode().getBoundingClientRect();
+ const rect = findDOMNode(this).getBoundingClientRect();
this.props.onMouseOver.call(this, rect.right, rect.top, this.props.dataPoint);
this.setState({
fill: shade(this.props.fill, 0.2), |
a8e3494a64450bc82d0bd331865a0a95fde5003d | client/src/components/App.jsx | client/src/components/App.jsx | export default class App extends React.Component () {
constructor(props) {
super(props);
}
render() {
return (
<div>Hello World!</div>
);
}
}
| export default class App extends React.Component () {
constructor(props) {
super(props);
}
render() {
return (
<div>Hello World!</div>
);
}
}
| Add react router and server middleware | Add react router and server middleware
| JSX | mit | folksy-squid/Picky-Notes,inspiredtolive/Picky-Notes,folksy-squid/Picky-Notes,inspiredtolive/Picky-Notes,derektliu/Picky-Notes,derektliu/Picky-Notes,derektliu/Picky-Notes,inspiredtolive/Picky-Notes,folksy-squid/Picky-Notes | ---
+++
@@ -8,4 +8,3 @@
);
}
}
- |
4679d5644be3598d2ad70a0398bec882d5ad782c | imports/ui/main-nav-bar.jsx | imports/ui/main-nav-bar.jsx | import React from 'react';
import { Navbar, Nav, NavItem } from 'react-bootstrap';
import { Link } from 'react-router';
export default class MainNavBar extends React.Component {
constructor(props, context) {
super(props, context);
this.isActive = this.isActive.bind(this);
}
isActive(view) {
return this.context.router.isActive(view);
}
render() {
return (
<Navbar>
<Navbar.Header>
<Navbar.Brand>
Blueprint
</Navbar.Brand>
</Navbar.Header>
<Nav>
<NavItem
active={this.isActive('structure-view')}
eventKey={'structure'}
>
<Link to="/structure-view">Structure View</Link>
</NavItem>
<NavItem
active={this.isActive('measure-view')}
eventKey={'measure'}
>
<Link to="measure-view">Measure View</Link>
</NavItem>
</Nav>
</Navbar>
);
}
}
MainNavBar.contextTypes = {
router: React.PropTypes.func.isRequired,
history: React.PropTypes.object.isRequired,
};
| import React from 'react';
import { Navbar, Nav, NavItem } from 'react-bootstrap';
import { Link } from 'react-router';
export default class MainNavBar extends React.Component {
constructor(props, context) {
super(props, context);
this.isActive = this.isActive.bind(this);
}
isActive(view) {
return this.context.router.isActive(view);
}
render() {
return (
<Navbar>
<Navbar.Header>
<Navbar.Brand>
Blueprint
</Navbar.Brand>
</Navbar.Header>
<Nav>
<NavItem
active={this.isActive('structure-view')}
eventKey={'structure'}
>
<Link to="/structure-view">Structure View</Link>
</NavItem>
<NavItem
active={this.isActive('measure-view')}
eventKey={'measure'}
>
<Link to="measure-view">Measure View</Link>
</NavItem>
</Nav>
</Navbar>
);
}
}
MainNavBar.contextTypes = {
router: React.PropTypes.object.isRequired,
};
| Fix wrong prop type validation in main nav bar | Fix wrong prop type validation in main nav bar
| JSX | mit | minden/data-furnace,minden/data-furnace | ---
+++
@@ -7,7 +7,6 @@
super(props, context);
this.isActive = this.isActive.bind(this);
}
-
isActive(view) {
return this.context.router.isActive(view);
@@ -41,6 +40,5 @@
}
MainNavBar.contextTypes = {
- router: React.PropTypes.func.isRequired,
- history: React.PropTypes.object.isRequired,
+ router: React.PropTypes.object.isRequired,
}; |
15c74d998b97f14c6a1817653e8ac48d290b9477 | src/containers/green-flag-overlay.jsx | src/containers/green-flag-overlay.jsx | import bindAll from 'lodash.bindall';
import React from 'react';
import PropTypes from 'prop-types';
import {connect} from 'react-redux';
import VM from 'scratch-vm';
import Box from '../components/box/box.jsx';
import greenFlag from '../components/green-flag/icon--green-flag.svg';
class GreenFlagOverlay extends React.Component {
constructor (props) {
super(props);
bindAll(this, [
'handleClick'
]);
}
handleClick () {
this.props.vm.start();
this.props.vm.greenFlag();
}
render () {
if (this.props.isStarted) return null;
return (
<Box
className={this.props.wrapperClass}
onClick={this.handleClick}
>
<div className={this.props.className}>
<img
draggable={false}
src={greenFlag}
/>
</div>
</Box>
);
}
}
GreenFlagOverlay.propTypes = {
className: PropTypes.string,
isStarted: PropTypes.bool,
vm: PropTypes.instanceOf(VM),
wrapperClass: PropTypes.string
};
const mapStateToProps = state => ({
isStarted: state.scratchGui.vmStatus.started,
vm: state.scratchGui.vm
});
const mapDispatchToProps = () => ({});
export default connect(
mapStateToProps,
mapDispatchToProps
)(GreenFlagOverlay);
| import bindAll from 'lodash.bindall';
import React from 'react';
import PropTypes from 'prop-types';
import {connect} from 'react-redux';
import VM from 'scratch-vm';
import Box from '../components/box/box.jsx';
import greenFlag from '../components/green-flag/icon--green-flag.svg';
class GreenFlagOverlay extends React.Component {
constructor (props) {
super(props);
bindAll(this, [
'handleClick'
]);
}
handleClick () {
this.props.vm.start();
this.props.vm.greenFlag();
}
render () {
return (
<Box
className={this.props.wrapperClass}
onClick={this.handleClick}
>
<div className={this.props.className}>
<img
draggable={false}
src={greenFlag}
/>
</div>
</Box>
);
}
}
GreenFlagOverlay.propTypes = {
className: PropTypes.string,
vm: PropTypes.instanceOf(VM),
wrapperClass: PropTypes.string
};
const mapStateToProps = state => ({
vm: state.scratchGui.vm
});
const mapDispatchToProps = () => ({});
export default connect(
mapStateToProps,
mapDispatchToProps
)(GreenFlagOverlay);
| Remove isStarted prop from GreenFlagOverlay | Remove isStarted prop from GreenFlagOverlay
Since #3885, the GreenFlagOverlay has been hidden by the Stage component
instead of having to hide itself if the project has been started. Thus
there's no need for GreenFlagOverlay to know whether the project has
been started.
| JSX | bsd-3-clause | LLK/scratch-gui,LLK/scratch-gui | ---
+++
@@ -21,8 +21,6 @@
}
render () {
- if (this.props.isStarted) return null;
-
return (
<Box
className={this.props.wrapperClass}
@@ -42,13 +40,11 @@
GreenFlagOverlay.propTypes = {
className: PropTypes.string,
- isStarted: PropTypes.bool,
vm: PropTypes.instanceOf(VM),
wrapperClass: PropTypes.string
};
const mapStateToProps = state => ({
- isStarted: state.scratchGui.vmStatus.started,
vm: state.scratchGui.vm
});
|
9b513ed7646014d2a73cdfc1829714306319e417 | src/js/gui/dialogs/addLayerDialog.jsx | src/js/gui/dialogs/addLayerDialog.jsx | import React from "react";
import { Button, TextInput } from "../guiComponents.jsx";
import PubSub from "../../event/pubSub.js";
import Events from "../../event/events.js";
export default class AddLayerDialog extends React.Component {
constructor(props) {
super(props);
this.state = { layerNameText: "" };
}
success(e) {
if (typeof e != "undefined") e.preventDefault();
PubSub.publish(Events.ADD_LAYER, this.state.layerNameText);
this.props.close();
}
abort() {
this.props.close();
}
onChange(e) {
this.setState({ layerNameText: e.target.value });
}
render() {
return (
<form onSubmit={ e => { this.success(e); } } onsubmit="return false">
<h2 className="primary">Add Layer</h2>
<TextInput name="layerName" label="Layer Name"
value={ this.state.layerNameText }
onChange={ this.onChange.bind(this) } />
<div className="actionButtonContainer">
<Button onClick={ () => this.abort() } text="Cancel" />
<Button onClick={ () => this.success() } text="Add" />
</div>
</form>
);
}
}
| import React from "react";
import { Button, TextInput } from "../guiComponents.jsx";
import PubSub from "../../event/pubSub.js";
import Events from "../../event/events.js";
export default class AddLayerDialog extends React.Component {
constructor(props) {
super(props);
this.state = { layerNameText: "" };
}
success(e) {
if (typeof e != "undefined") e.preventDefault();
PubSub.publish(Events.ADD_LAYER, this.state.layerNameText);
this.props.close();
}
abort() {
this.props.close();
}
onChange(e) {
this.setState({ layerNameText: e.target.value });
}
render() {
return (
<form onSubmit={ e => { this.success(e); } }>
<h2 className="primary">Add Layer</h2>
<TextInput name="layerName" label="Layer Name"
value={ this.state.layerNameText }
onChange={ this.onChange.bind(this) } />
<div className="actionButtonContainer">
<Button onClick={ () => this.abort() } text="Cancel" />
<Button onClick={ () => this.success() } text="Add" />
</div>
</form>
);
}
}
| Remove unnecessary onsubmit from add layer dialog | Remove unnecessary onsubmit from add layer dialog
| JSX | unknown | MagnonGames/DTile,theMagnon/DTile,MagnonGames/DTile,theMagnon/DTile,MagnonGames/DTile,theMagnon/DTile | ---
+++
@@ -29,7 +29,7 @@
render() {
return (
- <form onSubmit={ e => { this.success(e); } } onsubmit="return false">
+ <form onSubmit={ e => { this.success(e); } }>
<h2 className="primary">Add Layer</h2>
<TextInput name="layerName" label="Layer Name"
value={ this.state.layerNameText } |
42a3759cc05e83691be980209edf184e78cdd443 | src/renderer/modal/modalAutoUpdateDownloaded/view.jsx | src/renderer/modal/modalAutoUpdateDownloaded/view.jsx | import React from 'react';
import { ipcRenderer } from 'electron';
import { Modal } from 'modal/modal';
import Button from 'component/button';
class ModalAutoUpdateDownloaded extends React.PureComponent {
render() {
const { closeModal, declineAutoUpdate } = this.props;
return (
<Modal
isOpen
type="confirm"
contentLabel={__('Update Downloaded')}
confirmButtonLabel={__('Use it Now')}
abortButtonLabel={__('Upgrade on Close')}
onConfirmed={() => {
ipcRenderer.send('autoUpdateAccepted');
}}
onAborted={() => {
declineAutoUpdate();
ipcRenderer.send('autoUpdateDeclined');
closeModal();
}}
>
<section>
<h3 className="text-center">{__('LBRY Leveled Up')}</h3>
<p>
{__(
'A new version of LBRY has been released, downloaded, and is ready for you to use pending a restart.'
)}
</p>
<p className="meta text-center">
{__('Want to know what has changed?')} See the{' '}
<Button
button="link"
label={__('release notes')}
href="https://github.com/lbryio/lbry-desktop/releases"
/>.
</p>
</section>
</Modal>
);
}
}
export default ModalAutoUpdateDownloaded;
| // @flow
import React from 'react';
import { ipcRenderer } from 'electron';
import { Modal } from 'modal/modal';
import Button from 'component/button';
type Props = {
closeModal: any => any,
declineAutoUpdate: () => any,
};
class ModalAutoUpdateDownloaded extends React.PureComponent<Props> {
constructor(props: ModalProps) {
super(props);
this.state = {
disabled: false,
};
}
render() {
const { closeModal, declineAutoUpdate } = this.props;
return (
<Modal
isOpen
type="confirm"
contentLabel={__('Update Downloaded')}
confirmButtonLabel={__('Use it Now')}
abortButtonLabel={__('Upgrade on Close')}
confirmButtonDisabled={this.state.disabled}
onConfirmed={() => {
this.setState({ disabled: true });
ipcRenderer.send('autoUpdateAccepted');
}}
onAborted={() => {
declineAutoUpdate();
ipcRenderer.send('autoUpdateDeclined');
closeModal();
}}
>
<section>
<h3 className="text-center">{__('LBRY Leveled Up')}</h3>
<p>
{__(
'A new version of LBRY has been released, downloaded, and is ready for you to use pending a restart.'
)}
</p>
<p className="meta text-center">
{__('Want to know what has changed?')} See the{' '}
<Button
button="link"
label={__('release notes')}
href="https://github.com/lbryio/lbry-desktop/releases"
/>.
</p>
</section>
</Modal>
);
}
}
export default ModalAutoUpdateDownloaded;
| Disable confirm button after pressing "Use It Now" button | Disable confirm button after pressing "Use It Now" button
Closes #1823
| JSX | mit | lbryio/lbry-electron,lbryio/lbry-electron,lbryio/lbry-app,lbryio/lbry-app,lbryio/lbry-electron | ---
+++
@@ -1,9 +1,23 @@
+// @flow
import React from 'react';
import { ipcRenderer } from 'electron';
import { Modal } from 'modal/modal';
import Button from 'component/button';
-class ModalAutoUpdateDownloaded extends React.PureComponent {
+type Props = {
+ closeModal: any => any,
+ declineAutoUpdate: () => any,
+};
+
+class ModalAutoUpdateDownloaded extends React.PureComponent<Props> {
+ constructor(props: ModalProps) {
+ super(props);
+
+ this.state = {
+ disabled: false,
+ };
+ }
+
render() {
const { closeModal, declineAutoUpdate } = this.props;
@@ -14,7 +28,9 @@
contentLabel={__('Update Downloaded')}
confirmButtonLabel={__('Use it Now')}
abortButtonLabel={__('Upgrade on Close')}
+ confirmButtonDisabled={this.state.disabled}
onConfirmed={() => {
+ this.setState({ disabled: true });
ipcRenderer.send('autoUpdateAccepted');
}}
onAborted={() => { |
280dfce1a665fec82384a73d808c17bbf2acbc16 | app/client/components/layouts/main/MainHeader.jsx | app/client/components/layouts/main/MainHeader.jsx | Camino.MainHeader = React.createClass({
mixins: [ReactMeteorData],
getMeteorData() {
return {
currentUser: Meteor.user()
}
},
handleLogout() {
Meteor.logout();
},
render() {
let loginButton;
let { currentUser } = this.data;
if (currentUser) {
loginButton = (
<li><a href="#" onClick={this.handleLogout}>Logout</a></li>
)
} else {
loginButton = (
<li><a href="/login">Login</a></li>
)
}
return (
<nav className="navbar navbar-default">
<div className="container">
<div className="navbar-header">
<button type="button" className="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span className="sr-only">Toggle navigation</span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
</button>
<a className="navbar-brand" href="#">Camino</a>
</div>
<div className="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul className="nav navbar-nav navbar-right">
<li><a href="/">Home</a></li>
{loginButton}
</ul>
</div>
</div>
</nav>
)
}
});
| Camino.MainHeader = React.createClass({
mixins: [ReactMeteorData],
getMeteorData() {
return {
currentUser: Meteor.user()
};
},
handleLogout() {
Meteor.logout(() => {
FlowRouter.go('Login');
});
},
render() {
let logoutButton;
let { currentUser } = this.data;
if (currentUser) {
logoutButton = (
<li><a onClick={this.handleLogout}>Logout</a></li>
);
}
return (
<nav className="navbar navbar-default">
<div className="container">
{logoutButton}
</div>
</nav>
);
}
});
| Add redirect on log out and remove initial header | Add redirect on log out and remove initial header
| JSX | mit | fjaguero/camino,fjaguero/camino | ---
+++
@@ -3,46 +3,29 @@
getMeteorData() {
return {
currentUser: Meteor.user()
- }
+ };
},
handleLogout() {
- Meteor.logout();
+ Meteor.logout(() => {
+ FlowRouter.go('Login');
+ });
},
render() {
- let loginButton;
+ let logoutButton;
let { currentUser } = this.data;
if (currentUser) {
- loginButton = (
- <li><a href="#" onClick={this.handleLogout}>Logout</a></li>
- )
- } else {
- loginButton = (
- <li><a href="/login">Login</a></li>
- )
+ logoutButton = (
+ <li><a onClick={this.handleLogout}>Logout</a></li>
+ );
}
return (
<nav className="navbar navbar-default">
<div className="container">
- <div className="navbar-header">
- <button type="button" className="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
- <span className="sr-only">Toggle navigation</span>
- <span className="icon-bar"></span>
- <span className="icon-bar"></span>
- <span className="icon-bar"></span>
- </button>
- <a className="navbar-brand" href="#">Camino</a>
- </div>
-
- <div className="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
- <ul className="nav navbar-nav navbar-right">
- <li><a href="/">Home</a></li>
- {loginButton}
- </ul>
- </div>
+ {logoutButton}
</div>
</nav>
- )
+ );
}
}); |
67be61dc5def00c154874988f49c66171fd68fcd | webapp/src/components/molecules/highcharts/MapChart.jsx | webapp/src/components/molecules/highcharts/MapChart.jsx | import React from 'react'
import HighChart from 'components/molecules/highcharts/HighChart'
import format from 'utilities/format'
class MapChart extends HighChart {
setConfig () {
this.config = {
mapNavigation: {
enabled: true,
buttonOptions: {
verticalAlign: 'bottom'
}
},
colorAxis: {
min: 0
},
series: this.setSeries()
}
}
setSeries () {
const props = this.props
const current_indicator = this.props.selected_indicators[0]
return [{
data: this.props.datapoints.meta.chart_data,
mapData: {'features': this.props.features, 'type': 'FeatureCollection'},
joinBy: 'location_id',
name: current_indicator.name,
states: {
hover: {
color: '#BADA55'
}
},
tooltip: {
pointFormatter: function() {
return (
'<span> '+ props.locations_index[this.location_id].name
+ '<strong> '+ format.autoFormat(this.value, current_indicator.data_format) + ' </strong>'
+ '</span>'
)
}
}
}]
}
}
export default MapChart
| import React from 'react'
import HighChart from 'components/molecules/highcharts/HighChart'
import format from 'utilities/format'
class MapChart extends HighChart {
setConfig () {
this.config = {
mapNavigation: {
enabled: true,
enableMouseWheelZoom: false,
buttonOptions: {
verticalAlign: 'bottom'
}
},
colorAxis: {
min: 0
},
series: this.setSeries()
}
}
setSeries () {
const props = this.props
const current_indicator = this.props.selected_indicators[0]
return [{
data: this.props.datapoints.meta.chart_data,
mapData: {'features': this.props.features, 'type': 'FeatureCollection'},
joinBy: 'location_id',
name: current_indicator.name,
states: {
hover: {
color: '#BADA55'
}
},
tooltip: {
pointFormatter: function() {
return (
'<span> '+ props.locations_index[this.location_id].name
+ '<strong> '+ format.autoFormat(this.value, current_indicator.data_format) + ' </strong>'
+ '</span>'
)
}
}
}]
}
}
export default MapChart
| Disable map zoom on mouse scroll | Disable map zoom on mouse scroll
| JSX | agpl-3.0 | unicef/rhizome,unicef/rhizome,unicef/rhizome,unicef/rhizome | ---
+++
@@ -8,6 +8,7 @@
this.config = {
mapNavigation: {
enabled: true,
+ enableMouseWheelZoom: false,
buttonOptions: {
verticalAlign: 'bottom'
} |
398eb3a52a40c8018ac3eab8842e6e76f51128de | client/app/bundles/RentersRights/components/ReportIssue.jsx | client/app/bundles/RentersRights/components/ReportIssue.jsx | import React from 'react';
import RentersLayout from './RentersLayout'
export default class ReportIssue extends React.Component {
/* render() {
const { locale } = this.props;
<Renters Layout locale={locale}>
*/
render() {
const {} = this.props;
return (
<RentersLayout>
<div className="content-container language-paragraph">
<div className="page-header">
<h1>Report San JosΓ© Rental Issue(s)</h1>
</div>
<p>Contact the City of San JosΓ© Rental Rights and Referrals Program via <a href="mailto:[email protected]">email</a> or call <a href="tel:+4089754480">(408)975-4480</a>.</p>
</div>
</RentersLayout>
)
}
}
| import React from 'react';
import RentersLayout from './RentersLayout'
export default class ReportIssue extends React.Component {
/* render() {
const { locale } = this.props;
<Renters Layout locale={locale}>
*/
render() {
const {} = this.props;
return (
<RentersLayout>
<div className="content-container language-paragraph">
<div className="page-header">
<h1>Report San JosΓ© Rental Issue(s)</h1>
</div>
<p>Contact the City of San JosΓ© Rental Rights and Referrals Program via <a href="mailto:[email protected]">email</a> or call <a href="tel:+4089754480">(408)975-4480</a>.</p>
</div>
</RentersLayout>
)
}
}
| Add function for parsing .tsv file | Add function for parsing .tsv file
| JSX | mit | codeforsanjose/renters-rights,codeforsanjose/renters-rights,codeforsanjose/renters-rights | ---
+++
@@ -7,11 +7,11 @@
const { locale } = this.props;
<Renters Layout locale={locale}>
- */
+ */
render() {
-
+
const {} = this.props;
-
+
return (
<RentersLayout>
<div className="content-container language-paragraph"> |
30807c362ad0d55de403b647123ae38ea110f39a | app/assets/javascripts/components/ajax_checkbox.js.jsx | app/assets/javascripts/components/ajax_checkbox.js.jsx | var AjaxCheckbox = React.createClass({
getInitialState: function() {
return {state: "default", checked: this.props.checked}
},
success: function() {
this.setState({state: "default", checked: !this.state.checked});
},
error: function(data) {
console.error("ERROR DURING AJAX: " + data.responseText);
this.setState({state: "error"});
},
handleClick: function() {
if($(this.refs.checkbox.getDOMNode()).is(":checked")) {
createReview(this.props.reviewer_id, this.props.reviewee_id,this.success, this.error);
} else {
destroyReview(this.props.reviewer_id, this.props.reviewee_id, this.success, this.error);
}
this.setState({state: "loading"});
},
render: function() {
if(this.state.state == "error") {
return ( <span>!</span> );
}
if(this.state.state == "loading") {
return ( <img src="/small_spinner.gif" /> );
}
return (
<div className="label-combo">
<input type="checkbox" ref="checkbox" onChange={this.handleClick} checked={this.state.checked}></input>
<label>{this.props.label}</label>
</div>
)
}
});
| var AjaxCheckbox = React.createClass({
getInitialState: function() {
return {state: "default", checked: this.props.checked}
},
success: function() {
this.setState({state: "default", checked: !this.state.checked});
},
error: function(data) {
console.error("ERROR DURING AJAX: " + data.responseText);
this.setState({state: "error"});
},
handleClick: function() {
if($(ReactDOM.findDOMNode(this.refs.checkbox)).is(":checked")) {
createReview(this.props.reviewer_id, this.props.reviewee_id,this.success, this.error);
} else {
destroyReview(this.props.reviewer_id, this.props.reviewee_id, this.success, this.error);
}
this.setState({state: "loading"});
},
render: function() {
if(this.state.state == "error") {
return ( <span>!</span> );
}
if(this.state.state == "loading") {
return ( <img src="/small_spinner.gif" /> );
}
return (
<div className="label-combo">
<input type="checkbox" ref="checkbox" onChange={this.handleClick} checked={this.state.checked}></input>
<label>{this.props.label}</label>
</div>
)
}
});
| Fix ajax checkbox to use newer ReactDOM function. | Fix ajax checkbox to use newer ReactDOM function.
| JSX | mit | nilenso/reviews,nilenso/reviews,nilenso/reviews | ---
+++
@@ -13,7 +13,7 @@
},
handleClick: function() {
- if($(this.refs.checkbox.getDOMNode()).is(":checked")) {
+ if($(ReactDOM.findDOMNode(this.refs.checkbox)).is(":checked")) {
createReview(this.props.reviewer_id, this.props.reviewee_id,this.success, this.error);
} else {
destroyReview(this.props.reviewer_id, this.props.reviewee_id, this.success, this.error); |
60b8c7a448cdf17677ae9383e4c0dcc7fb6fcbe1 | app/scripts/components/Root/index.jsx | app/scripts/components/Root/index.jsx | import React from 'react';
import WelcomeModal from '../Modal/WelcomeModal';
class Root extends React.Component {
constructor() {
super();
this.state = {
modalWelcomeOpen: false
};
}
componentDidMount() {
if (sessionStorage.getItem('modalWelcomeOpened') === false ||
sessionStorage.getItem('modalWelcomeOpened') === null) {
this.setState({ modalWelcomeOpen: true });
}
}
render() {
return (
<div style={{height: '100%'}}>
{this.props.children}
{this.state.modalWelcomeOpen &&
<WelcomeModal
title={"Welcome to Partnership for Resilience & Preparedness Beta Platform"}
opened={this.state.modalWelcomeOpen}
close={() => {
this.setState({modalWelcomeOpen: false});
localStorage.setItem('modalWelcomeOpened', JSON.stringify(true));
}
}
hideCloseButton
/>
}
</div>
);
}
}
export default Root;
| import React from 'react';
import WelcomeModal from '../Modal/WelcomeModal';
class Root extends React.Component {
constructor() {
super();
this.state = {
modalWelcomeOpen: false
};
}
componentDidMount() {
if (sessionStorage.getItem('modalWelcomeOpened') === false ||
sessionStorage.getItem('modalWelcomeOpened') === null) {
this.setModalWelcome();
}
}
setModalWelcome() {
if (this.props.location.pathname.indexOf('embed') === -1) {
this.setState({ modalWelcomeOpen: true });
}
}
render() {
return (
<div style={{ height: '100%' }}>
{this.props.children}
{this.state.modalWelcomeOpen &&
<WelcomeModal
title={"Welcome to Partnership for Resilience & Preparedness Beta Platform"}
opened={this.state.modalWelcomeOpen}
close={() => {
this.setState({ modalWelcomeOpen: false });
localStorage.setItem('modalWelcomeOpened', JSON.stringify(true));
}
}
hideCloseButton
/>
}
</div>
);
}
}
export default Root;
| Hide beta modal in embed page | Hide beta modal in embed page
| JSX | mit | resource-watch/prep-app,resource-watch/prep-app | ---
+++
@@ -13,26 +13,32 @@
componentDidMount() {
if (sessionStorage.getItem('modalWelcomeOpened') === false ||
sessionStorage.getItem('modalWelcomeOpened') === null) {
+ this.setModalWelcome();
+ }
+ }
+
+ setModalWelcome() {
+ if (this.props.location.pathname.indexOf('embed') === -1) {
this.setState({ modalWelcomeOpen: true });
}
}
render() {
return (
- <div style={{height: '100%'}}>
+ <div style={{ height: '100%' }}>
{this.props.children}
{this.state.modalWelcomeOpen &&
- <WelcomeModal
- title={"Welcome to Partnership for Resilience & Preparedness Beta Platform"}
- opened={this.state.modalWelcomeOpen}
- close={() => {
- this.setState({modalWelcomeOpen: false});
- localStorage.setItem('modalWelcomeOpened', JSON.stringify(true));
- }
- }
- hideCloseButton
- />
+ <WelcomeModal
+ title={"Welcome to Partnership for Resilience & Preparedness Beta Platform"}
+ opened={this.state.modalWelcomeOpen}
+ close={() => {
+ this.setState({ modalWelcomeOpen: false });
+ localStorage.setItem('modalWelcomeOpened', JSON.stringify(true));
+ }
+ }
+ hideCloseButton
+ />
}
</div>
); |
816b4203ee689e7e126d4e7037c68295ace8db46 | src/components/SearchBar/SearchBarContainer.jsx | src/components/SearchBar/SearchBarContainer.jsx | import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import SearchBar from './SearchBar'
import * as Actions from '../../actions'
function mapStateToProps(state) {
return {
value: state.filter.query
}
}
function mapDispatchToProps(dispatch) {
return {
onChange(query) {
dispatch(Actions.filterQuery(query))
}
}
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(SearchBar)
| import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import SearchBar from './SearchBar'
import * as Actions from '../../actions'
function mapStateToProps(state) {
return {
value: state.filter.query
}
}
function mapDispatchToProps(dispatch) {
return {
onChange(evt) {
dispatch(Actions.filterQuery(evt.target.value))
}
}
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(SearchBar)
| Fix SearchBar output incorrect object instead of an input text | Fix SearchBar output incorrect object instead of an input text
| JSX | mit | rickychien/comiz,rickychien/comiz | ---
+++
@@ -13,8 +13,8 @@
function mapDispatchToProps(dispatch) {
return {
- onChange(query) {
- dispatch(Actions.filterQuery(query))
+ onChange(evt) {
+ dispatch(Actions.filterQuery(evt.target.value))
}
}
} |
f6d08547fd7099e6691fe70813b7efe84566ae31 | src/store.jsx | src/store.jsx | import { createStore } from 'redux'
import rootReducer from './reducers'
let store = createStore(rootReducer)
export default store
| import { createStore, compose } from 'redux'
import rootReducer from './reducers'
const initialState = {}
const middleware = compose(
window.devToolsExtension && window.devToolsExtension()
)
let store = createStore(rootReducer, initialState, middleware)
export default store
| Add hooks for Redux DevTools Extension | Add hooks for Redux DevTools Extension
| JSX | mit | OddEssay/react-seed,OddEssay/react-seed | ---
+++
@@ -1,6 +1,12 @@
-import { createStore } from 'redux'
+import { createStore, compose } from 'redux'
import rootReducer from './reducers'
-let store = createStore(rootReducer)
+const initialState = {}
+
+const middleware = compose(
+ window.devToolsExtension && window.devToolsExtension()
+)
+
+let store = createStore(rootReducer, initialState, middleware)
export default store |
ba6c7088285d3fcb5e9d5e30a57eaa57276153ef | specs/components/Form.spec.jsx | specs/components/Form.spec.jsx | import React from "react";
import loremIpsum from "lorem-ipsum";
import Form from "../../src/components/Form";
import Field from "../../src/components/Field";
import TextInput from "../../src/components/TextInput";
describe("Form", function() {
this.header(`## Form`); // Markdown.
before(() => {
function handleSubmit(submitData) {
console.log("submitData", submitData);
}
// Runs when the Suite loads. Use this to host your component-under-test.
this.load(
<Form onSubmit={handleSubmit}>
<Field
fieldKey={"firstName"}
label={"First Name"}
required={true}
>
<TextInput placeholder={"Fred"} />
</Field>
<Field
fieldKey={"lastName"}
label={"Last Name"}
required={true}
>
<TextInput placeholder={"Jones"} />
</Field>
</Form>
).width("100%");
});
/**
* Documentation (Markdown)
*/
this.footer(`
### Form
A Form Element
#### API
- **onSubmit** *React.PropTypes.func* (optional) called when Form has been submitted
`);
});
| import React from "react";
import loremIpsum from "lorem-ipsum";
import Form from "../../src/components/Form";
import Field from "../../src/components/Field";
import EmailInput from "../../src/components/EmailInput";
import PasswordInput from "../../src/components/PasswordInput";
describe("Form", function() {
this.header(`## Form`); // Markdown.
before(() => {
function handleSubmit(submitData) {
console.log("submitData", submitData);
}
// Runs when the Suite loads. Use this to host your component-under-test.
this.load(
<Form onSubmit={handleSubmit}>
<Field
fieldKey={"email"}
label={"Email"}
required={true}
>
<EmailInput placeholder={"[email protected]"} />
</Field>
<Field
fieldKey={"password"}
label={"Password"}
required={true}
>
<PasswordInput placeholder={"password"} />
</Field>
</Form>
).width("100%");
});
/**
* Documentation (Markdown)
*/
this.footer(`
### Form
A Form Element
#### API
- **onSubmit** *React.PropTypes.func* (optional) called when Form has been submitted
`);
});
| Use email and password in the form example | Use email and password in the form example
| JSX | mit | signal/sprinkles-ui,signal/sprinkles-ui | ---
+++
@@ -2,7 +2,8 @@
import loremIpsum from "lorem-ipsum";
import Form from "../../src/components/Form";
import Field from "../../src/components/Field";
-import TextInput from "../../src/components/TextInput";
+import EmailInput from "../../src/components/EmailInput";
+import PasswordInput from "../../src/components/PasswordInput";
describe("Form", function() {
this.header(`## Form`); // Markdown.
@@ -15,18 +16,18 @@
this.load(
<Form onSubmit={handleSubmit}>
<Field
- fieldKey={"firstName"}
- label={"First Name"}
+ fieldKey={"email"}
+ label={"Email"}
required={true}
>
- <TextInput placeholder={"Fred"} />
+ <EmailInput placeholder={"[email protected]"} />
</Field>
<Field
- fieldKey={"lastName"}
- label={"Last Name"}
+ fieldKey={"password"}
+ label={"Password"}
required={true}
>
- <TextInput placeholder={"Jones"} />
+ <PasswordInput placeholder={"password"} />
</Field>
</Form>
).width("100%"); |
9d0ee3ddaa61d65ae74ce7b4ea20600ea979caba | app/scripts/components/Dashboards/DashboardDetailTools.jsx | app/scripts/components/Dashboards/DashboardDetailTools.jsx | import React from 'react';
import Card from '../Cards/Card';
function DashboardDetailTools(props) {
return (
props.data.length
? <div className="row align-stretch">
{props.data.map((card, index) => (
<div
className="columns small-12 medium-6"
key={`tool-card-${index}`}
style={{ display: 'flex' }}
>
<Card border="neutral">
<h3>
<a target="_blank" href={card.url}>
{card.title}
</a>
</h3>
<p>
{card.summary}
</p>
{card.attribution &&
<span className="attribution">{card.attribution}</span>
}
</Card>
</div>
))}
</div>
: <div className="c-article">
<div className="row align-center">
<div className="column small-12 medium-8">
<p>There are no tools associated with this dashboard yet.</p>
</div>
</div>
</div>
);
}
DashboardDetailTools.propTypes = {
/**
* Define dashboard indicators data
*/
data: React.PropTypes.any.isRequired
};
export default DashboardDetailTools;
| import React from 'react';
import Card from '../Cards/Card';
function DashboardDetailTools(props) {
return (
props.data.length
? <div className="row align-stretch">
{props.data.map((card, index) => (
<div
className="columns small-12 medium-6"
key={`tool-card-${index}`}
style={{ display: 'flex' }}
>
<Card border="neutral">
<h3>
<a target="_blank" href={card.url}>
{card.title}
</a>
</h3>
<p>
{card.summary}
</p>
{card.partner &&
<a target="_blank" href={card.partner.href}>
<img
src={config.apiUrl + card.partner.images.logo}
className="logo"
alt={card.partner.name}
/>
</a>
}
{card.attribution &&
<span className="attribution">{card.attribution}</span>
}
</Card>
</div>
))}
</div>
: <div className="c-article">
<div className="row align-center">
<div className="column small-12 medium-8">
<p>There are no tools associated with this dashboard yet.</p>
</div>
</div>
</div>
);
}
DashboardDetailTools.propTypes = {
/**
* Define dashboard indicators data
*/
data: React.PropTypes.any.isRequired
};
export default DashboardDetailTools;
| Add partner logo in tools card | Add partner logo in tools card
| JSX | mit | resource-watch/prep-app,resource-watch/prep-app | ---
+++
@@ -21,6 +21,15 @@
{card.summary}
</p>
+ {card.partner &&
+ <a target="_blank" href={card.partner.href}>
+ <img
+ src={config.apiUrl + card.partner.images.logo}
+ className="logo"
+ alt={card.partner.name}
+ />
+ </a>
+ }
{card.attribution &&
<span className="attribution">{card.attribution}</span>
} |
be49e209bbb7b28b1e51e8725fb65620241842c7 | src/components/video/video.jsx | src/components/video/video.jsx | const PropTypes = require('prop-types');
const React = require('react');
const classNames = require('classnames');
require('./video.scss');
const Video = props => (
<div className={classNames('video-player', props.className)}>
<iframe
allowFullScreen
// allowFullScreen is legacy, can we start using allow='fullscreen'?
// allow="fullscreen"
frameBorder="0" // deprecated attribute
height={props.height}
scrolling="no" // deprecated attribute
src={props.isYouTube ?
`https://www.youtube.com/embed/${props.videoId}?autoplay=1` :
`https://fast.wistia.net/embed/iframe/${props.videoId}?seo=false&videoFoam=true`
}
title={props.title}
width={props.width}
/>
<script
async
src="https://fast.wistia.net/assets/external/E-v1.js"
/>
</div>
);
Video.defaultProps = {
height: '225',
isYouTube: false,
title: '',
width: '400'
};
Video.propTypes = {
className: PropTypes.string,
height: PropTypes.string.isRequired,
isYouTube: PropTypes.bool,
title: PropTypes.string.isRequired,
videoId: PropTypes.string.isRequired,
width: PropTypes.string.isRequired
};
module.exports = Video;
| const PropTypes = require('prop-types');
const React = require('react');
const classNames = require('classnames');
require('./video.scss');
const Video = props => (
<div className={classNames('video-player', props.className)}>
<iframe
allowFullScreen
// allowFullScreen is legacy, can we start using allow='fullscreen'?
// allow="fullscreen"
frameBorder="0" // deprecated attribute
height={props.height}
scrolling="no" // deprecated attribute
src={`https://fast.wistia.net/embed/iframe/${props.videoId}?seo=false&videoFoam=true`}
title={props.title}
width={props.width}
/>
<script
async
src="https://fast.wistia.net/assets/external/E-v1.js"
/>
</div>
);
Video.defaultProps = {
height: '225',
title: '',
width: '400'
};
Video.propTypes = {
className: PropTypes.string,
height: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
videoId: PropTypes.string.isRequired,
width: PropTypes.string.isRequired
};
module.exports = Video;
| Revert "Add ability to display YouTube in addition to Wistia" | Revert "Add ability to display YouTube in addition to Wistia"
This reverts commit 8d758f0420b967aa5d3f9e9c14b9f9201c2702a6.
| JSX | bsd-3-clause | LLK/scratch-www,LLK/scratch-www | ---
+++
@@ -13,10 +13,7 @@
frameBorder="0" // deprecated attribute
height={props.height}
scrolling="no" // deprecated attribute
- src={props.isYouTube ?
- `https://www.youtube.com/embed/${props.videoId}?autoplay=1` :
- `https://fast.wistia.net/embed/iframe/${props.videoId}?seo=false&videoFoam=true`
- }
+ src={`https://fast.wistia.net/embed/iframe/${props.videoId}?seo=false&videoFoam=true`}
title={props.title}
width={props.width}
/>
@@ -28,7 +25,6 @@
);
Video.defaultProps = {
height: '225',
- isYouTube: false,
title: '',
width: '400'
};
@@ -36,7 +32,6 @@
Video.propTypes = {
className: PropTypes.string,
height: PropTypes.string.isRequired,
- isYouTube: PropTypes.bool,
title: PropTypes.string.isRequired,
videoId: PropTypes.string.isRequired,
width: PropTypes.string.isRequired |
d63c03078ac440cf44f3cd980fe42eb055aa0ad6 | src/elements/Button/Button.jsx | src/elements/Button/Button.jsx | import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
const Button = ({ children, type, strong=false, ...rest }) => {
const classNames = classnames('button', typeClass(type), modeClass(strong));
return (
<button className={classNames} {...rest}>
{children}
</button>
);
};
const modeClass = (strong) => {
if (!strong) {
return 'is-outlined';
}
};
const typeClass = (type) => {
if (type) {
return `is-${type}`;
}
}
Button.propTypes = {
type: PropTypes.oneOf(['primary', 'link', 'info', 'success', 'warning', 'danger']),
strong: PropTypes.bool,
};
export default Button;
| import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
const Button = ({ children, type, strong=false, ...rest }) => {
const classNames = classnames('button', typeClass(type), modeClass(strong));
return (
<button className={classNames} {...rest}>
{children}
</button>
);
};
const modeClass = (strong) => {
if (!strong) {
return 'is-outlined';
}
};
const typeClass = (type) => {
if (type) {
return `is-${type}`;
}
}
Button.propTypes = {
type: PropTypes.oneOf(['primary', 'link', 'info', 'success', 'warning', 'danger', 'white']),
strong: PropTypes.bool,
};
export default Button;
| Add 'white' type to button | Add 'white' type to button
This feature is important for rendering buttons components inside
colored background components.
| JSX | apache-2.0 | nwsapps/flashcards,nwsapps/flashcards | ---
+++
@@ -27,7 +27,7 @@
}
Button.propTypes = {
- type: PropTypes.oneOf(['primary', 'link', 'info', 'success', 'warning', 'danger']),
+ type: PropTypes.oneOf(['primary', 'link', 'info', 'success', 'warning', 'danger', 'white']),
strong: PropTypes.bool,
};
|
3909310f1e092577aaf089fcb1e58052aa19bacd | src/pages/Home.jsx | src/pages/Home.jsx | import React from 'react'
import CSSModules from 'react-css-modules'
/* Containers */
import LatestEvent from 'containers/LatestEvent'
import Blurb from 'containers/Blurb'
import Navbar from 'containers/Navbar'
import Highlights from 'containers/Highlights'
/* Components */
import Cover from 'components/Cover'
import Footer from 'components/Footer'
import imgsrc from 'assets/images/home-parallax.png'
import styles from 'assets/styles/home'
// TODO: add line breaks for txt files.
class Home extends React.Component {
render() {
const imageStyle = {
backgroundImage: 'url(' + imgsrc + ')'
}
return (
<div style={ imageStyle } styleName="image">
<Cover />
<Navbar home />
<Blurb />
<LatestEvent />
<Highlights />
<div styleName="parallax" />
<Footer />
</div>
)
}
}
export default CSSModules(Home, styles)
| import React from 'react'
import CSSModules from 'react-css-modules'
/* Containers */
import LatestEvent from 'containers/LatestEvent'
import Blurb from 'containers/Blurb'
import Navbar from 'containers/Navbar'
import Highlights from 'containers/Highlights'
import FooterCard from 'containers/FooterCard'
/* Components */
import Cover from 'components/Cover'
import Footer from 'components/Footer'
/* Assets */
import imgsrc from 'assets/images/home-parallax.png'
import styles from 'assets/styles/home'
// TODO: add line breaks for txt files.
class Home extends React.Component {
render() {
const imageStyle = {
backgroundImage: 'url(' + imgsrc + ')'
}
return (
<div style={ imageStyle } styleName="image">
<Cover />
<Navbar home />
<Blurb />
<LatestEvent />
<Highlights />
<div styleName="parallax" />
<FooterCard />
<Footer />
</div>
)
}
}
export default CSSModules(Home, styles)
| Put footercard in home page. | Put footercard in home page.
| JSX | mit | sunyang713/sabor-website,sunyang713/sabor-website | ---
+++
@@ -6,11 +6,13 @@
import Blurb from 'containers/Blurb'
import Navbar from 'containers/Navbar'
import Highlights from 'containers/Highlights'
+import FooterCard from 'containers/FooterCard'
/* Components */
import Cover from 'components/Cover'
import Footer from 'components/Footer'
+/* Assets */
import imgsrc from 'assets/images/home-parallax.png'
import styles from 'assets/styles/home'
@@ -29,6 +31,7 @@
<LatestEvent />
<Highlights />
<div styleName="parallax" />
+ <FooterCard />
<Footer />
</div>
) |
12a3d7c71f1288e312051a882d7ed5b6c1d9df71 | client/components/InstanceTabs/index.jsx | client/components/InstanceTabs/index.jsx | 'use strict';
import React from 'react';
import action from '../../actions';
import store from '../../store';
import { Tab, Tabs } from './draggable-tab';
class InstanceTabs extends React.Component {
render() {
return <Tabs style={ { display: this.props.instances.count() === 1 ? 'none' : 'block' } }
onTabAddButtonClick={() =>
store.dispatch(action('addInstance'))
}
onTabSelect={(key) =>
store.dispatch(action('selectInstance', key))
}
onTabClose={(key) =>
store.dispatch(action('delInstance', key))
}
onTabPositionChange={(from, to) =>
store.dispatch(action('moveInstance', { from, to }))
}
selectedTab={ this.props.activeInstanceKey }
tabs={
this.props.instances.map(instance => {
return (<Tab key={instance.get('key')} title={instance.get('host')} ></Tab>);
}).toJS()
}
/>;
}
}
export default InstanceTabs;
| 'use strict';
import React from 'react';
import action from '../../actions';
import store from '../../store';
import { Tab, Tabs } from './draggable-tab';
class InstanceTabs extends React.Component {
render() {
return <div style={ { display: this.props.instances.count() === 1 ? 'none' : 'block' } }>
<Tabs
onTabAddButtonClick={() =>
store.dispatch(action('addInstance'))
}
onTabSelect={(key) =>
store.dispatch(action('selectInstance', key))
}
onTabClose={(key) =>
store.dispatch(action('delInstance', key))
}
onTabPositionChange={(from, to) =>
store.dispatch(action('moveInstance', { from, to }))
}
selectedTab={ this.props.activeInstanceKey }
tabs={
this.props.instances.map(instance => {
return (<Tab key={instance.get('key')} title={instance.get('host')} ></Tab>);
}).toJS()
}
/>
</div>;
}
}
export default InstanceTabs;
| Hide the tabar when there's only on instance | Hide the tabar when there's only on instance
| JSX | mit | luin/medis,luin/medis | ---
+++
@@ -7,26 +7,28 @@
class InstanceTabs extends React.Component {
render() {
- return <Tabs style={ { display: this.props.instances.count() === 1 ? 'none' : 'block' } }
- onTabAddButtonClick={() =>
- store.dispatch(action('addInstance'))
- }
- onTabSelect={(key) =>
- store.dispatch(action('selectInstance', key))
- }
- onTabClose={(key) =>
- store.dispatch(action('delInstance', key))
- }
- onTabPositionChange={(from, to) =>
- store.dispatch(action('moveInstance', { from, to }))
- }
- selectedTab={ this.props.activeInstanceKey }
- tabs={
- this.props.instances.map(instance => {
- return (<Tab key={instance.get('key')} title={instance.get('host')} ></Tab>);
- }).toJS()
- }
- />;
+ return <div style={ { display: this.props.instances.count() === 1 ? 'none' : 'block' } }>
+ <Tabs
+ onTabAddButtonClick={() =>
+ store.dispatch(action('addInstance'))
+ }
+ onTabSelect={(key) =>
+ store.dispatch(action('selectInstance', key))
+ }
+ onTabClose={(key) =>
+ store.dispatch(action('delInstance', key))
+ }
+ onTabPositionChange={(from, to) =>
+ store.dispatch(action('moveInstance', { from, to }))
+ }
+ selectedTab={ this.props.activeInstanceKey }
+ tabs={
+ this.props.instances.map(instance => {
+ return (<Tab key={instance.get('key')} title={instance.get('host')} ></Tab>);
+ }).toJS()
+ }
+ />
+ </div>;
}
}
|
86358e1b717f707f6a255ab9926f841b0bffdbb8 | client/components/main-layout/NavBar.jsx | client/components/main-layout/NavBar.jsx | import React from 'react';
import ReactDom from 'react-dom';
import { Link } from 'react-router';
export default class NavBar extends React.Component {
render() {
return (
<div className="nav-bar">
<div className="pure-menu-heading">
<Link className="home-link" to="/">Sentimize</Link>
</div>
<div className="pure-menu pure-menu-horizontal pure-menu-fixed">
<ul className="pure-menu-list">
<li className="pure-menu-item"><Link to="/record" className="pure-menu-link">Record</Link></li>
<li className="pure-menu-item"><Link to="/sessions" className="pure-menu-link">Sessions</Link></li>
<li className="pure-menu-item"><Link to="/reports" className="pure-menu-link">Reports</Link></li>
<li className="pure-menu-item"><a href="/logout" className="pure-menu-link">Log out</a></li>
</ul>
</div>
</div>
)
}
} | import React from 'react';
import ReactDom from 'react-dom';
import { Link } from 'react-router';
export default class NavBar extends React.Component {
render() {
return (
<div className="nav-bar">
<div className="pure-menu-heading">
<Link className="home-link" to="/">Sentimize</Link>
</div>
<div className="pure-menu pure-menu-horizontal pure-menu-fixed">
<ul className="pure-menu-list">
<li className="pure-menu-item"><Link to="/record" className="pure-menu-link">Record</Link></li>
<li className="pure-menu-item"><Link to="/sessions" className="pure-menu-link">Sessions</Link></li>
<li className="pure-menu-item"><a href="/logout" className="pure-menu-link">Log out</a></li>
</ul>
</div>
</div>
)
}
} | Remove reports link from navbar | Remove reports link from navbar
| JSX | mit | formidable-coffee/masterfully,chkakaja/sentimize,formidable-coffee/masterfully,chkakaja/sentimize | ---
+++
@@ -14,7 +14,6 @@
<ul className="pure-menu-list">
<li className="pure-menu-item"><Link to="/record" className="pure-menu-link">Record</Link></li>
<li className="pure-menu-item"><Link to="/sessions" className="pure-menu-link">Sessions</Link></li>
- <li className="pure-menu-item"><Link to="/reports" className="pure-menu-link">Reports</Link></li>
<li className="pure-menu-item"><a href="/logout" className="pure-menu-link">Log out</a></li>
</ul>
</div> |
9645ade1bb0049ccfb223b711397bee629c6fd2a | app/javascript/forms/mappers/formFieldsMapper.jsx | app/javascript/forms/mappers/formFieldsMapper.jsx | import React from 'react';
import { formFieldsMapper, components } from '@data-driven-forms/pf3-component-mapper';
import { componentTypes } from '@@ddf';
import AsyncCredentials from '../../components/async-credentials/async-credentials';
import DualGroup from '../../components/dual-group';
import DualListSelect from '../../components/dual-list-select';
import EditPasswordField from '../../components/async-credentials/edit-password-field';
import InputWithDynamicPrefix from '../input-with-dynamic-prefix';
import PasswordField from '../../components/async-credentials/password-field';
import { DataDrivenFormCodeEditor } from '../../components/code-editor';
import FieldArray from '../../components/field-array';
const fieldsMapper = {
...formFieldsMapper,
'code-editor': DataDrivenFormCodeEditor,
'edit-password-field': EditPasswordField,
'field-array': FieldArray,
'dual-group': DualGroup,
'dual-list-select': DualListSelect,
'input-with-dynamic-prefix': InputWithDynamicPrefix,
hr: () => <hr />,
'password-field': PasswordField,
'validate-credentials': AsyncCredentials,
'field-array': FieldArray,
[componentTypes.SELECT]: props => <components.SelectField placeholder={`<${__('Choose')}>`} {...props} />,
};
export default fieldsMapper;
| import React from 'react';
import { formFieldsMapper, components } from '@data-driven-forms/pf3-component-mapper';
import { componentTypes } from '@@ddf';
import AsyncCredentials from '../../components/async-credentials/async-credentials';
import DualGroup from '../../components/dual-group';
import DualListSelect from '../../components/dual-list-select';
import EditPasswordField from '../../components/async-credentials/edit-password-field';
import InputWithDynamicPrefix from '../input-with-dynamic-prefix';
import PasswordField from '../../components/async-credentials/password-field';
import { DataDrivenFormCodeEditor } from '../../components/code-editor';
import FieldArray from '../../components/field-array';
const fieldsMapper = {
...formFieldsMapper,
'code-editor': DataDrivenFormCodeEditor,
'edit-password-field': EditPasswordField,
'field-array': FieldArray,
'dual-group': DualGroup,
'dual-list-select': DualListSelect,
'input-with-dynamic-prefix': InputWithDynamicPrefix,
hr: () => <hr />,
'password-field': PasswordField,
'validate-credentials': AsyncCredentials,
[componentTypes.SELECT]: props => <components.SelectField placeholder={`<${__('Choose')}>`} {...props} />,
};
export default fieldsMapper;
| Remove duplicated FieldArray component from the component mapper | Remove duplicated FieldArray component from the component mapper
| JSX | apache-2.0 | ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic | ---
+++
@@ -22,7 +22,6 @@
hr: () => <hr />,
'password-field': PasswordField,
'validate-credentials': AsyncCredentials,
- 'field-array': FieldArray,
[componentTypes.SELECT]: props => <components.SelectField placeholder={`<${__('Choose')}>`} {...props} />,
};
|
181fa40fb117a7a8c6bd32052a0bfe9910f67403 | src/components/FormComponents/mixins/componentMixin.jsx | src/components/FormComponents/mixins/componentMixin.jsx | import React from 'react';
import Input from 'react-input-mask';
import { deepEqual } from '../../../util';
module.exports = {
shouldComponentUpdate: function(nextProps, nextState) {
// If a new value is set within state, re-render.
if (this.state && this.state.hasOwnProperty('value') && this.state.value !== nextState.value) {
return true;
}
// If a new value is passed in, re-render.
if (this.props.value !== nextProps.value) {
return true;
}
// If the component definition change, re-render.
if (!deepEqual(this.props.component, nextProps.component)) {
return true;
}
return false;
}
};
| import React from 'react';
import Input from 'react-input-mask';
import { deepEqual } from '../../../util';
module.exports = {
shouldComponentUpdate: function(nextProps, nextState) {
// If a new value is set within state, re-render.
if (this.state && this.state.hasOwnProperty('value') && this.state.value !== nextState.value) {
return true;
}
// If the pristineness changes without a value change, re-render.
if (this.state && this.state.hasOwnProperty('isPristine') && this.state.isPristine !== nextState.isPristine) {
return true;
}
// If a new value is passed in, re-render.
if (this.props.value !== nextProps.value) {
return true;
}
// If the component definition change, re-render.
if (!deepEqual(this.props.component, nextProps.component)) {
return true;
}
return false;
}
};
| Enable component update when isPristine changes | Enable component update when isPristine changes
In cases where form values do not change, but the pristineness does (for example, when the form is submitted without any modifications to the fields), the form components would not update to show any validation errors. This is now corrected with this fix. | JSX | mit | formio/react-formio | ---
+++
@@ -9,6 +9,11 @@
return true;
}
+ // If the pristineness changes without a value change, re-render.
+ if (this.state && this.state.hasOwnProperty('isPristine') && this.state.isPristine !== nextState.isPristine) {
+ return true;
+ }
+
// If a new value is passed in, re-render.
if (this.props.value !== nextProps.value) {
return true; |
0fb54b2e498e1d46cda0b7e3c4e5624326740c2c | app/javascript/components/meeting/agendum/AgendumDetails.jsx | app/javascript/components/meeting/agendum/AgendumDetails.jsx | import React from 'react';
import AgendumNotes from '../agendum_note/AgendumNotes';
const AgendumDetails = ({ agendum, agendumNotes, agendumUploads }) => {
if (!agendum) {
return (
<p className="padding-sides-default">
Select an agendum to see details.
</p>
);
}
return (
<div className="agendum-details padding-sides-default padding-bottom-default">
<h4>{agendum.title}</h4>
{agendumUploads.length > 0 &&
<div>
<h6 className="mb-2">Uploads</h6>
<ul className="list">
{agendumUploads.map(upload =>
<li key={upload.id}>
<a href={`/uploads/${upload.id}/download`}>{upload.filename}</a>
</li>
)}
</ul>
</div>
}
<h6 className="mt-4 mb-2">Agendum Notes</h6>
<AgendumNotes
agendumID={agendum.id}
notes={agendumNotes} />
</div>
);
};
export default AgendumDetails;
| import React from 'react';
import AgendumNotes from '../agendum_note/AgendumNotes';
const AgendumDetails = ({ agendum, agendumNotes, agendumUploads }) => {
if (!agendum) {
return (
<p className="padding-sides-default">
Select an agendum to see details.
</p>
);
}
const determinefileIcon = upload => upload.content_type.includes('image') ? 'fa-image' : 'fa-file';
const humanizedFileSize = upload => (upload.file_size / 1024).toFixed(2);
return (
<div className="agendum-details padding-sides-default padding-bottom-default">
<h4>{agendum.title}</h4>
{agendumUploads.length > 0 &&
<div>
<h6 className="mb-2">Uploads</h6>
<ul className="list">
{agendumUploads.map(upload =>
<li className="list-item" key={upload.id}>
<div className="media">
<i className={`fa ${determinefileIcon(upload)} fa-lg`}></i>
<div className="media-text">
<a href={`/uploads/${upload.id}/download`}>{upload.filename}</a>
<span className="text-grey">{humanizedFileSize(upload)} KB</span>
</div>
</div>
</li>
)}
</ul>
</div>
}
<h6 className="mt-4 mb-2">Agendum Notes</h6>
<AgendumNotes
agendumID={agendum.id}
notes={agendumNotes} />
</div>
);
};
export default AgendumDetails;
| Fix styles for uploads within agendum details | Fix styles for uploads within agendum details
| JSX | mit | robyparr/adjourn,robyparr/adjourn,robyparr/adjourn | ---
+++
@@ -11,6 +11,9 @@
);
}
+ const determinefileIcon = upload => upload.content_type.includes('image') ? 'fa-image' : 'fa-file';
+ const humanizedFileSize = upload => (upload.file_size / 1024).toFixed(2);
+
return (
<div className="agendum-details padding-sides-default padding-bottom-default">
<h4>{agendum.title}</h4>
@@ -20,8 +23,14 @@
<h6 className="mb-2">Uploads</h6>
<ul className="list">
{agendumUploads.map(upload =>
- <li key={upload.id}>
- <a href={`/uploads/${upload.id}/download`}>{upload.filename}</a>
+ <li className="list-item" key={upload.id}>
+ <div className="media">
+ <i className={`fa ${determinefileIcon(upload)} fa-lg`}></i>
+ <div className="media-text">
+ <a href={`/uploads/${upload.id}/download`}>{upload.filename}</a>
+ <span className="text-grey">{humanizedFileSize(upload)} KB</span>
+ </div>
+ </div>
</li>
)}
</ul> |
186c4cae43db21d621e0bd136e4616acebe523b9 | ui/src/message_popup/renderers/response_with_past_notes.jsx | ui/src/message_popup/renderers/response_with_past_notes.jsx | /* @flow weak */
import React from 'react';
// This shows a past set of notes from previous scenes, for writing feedback based on those notes.
// `children` is intended to be an response like MinimalTextResponse.
export default React.createClass({
displayName: 'ResponseWithNotes',
propTypes: {
pastNotes: React.PropTypes.arrayOf(React.PropTypes.string).isRequired,
children: React.PropTypes.element
},
render() {
const {pastNotes, children} = this.props;
return (
<div>
<div style={styles.container}>
<div>Your notes:</div>
<ul>{pastNotes.map(note => <li style={{}}>{note}</li>)}</ul>
</div>
{children}
</div>
);
}
});
const styles = {
container: {
paddingBottom: 5,
margin: 20
}
}; | /* @flow weak */
import React from 'react';
// This shows a past set of notes from previous scenes, for writing feedback based on those notes.
// `children` is intended to be an response like MinimalTextResponse.
export default React.createClass({
displayName: 'ResponseWithNotes',
propTypes: {
pastNotes: React.PropTypes.arrayOf(React.PropTypes.string).isRequired,
children: React.PropTypes.element
},
render() {
const {pastNotes, children} = this.props;
return (
<div>
<div style={styles.container}>
<div>Your notes:</div>
<ul>{pastNotes.map(note => <li key={note} style={{}}>{note}</li>)}</ul>
</div>
{children}
</div>
);
}
});
const styles = {
container: {
paddingBottom: 5,
margin: 20
}
}; | Fix missing key in ResponseWithNotes | Fix missing key in ResponseWithNotes
| JSX | mit | mit-teaching-systems-lab/threeflows,mit-teaching-systems-lab/threeflows,mit-teaching-systems-lab/threeflows,mit-teaching-systems-lab/threeflows | ---
+++
@@ -19,7 +19,7 @@
<div>
<div style={styles.container}>
<div>Your notes:</div>
- <ul>{pastNotes.map(note => <li style={{}}>{note}</li>)}</ul>
+ <ul>{pastNotes.map(note => <li key={note} style={{}}>{note}</li>)}</ul>
</div>
{children}
</div> |
ebd03ec1bdad17e0568f326fa2c13b9799312e36 | src/sentry/static/sentry/app/components/narrowLayout.jsx | src/sentry/static/sentry/app/components/narrowLayout.jsx | import jQuery from 'jquery';
import React from 'react';
import Footer from '../components/footer';
import Sidebar from '../components/sidebar';
const NarryLayout = React.createClass({
componentWillMount() {
jQuery(document.body).addClass('narrow');
},
componentWillUnmount() {
jQuery(document.body).removeClass('narrow');
},
render() {
return (
<div className="app">
<Sidebar />
<div className="container">
<div className="box">
<div className="box-content with-padding">
{this.props.children}
</div>
</div>
</div>
<Footer />
</div>
);
}
});
export default NarryLayout;
| import jQuery from 'jquery';
import React from 'react';
import Footer from '../components/footer';
const NarryLayout = React.createClass({
componentWillMount() {
jQuery(document.body).addClass('narrow');
},
componentWillUnmount() {
jQuery(document.body).removeClass('narrow');
},
render() {
return (
<div className="app">
<div className="pattern-bg"/>
<div className="container">
<div className="box box-modal">
<div className="box-header">
<a href="/">
<span className="icon-sentry-logo" />
</a>
</div>
<div className="box-content with-padding">
{this.props.children}
</div>
</div>
</div>
<Footer />
</div>
);
}
});
export default NarryLayout;
| Remove sidebar from react modals | Remove sidebar from react modals
| JSX | bsd-3-clause | JamesMura/sentry,mvaled/sentry,BuildingLink/sentry,jean/sentry,jean/sentry,zenefits/sentry,ifduyue/sentry,BuildingLink/sentry,gencer/sentry,gencer/sentry,mvaled/sentry,zenefits/sentry,JackDanger/sentry,alexm92/sentry,looker/sentry,beeftornado/sentry,ifduyue/sentry,beeftornado/sentry,looker/sentry,JackDanger/sentry,looker/sentry,mvaled/sentry,JamesMura/sentry,BuildingLink/sentry,looker/sentry,JamesMura/sentry,zenefits/sentry,mvaled/sentry,gencer/sentry,alexm92/sentry,BuildingLink/sentry,ifduyue/sentry,jean/sentry,ifduyue/sentry,JackDanger/sentry,JamesMura/sentry,zenefits/sentry,jean/sentry,zenefits/sentry,alexm92/sentry,jean/sentry,BuildingLink/sentry,looker/sentry,ifduyue/sentry,mvaled/sentry,JamesMura/sentry,gencer/sentry,beeftornado/sentry,gencer/sentry,mvaled/sentry | ---
+++
@@ -2,7 +2,6 @@
import React from 'react';
import Footer from '../components/footer';
-import Sidebar from '../components/sidebar';
const NarryLayout = React.createClass({
componentWillMount() {
@@ -16,9 +15,14 @@
render() {
return (
<div className="app">
- <Sidebar />
+ <div className="pattern-bg"/>
<div className="container">
- <div className="box">
+ <div className="box box-modal">
+ <div className="box-header">
+ <a href="/">
+ <span className="icon-sentry-logo" />
+ </a>
+ </div>
<div className="box-content with-padding">
{this.props.children}
</div> |
c760bd9c8d6c22581ed5c6c10d46976891df1b7c | src/components/notes/Layout.jsx | src/components/notes/Layout.jsx | import React from 'react';
import * as firebase from 'firebase';
import { config } from '../../config';
import Note from './Note';
import './Layout.scss';
export default class Layout extends React.Component {
constructor() {
super();
this.state = {
notes: [],
};
}
componentDidMount() {
firebase.initializeApp(config);
const notesRef = firebase.database().ref('notes');
notesRef.on('child_added', snapshot => {
// name object key after note title, assign note content to keyvalue
const { content, title } = snapshot.val();
const note = {};
note[title] = content;
// update state
const newState = this.state.notes;
newState.unshift(note);
this.setState(newState)
});
}
render() {
return (
<div className="notes">
{this.state.notes.map((note, index) => {
const [title] = Object.keys(note);
return (
<Note key={`note${index}`} title={title} content={note[title]} />
);
})}
</div>
);
}
}
| import React from 'react';
import * as firebase from 'firebase';
import { config } from '../../config';
import Note from './Note';
import './Layout.scss';
export default class Layout extends React.Component {
constructor() {
super();
this.state = {
notes: [],
};
}
componentDidMount() {
firebase.initializeApp(config);
const notesRef = firebase.database().ref('notes');
notesRef.on('child_added', snapshot => {
const { title, content } = snapshot.val();
const id = snapshot.W.path.o.join('');
const note = { title, content, id };
// update state
const newState = this.state.notes;
newState.unshift(note);
this.setState(newState)
});
}
render() {
return (
<div className="notes">
{this.state.notes.map(({ title, content, id }) => {
return <Note key={id} title={title} content={content} />;
})}
</div>
);
}
}
| Replace index-based key with database entry ID Remove 'index as a key' anti-pattern | Replace index-based key with database entry ID
Remove 'index as a key' anti-pattern
| JSX | mit | emyarod/refuge,emyarod/refuge | ---
+++
@@ -16,10 +16,9 @@
firebase.initializeApp(config);
const notesRef = firebase.database().ref('notes');
notesRef.on('child_added', snapshot => {
- // name object key after note title, assign note content to keyvalue
- const { content, title } = snapshot.val();
- const note = {};
- note[title] = content;
+ const { title, content } = snapshot.val();
+ const id = snapshot.W.path.o.join('');
+ const note = { title, content, id };
// update state
const newState = this.state.notes;
@@ -31,11 +30,8 @@
render() {
return (
<div className="notes">
- {this.state.notes.map((note, index) => {
- const [title] = Object.keys(note);
- return (
- <Note key={`note${index}`} title={title} content={note[title]} />
- );
+ {this.state.notes.map(({ title, content, id }) => {
+ return <Note key={id} title={title} content={content} />;
})}
</div>
); |
d0732c4ac9586508e5a78790ebf854c09c3c9042 | packages/nova-base-components/lib/users/UsersAvatar.jsx | packages/nova-base-components/lib/users/UsersAvatar.jsx | import { registerComponent } from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import Users from 'meteor/nova:users';
import { Link } from 'react-router';
const UsersAvatar = ({user, size, link}) => {
const sizes = {
small: "20px",
medium: "30px",
large: "50px"
}
const aStyle = {
borderRadius: "100%",
display: "inline-block",
height: sizes[size],
width: sizes[size]
};
const imgStyle = {
borderRadius: "100%",
display: "block",
height: sizes[size],
width: sizes[size]
};
const avatarUrl = Users.avatar.getUrl(user);
const img = <img alt={Users.getDisplayName(user)} style={imgStyle} className="avatar" src={avatarUrl}/>;
const initials = <span className="avatar-initials"><span>{Users.avatar.getInitials(user)}</span></span>;
const avatar = avatarUrl ? img : initials;
return link ? <Link style={aStyle} className="users-avatar" to={Users.getProfileUrl(user)}>{avatar}</Link> : avatar;
}
UsersAvatar.propTypes = {
user: React.PropTypes.object.isRequired,
size: React.PropTypes.string,
link: React.PropTypes.bool
}
UsersAvatar.defaultProps = {
size: "medium",
link: true
}
UsersAvatar.displayName = "UsersAvatar";
registerComponent('UsersAvatar', UsersAvatar); | import { registerComponent } from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import Users from 'meteor/nova:users';
import { Link } from 'react-router';
const UsersAvatar = ({user, size, link}) => {
const sizes = {
small: "20px",
medium: "30px",
large: "50px"
}
const aStyle = {
borderRadius: "100%",
display: "inline-block",
height: sizes[size],
width: sizes[size]
};
const imgStyle = {
borderRadius: "100%",
display: "block",
height: sizes[size],
width: sizes[size]
};
const avatarUrl = Users.avatar.getUrl(user);
const img = <img alt={Users.getDisplayName(user)} style={imgStyle} className="avatar" src={avatarUrl} title={user.username}/>;
const initials = <span className="avatar-initials"><span>{Users.avatar.getInitials(user)}</span></span>;
const avatar = avatarUrl ? img : initials;
return link ? <Link style={aStyle} className="users-avatar" to={Users.getProfileUrl(user)}>{avatar}</Link> : avatar;
}
UsersAvatar.propTypes = {
user: React.PropTypes.object.isRequired,
size: React.PropTypes.string,
link: React.PropTypes.bool
}
UsersAvatar.defaultProps = {
size: "medium",
link: true
}
UsersAvatar.displayName = "UsersAvatar";
registerComponent('UsersAvatar', UsersAvatar);
| Add username tooltip to user's avatar. Nice in the commenters list of a PostItem. | Add username tooltip to user's avatar. Nice in the commenters list of a PostItem.
| JSX | mit | Discordius/Lesswrong2,SachaG/Gamba,dominictracey/Telescope,bengott/Telescope,dominictracey/Telescope,SachaG/Gamba,Discordius/Telescope,SachaG/Zensroom,Discordius/Lesswrong2,manriquef/Vulcan,rtluu/immersive,Discordius/Lesswrong2,acidsound/Telescope,Discordius/Telescope,bshenk/projectIterate,Discordius/Lesswrong2,acidsound/Telescope,rtluu/immersive,SachaG/Zensroom,manriquef/Vulcan,TodoTemplates/Telescope,bengott/Telescope,VulcanJS/Vulcan,TodoTemplates/Telescope,HelloMeets/HelloMakers,HelloMeets/HelloMakers,manriquef/Vulcan,TodoTemplates/Telescope,acidsound/Telescope,SachaG/Zensroom,HelloMeets/HelloMakers,rtluu/immersive,bengott/Telescope,bshenk/projectIterate,SachaG/Gamba,bshenk/projectIterate,dominictracey/Telescope,VulcanJS/Vulcan,Discordius/Telescope,Discordius/Telescope | ---
+++
@@ -16,18 +16,18 @@
display: "inline-block",
height: sizes[size],
width: sizes[size]
- };
+ };
const imgStyle = {
borderRadius: "100%",
display: "block",
height: sizes[size],
width: sizes[size]
- };
+ };
const avatarUrl = Users.avatar.getUrl(user);
- const img = <img alt={Users.getDisplayName(user)} style={imgStyle} className="avatar" src={avatarUrl}/>;
+ const img = <img alt={Users.getDisplayName(user)} style={imgStyle} className="avatar" src={avatarUrl} title={user.username}/>;
const initials = <span className="avatar-initials"><span>{Users.avatar.getInitials(user)}</span></span>;
const avatar = avatarUrl ? img : initials; |
c3dfd40ba881efa61bb1955c6c164973e77c987b | src/components/AccountView.jsx | src/components/AccountView.jsx | import styles from '../styles/accountView'
import React from 'react'
import ReactMarkdown from 'react-markdown'
import { translate } from 'cozy-ui/react/helpers/i18n'
import PassphraseForm from './PassphraseForm'
import Input from './Input'
import Select from './Select'
const LANG_OPTIONS = ['en', 'fr']
const AccountView = ({ t, fields, passphrase, isFetching, onFieldChange, onPassphraseSubmit }) => (
<div className={styles['account-view']}>
{ isFetching && <p>Loading...</p> }
<h2>{t('AccountView.title')}</h2>
<Input name='email' type='email' {...fields.email} onChange={onFieldChange} />
<Input name='public_name' type='text' {...fields.public_name} onChange={onFieldChange} />
<PassphraseForm {...passphrase} onSubmit={onPassphraseSubmit} />
<Select name='locale' options={LANG_OPTIONS} {...fields.locale} onChange={onFieldChange} />
<p className={styles['account-view-desc']}>
<ReactMarkdown
source={
t(`AccountView.locale.contrib`)
}
renderers={{Link: props => <a href={props.href} target='_blank'>{props.children}</a>}}
/>
</p>
</div>
)
export default translate()(AccountView)
| import styles from '../styles/accountView'
import React from 'react'
import ReactMarkdown from 'react-markdown'
import { translate } from 'cozy-ui/react/helpers/i18n'
import PassphraseForm from './PassphraseForm'
import Input from './Input'
import Select from './Select'
const LANG_OPTIONS = ['en', 'fr']
const AccountView = ({ t, fields, passphrase, isFetching, onFieldChange, onPassphraseSubmit }) => (
<div className={styles['account-view']}>
{ isFetching && <p>Loading...</p> }
<h2>{t('AccountView.title')}</h2>
<Input name='email' type='email' {...fields.email} onChange={onFieldChange} />
<Input name='public_name' type='text' {...fields.public_name} onChange={onFieldChange} />
<Select name='locale' options={LANG_OPTIONS} {...fields.locale} onChange={onFieldChange} />
<p className={styles['account-view-desc']}>
<ReactMarkdown
source={
t(`AccountView.locale.contrib`)
}
renderers={{Link: props => <a href={props.href} target='_blank'>{props.children}</a>}}
/>
</p>
<PassphraseForm {...passphrase} onSubmit={onPassphraseSubmit} />
</div>
)
export default translate()(AccountView)
| Switch locale and password position in form | [feat] Switch locale and password position in form
| JSX | agpl-3.0 | y-lohse/cozy-settings,y-lohse/cozy-settings | ---
+++
@@ -15,7 +15,6 @@
<h2>{t('AccountView.title')}</h2>
<Input name='email' type='email' {...fields.email} onChange={onFieldChange} />
<Input name='public_name' type='text' {...fields.public_name} onChange={onFieldChange} />
- <PassphraseForm {...passphrase} onSubmit={onPassphraseSubmit} />
<Select name='locale' options={LANG_OPTIONS} {...fields.locale} onChange={onFieldChange} />
<p className={styles['account-view-desc']}>
<ReactMarkdown
@@ -25,6 +24,7 @@
renderers={{Link: props => <a href={props.href} target='_blank'>{props.children}</a>}}
/>
</p>
+ <PassphraseForm {...passphrase} onSubmit={onPassphraseSubmit} />
</div>
)
|
bf90e755abbdfdd989210a8112dddb38252e3b3c | web/components/header/index.jsx | web/components/header/index.jsx | var React = require('react');
var Router = require('react-router');
var Route = Router.Route;
var Link = Router.Link;
var Header = React.createClass({
render: function() {
return (
<div>
<nav className="navbar navbar-default navbar-fixed-top">
<div className="container">
<div className="navbar-header">
<button type="button" className="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
<span className="sr-only"></span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
</button>
<a className="navbar-brand" href="#">WebAppEngine</a>
</div>
<div className="navbar-collapse collapse" id="navbar-collapse">
<ul className="nav navbar-nav">
<li className="active"><Link to="dashboard">Dashboard</Link></li>
</ul>
</div>
</div>
</nav>
</div>
);
}
});
module.exports = {
Header: Header
};
| var React = require('react');
var Router = require('react-router');
var Route = Router.Route;
var Link = Router.Link;
var Header = React.createClass({
render: function() {
return (
<div>
<nav className="navbar navbar-default navbar-fixed-top">
<div className="container">
<div className="navbar-header">
<button type="button" className="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
<span className="sr-only"></span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
</button>
<a className="navbar-brand" href="#">WebAppEngine</a>
</div>
<div className="navbar-collapse collapse" id="navbar-collapse">
<ul className="nav navbar-nav">
<li><Link to="dashboard">Dashboard</Link></li>
</ul>
</div>
</div>
</nav>
</div>
);
}
});
module.exports = {
Header: Header
};
| Remove the 'active' class from the list item | Remove the 'active' class from the list item
| JSX | mit | cheton/webappengine,cheton/webappengine,cheton/webappengine | ---
+++
@@ -20,7 +20,7 @@
</div>
<div className="navbar-collapse collapse" id="navbar-collapse">
<ul className="nav navbar-nav">
- <li className="active"><Link to="dashboard">Dashboard</Link></li>
+ <li><Link to="dashboard">Dashboard</Link></li>
</ul>
</div>
</div> |
0b50dd5528ad62ef46586925275242720ac3c481 | src/components/elements/search-form.jsx | src/components/elements/search-form.jsx | import React from 'react';
import { connect } from 'react-redux';
import { browserHistory } from 'react-router';
import classnames from 'classnames';
import { preventDefault } from '../../utils';
export default class SearchForm extends React.Component {
constructor(props) {
super(props);
this.state = {
isFocused: false
};
}
refSearchQuery = (input) => {
this.searchQuery = input;
};
focusForm = () => {
this.setState({ isFocused: true });
};
blurForm = () => {
this.setState({ isFocused: false });
};
submitForm = () => {
const query = this.searchQuery.value;
browserHistory.push(`/search?q=${encodeURIComponent(query)}`);
};
render() {
const formClasses = classnames({
'search-form-in-header': true,
'form-inline': true,
'focused': this.state.isFocused
});
return (
<form className={formClasses} action="/search" onSubmit={preventDefault(this.submitForm)}>
<input className="form-control" type="text" name="q" ref={this.refSearchQuery} defaultValue="" onFocus={this.focusForm} onBlur={this.blurForm}/>
<button className="btn btn-default" type="submit">
<i className="fa fa-search"></i>
</button>
</form>
);
}
}
| import React from 'react';
import { browserHistory } from 'react-router';
import classnames from 'classnames';
import { preventDefault } from '../../utils';
export default class SearchForm extends React.Component {
constructor(props) {
super(props);
this.state = {
isFocused: false
};
}
refSearchQuery = (input) => {
this.searchQuery = input;
};
focusForm = () => {
this.setState({ isFocused: true });
};
blurForm = () => {
this.setState({ isFocused: false });
};
submitForm = () => {
const query = this.searchQuery.value;
browserHistory.push(`/search?q=${encodeURIComponent(query)}`);
};
render() {
const formClasses = classnames({
'search-form-in-header': true,
'form-inline': true,
'focused': this.state.isFocused
});
return (
<form className={formClasses} action="/search" onSubmit={preventDefault(this.submitForm)}>
<input className="form-control" type="text" name="q" ref={this.refSearchQuery} defaultValue="" onFocus={this.focusForm} onBlur={this.blurForm}/>
<button className="btn btn-default" type="submit">
<i className="fa fa-search"></i>
</button>
</form>
);
}
}
| Remove unused import from SearchForm | Remove unused import from SearchForm
| JSX | mit | clbn/freefeed-gamma,clbn/freefeed-gamma,clbn/freefeed-gamma | ---
+++
@@ -1,5 +1,4 @@
import React from 'react';
-import { connect } from 'react-redux';
import { browserHistory } from 'react-router';
import classnames from 'classnames';
|
36075f8a0e2f9756d327946bc4792c59cf833b28 | src/furniture/containers/addFurnitureForm.container.jsx | src/furniture/containers/addFurnitureForm.container.jsx | import React, { Component } from 'react';
import { Button, Input, Row, Col } from 'react-materialize';
import { reduxForm } from 'redux-form';
import { addFurniture } from '../actions/furniture.action.js';
class AddFurnitureForm extends Component {
render() {
const { fields: {
itemName, price, description, url, deliveryDate,
}, handleSubmit, } = this.props;
return (
<Col s={12} l={6}>
<form onSubmit={ handleSubmit(this.props.addFurniture.bind(null, this.props.roomSelected)) }>
<Row>
<Input s={6} placeholder='Item'{ ...itemName } />
<Input s={6} placeholder='Price'{ ...price } />
</Row>
<Row>
<Input s={6} placeholder='Description'{ ...description } />
<Input s={6} placeholder='URL'{ ...url } />
</Row>
<Row>
<Input s={6} placeholder='Delivery Date' label='Date' { ...deliveryDate } />
</Row>
<Button type="submit">Submit</Button>
</form>
</Col>
);
}
}
export default reduxForm({
form: 'AddFurnitureForm',
fields: ['itemName', 'price', 'description', 'url', 'deliveryDate', 'roomSelected'],
}, state => ({ roomSelected: state.roomSelected }), { addFurniture })(AddFurnitureForm);
| import React, { Component } from 'react';
import { Button, Input, Row, Col } from 'react-materialize';
import { reduxForm } from 'redux-form';
import { addFurniture } from '../actions/furniture.action.js';
import { DatePicker } from 'material-ui/DatePicker'
class AddFurnitureForm extends Component {
render() {
const { fields: {
itemName, price, description, url, deliveryDate,
}, handleSubmit, } = this.props;
return (
<Col s={12} l={6}>
<form onSubmit={ handleSubmit(this.props.addFurniture.bind(null, this.props.roomSelected)) }>
<Row>
<Input s={6} placeholder='Item'{ ...itemName } />
<Input s={6} placeholder='Price'{ ...price } />
</Row>
<Row>
<Input s={6} placeholder='Description'{ ...description } />
<Input s={6} placeholder='URL'{ ...url } />
</Row>
<Row>
<Col s={6}>
<input type='date' className='datepicker'{...deliveryDate} />
</Col>
</Row>
<Button type="submit">Submit</Button>
</form>
</Col>
);
}
}
export default reduxForm({
form: 'AddFurnitureForm',
fields: ['itemName', 'price', 'description', 'url', 'deliveryDate', 'roomSelected'],
}, state => ({ roomSelected: state.roomSelected }), { addFurniture })(AddFurnitureForm);
| Add Datepicker on add furniture form | Style: Add Datepicker on add furniture form
| JSX | mit | Nailed-it/Designify,Nailed-it/Designify | ---
+++
@@ -2,6 +2,7 @@
import { Button, Input, Row, Col } from 'react-materialize';
import { reduxForm } from 'redux-form';
import { addFurniture } from '../actions/furniture.action.js';
+import { DatePicker } from 'material-ui/DatePicker'
class AddFurnitureForm extends Component {
render() {
@@ -9,6 +10,7 @@
itemName, price, description, url, deliveryDate,
}, handleSubmit, } = this.props;
+
return (
<Col s={12} l={6}>
<form onSubmit={ handleSubmit(this.props.addFurniture.bind(null, this.props.roomSelected)) }>
@@ -21,7 +23,9 @@
<Input s={6} placeholder='URL'{ ...url } />
</Row>
<Row>
- <Input s={6} placeholder='Delivery Date' label='Date' { ...deliveryDate } />
+ <Col s={6}>
+ <input type='date' className='datepicker'{...deliveryDate} />
+ </Col>
</Row>
<Button type="submit">Submit</Button>
</form>
@@ -34,3 +38,5 @@
form: 'AddFurnitureForm',
fields: ['itemName', 'price', 'description', 'url', 'deliveryDate', 'roomSelected'],
}, state => ({ roomSelected: state.roomSelected }), { addFurniture })(AddFurnitureForm);
+
+ |
316c0b06280bac8c24a322ff29e86699ae79cfff | test/index.jsx | test/index.jsx | // Import helpers
import should from 'turris-test-helpers';
// Import app
import App from '../src/app.jsx';
// Import other tests
import './number-iterator.js';
import './find-primes.js';
describe('App suite', function() {
it('Renders the main app container', function() {
// const React = this.React;
// const TestUtils = this.TestUtils;
// render
App.start();
// verify it exists
document.getElementById('mainContainer').children.length.should.equal(1);
});
it('Defaults to printing multiplication table for the first 10 primes', function() {
App.start();
const multiplicationTable = document.querySelector('.multiplication-table');
should.exist(multiplicationTable);
multiplicationTable.querySelectorAll('tbody > tr').length.should.equal(10);
multiplicationTable.querySelector('tr').querySelectorAll('td').should.equal(10);
});
});
| // Import helpers
import should from 'turris-test-helpers';
// Import app
import App from '../src/app.jsx';
// Import other tests
import './number-iterator.js';
import './find-primes.js';
describe('App suite', function() {
it('Renders the main app container', function() {
// const React = this.React;
// const TestUtils = this.TestUtils;
// Render
App.start();
// Verify it exists
document.getElementById('mainContainer').children.length.should.equal(1);
});
it('Defaults to printing multiplication table for the first 10 primes with vertical and horizontal headings', function() {
App.start();
const multiplicationTable = document.querySelector('.multiplication-table');
should.exist(multiplicationTable);
multiplicationTable.querySelectorAll('tbody > tr').length.should.equal(10);
multiplicationTable.querySelector('tbody > tr').querySelectorAll('td').length.should.equal(10);
// Check for headings: should have thead, and length should be 11 (includes vertical table headings)
multiplicationTable.querySelectorAll('thead th').length.should.equal(11);
multiplicationTable.querySelector('tbody > tr > :first-child').nodeName.toLowerCase().should.equal('th');
});
});
| Fix and extend multiplication table tests | Fix and extend multiplication table tests
Should be checking number of <td>s per <tr> in <tbody>, not in the
whole table; also, check for presence of horizontal and vertical
headings.
| JSX | cc0-1.0 | acusti/primal-multiplication,acusti/primal-multiplication | ---
+++
@@ -13,18 +13,21 @@
// const React = this.React;
// const TestUtils = this.TestUtils;
- // render
+ // Render
App.start();
- // verify it exists
+ // Verify it exists
document.getElementById('mainContainer').children.length.should.equal(1);
});
- it('Defaults to printing multiplication table for the first 10 primes', function() {
+ it('Defaults to printing multiplication table for the first 10 primes with vertical and horizontal headings', function() {
App.start();
const multiplicationTable = document.querySelector('.multiplication-table');
should.exist(multiplicationTable);
multiplicationTable.querySelectorAll('tbody > tr').length.should.equal(10);
- multiplicationTable.querySelector('tr').querySelectorAll('td').should.equal(10);
+ multiplicationTable.querySelector('tbody > tr').querySelectorAll('td').length.should.equal(10);
+ // Check for headings: should have thead, and length should be 11 (includes vertical table headings)
+ multiplicationTable.querySelectorAll('thead th').length.should.equal(11);
+ multiplicationTable.querySelector('tbody > tr > :first-child').nodeName.toLowerCase().should.equal('th');
});
}); |
ea5489417d60093059ed389de95913fb47003850 | client/components/Challenge.jsx | client/components/Challenge.jsx | import React from 'react';
require('./../../public/main.css');
class Challenge extends React.Component {
constructor(props) {
super(props);
this.state = {};
console.log('props:', props);
// console.log(this.state)
this.updateChallenge = this.updateChallenge.bind(this);
}
updateChallenge(e) {
this.setState({
challenge: e.target.value
});
}
render() {
return (
<div>
{this.props.chapter ? this.props.chapter[0].challengeText : null}
</div>
);
}
}
export default Challenge;
| import React from 'react';
require('./../../public/main.css');
class Challenge extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
return (
<div>
<strong><p> Challenge Text </p></strong>
<div dangerouslySetInnerHTML={{__html: this.props.chapter ? this.props.chapter[0].challengeText : null}} />
</div>
);
}
}
export default Challenge;
| Make html render on page from server | Make html render on page from server
| JSX | mit | OrderlyPhoenix/OrderlyPhoenix,OrderlyPhoenix/OrderlyPhoenix | ---
+++
@@ -5,21 +5,13 @@
constructor(props) {
super(props);
this.state = {};
- console.log('props:', props);
- // console.log(this.state)
- this.updateChallenge = this.updateChallenge.bind(this);
- }
-
- updateChallenge(e) {
- this.setState({
- challenge: e.target.value
- });
}
render() {
return (
<div>
- {this.props.chapter ? this.props.chapter[0].challengeText : null}
+ <strong><p> Challenge Text </p></strong>
+ <div dangerouslySetInnerHTML={{__html: this.props.chapter ? this.props.chapter[0].challengeText : null}} />
</div>
);
} |
53c174f20e97e0ee7a657cacc8b1c46f7eb4d041 | src/components/SelectBox.jsx | src/components/SelectBox.jsx | import styles from '../styles/selectBox'
import React from 'react'
import ReactMarkdown from 'react-markdown'
const LANGS_OPTIONS = ['en', 'fr']
const Option = ({t, inputData, optionValue, setValue}) => (
<option
value={optionValue}
selected={setValue === optionValue}
>
{t(`AccountView.${inputData}.${optionValue}.text`)}
</option>
)
const SelectBox = ({t, inputData, setValue, infosSubmitting, updateInfos}) => (
<div className={styles['coz-form']}>
<h3>{t(`AccountView.${inputData}.title`)}</h3>
<label className={styles['coz-desc']}>
{t(`AccountView.${inputData}.label`)}
</label>
<select
name={inputData}
onBlur={updateInfos}
>
{
LANGS_OPTIONS.map(function (lang) {
return <Option
optionValue={lang}
inputData={inputData}
setValue={setValue}
t={t}
/>
})
}
</select>
<p className={styles['coz-desc']}>
<ReactMarkdown source={
t(`AccountView.${inputData}.contrib`, {
url: 'http://cozy.io'
})
} />
</p>
</div>
)
export default SelectBox
| import styles from '../styles/selectBox'
import React from 'react'
import ReactMarkdown from 'react-markdown'
const LANGS_OPTIONS = ['en', 'fr']
const Option = ({t, inputData, optionValue, setValue}) => (
<option
value={optionValue}
selected={setValue === optionValue}
>
{t(`AccountView.${inputData}.${optionValue}.text`)}
</option>
)
const SelectBox = ({t, inputData, setValue, infosSubmitting, updateInfos}) => (
<div className={styles['coz-form']}>
<h3>{t(`AccountView.${inputData}.title`)}</h3>
<label className={styles['coz-desc']}>
{t(`AccountView.${inputData}.label`)}
</label>
<select
name={inputData}
onBlur={updateInfos}
>
{
LANGS_OPTIONS.map(function (lang) {
return <Option
optionValue={lang}
inputData={inputData}
setValue={setValue}
t={t}
/>
})
}
</select>
<p className={styles['coz-desc']}>
<ReactMarkdown
source={
t(`AccountView.${inputData}.contrib`, {
url: 'https://www.transifex.com/cozy/'
})
}
renderers={{Link: props => <a href={props.href} target='_blank'>{props.children}</a>}}
/>
</p>
</div>
)
export default SelectBox
| Add target blank on help for translations link | [Chore] Add target blank on help for translations link
| JSX | agpl-3.0 | y-lohse/cozy-settings,y-lohse/cozy-settings | ---
+++
@@ -36,11 +36,14 @@
}
</select>
<p className={styles['coz-desc']}>
- <ReactMarkdown source={
- t(`AccountView.${inputData}.contrib`, {
- url: 'http://cozy.io'
- })
- } />
+ <ReactMarkdown
+ source={
+ t(`AccountView.${inputData}.contrib`, {
+ url: 'https://www.transifex.com/cozy/'
+ })
+ }
+ renderers={{Link: props => <a href={props.href} target='_blank'>{props.children}</a>}}
+ />
</p>
</div>
) |
77a7b523352c5985c82ec67c312437e64d5a98b1 | ditto/static/tidy/js/formbuilder/components/editors/Text.jsx | ditto/static/tidy/js/formbuilder/components/editors/Text.jsx | import React, { PropTypes } from 'react';
import Row from './Row';
export default class Text extends React.Component {
static propTypes = {
maxChars: PropTypes.number,
maxWords: PropTypes.number,
isMultiline: PropTypes.bool,
onChangeMaxChars: PropTypes.func,
onChangeMaxWords: PropTypes.func,
onChangeIsMultiline: PropTypes.func
}
static defaultProps = {
maxChars: null,
maxWords: null,
isMultiline: false
}
render() {
console.log('text props', this.props);
//disabled={!this.props.isMultiline}
return (
<div>
<Row errors={this.props.maxChars ? this.props.errors.maxChars : null}>
<label>
Max characters
</label>
<input
type="text"
value={this.props.maxChars}
onChange={(e) => this.props.onChangeMaxChars(e.target.value || null)}
/>
</Row>
<Row errors={this.props.maxWords ? this.props.errors.maxWords : null}>
<label>
Max words
</label>
<input
type="number"
value={this.props.maxWords}
onChange={(e) => this.props.onChangeMaxWords(e.target.value || null)}
/>
</Row>
<Row>
<label>
Is mult-line?
</label>
<input
type="checkbox"
checked={this.props.isMultiline}
onChange={(e) => this.props.onChangeIsMultiline(e.target.checked)}
/>
</Row>
</div>
);
}
}
| import React, { PropTypes } from 'react';
import Row from './Row';
export default class Text extends React.Component {
static propTypes = {
maxChars: PropTypes.number,
maxWords: PropTypes.number,
isMultiline: PropTypes.bool,
onChangeMaxChars: PropTypes.func,
onChangeMaxWords: PropTypes.func,
onChangeIsMultiline: PropTypes.func
}
static defaultProps = {
maxChars: null,
maxWords: null,
isMultiline: false
}
render() {
console.log('text props', this.props);
return (
<div>
<Row errors={this.props.maxChars ? this.props.errors.maxChars : null}>
<label>
Max characters
</label>
<input
type="text"
value={this.props.maxChars}
onChange={(e) => this.props.onChangeMaxChars(e.target.value || null)}
/>
</Row>
<Row>
<label>
Is mult-line?
</label>
<input
type="checkbox"
checked={this.props.isMultiline}
onChange={(e) => this.props.onChangeIsMultiline(e.target.checked)}
/>
</Row>
<Row errors={this.props.maxWords ? this.props.errors.maxWords : null}>
<label>
Max words
</label>
<input
disabled={!this.props.isMultiline}
type="number"
value={this.props.maxWords}
onChange={(e) => this.props.onChangeMaxWords(e.target.value || null)}
/>
</Row>
</div>
);
}
}
| Disable max words input unless multiline is selected | Disable max words input unless multiline is selected
| JSX | bsd-3-clause | Kvoti/ditto,Kvoti/ditto,Kvoti/ditto,Kvoti/ditto,Kvoti/ditto | ---
+++
@@ -19,7 +19,6 @@
render() {
console.log('text props', this.props);
- //disabled={!this.props.isMultiline}
return (
<div>
<Row errors={this.props.maxChars ? this.props.errors.maxChars : null}>
@@ -32,16 +31,6 @@
onChange={(e) => this.props.onChangeMaxChars(e.target.value || null)}
/>
</Row>
- <Row errors={this.props.maxWords ? this.props.errors.maxWords : null}>
- <label>
- Max words
- </label>
- <input
- type="number"
- value={this.props.maxWords}
- onChange={(e) => this.props.onChangeMaxWords(e.target.value || null)}
- />
- </Row>
<Row>
<label>
Is mult-line?
@@ -52,6 +41,17 @@
onChange={(e) => this.props.onChangeIsMultiline(e.target.checked)}
/>
</Row>
+ <Row errors={this.props.maxWords ? this.props.errors.maxWords : null}>
+ <label>
+ Max words
+ </label>
+ <input
+ disabled={!this.props.isMultiline}
+ type="number"
+ value={this.props.maxWords}
+ onChange={(e) => this.props.onChangeMaxWords(e.target.value || null)}
+ />
+ </Row>
</div>
);
} |
42bae8555c21e4ef39ef6357f2e149c85575e9fb | app/assets/javascripts/components/chat_typing_label.js.jsx | app/assets/javascripts/components/chat_typing_label.js.jsx |
(function(){
var ChatTypingLabel = React.createClass({
propTypes: {
usernames: React.PropTypes.array
},
render: function() {
return <div>
<span className="text-small gray-2">{this.message()}</span>
</div>
},
message: function() {
var len = this.props.usernames.length
if (len == 1) {
return <span><strong>{this.props.usernames[0]}</strong> is typing</span>
} else if (len == 2) {
return <span>
<strong>{this.props.usernames[0]}</strong> and
<strong>{this.props.usernames[1]}</strong> are typing
</span>
} else if (len > 2) {
return <span>several people are typing</span>
}
return <span> </span>
}
})
if (typeof module !== 'undefined') {
module.exports = ChatTypingLabel
}
window.ChatTypingLabel = ChatTypingLabel
})() |
(function(){
var ChatTypingLabel = React.createClass({
propTypes: {
usernames: React.PropTypes.array
},
render: function() {
return <div>
<span className="text-small gray-2">{this.message()}</span>
</div>
},
message: function() {
var len = this.props.usernames.length
if (len === 1) {
return <span><strong>{this.props.usernames[0]}</strong> is typing</span>
} else if (len === 2) {
return <span>
<strong>{this.props.usernames[0]}</strong> and
<strong>{this.props.usernames[1]}</strong> are typing
</span>
} else if (len > 2) {
return <span>several people are typing</span>
}
return <span> </span>
}
})
if (typeof module !== 'undefined') {
module.exports = ChatTypingLabel
}
window.ChatTypingLabel = ChatTypingLabel
})()
| Use triple equals for comparing numbers | Use triple equals for comparing numbers
| JSX | agpl-3.0 | assemblymade/meta,assemblymade/meta,assemblymade/meta,assemblymade/meta,lachlanjc/meta,lachlanjc/meta,lachlanjc/meta,lachlanjc/meta | ---
+++
@@ -14,9 +14,9 @@
message: function() {
var len = this.props.usernames.length
- if (len == 1) {
+ if (len === 1) {
return <span><strong>{this.props.usernames[0]}</strong> is typing</span>
- } else if (len == 2) {
+ } else if (len === 2) {
return <span>
<strong>{this.props.usernames[0]}</strong> and
<strong>{this.props.usernames[1]}</strong> are typing |
6ee2ac2578e09c93735e99df5f4a07bd3ef3d8fd | app/assets/javascripts/components/categories/category.jsx | app/assets/javascripts/components/categories/category.jsx | import React from 'react';
import CourseUtils from '../../utils/course_utils';
import moment from 'moment';
const Category = ({ course, category, remove, editable }) => {
let removeButton;
if (editable) {
removeButton = <button className="button pull-right small danger" onClick={remove}>{I18n.t('categories.remove')}</button>;
}
const catName = CourseUtils.formattedCategoryName(category, course.home_wiki);
let depth;
let link;
if (category.source === 'category') {
depth = category.depth;
}
if (category.source === 'psid') {
link = `https://petscan.wmflabs.org/?psid=${category.name}`;
} else {
link = `https://en.wikipedia.org/wiki/${catName}`;
}
const lastUpdate = category.updated_at;
const lastUpdateMoment = moment.utc(lastUpdate);
let lastUpdateMessage;
if (lastUpdate) {
lastUpdateMessage = `${I18n.t('metrics.last_update')}: ${lastUpdateMoment.fromNow()}`;
}
return (
<tr>
<td>
<a target="_blank" href={link}>{catName}</a>
</td>
<td>{depth}</td>
<td>{category.articles_count}</td>
<td>
<div className="pull-center">
<small className="mb2">{lastUpdateMessage}</small>
</div>
</td>
<td>{removeButton}</td>
</tr>
);
};
export default Category;
| import React from 'react';
import CourseUtils from '../../utils/course_utils';
import moment from 'moment';
const Category = ({ course, category, remove, editable }) => {
let removeButton;
if (editable) {
removeButton = <button className="button pull-right small danger" onClick={remove}>{I18n.t('categories.remove')}</button>;
}
const catName = CourseUtils.formattedCategoryName(category, course.home_wiki);
let depth;
let link;
if (category.source === 'category') {
depth = category.depth;
}
if (category.source === 'psid') {
link = `https://petscan.wmflabs.org/?psid=${category.name}`;
} else {
link = `https://${course.home_wiki.language}.${course.home_wiki.project}.org/wiki/${catName}`;
}
const lastUpdate = category.updated_at;
const lastUpdateMoment = moment.utc(lastUpdate);
let lastUpdateMessage;
if (lastUpdate) {
lastUpdateMessage = `${I18n.t('metrics.last_update')}: ${lastUpdateMoment.fromNow()}`;
}
return (
<tr>
<td>
<a target="_blank" href={link}>{catName}</a>
</td>
<td>{depth}</td>
<td>{category.articles_count}</td>
<td>
<div className="pull-center">
<small className="mb2">{lastUpdateMessage}</small>
</div>
</td>
<td>{removeButton}</td>
</tr>
);
};
export default Category;
| Fix Category link for non-en.wiki courses | Fix Category link for non-en.wiki courses
| JSX | mit | WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard | ---
+++
@@ -17,7 +17,7 @@
if (category.source === 'psid') {
link = `https://petscan.wmflabs.org/?psid=${category.name}`;
} else {
- link = `https://en.wikipedia.org/wiki/${catName}`;
+ link = `https://${course.home_wiki.language}.${course.home_wiki.project}.org/wiki/${catName}`;
}
const lastUpdate = category.updated_at;
const lastUpdateMoment = moment.utc(lastUpdate); |
ceebe69862210293c757f8c7f5f65fd17698359f | packages/lesswrong/components/questions/AnswersSection.jsx | packages/lesswrong/components/questions/AnswersSection.jsx | import { Components, registerComponent } from 'meteor/vulcan:core';
import React from 'react';
import PropTypes from 'prop-types';
import withUser from '../common/withUser'
const AnswersSection = ({post}) => {
const { AnswersList, NewAnswerForm, currentUser } = Components
return (
<div>
{currentUser && <NewAnswerForm postId={post._id}/>}
<AnswersList terms={{view: "questionAnswers", postId: post._id}} post={post}/>
</div>
)
};
AnswersSection.propTypes = {
post: PropTypes.object.isRequired,
};
registerComponent('AnswersSection', AnswersSection, withUser);
| import { Components, registerComponent } from 'meteor/vulcan:core';
import React from 'react';
import PropTypes from 'prop-types';
import withUser from '../common/withUser'
const AnswersSection = ({post, currentUser}) => {
const { AnswersList, NewAnswerForm } = Components
return (
<div>
{currentUser && <NewAnswerForm postId={post._id}/>}
<AnswersList terms={{view: "questionAnswers", postId: post._id}} post={post}/>
</div>
)
};
AnswersSection.propTypes = {
post: PropTypes.object.isRequired,
};
registerComponent('AnswersSection', AnswersSection, withUser);
| Fix NewAnswerForm for logged-in users | Fix NewAnswerForm for logged-in users
| JSX | mit | Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Telescope,Discordius/Telescope,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Lesswrong2 | ---
+++
@@ -3,8 +3,8 @@
import PropTypes from 'prop-types';
import withUser from '../common/withUser'
-const AnswersSection = ({post}) => {
- const { AnswersList, NewAnswerForm, currentUser } = Components
+const AnswersSection = ({post, currentUser}) => {
+ const { AnswersList, NewAnswerForm } = Components
return (
<div> |
85844c37f9b026a0aad0b90c5dbbc4b9412f44c7 | src/js/components/TabPaneComponent.jsx | src/js/components/TabPaneComponent.jsx | import classNames from "classnames";
import React from "react/addons";
var TabPaneComponent = React.createClass({
displayName: "TabPaneComponent",
propTypes: {
children: React.PropTypes.node,
className: React.PropTypes.string,
isActive: React.PropTypes.bool,
onActivate: React.PropTypes.func
},
componentDidUpdate: function (prevProps) {
if (!prevProps.isActive && this.props.isActive) {
this.props.onActivate();
}
},
getDefaultProps: function () {
return {
isActive: false,
onActivate: function () {}
};
},
render: function () {
if (!this.props.isActive) {
return null;
}
var classSet = classNames("tab-pane active", this.props.className);
return (
<div className={classSet}>
{this.props.children}
</div>
);
}
});
export default TabPaneComponent;
| import classNames from "classnames";
import React from "react/addons";
var TabPaneComponent = React.createClass({
displayName: "TabPaneComponent",
propTypes: {
children: React.PropTypes.node,
className: React.PropTypes.string,
isActive: React.PropTypes.bool
},
getDefaultProps: function () {
return {
isActive: false
};
},
render: function () {
if (!this.props.isActive) {
return null;
}
var classSet = classNames("tab-pane active", this.props.className);
return (
<div className={classSet}>
{this.props.children}
</div>
);
}
});
export default TabPaneComponent;
| Remove unused callback from tab pane component | Remove unused callback from tab pane component
| JSX | apache-2.0 | mesosphere/marathon-ui,cribalik/marathon-ui,mesosphere/marathon-ui,cribalik/marathon-ui | ---
+++
@@ -7,20 +7,12 @@
propTypes: {
children: React.PropTypes.node,
className: React.PropTypes.string,
- isActive: React.PropTypes.bool,
- onActivate: React.PropTypes.func
- },
-
- componentDidUpdate: function (prevProps) {
- if (!prevProps.isActive && this.props.isActive) {
- this.props.onActivate();
- }
+ isActive: React.PropTypes.bool
},
getDefaultProps: function () {
return {
- isActive: false,
- onActivate: function () {}
+ isActive: false
};
},
|
d7eb3182579c83510cae989525455c8cf92f4e8e | lib/src/_shared/MaskedInput.jsx | lib/src/_shared/MaskedInput.jsx | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import MaskedInput from 'react-text-mask';
export default class Input extends PureComponent {
static propTypes = {
mask: PropTypes.any,
value: PropTypes.string,
inputRef: PropTypes.func.isRequired,
}
static defaultProps = {
value: undefined,
mask: undefined,
}
getMask = () => {
if (this.props.value) {
return this.props.mask;
}
return [];
}
render() {
const { inputRef, mask, ...props } = this.props;
return (
mask
? <MaskedInput mask={this.getMask()} {...props} ref={inputRef} />
: <input {...props} ref={inputRef} />
);
}
}
| import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import MaskedInput from 'react-text-mask';
export default class Input extends PureComponent {
static propTypes = {
mask: PropTypes.any,
inputRef: PropTypes.func.isRequired,
}
static defaultProps = {
mask: undefined,
}
render() {
const { inputRef, ...props } = this.props;
return (
this.props.mask
? <MaskedInput {...props} ref={inputRef} />
: <input {...props} ref={inputRef} />
);
}
}
| Revert ignoring mask if value is empty code | Revert ignoring mask if value is empty code
| JSX | mit | mbrookes/material-ui,rscnt/material-ui,oliviertassinari/material-ui,mui-org/material-ui,callemall/material-ui,callemall/material-ui,callemall/material-ui,rscnt/material-ui,rscnt/material-ui,oliviertassinari/material-ui,mbrookes/material-ui,callemall/material-ui,dmtrKovalenko/material-ui-pickers,oliviertassinari/material-ui,dmtrKovalenko/material-ui-pickers,mbrookes/material-ui,mui-org/material-ui,mui-org/material-ui | ---
+++
@@ -5,28 +5,18 @@
export default class Input extends PureComponent {
static propTypes = {
mask: PropTypes.any,
- value: PropTypes.string,
inputRef: PropTypes.func.isRequired,
}
static defaultProps = {
- value: undefined,
mask: undefined,
}
- getMask = () => {
- if (this.props.value) {
- return this.props.mask;
- }
-
- return [];
- }
-
render() {
- const { inputRef, mask, ...props } = this.props;
+ const { inputRef, ...props } = this.props;
return (
- mask
- ? <MaskedInput mask={this.getMask()} {...props} ref={inputRef} />
+ this.props.mask
+ ? <MaskedInput {...props} ref={inputRef} />
: <input {...props} ref={inputRef} />
);
} |
7ddf931b396d9621bbf42c4227e8487cdb612a98 | packages/lesswrong/components/alignment-forum/AlignmentForumHome.jsx | packages/lesswrong/components/alignment-forum/AlignmentForumHome.jsx | import { Components, registerComponent } from 'meteor/vulcan:core';
import React from 'react';
import { Link } from 'react-router';
import Users from "meteor/vulcan:users";
import withUser from '../common/withUser';
const AlignmentForumHome = ({currentUser}) => {
let recentPostsTerms = {view: 'new', limit: 10, forum: true}
const renderRecentPostsTitle = () => <div className="recent-posts-title-component">
{ currentUser && Users.canDo(currentUser, "posts.alignment.new") &&
<div className="new-post-link">
<Link to={{pathname:"/newPost", query: {af: true}}}>
new post
</Link>
</div>
}
</div>
return (
<div className="alignment-forum-home">
<Components.Section title="AI Alignment Posts"
titleComponent={renderRecentPostsTitle()}>
<Components.PostsList terms={recentPostsTerms} showHeader={false} />
</Components.Section>
<Components.Section title="Recent Discussion" titleLink="/AllComments">
<Components.RecentDiscussionThreadsList
terms={{view: 'afRecentDiscussionThreadsList', limit:6}}
threadView={"afRecentDiscussionThread"}
/>
</Components.Section>
</div>
)
};
registerComponent('AlignmentForumHome', AlignmentForumHome, withUser);
| import { Components, registerComponent } from 'meteor/vulcan:core';
import React from 'react';
import { Link } from 'react-router';
import Users from "meteor/vulcan:users";
import withUser from '../common/withUser';
const AlignmentForumHome = ({currentUser}) => {
let recentPostsTerms = {view: 'new', limit: 10, forum: true, af: true}
const renderRecentPostsTitle = () => <div className="recent-posts-title-component">
{ currentUser && Users.canDo(currentUser, "posts.alignment.new") &&
<div className="new-post-link">
<Link to={{pathname:"/newPost", query: {af: true}}}>
new post
</Link>
</div>
}
</div>
return (
<div className="alignment-forum-home">
<Components.Section title="AI Alignment Posts"
titleComponent={renderRecentPostsTitle()}>
<Components.PostsList terms={recentPostsTerms} showHeader={false} />
</Components.Section>
<Components.Section title="Recent Discussion" titleLink="/AllComments">
<Components.RecentDiscussionThreadsList
terms={{view: 'afRecentDiscussionThreadsList', limit:6}}
threadView={"afRecentDiscussionThread"}
/>
</Components.Section>
</div>
)
};
registerComponent('AlignmentForumHome', AlignmentForumHome, withUser);
| Fix sticky posts for alignment forum | Fix sticky posts for alignment forum
| JSX | mit | Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Telescope,Discordius/Telescope | ---
+++
@@ -5,7 +5,7 @@
import withUser from '../common/withUser';
const AlignmentForumHome = ({currentUser}) => {
- let recentPostsTerms = {view: 'new', limit: 10, forum: true}
+ let recentPostsTerms = {view: 'new', limit: 10, forum: true, af: true}
const renderRecentPostsTitle = () => <div className="recent-posts-title-component">
{ currentUser && Users.canDo(currentUser, "posts.alignment.new") && |
dca2e6fec3ad3215e9a19694ce18f633c39a6e9d | client/activities/activity-back-button.jsx | client/activities/activity-back-button.jsx | import React from 'react'
import { connect } from 'react-redux'
import styled from 'styled-components'
import { goBack } from '../activities/action-creators'
import IconButton from '../material/icon-button.jsx'
import BackIcon from '../icons/material/baseline-arrow_back-24px.svg'
const BackButton = styled(IconButton)`
margin-right: 16px;
`
@connect(state => ({ activityOverlay: state.activityOverlay }))
export default class ActivityBackButton extends React.Component {
render() {
const { activityOverlay } = this.props
if (activityOverlay.history.size < 2) return null
return <BackButton icon={<BackIcon />} title='Back' onClick={this.onBackClick} />
}
onBackClick = () => {
this.props.dispatch(goBack())
}
}
| import React from 'react'
import { connect } from 'react-redux'
import styled from 'styled-components'
import { goBack } from '../activities/action-creators'
import IconButton from '../material/icon-button.jsx'
import BackIcon from '../icons/material/baseline-arrow_back-24px.svg'
const BackButton = styled(IconButton)`
margin-right: 16px;
`
@connect(state => ({ activityOverlay: state.activityOverlay }))
export default class ActivityBackButton extends React.Component {
hasBeenRendered = false
shouldShow = true
render() {
const { activityOverlay } = this.props
// We only check to see if the back button should display on the first render, and keep it from
// then on. This assumes that the back stack cannot change without the ActivityOverlay content
// changing, which seems to be an accurate assumption. By doing it this way, we prevent the
// back button from disappearing during transitions (e.g. if you click off the overlay)
if (!this.hasBeenRendered) {
this.shouldShow = activityOverlay.history.size >= 2
this.hasBeenRendered = true
}
return this.shouldShow ? (
<BackButton icon={<BackIcon />} title='Back' onClick={this.onBackClick} />
) : null
}
onBackClick = () => {
this.props.dispatch(goBack())
}
}
| Fix the back button disappearing when clicking off the map preferences overlay. | Fix the back button disappearing when clicking off the map preferences overlay.
| JSX | mit | ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery | ---
+++
@@ -14,12 +14,24 @@
@connect(state => ({ activityOverlay: state.activityOverlay }))
export default class ActivityBackButton extends React.Component {
+ hasBeenRendered = false
+ shouldShow = true
+
render() {
const { activityOverlay } = this.props
- if (activityOverlay.history.size < 2) return null
+ // We only check to see if the back button should display on the first render, and keep it from
+ // then on. This assumes that the back stack cannot change without the ActivityOverlay content
+ // changing, which seems to be an accurate assumption. By doing it this way, we prevent the
+ // back button from disappearing during transitions (e.g. if you click off the overlay)
+ if (!this.hasBeenRendered) {
+ this.shouldShow = activityOverlay.history.size >= 2
+ this.hasBeenRendered = true
+ }
- return <BackButton icon={<BackIcon />} title='Back' onClick={this.onBackClick} />
+ return this.shouldShow ? (
+ <BackButton icon={<BackIcon />} title='Back' onClick={this.onBackClick} />
+ ) : null
}
onBackClick = () => { |
d6e50e3a4c6266d9b5e7dbe5fd0aa8c7f031f10c | app/scripts/pages/nexgddp-embed/nexgddp-embed-component.jsx | app/scripts/pages/nexgddp-embed/nexgddp-embed-component.jsx | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import isEmpty from 'lodash/isEmpty';
// Components
import NexGDDPTool from 'components/nexgddp-tool/NexGDDPTool';
class NexGDDPEmbedPage extends PureComponent {
componentDidMount() {
if (isEmpty(this.props.dataset)) {
this.props.getDatasetByIdOrSlug(
this.props.datasetSlug,
['metadata', 'widget', 'layer']
);
}
}
componentWillUnmount() {
if (!isEmpty(this.props.dataset)) this.setState({ data: {} });
}
render() {
const { dataset, embed } = this.props;
return (
<div className="-theme-2">
<h2>{dataset.name}</h2>
{!isEmpty(dataset) &&
<NexGDDPTool
embed={embed}
dataset={dataset}
/>
}
</div>
);
}
}
NexGDDPEmbedPage.propTypes = {
embed: PropTypes.bool,
datasetSlug: PropTypes.string,
dataset: PropTypes.object,
getDatasetByIdOrSlug: PropTypes.func
};
NexGDDPEmbedPage.defaultProps = {
datasetSlug: '',
dataset: {}
};
export default NexGDDPEmbedPage;
| import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import isEmpty from 'lodash/isEmpty';
// Components
import NexGDDPTool from 'components/nexgddp-tool/NexGDDPTool';
class NexGDDPEmbedPage extends PureComponent {
componentDidMount() {
if (isEmpty(this.props.dataset)) {
this.props.getDatasetByIdOrSlug(
this.props.datasetSlug,
['metadata', 'widget', 'layer']
);
}
}
componentWillUnmount() {
if (!isEmpty(this.props.dataset)) this.setState({ data: {} });
}
render() {
const { dataset, embed } = this.props;
const title = dataset.metadata && dataset.metadata.length && dataset.metadata[0].attributes.name
? dataset.metadata[0].attributes.name
: dataset.name;
return (
<div className="-theme-2">
<h2>{title}</h2>
{!isEmpty(dataset) &&
<NexGDDPTool
embed={embed}
dataset={dataset}
/>
}
</div>
);
}
}
NexGDDPEmbedPage.propTypes = {
embed: PropTypes.bool,
datasetSlug: PropTypes.string,
dataset: PropTypes.object,
getDatasetByIdOrSlug: PropTypes.func
};
NexGDDPEmbedPage.defaultProps = {
datasetSlug: '',
dataset: {}
};
export default NexGDDPEmbedPage;
| Use the dataset's metadata name for the NexGDDP's embeds | Use the dataset's metadata name for the NexGDDP's embeds
Because the NexGDDP dataset are actually spread into several datasets in the API, when sharing an embed of a NexGDDP visualisation, we would display the name of a specific dataset instead of the one of the "group". By using the metadata's title, we avoid this problem.
| JSX | mit | resource-watch/prep-app,resource-watch/prep-app | ---
+++
@@ -23,9 +23,13 @@
render() {
const { dataset, embed } = this.props;
+ const title = dataset.metadata && dataset.metadata.length && dataset.metadata[0].attributes.name
+ ? dataset.metadata[0].attributes.name
+ : dataset.name;
+
return (
<div className="-theme-2">
- <h2>{dataset.name}</h2>
+ <h2>{title}</h2>
{!isEmpty(dataset) &&
<NexGDDPTool |
1df5543bf9c96c2fe80afa9fa800a028a846e445 | react-router/components/Nav.jsx | react-router/components/Nav.jsx | /**
* Copyright 2014, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
var React = require('react');
var Link = require('react-router').Link;
var StateMixin = require('react-router').State;
var Nav = React.createClass({
mixins: [StateMixin],
render: function() {
return (
<ul className="pure-menu pure-menu-open pure-menu-horizontal">
<li className={this.isActive('/') ? 'pure-menu-selected' : ''}><Link to='/'>Home</Link></li>
<li className={this.isActive('/about') ? 'pure-menu-selected' : ''}><Link to='/about'>About</Link></li>
</ul>
);
}
});
module.exports = Nav;
| /**
* Copyright 2014, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
var React = require('react');
var Link = require('react-router').Link;
var Nav = React.createClass({
contextTypes: {
router: React.PropTypes.func.isRequired
},
render: function() {
return (
<ul className="pure-menu pure-menu-open pure-menu-horizontal">
<li className={this.context.router.isActive('/') ? 'pure-menu-selected' : ''}><Link to='/'>Home</Link></li>
<li className={this.context.router.isActive('/about') ? 'pure-menu-selected' : ''}><Link to='/about'>About</Link></li>
</ul>
);
}
});
module.exports = Nav;
| Move from StateMixin to contextTypes | Move from StateMixin to contextTypes
[context docs](https://github.com/rackt/react-router/blob/4ec1f289962217dbd84a8f60d306cfd4d45bf561/docs/api/RouterContext.md) as of this commit.
| JSX | bsd-3-clause | src-code/flux-examples,eriknyk/flux-examples,jeffreywescott/flux-examples,JonnyCheng/flux-examples,devypt/flux-examples,ybbkrishna/flux-examples | ---
+++
@@ -5,15 +5,16 @@
'use strict';
var React = require('react');
var Link = require('react-router').Link;
-var StateMixin = require('react-router').State;
var Nav = React.createClass({
- mixins: [StateMixin],
+ contextTypes: {
+ router: React.PropTypes.func.isRequired
+ },
render: function() {
return (
<ul className="pure-menu pure-menu-open pure-menu-horizontal">
- <li className={this.isActive('/') ? 'pure-menu-selected' : ''}><Link to='/'>Home</Link></li>
- <li className={this.isActive('/about') ? 'pure-menu-selected' : ''}><Link to='/about'>About</Link></li>
+ <li className={this.context.router.isActive('/') ? 'pure-menu-selected' : ''}><Link to='/'>Home</Link></li>
+ <li className={this.context.router.isActive('/about') ? 'pure-menu-selected' : ''}><Link to='/about'>About</Link></li>
</ul>
);
} |
61834dfed6b37502262fb7c281b7e9afb8d3e445 | src/js/components/MemoryFieldComponent.jsx | src/js/components/MemoryFieldComponent.jsx | var React = require("react/addons");
var MemoryFieldComponent = React.createClass({
displayName: "MemoryFieldComponent",
propTypes: {
megabytes: React.PropTypes.number.isRequired
},
render() {
// For a documentation of the different unit prefixes please refer to:
// https://en.wikipedia.org/wiki/Template:Quantities_of_bytes
const units = ["MB", "GB", "TiB", "PiB", "EiB", "ZiB", "YiB"];
const factor = 1024;
const megabytes = this.props.megabytes;
let value = 0;
let index = 0;
if (megabytes > 0) {
index = Math.floor(Math.log(megabytes) / Math.log(factor));
value = Math.round(megabytes / Math.pow(factor, index));
}
return (
<span title={`${megabytes}MB`}>{`${value}${units[index]}`}</span>
);
}
});
module.exports = MemoryFieldComponent;
| var React = require("react/addons");
var MemoryFieldComponent = React.createClass({
displayName: "MemoryFieldComponent",
propTypes: {
megabytes: React.PropTypes.number.isRequired
},
render() {
// For a documentation of the different unit prefixes please refer to:
// https://en.wikipedia.org/wiki/Template:Quantities_of_bytes
var units = ["MB", "GB", "TiB", "PiB", "EiB", "ZiB", "YiB"];
var factor = 1024;
var megabytes = this.props.megabytes;
var value = 0;
var index = 0;
if (megabytes > 0) {
index = Math.floor(Math.log(megabytes) / Math.log(factor));
value = Math.round(megabytes / Math.pow(factor, index));
}
return (
<span title={`${megabytes}MB`}>{`${value}${units[index]}`}</span>
);
}
});
module.exports = MemoryFieldComponent;
| Use var instead of const and let in function scopes for consistency | Use var instead of const and let in function scopes for consistency
| JSX | apache-2.0 | cribalik/marathon-ui,mesosphere/marathon-ui,cribalik/marathon-ui,mesosphere/marathon-ui | ---
+++
@@ -8,11 +8,11 @@
render() {
// For a documentation of the different unit prefixes please refer to:
// https://en.wikipedia.org/wiki/Template:Quantities_of_bytes
- const units = ["MB", "GB", "TiB", "PiB", "EiB", "ZiB", "YiB"];
- const factor = 1024;
- const megabytes = this.props.megabytes;
- let value = 0;
- let index = 0;
+ var units = ["MB", "GB", "TiB", "PiB", "EiB", "ZiB", "YiB"];
+ var factor = 1024;
+ var megabytes = this.props.megabytes;
+ var value = 0;
+ var index = 0;
if (megabytes > 0) {
index = Math.floor(Math.log(megabytes) / Math.log(factor));
value = Math.round(megabytes / Math.pow(factor, index)); |
f1c484c9bf378abd1f5e67132f566300807caafc | public/components/QueryArea.jsx | public/components/QueryArea.jsx | import React from 'react';
class QueryArea extends React.Component {
constructor(props){
super(props);
this.handleBeerClick = this.handleBeerClick.bind(this);
}
handleBeerClick(e) {
e.preventDefault();
const targetBeer = this.props.beerList[e.target.key];
this.props.handleIndividalBeerSearch(targetBeer);
}
render(){
return(
<div>
{
this.props.beerList && this.props.beerList.length > 1 ?
<div>
<h4>Did you mean...</h4>
<ul>
{this.props.beerList.map((item, index) => {
return <li key={index} onClick={this.handleBeerClick}>{item['name']}</li>
})}
</ul></div> : ''
}
</div>
)
}
}
export default QueryArea; | import React from 'react';
class QueryArea extends React.Component {
constructor(props){
super(props);
this.handleBeerClick = this.handleBeerClick.bind(this);
}
handleBeerClick(e) {
e.preventDefault();
const targetBeer = this.props.beerList[e.target.value];
this.props.handleIndividalBeerSearch(targetBeer);
}
render(){
return(
<div>
{
this.props.beerList && this.props.beerList.length > 1 ?
<div>
<h4>Did you mean...</h4>
<ul>
{this.props.beerList.map((item, index) => {
return <li value={index} key={index} onClick={this.handleBeerClick}>{item['name']}</li>
})}
</ul></div> : ''
}
</div>
)
}
}
export default QueryArea; | Fix issue with array mapping | Fix issue with array mapping
| JSX | mit | joeylaguna/tankard.io,joeylaguna/tankard.io | ---
+++
@@ -8,7 +8,7 @@
handleBeerClick(e) {
e.preventDefault();
- const targetBeer = this.props.beerList[e.target.key];
+ const targetBeer = this.props.beerList[e.target.value];
this.props.handleIndividalBeerSearch(targetBeer);
}
@@ -21,7 +21,7 @@
<h4>Did you mean...</h4>
<ul>
{this.props.beerList.map((item, index) => {
- return <li key={index} onClick={this.handleBeerClick}>{item['name']}</li>
+ return <li value={index} key={index} onClick={this.handleBeerClick}>{item['name']}</li>
})}
</ul></div> : ''
} |
fcafd00ceb0c81dba3732e421538e74be3c4def8 | src/components/Icons.jsx | src/components/Icons.jsx | import React from 'react';
export default function Icon({ icon }) {
return (
<svg viewBox="0 0 1024 1024">
<path d={icon}></path>
</svg>
);
};
| import React from 'react';
export default function Icon({ icon }) {
return (
<svg className="icon" viewBox="0 0 1024 1024">
<path d={icon}></path>
</svg>
);
};
| Add class names to svg icon components | Add class names to svg icon components
| JSX | mit | emyarod/afw,emyarod/afw | ---
+++
@@ -2,7 +2,7 @@
export default function Icon({ icon }) {
return (
- <svg viewBox="0 0 1024 1024">
+ <svg className="icon" viewBox="0 0 1024 1024">
<path d={icon}></path>
</svg>
); |
41e75858c0ef7285393d5cae26ae1cf1d6480b33 | components/Error.jsx | components/Error.jsx | import React, { Component } from 'react';
const Error = () => (
<div className="error">
<div className="error-message">
Does not exist
</div>
</div>
);
export default Error;
| import React, { Component } from 'react';
//Stateless component as it does not need to manage any state
const Error = () => (
<div className="error">
<div className="error-message">
Does not exist
</div>
</div>
);
export default Error;
| Add comments to error component | Add comments to error component
| JSX | mit | PMiraLopes/GithubSearcher,PMiraLopes/GithubSearcher | ---
+++
@@ -1,5 +1,6 @@
import React, { Component } from 'react';
+//Stateless component as it does not need to manage any state
const Error = () => (
<div className="error">
<div className="error-message"> |
ee17257f79ad8af4ee88697b1218bb8f1c4a811c | src/query_set.jsx | src/query_set.jsx | // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
import React from 'react';
import { connect } from 'react-redux';
import { RangeQuerySet } from './range_query.jsx';
class _QuerySet extends React.Component {
componentDidMount() {
this._setupQueries(this.props.queries);
this._updateData();
}
componentWillReceiveProps(nextProps) {
if (this.props.queries !== nextProps.queries) {
this._setupQueries(nextProps.queries);
}
this._updateData();
}
_setupQueries(queries) {
this.queries = new RangeQuerySet(queries, this.context.queryStore, (datasets) => this.props.onQueryData(datasets));
}
_updateData() {
const end = Math.round(this.props.range.end.getTime()/1000);
const start = end - this.props.range.duration;
this.queries.updateData(start, end, this.props.filter);
}
render() {
return false;
}
}
_QuerySet.propTypes = {
queries: React.PropTypes.array.isRequired,
onQueryData: React.PropTypes.func.isRequired,
range: React.PropTypes.object.isRequired,
filter: React.PropTypes.object.isRequired,
};
_QuerySet.contextTypes = {
queryStore: React.PropTypes.object.isRequired,
};
export const QuerySet = connect(
(state) => ({
range: state.range,
filter: state.filter,
})
)(_QuerySet);
| // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
import React from 'react';
import { connect } from 'react-redux';
import { RangeQuerySet } from './range_query.jsx';
class _QuerySet extends React.Component {
componentDidMount() {
this._setupQueries(this.props.queries);
this._updateData(this.props);
}
componentWillReceiveProps(nextProps) {
if (this.props.queries !== nextProps.queries) {
this._setupQueries(nextProps.queries);
}
this._updateData(nextProps);
}
_setupQueries(queries) {
this.queries = new RangeQuerySet(queries, this.context.queryStore, (datasets) => this.props.onQueryData(datasets));
}
_updateData(props) {
const end = Math.round(props.range.end.getTime()/1000);
const start = end - props.range.duration;
this.queries.updateData(start, end, props.filter);
}
render() {
return false;
}
}
_QuerySet.propTypes = {
queries: React.PropTypes.array.isRequired,
onQueryData: React.PropTypes.func.isRequired,
range: React.PropTypes.object.isRequired,
filter: React.PropTypes.object.isRequired,
};
_QuerySet.contextTypes = {
queryStore: React.PropTypes.object.isRequired,
};
export const QuerySet = connect(
(state) => ({
range: state.range,
filter: state.filter,
})
)(_QuerySet);
| Fix queries not updating on some filter changes. | Fix queries not updating on some filter changes.
| JSX | apache-2.0 | devnev/boardwalk,devnev/boardwalk | ---
+++
@@ -8,21 +8,21 @@
class _QuerySet extends React.Component {
componentDidMount() {
this._setupQueries(this.props.queries);
- this._updateData();
+ this._updateData(this.props);
}
componentWillReceiveProps(nextProps) {
if (this.props.queries !== nextProps.queries) {
this._setupQueries(nextProps.queries);
}
- this._updateData();
+ this._updateData(nextProps);
}
_setupQueries(queries) {
this.queries = new RangeQuerySet(queries, this.context.queryStore, (datasets) => this.props.onQueryData(datasets));
}
- _updateData() {
- const end = Math.round(this.props.range.end.getTime()/1000);
- const start = end - this.props.range.duration;
- this.queries.updateData(start, end, this.props.filter);
+ _updateData(props) {
+ const end = Math.round(props.range.end.getTime()/1000);
+ const start = end - props.range.duration;
+ this.queries.updateData(start, end, props.filter);
}
render() {
return false; |
5ff9792bead63f6552d2004a23026ae321397f04 | src/components/elements/search-form.jsx | src/components/elements/search-form.jsx | import React from 'react';
import { browserHistory } from 'react-router';
import classnames from 'classnames';
import { preventDefault } from '../../utils';
export default class SearchForm extends React.Component {
constructor(props) {
super(props);
this.state = {
isFocused: false
};
}
refSearchQuery = (input) => {
this.searchQuery = input;
};
focusForm = () => {
this.setState({ isFocused: true });
};
blurForm = () => {
this.setState({ isFocused: false });
};
submitForm = () => {
const query = this.searchQuery.value;
browserHistory.push(`/search?q=${encodeURIComponent(query)}`);
};
render() {
const formClasses = classnames({
'search-form-in-header': true,
'form-inline': true,
'focused': this.state.isFocused
});
return (
<form className={formClasses} action="/search" onSubmit={preventDefault(this.submitForm)}>
<input className="form-control" type="text" name="q" ref={this.refSearchQuery} defaultValue="" onFocus={this.focusForm} onBlur={this.blurForm}/>
<button className="btn btn-default" type="submit">
<i className="fa fa-search"></i>
</button>
</form>
);
}
}
| import React from 'react';
import { connect } from 'react-redux';
import { browserHistory } from 'react-router';
import classnames from 'classnames';
import { preventDefault } from '../../utils';
class SearchForm extends React.Component {
constructor(props) {
super(props);
this.state = {
isFocused: false
};
}
refSearchQuery = (input) => {
this.searchQuery = input;
};
focusForm = () => {
this.setState({ isFocused: true });
};
blurForm = () => {
this.setState({ isFocused: false });
};
submitForm = () => {
const query = this.searchQuery.value;
browserHistory.push(`/search?q=${encodeURIComponent(query)}`);
};
componentWillReceiveProps(newProps) {
if (newProps.query !== this.props.query) {
this.searchQuery.value = newProps.query;
}
}
render() {
const formClasses = classnames({
'search-form-in-header': true,
'form-inline': true,
'focused': this.state.isFocused
});
return (
<form className={formClasses} action="/search" onSubmit={preventDefault(this.submitForm)}>
<input className="form-control" type="text" name="q" ref={this.refSearchQuery} defaultValue={this.props.query} onFocus={this.focusForm} onBlur={this.blurForm}/>
<button className="btn btn-default" type="submit">
<i className="fa fa-search"></i>
</button>
</form>
);
}
}
function mapStateToProps(state) {
return {
query: state.routing.locationBeforeTransitions.query.q || state.routing.locationBeforeTransitions.query.qs || ''
};
}
export default connect(mapStateToProps)(SearchForm);
| Make SearchForm aware of query changes | Make SearchForm aware of query changes
This fixes bug with leftover text in mobile sidebar SearchForm.
| JSX | mit | clbn/freefeed-gamma,clbn/freefeed-gamma,clbn/freefeed-gamma | ---
+++
@@ -1,10 +1,11 @@
import React from 'react';
+import { connect } from 'react-redux';
import { browserHistory } from 'react-router';
import classnames from 'classnames';
import { preventDefault } from '../../utils';
-export default class SearchForm extends React.Component {
+class SearchForm extends React.Component {
constructor(props) {
super(props);
@@ -30,6 +31,12 @@
browserHistory.push(`/search?q=${encodeURIComponent(query)}`);
};
+ componentWillReceiveProps(newProps) {
+ if (newProps.query !== this.props.query) {
+ this.searchQuery.value = newProps.query;
+ }
+ }
+
render() {
const formClasses = classnames({
'search-form-in-header': true,
@@ -39,7 +46,7 @@
return (
<form className={formClasses} action="/search" onSubmit={preventDefault(this.submitForm)}>
- <input className="form-control" type="text" name="q" ref={this.refSearchQuery} defaultValue="" onFocus={this.focusForm} onBlur={this.blurForm}/>
+ <input className="form-control" type="text" name="q" ref={this.refSearchQuery} defaultValue={this.props.query} onFocus={this.focusForm} onBlur={this.blurForm}/>
<button className="btn btn-default" type="submit">
<i className="fa fa-search"></i>
</button>
@@ -47,3 +54,11 @@
);
}
}
+
+function mapStateToProps(state) {
+ return {
+ query: state.routing.locationBeforeTransitions.query.q || state.routing.locationBeforeTransitions.query.qs || ''
+ };
+}
+
+export default connect(mapStateToProps)(SearchForm); |
157969aa5ea168b25b5d969fa57fbb31d46a56c2 | app/javascript/src/components/Navigation/components/AboutScinoteModal.jsx | app/javascript/src/components/Navigation/components/AboutScinoteModal.jsx | // @flow
import React from "react";
import type { Node } from "react";
import { FormattedMessage } from "react-intl";
import { Modal } from "react-bootstrap";
type Props = {
showModal: boolean,
scinoteVersion: string,
addons: Array<string>,
onModalClose: Function
};
export default (props: Props): Node => {
const { showModal, scinoteVersion, addons, onModalClose } = props;
return (
<Modal show={showModal} onHide={onModalClose}>
<Modal.Header closeButton>
<Modal.Title>
<FormattedMessage id="general.about_scinote" />
</Modal.Title>
</Modal.Header>
<Modal.Body>
<strong>
<FormattedMessage id="general.core_version" />
</strong>
<p>{scinoteVersion}</p>
<strong>
<FormattedMessage id="general.addon_versions" />
</strong>
{addons.map((addon: string): Node => <p>{addon}</p>)}
</Modal.Body>
</Modal>
);
};
| // @flow
import React from "react";
import type { Node } from "react";
import { FormattedMessage } from "react-intl";
import { Modal } from "react-bootstrap";
type Props = {
showModal: boolean,
scinoteVersion: string,
addons: Array<string>,
onModalClose: Function
};
export default (props: Props): Node => {
const { showModal, scinoteVersion, addons, onModalClose } = props;
return (
<Modal show={showModal} onHide={onModalClose}>
<Modal.Header closeButton>
<Modal.Title>
<FormattedMessage id="general.about_scinote" />
</Modal.Title>
</Modal.Header>
<Modal.Body>
<strong>
<FormattedMessage id="general.core_version" />
</strong>
<p>{scinoteVersion}</p>
<strong>
<FormattedMessage id="general.addon_versions" />
</strong>
{/* {addons.map((addon: string): Node => <p>{addon}</p>)} */}
</Modal.Body>
</Modal>
);
};
| Comment out code which returns invalid data | HACK: Comment out code which returns invalid data
It seems like the backend is returning a weird response when queried for
addons. Once the backend issue is identified and fixed this should be
uncommented.
Signed-off-by: Adrian Oprea <[email protected]>
| JSX | mpl-2.0 | Ducz0r/scinote-web,mlorb/scinote-web,Ducz0r/scinote-web,mlorb/scinote-web,mlorb/scinote-web,Ducz0r/scinote-web | ---
+++
@@ -28,7 +28,7 @@
<strong>
<FormattedMessage id="general.addon_versions" />
</strong>
- {addons.map((addon: string): Node => <p>{addon}</p>)}
+ {/* {addons.map((addon: string): Node => <p>{addon}</p>)} */}
</Modal.Body>
</Modal>
); |
207b4f0a56c3a8c43f9ecb171fa34dea39e03028 | plugins/resources/app/javascript/app/components/availability_zones/overview.jsx | plugins/resources/app/javascript/app/components/availability_zones/overview.jsx | import AvailabilityZoneCategory from '../../containers/availability_zones/category';
import { byUIString, byNameIn } from '../../utils';
const AvailabilityZoneOverview = ({ isFetching, overview, flavorData }) => {
if (isFetching) {
return <p><span className='spinner'/> Loading capacity data...</p>;
}
const forwardProps = { flavorData };
return (
<React.Fragment>
<div className='bs-callout bs-callout-info bs-callout-emphasize'>
This screen shows the available capacity (gray bar) and actual current resource usage (blue part) in each availability zone.
Use this data to choose which availability zone to deploy your application to.
</div>
{Object.keys(overview.areas).sort(byUIString).map(area => (
overview.areas[area].sort(byUIString).map(serviceType => (
overview.categories[serviceType].sort(byNameIn(serviceType)).map(categoryName => (
<AvailabilityZoneCategory key={categoryName} categoryName={categoryName} {...forwardProps} />
))
))
))}
</React.Fragment>
);
}
export default AvailabilityZoneOverview;
| import AvailabilityZoneCategory from '../../containers/availability_zones/category';
import { byUIString, byNameIn } from '../../utils';
const AvailabilityZoneOverview = ({ isFetching, overview, flavorData }) => {
if (isFetching) {
return <p><span className='spinner'/> Loading capacity data...</p>;
}
const forwardProps = { flavorData };
return (
<React.Fragment>
<div className='bs-callout bs-callout-info bs-callout-emphasize'>
This screen shows the available capacity (gray bar) and actual current resource usage (blue part) in each availability zone.
Use this data to choose which availability zone to deploy your application to.
Please note, it does not account for capacity that has already been assigned but not yet used and therefore may not reflect overall available capacity in the region.
</div>
{Object.keys(overview.areas).sort(byUIString).map(area => (
overview.areas[area].sort(byUIString).map(serviceType => (
overview.categories[serviceType].sort(byNameIn(serviceType)).map(categoryName => (
<AvailabilityZoneCategory key={categoryName} categoryName={categoryName} {...forwardProps} />
))
))
))}
</React.Fragment>
);
}
export default AvailabilityZoneOverview;
| Clarify that this is resource, not quota usage | Clarify that this is resource, not quota usage | JSX | apache-2.0 | sapcc/elektra,sapcc/elektra,sapcc/elektra,sapcc/elektra | ---
+++
@@ -13,6 +13,7 @@
<div className='bs-callout bs-callout-info bs-callout-emphasize'>
This screen shows the available capacity (gray bar) and actual current resource usage (blue part) in each availability zone.
Use this data to choose which availability zone to deploy your application to.
+ Please note, it does not account for capacity that has already been assigned but not yet used and therefore may not reflect overall available capacity in the region.
</div>
{Object.keys(overview.areas).sort(byUIString).map(area => (
overview.areas[area].sort(byUIString).map(serviceType => ( |
d3b65176d36ebed71794c716ca5d1ab28c6e51d4 | src/field/email/ask_email.jsx | src/field/email/ask_email.jsx | import React from 'react';
import Screen from '../../core/screen';
import EmailPane from './email_pane';
const Component = ({model, t}) => (
<EmailPane
lock={model}
placeholder={t("emailInputPlaceholder", {__textOnly: true})}
/>
);
export default class AskEmail extends Screen {
constructor() {
super("email");
}
render() {
return Component;
}
}
| import React from 'react';
import Screen from '../../core/screen';
import EmailPane from './email_pane';
const Component = ({i18n, model}) => (
<EmailPane
lock={model}
placeholder={i18n.str("emailInputPlaceholder")}
/>
);
export default class AskEmail extends Screen {
constructor() {
super("email");
}
render() {
return Component;
}
}
| Use i18n prop instead of t in AskEmail screen | Use i18n prop instead of t in AskEmail screen
| JSX | mit | mike-casas/lock,mike-casas/lock,mike-casas/lock | ---
+++
@@ -2,10 +2,10 @@
import Screen from '../../core/screen';
import EmailPane from './email_pane';
-const Component = ({model, t}) => (
+const Component = ({i18n, model}) => (
<EmailPane
lock={model}
- placeholder={t("emailInputPlaceholder", {__textOnly: true})}
+ placeholder={i18n.str("emailInputPlaceholder")}
/>
);
|
d9761d0466b7a5a93401f662df758b66448039eb | src/client/components/Header.jsx | src/client/components/Header.jsx | import React, { Component } from 'react'
import { Link } from 'react-router'
import { Navbar } from 'react-bootstrap'
import { has } from 'lodash'
import JWTPayload from '../react-prop-types/JWTPayload.js'
import GitHubButton from './GitHubButton.jsx'
import LazyImage from './LazyImage.jsx'
export default class Header extends Component {
render() {
const ghAuthorized = has(this.props, 'jwtPayload.services.github')
if (has(this.props, 'jwtPayload.services.github.username')) {
const jsonReducer = json => json.avatar_url
const ghUsername = this.props.jwtPayload.services.github.username
var avatar = ( // eslint-disable-line no-extra-parens
<LazyImage url={`https://api.github.com/users/${ghUsername}`}
jsonReducer={jsonReducer}
/>
)
} else {
avatar = <img src="public/bird.png" />
}
return (
<Navbar>
<Navbar.Header>
<Link to="/">
<Navbar.Brand>
ioCupid
</Navbar.Brand>
</Link>
</Navbar.Header>
<Navbar.Form pullRight>
{ghAuthorized === true ? avatar : <GitHubButton jwtPayload={this.props.jwtPayload} />}
</Navbar.Form>
</Navbar>
)
}
}
Header.propTypes = {
jwtPayload: JWTPayload.allowNull
}
Header.defaultProps = {
styles: {
}
}
| import React, { Component } from 'react'
import { Link } from 'react-router'
import { Navbar } from 'react-bootstrap'
import { has } from 'lodash'
import JWTPayload from '../react-prop-types/JWTPayload.js'
import GitHubButton from './GitHubButton.jsx'
import LazyImage from './LazyImage.jsx'
export default class Header extends Component {
render() {
const ghAuthorized = has(this.props, 'jwtPayload.services.github')
if (has(this.props, 'jwtPayload.services.github.username')) {
const jsonReducer = json => json.avatar_url
const ghUsername = this.props.jwtPayload.services.github.username
var avatar = ( // eslint-disable-line no-extra-parens
<LazyImage url={`https://api.github.com/users/${ghUsername}`}
jsonReducer={jsonReducer}
placeholder="public/anonymous.png"
/>
)
} else {
avatar = <img src="public/anonymous.png" />
}
return (
<Navbar>
<Navbar.Header>
<Link to="/">
<Navbar.Brand>
ioCupid
</Navbar.Brand>
</Link>
</Navbar.Header>
<Navbar.Form pullRight>
{ghAuthorized === true ? avatar : <GitHubButton jwtPayload={this.props.jwtPayload} />}
</Navbar.Form>
</Navbar>
)
}
}
Header.propTypes = {
jwtPayload: JWTPayload.allowNull
}
Header.defaultProps = {
styles: {
}
}
| Use a more meaningful avatar placeholder | Use a more meaningful avatar placeholder
| JSX | isc | brooksn/iocupid,brooksn/iocupid | ---
+++
@@ -15,10 +15,11 @@
var avatar = ( // eslint-disable-line no-extra-parens
<LazyImage url={`https://api.github.com/users/${ghUsername}`}
jsonReducer={jsonReducer}
+ placeholder="public/anonymous.png"
/>
)
} else {
- avatar = <img src="public/bird.png" />
+ avatar = <img src="public/anonymous.png" />
}
return (
<Navbar> |
fb590c6a9c3feb912690aab2853478636c4581a1 | packages/mwp-app-render/src/components/uxcapture/UXCaptureFont.jsx | packages/mwp-app-render/src/components/uxcapture/UXCaptureFont.jsx | // @flow
import React from 'react';
type Props = {
fontFamily: string,
mark: string,
};
export const fontLoaderSrc =
'https://ajax.googleapis.com/ajax/libs/webfont/1.5.10/webfont.js';
const generateUXCaptureFontJS = (fontFamily: string, mark: string) => `
WebFont.load({
custom: {
families: ['${fontFamily}']
},
active: function() {
window.performance.mark('${mark}');
}
});
`;
// fontFamily attribute should include individual weights if separate files are used
// Example: "Graphik Meetup:n4,n5,n6"
// Attention, if no weight specified, only n4 (e.g. font-weight: 400) is tested for!
// See https://github.com/typekit/webfontloader#events for more detail
const UXCaptureFont = ({ fontFamily, mark }: Props) =>
<script
dangerouslySetInnerHTML={{
__html: generateUXCaptureFontJS(fontFamily, mark),
}}
/>; // eslint-disable-line react/no-danger
export default UXCaptureFont;
| // @flow
import React from 'react';
type Props = {
fontFamily: string,
mark: string,
};
export const fontLoaderSrc =
'https://ajax.googleapis.com/ajax/libs/webfont/1.5.10/webfont.js';
const generateUXCaptureFontJS = (fontFamily: string, mark: string) => `
WebFont.load({
custom: {
families: ['${fontFamily}']
},
active: function() {
if (window.UX) {
window.UX.mark('${mark}');
}
}
});
`;
// fontFamily attribute should include individual weights if separate files are used
// Example: "Graphik Meetup:n4,n5,n6"
// Attention, if no weight specified, only n4 (e.g. font-weight: 400) is tested for!
// See https://github.com/typekit/webfontloader#events for more detail
const UXCaptureFont = ({ fontFamily, mark }: Props) =>
<script
dangerouslySetInnerHTML={{
__html: generateUXCaptureFontJS(fontFamily, mark),
}}
/>; // eslint-disable-line react/no-danger
export default UXCaptureFont;
| Use UX Capture's mark() rather than native UserTiming's mark(). | Use UX Capture's mark() rather than native UserTiming's mark().
| JSX | mit | meetup/meetup-web-platform | ---
+++
@@ -15,7 +15,9 @@
families: ['${fontFamily}']
},
active: function() {
- window.performance.mark('${mark}');
+ if (window.UX) {
+ window.UX.mark('${mark}');
+ }
}
});
`; |
c9e1cadabfc48a3564be7787c3ac2a5121981771 | src/FadeThroughContainer.jsx | src/FadeThroughContainer.jsx | import React from 'react'
import FadeThroughComponent from './FadeThroughComponent.jsx'
export default class FadeThroughContainer extends React.Component {
static propTypes = {
width: React.PropTypes.number.isRequired,
height: React.PropTypes.number.isRequired,
delay: React.PropTypes.number.isRequired
};
state = {
activeIndex: 0
};
componentDidMount() {
this.interval = setInterval(
this.next(),
this.props.delay
)
}
componentWillUnmount() {
clearInterval(this.interval)
}
next() {
return () => {
this.setState({ activeIndex: this.state.activeIndex + 1 })
if (this.state.activeIndex === this.props.children.length)
this.setState({ activeIndex: 0 })
}
}
render() {
const style = {
width: this.props.width,
height: this.props.height
}
return (
<div style={ style }>
<FadeThroughComponent
activeIndex={ this.state.activeIndex }
delay={ this.props.delay }
>
{ this.props.children }
</FadeThroughComponent>
</div>
)
}
}
| import React from 'react'
import FadeThroughComponent from './FadeThroughComponent.jsx'
export default class FadeThroughContainer extends React.Component {
static propTypes = {
width: React.PropTypes.string.isRequired,
height: React.PropTypes.string.isRequired,
delay: React.PropTypes.number.isRequired
};
state = {
activeIndex: 0
};
componentDidMount() {
this.interval = setInterval(
this.next(),
this.props.delay
)
}
componentWillUnmount() {
clearInterval(this.interval)
}
next() {
return () => {
this.setState({ activeIndex: this.state.activeIndex + 1 })
if (this.state.activeIndex === this.props.children.length)
this.setState({ activeIndex: 0 })
}
}
render() {
const style = {
width: this.props.width,
height: this.props.height
}
return (
<div style={ style }>
<FadeThroughComponent
activeIndex={ this.state.activeIndex }
delay={ this.props.delay }
>
{ this.props.children }
</FadeThroughComponent>
</div>
)
}
}
| Fix Proptype requirement for height and width. Change to string. | Fix Proptype requirement for height and width. Change to string.
| JSX | mit | sunyang713/react-fadethrough | ---
+++
@@ -4,8 +4,8 @@
export default class FadeThroughContainer extends React.Component {
static propTypes = {
- width: React.PropTypes.number.isRequired,
- height: React.PropTypes.number.isRequired,
+ width: React.PropTypes.string.isRequired,
+ height: React.PropTypes.string.isRequired,
delay: React.PropTypes.number.isRequired
};
|
a465f12f54e65277d268b14e7d97d2df286b4d64 | src/components/pages/NotFoundPage/index.jsx | src/components/pages/NotFoundPage/index.jsx | /*
Copyright (C) 2017 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// @flow
import React from 'react'
import styled from 'styled-components'
import EmptyTemplate from '../../templates/EmptyTemplate'
const Wrapper = styled.div``
const NotFoundPage = () => {
return (
<EmptyTemplate>
<Wrapper>
Not found
</Wrapper>
</EmptyTemplate>
)
}
export default NotFoundPage
| /*
Copyright (C) 2017 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// @flow
import React from 'react'
import styled from 'styled-components'
import Palette from '../../styleUtils/Palette'
import EmptyTemplate from '../../templates/EmptyTemplate'
const Wrapper = styled.div`
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
`
const Title = styled.div`
font-size: 21px;
color: ${Palette.grayscale[4]};
`
const Message = styled.div`
margin-top: 16px;
color: ${Palette.grayscale[8]};
`
const NotFoundPage = () => {
return (
<EmptyTemplate>
<Wrapper>
<Title>Page Not Found</Title>
<Message>Sorry, but the page you are trying to view does not exist.</Message>
</Wrapper>
</EmptyTemplate>
)
}
export default NotFoundPage
| Add basic style to `NotFoundPage` | Add basic style to `NotFoundPage`
Use any invalid path to view it. Ex.: 'http://localhost:3000/blabla'.
| JSX | agpl-3.0 | aznashwan/coriolis-web,aznashwan/coriolis-web | ---
+++
@@ -17,15 +17,35 @@
import React from 'react'
import styled from 'styled-components'
+import Palette from '../../styleUtils/Palette'
import EmptyTemplate from '../../templates/EmptyTemplate'
-const Wrapper = styled.div``
+const Wrapper = styled.div`
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: 0;
+ left: 0;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+`
+const Title = styled.div`
+ font-size: 21px;
+ color: ${Palette.grayscale[4]};
+`
+const Message = styled.div`
+ margin-top: 16px;
+ color: ${Palette.grayscale[8]};
+`
const NotFoundPage = () => {
return (
<EmptyTemplate>
<Wrapper>
- Not found
+ <Title>Page Not Found</Title>
+ <Message>Sorry, but the page you are trying to view does not exist.</Message>
</Wrapper>
</EmptyTemplate>
) |
3ffad7530ea4af1fa8fe30b9a7d1731873d87b69 | app/assets/javascripts/scorebook/progress_reports/sortable_th.jsx | app/assets/javascripts/scorebook/progress_reports/sortable_th.jsx | // Ported from EC.ActivitySearchSort
EC.SortableTh = React.createClass({
propTypes: {
displayName: React.PropTypes.string.isRequired,
sortHandler: React.PropTypes.func.isRequired // Handle sorting of columns
},
getInitialState: function() {
return {
sortDirection: 'asc'
};
},
arrowClass: function() {
return this.state.sortDirection === 'desc' ? 'fa fa-caret-down' : 'fa fa-caret-up';
},
clickSort: function() {
// Toggle the sort direction.
var newDirection = (this.state.sortDirection === 'asc') ? 'desc' : 'asc';
this.setState({sortDirection: newDirection}, _.bind(function() {
this.props.sortHandler(newDirection);
}, this));
},
render: function() {
return (
<th className="sorter" onClick={this.clickSort}>
{this.props.displayName}
<i className={this.arrowClass()}></i>
</th>
);
}
}); | // Ported from EC.ActivitySearchSort
EC.SortableTh = React.createClass({
propTypes: {
displayName: React.PropTypes.string.isRequired,
sortHandler: React.PropTypes.func.isRequired // Handle sorting of columns
},
getInitialState: function() {
return {
sortDirection: 'asc'
};
},
arrowClass: function() {
return this.state.sortDirection === 'desc' ? 'fa fa-caret-down' : 'fa fa-caret-up';
},
clickSort: function() {
// Toggle the sort direction.
var newDirection = (this.state.sortDirection === 'asc') ? 'desc' : 'asc';
this.setState({sortDirection: newDirection}, function() {
this.props.sortHandler(newDirection);
});
},
render: function() {
return (
<th className="sorter" onClick={this.clickSort}>
{this.props.displayName}
<i className={this.arrowClass()}></i>
</th>
);
}
}); | Remove unnecessary bind() in SortableTh | Remove unnecessary bind() in SortableTh
| JSX | agpl-3.0 | empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core | ---
+++
@@ -18,9 +18,9 @@
clickSort: function() {
// Toggle the sort direction.
var newDirection = (this.state.sortDirection === 'asc') ? 'desc' : 'asc';
- this.setState({sortDirection: newDirection}, _.bind(function() {
- this.props.sortHandler(newDirection);
- }, this));
+ this.setState({sortDirection: newDirection}, function() {
+ this.props.sortHandler(newDirection);
+ });
},
render: function() { |
3204a90970c70ea01c66186ee0e9a02cbc74470a | src/common/Track.jsx | src/common/Track.jsx | /* eslint-disable react/prop-types */
import React from 'react';
const Track = (props) => {
const { className, included, vertical, offset, length, style } = props;
const positonStyle = vertical ? {
bottom: `${offset}%`,
height: `${length}%`,
} : {
left: `${offset}%`,
width: `${length}%`,
};
const elStyle = {
visibility: included ? 'visible' : 'hidden',
...style,
...positonStyle,
};
return <div className={className} style={elStyle} />;
};
export default Track;
| /* eslint-disable react/prop-types */
import React from 'react';
const Track = (props) => {
const { className, included, vertical, offset, length, style } = props;
const positonStyle = vertical ? {
bottom: `${offset}%`,
height: `${length}%`,
} : {
left: `${offset}%`,
width: `${length}%`,
};
const elStyle = {
...style,
...positonStyle,
};
return included ? <div className={className} style={elStyle} /> : null;
};
export default Track;
| Remove visibility property from rc-slider-track | Remove visibility property from rc-slider-track
| JSX | mit | react-component/slider,react-component/slider | ---
+++
@@ -13,11 +13,10 @@
};
const elStyle = {
- visibility: included ? 'visible' : 'hidden',
...style,
...positonStyle,
};
- return <div className={className} style={elStyle} />;
+ return included ? <div className={className} style={elStyle} /> : null;
};
export default Track; |
8ce8da0713055fc6265388b4af8c9fd776502761 | app/app/components/navbar/Nav.jsx | app/app/components/navbar/Nav.jsx | import React from 'react';
import {Link, hashHistory} from 'react-router'
import NavLinks from './NavLinks.jsx'
export default class Nav extends React.Component {
render(){
return (
<nav className="navbar navbar-inverse">
<div className="container">
<div className="navbar-header">
<button type="button" className="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span className="sr-only">Toggle navigation</span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
</button>
<Link to="/" className="navbar-brand">MicroSerfs</Link>
</div>
<div id="navbar" className="collapse navbar-collapse">
<ul className="nav navbar-nav">
<NavLinks />
</ul>
</div>
</div>
</nav>
)
}
} | import React from 'react';
import {Link, hashHistory} from 'react-router'
import NavLinks from './NavLinks.jsx'
export default class Nav extends React.Component {
render(){
return (
<nav className="navbar navbar-inverse">
<div className="container">
<div className="navbar-header">
<button type="button" className="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span className="sr-only">Toggle navigation</span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
</button>
<Link to="/" className="navbar-brand">MicroSerfs</Link>
</div>
<div id="navbar" className="collapse navbar-collapse">
<NavLinks />
</div>
</div>
</nav>
)
}
} | Update navbar to include it's links factored out | Update navbar to include it's links factored out
| JSX | mit | taodav/MicroSerfs,taodav/MicroSerfs | ---
+++
@@ -18,9 +18,7 @@
<Link to="/" className="navbar-brand">MicroSerfs</Link>
</div>
<div id="navbar" className="collapse navbar-collapse">
- <ul className="nav navbar-nav">
- <NavLinks />
- </ul>
+ <NavLinks />
</div>
</div>
</nav> |
0ea5420bdf744fc4180948877ef41fb6b41cbe73 | system-addon/content-src/asrouter/templates/OnboardingMessage/OnboardingMessage.jsx | system-addon/content-src/asrouter/templates/OnboardingMessage/OnboardingMessage.jsx | import {ModalOverlay} from "../../components/ModalOverlay/ModalOverlay";
import React from "react";
class OnboardingCard extends React.PureComponent {
constructor(props) {
super(props);
this.onClick = this.onClick.bind(this);
}
onClick() {
const {props} = this;
props.sendUserActionTelemetry({event: "TRY_NOW", message_id: props.id});
props.onAction(props.content);
}
render() {
const {content} = this.props;
return (
<div className="onboardingMessage">
<div className={`onboardingMessageImage ${content.icon}`} />
<div className="onboardingContent">
<span>
<h3> {content.title} </h3>
<p> {content.text} </p>
</span>
<span>
<button className="button onboardingButton" onClick={this.onClick}> {content.button_label} </button>
</span>
</div>
</div>
);
}
}
export class OnboardingMessage extends React.PureComponent {
render() {
const {props} = this;
return (
<ModalOverlay {...props} button_label={"Start Browsing"} title={"Welcome to Firefox"}>
<div className="onboardingMessageContainer">
{props.bundle.map(message => (
<OnboardingCard key={message.id} sendUserActionTelemetry={props.sendUserActionTelemetry} onAction={props.onAction} {...message} />
))}
</div>
</ModalOverlay>
);
}
}
| import {ModalOverlay} from "../../components/ModalOverlay/ModalOverlay";
import React from "react";
class OnboardingCard extends React.PureComponent {
constructor(props) {
super(props);
this.onClick = this.onClick.bind(this);
}
onClick() {
const {props} = this;
props.sendUserActionTelemetry({event: "CLICK_BUTTON", message_id: props.id});
props.onAction(props.content);
}
render() {
const {content} = this.props;
return (
<div className="onboardingMessage">
<div className={`onboardingMessageImage ${content.icon}`} />
<div className="onboardingContent">
<span>
<h3> {content.title} </h3>
<p> {content.text} </p>
</span>
<span>
<button className="button onboardingButton" onClick={this.onClick}> {content.button_label} </button>
</span>
</div>
</div>
);
}
}
export class OnboardingMessage extends React.PureComponent {
render() {
const {props} = this;
return (
<ModalOverlay {...props} button_label={"Start Browsing"} title={"Welcome to Firefox"}>
<div className="onboardingMessageContainer">
{props.bundle.map(message => (
<OnboardingCard key={message.id} sendUserActionTelemetry={props.sendUserActionTelemetry} onAction={props.onAction} {...message} />
))}
</div>
</ModalOverlay>
);
}
}
| Change telemetry for onboarding from 'TRY_NOW' to regular button click | chore(telemetry): Change telemetry for onboarding from 'TRY_NOW' to regular button click
| JSX | mpl-2.0 | mozilla/activity-stream,mozilla/activity-stream,rlr/activity-streams,Mardak/activity-stream,rlr/activity-streams,mozilla/activity-streams,AdamHillier/activity-stream,rlr/activity-streams,sarracini/activity-stream,Mardak/activity-stream,AdamHillier/activity-stream,sarracini/activity-stream,AdamHillier/activity-stream,Mardak/activity-stream,mozilla/activity-stream,mozilla/activity-streams,AdamHillier/activity-stream,rlr/activity-streams,sarracini/activity-stream,Mardak/activity-stream,mozilla/activity-stream,sarracini/activity-stream | ---
+++
@@ -9,7 +9,7 @@
onClick() {
const {props} = this;
- props.sendUserActionTelemetry({event: "TRY_NOW", message_id: props.id});
+ props.sendUserActionTelemetry({event: "CLICK_BUTTON", message_id: props.id});
props.onAction(props.content);
}
|
1f18cf97b5b2a8b1c5293e792a98b1cc486ed456 | app/assets/javascripts/components/components/media_gallery.jsx | app/assets/javascripts/components/components/media_gallery.jsx | import ImmutablePropTypes from 'react-immutable-proptypes';
import PureRenderMixin from 'react-addons-pure-render-mixin';
const MediaGallery = React.createClass({
propTypes: {
media: ImmutablePropTypes.list.isRequired
},
mixins: [PureRenderMixin],
render () {
var children = this.props.media.take(4);
var size = children.size;
children = children.map((attachment, i) => {
let width = 142;
let height = 110;
let marginRight = 0;
if (size == 4 || (size === 3 && i > 0)) {
height = 52.5;
}
if ((size === 3 && i === 0) || (size === 4 && i % 2 === 0)) {
marginRight = 5;
}
return <a key={attachment.get('id')} href={attachment.get('url')} style={{ position: 'relative', float: 'left', marginRight: `${marginRight}px`, marginBottom: '5px', textDecoration: 'none', border: 'none', display: 'block', width: `${width}px`, height: `${height}px`, background: `url(${attachment.get('preview_url')}) no-repeat`, backgroundSize: 'cover', cursor: 'zoom-in' }} />;
});
return (
<div style={{ marginTop: '8px', overflow: 'hidden', marginBottom: '-5px' }}>
{children}
</div>
);
}
});
export default MediaGallery;
| import ImmutablePropTypes from 'react-immutable-proptypes';
import PureRenderMixin from 'react-addons-pure-render-mixin';
const MediaGallery = React.createClass({
propTypes: {
media: ImmutablePropTypes.list.isRequired
},
mixins: [PureRenderMixin],
render () {
var children = this.props.media.take(4);
var size = children.size;
children = children.map((attachment, i) => {
let width = 50;
let height = 100;
if (size == 4 || (size === 3 && i > 0)) {
height = 50;
}
return <a key={attachment.get('id')} href={attachment.get('url')} style={{ boxSizing: 'border-box', position: 'relative', float: 'left', textDecoration: 'none', border: 'none', display: 'block', width: `${width}%`, height: `${height}%`, background: `url(${attachment.get('preview_url')}) no-repeat`, backgroundSize: 'cover', cursor: 'zoom-in' }} />;
});
return (
<div style={{ marginTop: '8px', overflow: 'hidden', width: '100%', height: '110px', boxSizing: 'border-box', padding: '4px' }}>
{children}
</div>
);
}
});
export default MediaGallery;
| Fix styling of media attachments in statuses | Fix styling of media attachments in statuses
| JSX | agpl-3.0 | bureaucracy/mastodon,pso2club/mastodon,pinfort/mastodon,verniy6462/mastodon,lindwurm/mastodon,maa123/mastodon,unarist/mastodon,foozmeat/mastodon,sylph-sin-tyaku/mastodon,bureaucracy/mastodon,kibousoft/mastodon,kagucho/mastodon,thor-the-norseman/mastodon,summoners-riftodon/mastodon,anon5r/mastonon,rutan/mastodon,Monappy/mastodon,mosaxiv/mastodon,NS-Kazuki/mastodon,NS-Kazuki/mastodon,TheInventrix/mastodon,Chronister/mastodon,ambition-vietnam/mastodon,Nyoho/mastodon,ineffyble/mastodon,imas/mastodon,librize/mastodon,tootsuite/mastodon,mimumemo/mastodon,mimumemo/mastodon,developer-mstdn18/mstdn18,3846masa/mastodon,cobodo/mastodon,pfm-eyesightjp/mastodon,amazedkoumei/mastodon,riku6460/chikuwagoddon,Gargron/mastodon,havicon/mastodon,ashfurrow/mastodon,rekif/mastodon,tootsuite/mastodon,lindwurm/mastodon,Craftodon/Craftodon,heropunch/mastodon-ce,alarky/mastodon,MastodonCloud/mastodon,alarky/mastodon,codl/mastodon,MastodonCloud/mastodon,tootcafe/mastodon,NS-Kazuki/mastodon,primenumber/mastodon,pso2club/mastodon,amazedkoumei/mastodon,ykzts/mastodon,WitchesTown/mastodon,ikuradon/mastodon,KnzkDev/mastodon,mimumemo/mastodon,hugogameiro/mastodon,NS-Kazuki/mastodon,blackle/mastodon,vahnj/mastodon,theoria24/mastodon,nclm/mastodon,tri-star/mastodon,masarakki/mastodon,YuyaYokosuka/mastodon_animeclub,h-izumi/mastodon,sylph-sin-tyaku/mastodon,MitarashiDango/mastodon,masarakki/mastodon,TootCat/mastodon,masarakki/mastodon,h-izumi/mastodon,ambition-vietnam/mastodon,mimumemo/mastodon,musashino205/mastodon,verniy6462/mastodon,Ryanaka/mastodon,Ryanaka/mastodon,Nyoho/mastodon,cobodo/mastodon,dunn/mastodon,rainyday/mastodon,YuyaYokosuka/mastodon_animeclub,kagucho/mastodon,dissolve/mastodon,havicon/mastodon,unarist/mastodon,glitch-soc/mastodon,nonoz/mastodon,rekif/mastodon,hyuki0000/mastodon,kazh98/social.arnip.org,palon7/mastodon,hyuki0000/mastodon,Monappy/mastodon,ebihara99999/mastodon,pso2club/mastodon,h3zjp/mastodon,WitchesTown/mastodon,RobertRence/Mastodon,rutan/mastodon,robotstart/mastodon,ambition-vietnam/mastodon,YuyaYokosuka/mastodon_animeclub,imomix/mastodon,kagucho/mastodon,pointlessone/mastodon,corzntin/mastodon,8796n/mastodon,SerCom-KC/mastodon,moeism/mastodon,tateisu/mastodon,alarky/mastodon,Arukas/mastodon,verniy6462/mastodon,alimony/mastodon,amazedkoumei/mastodon,tcitworld/mastodon,tootcafe/mastodon,koteitan/googoldon,tootcafe/mastodon,KnzkDev/mastodon,MastodonCloud/mastodon,danhunsaker/mastodon,saggel/mastodon,Toootim/mastodon,h-izumi/mastodon,dwango/mastodon,masto-donte-com-br/mastodon,summoners-riftodon/mastodon,danhunsaker/mastodon,developer-mstdn18/mstdn18,librize/mastodon,primenumber/mastodon,salvadorpla/mastodon,5thfloor/ichiji-social,res-ac/mstdn.res.ac,foozmeat/mastodon,3846masa/mastodon,tateisu/mastodon,saggel/mastodon,PlantsNetwork/mastodon,gol-cha/mastodon,kirakiratter/mastodon,dunn/mastodon,saggel/mastodon,MastodonCloud/mastodon,SerCom-KC/mastodon,Kirishima21/mastodon,imomix/mastodon,yi0713/mastodon,sinsoku/mastodon,unarist/mastodon,corzntin/mastodon,koba-lab/mastodon,mhffdq/mastodon,koteitan/googoldon,RobertRence/Mastodon,alarky/mastodon,Toootim/mastodon,danhunsaker/mastodon,Craftodon/Craftodon,ebihara99999/mastodon,riku6460/chikuwagoddon,ashfurrow/mastodon,glitch-soc/mastodon,musashino205/mastodon,cobodo/mastodon,honpya/taketodon,hyuki0000/mastodon,imas/mastodon,gol-cha/mastodon,vahnj/mastodon,tri-star/mastodon,ikuradon/mastodon,lindwurm/mastodon,summoners-riftodon/mastodon,kibousoft/mastodon,h-izumi/mastodon,mhffdq/mastodon,pixiv/mastodon,HogeTatu/mastodon,Kirishima21/mastodon,lynlynlynx/mastodon,MitarashiDango/mastodon,HogeTatu/mastodon,primenumber/mastodon,tootsuite/mastodon,Kirishima21/mastodon,ebihara99999/mastodon,kirakiratter/mastodon,cybrespace/mastodon,robotstart/mastodon,alimony/mastodon,salvadorpla/mastodon,Kyon0000/mastodon,kazh98/social.arnip.org,koba-lab/mastodon,clworld/mastodon,maa123/mastodon,codl/mastodon,RobertRence/Mastodon,PlantsNetwork/mastodon,honpya/taketodon,rekif/mastodon,heropunch/mastodon-ce,imas/mastodon,res-ac/mstdn.res.ac,tootcafe/mastodon,blackle/mastodon,Monappy/mastodon,Arukas/mastodon,developer-mstdn18/mstdn18,nonoz/mastodon,palon7/mastodon,kazh98/social.arnip.org,Kyon0000/mastodon,Arukas/mastodon,sinsoku/mastodon,Arukas/mastodon,ms2sato/mastodon,KnzkDev/mastodon,masarakki/mastodon,theoria24/mastodon,pfm-eyesightjp/mastodon,masto-donte-com-br/mastodon,palon7/mastodon,mstdn-jp/mastodon,TootCat/mastodon,abcang/mastodon,primenumber/mastodon,narabo/mastodon,increments/mastodon,Gargron/mastodon,kirakiratter/mastodon,TheInventrix/mastodon,koteitan/googoldon,infinimatix/infinimatix.net,salvadorpla/mastodon,ikuradon/mastodon,musashino205/mastodon,clworld/mastodon,YuyaYokosuka/mastodon_animeclub,TootCat/mastodon,ykzts/mastodon,koba-lab/mastodon,narabo/mastodon,pointlessone/mastodon,corzntin/mastodon,koteitan/googoldon,Craftodon/Craftodon,d6rkaiz/mastodon,lynlynlynx/mastodon,pixiv/mastodon,librize/mastodon,masto-donte-com-br/mastodon,nonoz/mastodon,increments/mastodon,mosaxiv/mastodon,yi0713/mastodon,SerCom-KC/mastodon,narabo/mastodon,anon5r/mastonon,esetomo/mastodon,8796n/mastodon,ms2sato/mastodon,moeism/mastodon,rainyday/mastodon,hugogameiro/mastodon,rainyday/mastodon,sylph-sin-tyaku/mastodon,PlantsNetwork/mastodon,jukper/mastodon,esetomo/mastodon,h3zjp/mastodon,RobertRence/Mastodon,ashfurrow/mastodon,vahnj/mastodon,Gargron/mastodon,d6rkaiz/mastodon,Kirishima21/mastodon,rekif/mastodon,mecab/mastodon,cybrespace/mastodon,mstdn-jp/mastodon,pixiv/mastodon,dwango/mastodon,rainyday/mastodon,Toootim/mastodon,haleyashleypraesent/ProjectPrionosuchus,5thfloor/ichiji-social,res-ac/mstdn.res.ac,infinimatix/infinimatix.net,tcitworld/mastodon,danhunsaker/mastodon,infinimatix/infinimatix.net,tootsuite/mastodon,tateisu/mastodon,riku6460/chikuwagoddon,dwango/mastodon,Chronister/mastodon,clworld/mastodon,unarist/mastodon,kagucho/mastodon,ebihara99999/mastodon,MitarashiDango/mastodon,mstdn-jp/mastodon,sylph-sin-tyaku/mastodon,dissolve/mastodon,kibousoft/mastodon,im-in-space/mastodon,mhffdq/mastodon,mhffdq/mastodon,TheInventrix/mastodon,Chronister/mastodon,honpya/taketodon,abcang/mastodon,sinsoku/mastodon,im-in-space/mastodon,3846masa/mastodon,ykzts/mastodon,ykzts/mastodon,d6rkaiz/mastodon,8796n/mastodon,yukimochi/mastodon,ms2sato/mastodon,ineffyble/mastodon,maa123/mastodon,mecab/mastodon,vahnj/mastodon,hyuki0000/mastodon,Toootim/mastodon,hugogameiro/mastodon,pixiv/mastodon,imas/mastodon,rutan/mastodon,dwango/mastodon,honpya/taketodon,lynlynlynx/mastodon,bureaucracy/mastodon,thnkrs/mastodon,mosaxiv/mastodon,SerCom-KC/mastodon,haleyashleypraesent/ProjectPrionosuchus,5thfloor/ichiji-social,yukimochi/mastodon,haleyashleypraesent/ProjectPrionosuchus,alimony/mastodon,nclm/mastodon,TootCat/mastodon,TheInventrix/mastodon,dunn/mastodon,kibousoft/mastodon,esetomo/mastodon,cybrespace/mastodon,glitch-soc/mastodon,ashfurrow/mastodon,5thfloor/ichiji-social,amazedkoumei/mastodon,KnzkDev/mastodon,yi0713/mastodon,mstdn-jp/mastodon,abcang/mastodon,MitarashiDango/mastodon,d6rkaiz/mastodon,mecab/mastodon,imomix/mastodon,riku6460/chikuwagoddon,maa123/mastodon,heropunch/mastodon-ce,jukper/mastodon,tateisu/mastodon,yukimochi/mastodon,theoria24/mastodon,vahnj/mastodon,pso2club/mastodon,koba-lab/mastodon,pointlessone/mastodon,lynlynlynx/mastodon,thor-the-norseman/mastodon,anon5r/mastonon,blackle/mastodon,3846masa/mastodon,nclm/mastodon,ineffyble/mastodon,jukper/mastodon,imomix/mastodon,pinfort/mastodon,corzntin/mastodon,Kyon0000/mastodon,moeism/mastodon,TheInventrix/mastodon,musashino205/mastodon,dunn/mastodon,havicon/mastodon,hugogameiro/mastodon,pointlessone/mastodon,codl/mastodon,thor-the-norseman/mastodon,foozmeat/mastodon,anon5r/mastonon,Chronister/mastodon,narabo/mastodon,abcang/mastodon,h3zjp/mastodon,res-ac/mstdn.res.ac,thnkrs/mastodon,salvadorpla/mastodon,palon7/mastodon,mosaxiv/mastodon,tri-star/mastodon,theoria24/mastodon,pfm-eyesightjp/mastodon,codl/mastodon,ikuradon/mastodon,im-in-space/mastodon,Craftodon/Craftodon,kirakiratter/mastodon,robotstart/mastodon,verniy6462/mastodon,foozmeat/mastodon,nonoz/mastodon,Monappy/mastodon,lindwurm/mastodon,im-in-space/mastodon,cybrespace/mastodon,Ryanaka/mastodon,WitchesTown/mastodon,Ryanaka/mastodon,increments/mastodon,clworld/mastodon,dissolve/mastodon,PlantsNetwork/mastodon,h3zjp/mastodon,HogeTatu/mastodon,gol-cha/mastodon,Nyoho/mastodon,thnkrs/mastodon,ambition-vietnam/mastodon,glitch-soc/mastodon,mecab/mastodon,pinfort/mastodon,yukimochi/mastodon,masto-donte-com-br/mastodon,summoners-riftodon/mastodon,WitchesTown/mastodon,kazh98/social.arnip.org,esetomo/mastodon,blackle/mastodon,pfm-eyesightjp/mastodon,pinfort/mastodon,yi0713/mastodon,increments/mastodon,rutan/mastodon,gol-cha/mastodon,haleyashleypraesent/ProjectPrionosuchus,tri-star/mastodon,tcitworld/mastodon,Nyoho/mastodon,cobodo/mastodon | ---
+++
@@ -14,23 +14,18 @@
var size = children.size;
children = children.map((attachment, i) => {
- let width = 142;
- let height = 110;
- let marginRight = 0;
+ let width = 50;
+ let height = 100;
if (size == 4 || (size === 3 && i > 0)) {
- height = 52.5;
+ height = 50;
}
- if ((size === 3 && i === 0) || (size === 4 && i % 2 === 0)) {
- marginRight = 5;
- }
-
- return <a key={attachment.get('id')} href={attachment.get('url')} style={{ position: 'relative', float: 'left', marginRight: `${marginRight}px`, marginBottom: '5px', textDecoration: 'none', border: 'none', display: 'block', width: `${width}px`, height: `${height}px`, background: `url(${attachment.get('preview_url')}) no-repeat`, backgroundSize: 'cover', cursor: 'zoom-in' }} />;
+ return <a key={attachment.get('id')} href={attachment.get('url')} style={{ boxSizing: 'border-box', position: 'relative', float: 'left', textDecoration: 'none', border: 'none', display: 'block', width: `${width}%`, height: `${height}%`, background: `url(${attachment.get('preview_url')}) no-repeat`, backgroundSize: 'cover', cursor: 'zoom-in' }} />;
});
return (
- <div style={{ marginTop: '8px', overflow: 'hidden', marginBottom: '-5px' }}>
+ <div style={{ marginTop: '8px', overflow: 'hidden', width: '100%', height: '110px', boxSizing: 'border-box', padding: '4px' }}>
{children}
</div>
); |
23bdbfcf3155427f1c2458e6e1608fece8d3a1fd | packages/lesswrong/components/recommendations/RecommendationsPage.jsx | packages/lesswrong/components/recommendations/RecommendationsPage.jsx | import { Components, registerComponent } from 'meteor/vulcan:core';
import React, { Component } from 'react';
import { withStyles } from '@material-ui/core/styles';
import { getFragment } from 'meteor/vulcan:core';
import gql from 'graphql-tag';
import { graphql } from 'react-apollo';
import withUser from '../common/withUser';
const withRecommendations = component => {
const recommendationsQuery = gql`
query RecommendationsQuery($count: Int) {
Recommendations(count: $count) {
...PostsList
}
}
${getFragment("PostsList")}
`;
return graphql(recommendationsQuery,
{
alias: "withRecommendations",
options: () => ({
variables: {
count: 10,
}
}),
props(props) {
return {
recommendationsLoading: props.data.loading,
recommendations: props.data.Recommendations,
}
}
}
)(component);
}
const styles = theme => ({
});
const RecommendationsPage = ({ classes, recommendations, currentUser }) => {
const { Section } = Components;
if (!recommendations)
return <Components.PostsLoading/>
return <Section title="Recommended Posts">
{recommendations.map(post => <Components.PostsItem post={post} key={post._id} currentUser={currentUser}/>)}
</Section>
};
registerComponent('RecommendationsPage', RecommendationsPage,
withRecommendations,
withUser,
withStyles(styles, {name:"RecommendationsPage"})
);
| import { Components, registerComponent } from 'meteor/vulcan:core';
import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import { getFragment } from 'meteor/vulcan:core';
import gql from 'graphql-tag';
import { graphql } from 'react-apollo';
import withUser from '../common/withUser';
const withRecommendations = component => {
const recommendationsQuery = gql`
query RecommendationsQuery($count: Int) {
Recommendations(count: $count) {
...PostsList
}
}
${getFragment("PostsList")}
`;
return graphql(recommendationsQuery,
{
alias: "withRecommendations",
options: () => ({
variables: {
count: 10,
}
}),
props(props) {
return {
recommendationsLoading: props.data.loading,
recommendations: props.data.Recommendations,
}
}
}
)(component);
}
const styles = theme => ({
});
const RecommendationsPage = ({ classes, recommendations, currentUser }) => {
const { Section } = Components;
if (!recommendations)
return <Components.PostsLoading/>
return <Section title="Recommended Posts">
{recommendations.map(post => <Components.PostsItem post={post} key={post._id} currentUser={currentUser}/>)}
</Section>
};
registerComponent('RecommendationsPage', RecommendationsPage,
withRecommendations,
withUser,
withStyles(styles, {name:"RecommendationsPage"})
);
| Fix DeepScan warning (unused import) | Fix DeepScan warning (unused import)
| JSX | mit | Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Telescope | ---
+++
@@ -1,5 +1,5 @@
import { Components, registerComponent } from 'meteor/vulcan:core';
-import React, { Component } from 'react';
+import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import { getFragment } from 'meteor/vulcan:core';
import gql from 'graphql-tag'; |
962facee89c2a1f43ef70f39b5dc83c97f4e6050 | app/assets/javascripts/components/IssueShowComponents/FixList.js.jsx | app/assets/javascripts/components/IssueShowComponents/FixList.js.jsx | var FixList = React.createClass({
render: function(){
var issueID = this.props.issue_id
var Fixes = this.props.fixes.map(function(fix) {
return < FixItem title={fix.title} issue_id={issueID} id={fix.id} key={fix.id} image_url={fix.image_url}/>
});
return (
<div className="fix_list">
<h4 className="ui horizontal divider header">
Fixes
</h4>
<div className="ui feed small">
{ this.props.fixes.length == 0 ?
<p> No fixes posted. Submit a fix! </p>
:
{Fixes}
}
</div>
{ this.props.current_user ?
< SubmitFixButton issue_id={this.props.issue.id} />
:
null
}
</div>
)
}
})
| var FixList = React.createClass({
render: function(){
var issueID = this.props.issue_id
var Fixes = this.props.fixes.map(function(fix) {
return < FixItem title={fix.title} issue_id={issueID} id={fix.id} key={fix.id} image_url={fix.image_url}/>
});
return (
<div className="fix_list">
<h4 className="ui horizontal divider header">
Fixes
</h4>
<div className="ui feed small">
{ this.props.fixes.length == 0 ?
<p> No fixes posted. Submit a fix! </p>
:
React.addons.createFragment({Fixes})
}
</div>
{ this.props.current_user ?
< SubmitFixButton issue_id={this.props.issue.id} />
:
null
}
</div>
)
}
})
| Fix React complaints about needing React.addons.createFragment(object) on IssueShow page | Fix React complaints about needing React.addons.createFragment(object) on IssueShow page
| JSX | mit | ShadyLogic/fixstarter,ShadyLogic/fixstarter,TimCannady/fixstarter,TimCannady/fixstarter,TimCannady/fixstarter,ShadyLogic/fixstarter | ---
+++
@@ -15,7 +15,7 @@
{ this.props.fixes.length == 0 ?
<p> No fixes posted. Submit a fix! </p>
:
- {Fixes}
+ React.addons.createFragment({Fixes})
}
</div>
|
2b9cc97601faacb3b499c612775c875d0aadc133 | app/components/Contact.jsx | app/components/Contact.jsx | 'use strict';
import React from 'react';
import GMap from './partials/GMap';
import ContactInfo from '../constants/json/ContactInfoData.json';
import LocationInfo from '../constants/json/LocationInfoData.json';
import VCard from '../../public/resources/Ralph Isenrich, CFA.vcf';
import { INFO_MAP, renderContactInfo } from '../Mixins';
const Contact = () => (
<div className="flexbox-col contact">
<div className="center-cont">
<h3>Please contact us to discuss investment opportunities</h3>
<div className="wrapper">
<div className="flex-contact">
<div className="info">{ renderContactInfo(ContactInfo) }</div>
<a
className="primary-btn"
href={ VCard }
target="_blank"
download="Ralph Isenrich, CFA">
{[
<i
key={ `FAIcon_AddressCard` }
className="fa fa-address-card invert" />,
'Download vCard'
]}
</a>
</div>
<div className="flex-contact">
<div className="info">{ renderContactInfo(LocationInfo) }</div>
<a
className="primary-btn"
href="http://eepurl.com/_30or"
target="_blank">
{[
<i
key={ `FAIcon_Newspaper` }
className="fa fa-newspaper-o invert" />,
'Subscribe for News & Updates'
]}
</a>
</div>
</div>
</div>
<GMap />
</div>
);
export default Contact;
| 'use strict';
import React from 'react';
import GMap from './partials/GMap';
import ContactInfo from '../constants/json/ContactInfoData.json';
import LocationInfo from '../constants/json/LocationInfoData.json';
import VCard from '../../public/resources/Ralph Isenrich CFA.vcf';
import { INFO_MAP, renderContactInfo } from '../Mixins';
const Contact = () => (
<div className="flexbox-col contact">
<div className="center-cont">
<h3>Please contact us to discuss investment opportunities</h3>
<div className="wrapper">
<div className="flex-contact">
<div className="info">{ renderContactInfo(ContactInfo) }</div>
<a
className="primary-btn"
href={ VCard }
target="_blank"
download="Ralph Isenrich, CFA">
{[
<i
key={ `FAIcon_AddressCard` }
className="fa fa-address-card invert" />,
'Download vCard'
]}
</a>
</div>
<div className="flex-contact">
<div className="info">{ renderContactInfo(LocationInfo) }</div>
<a
className="primary-btn"
href="http://eepurl.com/_30or"
target="_blank">
{[
<i
key={ `FAIcon_Newspaper` }
className="fa fa-newspaper-o invert" />,
'Subscribe for News & Updates'
]}
</a>
</div>
</div>
</div>
<GMap />
</div>
);
export default Contact;
| Correct import to reflect new vCard file name | chore: Correct import to reflect new vCard file name
| JSX | mit | IsenrichO/DaviePoplarCapital,IsenrichO/DaviePoplarCapital | ---
+++
@@ -4,7 +4,7 @@
import GMap from './partials/GMap';
import ContactInfo from '../constants/json/ContactInfoData.json';
import LocationInfo from '../constants/json/LocationInfoData.json';
-import VCard from '../../public/resources/Ralph Isenrich, CFA.vcf';
+import VCard from '../../public/resources/Ralph Isenrich CFA.vcf';
import { INFO_MAP, renderContactInfo } from '../Mixins';
|
ffb7041f236b2f8f671c2cfd96962f3886d3af45 | client/components/UVicHybridTelemetry.jsx | client/components/UVicHybridTelemetry.jsx | import React, {Component} from 'react'
import Panel from './Panel'
import io from 'socket.io-client'
const socket = io()
export default class UVicHybridTelemetry extends Component {
constructor (props) {
super(props)
socket.on('data', (msg) => {
console.log(msg)
})
}
render () {
return (
<div className="container">
<div className="row">
<div className="col-md-4">
<Frame header="Dash"/>
</div>
<div className="col-md-8">
<Frame header="Graphs"/>
</div>
</div>
</div>
)
}
}
| import React, {Component} from 'react'
import Panel from './Panel'
import io from 'socket.io-client'
const socket = io()
export default class UVicHybridTelemetry extends Component {
constructor (props) {
super(props)
socket.on('data', (msg) => {
console.log(msg)
})
}
render () {
return (
<div className="container">
<div className="row">
<div className="col-md-4">
<Panel header="Dash"/>
</div>
<div className="col-md-8">
<Panel header="Graphs"/>
</div>
</div>
</div>
)
}
}
| Fix frame to panel type | Fix frame to panel type
| JSX | mit | UVicFH/Telemetry-v2,UVicFH/Telemetry-v2 | ---
+++
@@ -18,10 +18,10 @@
<div className="container">
<div className="row">
<div className="col-md-4">
- <Frame header="Dash"/>
+ <Panel header="Dash"/>
</div>
<div className="col-md-8">
- <Frame header="Graphs"/>
+ <Panel header="Graphs"/>
</div>
</div>
</div> |
16b92d055f83508f575071b30843cc590f76e13d | app/assets/javascripts/components/main-nav.jsx | app/assets/javascripts/components/main-nav.jsx | class MainNav extends React.Component {
signInLink() {
const { battletag, authPath } = this.props
if (battletag.length > 0) {
return (
<span className="nav-item">Signed in as <strong>{battletag}</strong></span>
)
}
return (
<a
href={authPath}
className="nav-item"
>Sign in with Battle.net</a>
)
}
render() {
return (
<nav className="nav">
<div className="nav-right">
{this.signInLink()}
</div>
</nav>
)
}
}
MainNav.propTypes = {
battletag: React.PropTypes.string.isRequired,
authPath: React.PropTypes.string.isRequired
}
export default MainNav
| class MainNav extends React.Component {
signInLink() {
const { battletag, authPath } = this.props
if (battletag.length > 0) {
return (
<span className="nav-item">Signed in as <strong>{battletag}</strong></span>
)
}
return (
<a
href={authPath}
className="nav-item"
>Sign in with Battle.net</a>
)
}
render() {
return (
<div className="container">
<nav className="nav">
<div className="nav-right">
{this.signInLink()}
</div>
</nav>
</div>
)
}
}
MainNav.propTypes = {
battletag: React.PropTypes.string.isRequired,
authPath: React.PropTypes.string.isRequired
}
export default MainNav
| Make nav bar same width as content area | Make nav bar same width as content area
| JSX | mit | cheshire137/overwatch-team-comps,cheshire137/overwatch-team-comps,cheshire137/overwatch-team-comps | ---
+++
@@ -17,11 +17,13 @@
render() {
return (
- <nav className="nav">
- <div className="nav-right">
- {this.signInLink()}
- </div>
- </nav>
+ <div className="container">
+ <nav className="nav">
+ <div className="nav-right">
+ {this.signInLink()}
+ </div>
+ </nav>
+ </div>
)
}
} |
4c6ae454c56ce6cdd71d32559fb8317675f5f82f | app/assets/javascripts/components/news_feed/news_feed_item_post.js.jsx | app/assets/javascripts/components/news_feed/news_feed_item_post.js.jsx | (function() {
module.exports = React.createClass({
displayName: 'NewsFeedItemPost',
propTypes: {
post: React.PropTypes.object.isRequired,
user: React.PropTypes.object.isRequired,
product: React.PropTypes.object.isRequired
},
render: function() {
var post = this.props.post
var user = this.props.user
var product = this.props.product
return (
<div className="p3">
<a href={post.url} className="block h4 mt0 mb2 black">
{post.title}
</a>
<div className="clearfix gray h6 mt0 mb2">
<div className="left mr1">
<Avatar user={user} size={18} />
</div>
<div className="overflow-hidden">
Created by
{' '}
<a className="gray" href={user.url}>{user.username}</a>
</div>
</div>
<div className="gray-darker" dangerouslySetInnerHTML={{__html: post.markdown_body}} />
<a className="btn btn-pill btn-sm" href={product.url}>Read more</a>
</div>
)
}
})
})()
| (function() {
module.exports = React.createClass({
displayName: 'NewsFeedItemPost',
propTypes: {
post: React.PropTypes.object.isRequired,
user: React.PropTypes.object.isRequired,
product: React.PropTypes.object.isRequired
},
render: function() {
var post = this.props.post
var user = this.props.user
var product = this.props.product
return (
<div className="p3">
<a href={post.url} className="block h4 mt0 mb2 black">
{post.title}
</a>
<div className="clearfix gray h6 mt0 mb2">
<div className="left mr1">
<Avatar user={user} size={18} />
</div>
<div className="overflow-hidden">
Created by
{' '}
<a className="gray" href={user.url}>{user.username}</a>
</div>
</div>
<div className="gray-darker" dangerouslySetInnerHTML={{__html: post.markdown_body}} />
<a className="btn btn-pill btn-sm" href={post.url}>Read more</a>
</div>
)
}
})
})()
| Read more for posts should link to the post | Read more for posts should link to the post
| JSX | agpl-3.0 | lachlanjc/meta,lachlanjc/meta,assemblymade/meta,assemblymade/meta,lachlanjc/meta,lachlanjc/meta,assemblymade/meta,assemblymade/meta | ---
+++
@@ -33,7 +33,7 @@
<div className="gray-darker" dangerouslySetInnerHTML={{__html: post.markdown_body}} />
- <a className="btn btn-pill btn-sm" href={product.url}>Read more</a>
+ <a className="btn btn-pill btn-sm" href={post.url}>Read more</a>
</div>
)
} |
34294090e9e21c2d50d6d666a099ca6ec5fe6f14 | test/fixtures/unsafeComponent.jsx | test/fixtures/unsafeComponent.jsx | var React = require("react");
var UnsafeComponent = React.createClass({
render: function () {
return <div ref="element" />;
}
});
module.exports = UnsafeComponent; | var React = require("react");
var UnsafeComponent = React.createClass({
render: function () {
return <div ref="value" />;
}
});
module.exports = UnsafeComponent; | Adjust test case for protected properties | Adjust test case for protected properties
| JSX | mit | besarthoxhaj/react-test-tree,QubitProducts/react-test-tree,besarthoxhaj/react-test-tree,QubitProducts/react-test-tree | ---
+++
@@ -2,7 +2,7 @@
var UnsafeComponent = React.createClass({
render: function () {
- return <div ref="element" />;
+ return <div ref="value" />;
}
});
|
23e70160311c2a5cd3386d95f81bab7ac988eb7c | src/js/components/validateData/validateValues/ValidateValuesTreemapHelp.jsx | src/js/components/validateData/validateValues/ValidateValuesTreemapHelp.jsx | /**
* ValidateValuesTreemapHelp.jsx
* Created by Kevin Li 6/20/16
**/
import React from 'react';
const defaultProps = {
rule: 'Unspecified',
description: '',
detail: null,
count: 0,
type: 'error'
};
export default class ValidateValuesTreemapHelp extends React.Component {
render() {
let detail = ' hide';
if (this.props.detail) {
detail = '';
}
return (
<div className="usa-da-treemap-help-wrap">
<div className="treemap-help-title">
</div>
<div className="treemap-help-description">
<b>Field:</b> {this.props.field}<br />
<b>{this.props.type}:</b> {this.props.description}<br />
<b>Occurrences: </b>{this.props.count}
</div>
<div className={"treemap-help-detail" + detail}>
<b>More information:</b><br />
{this.props.detail}
</div>
</div>
)
}
}
ValidateValuesTreemapHelp.defaultProps = defaultProps; | /**
* ValidateValuesTreemapHelp.jsx
* Created by Kevin Li 6/20/16
**/
import React from 'react';
const defaultProps = {
rule: 'Unspecified',
description: '',
detail: null,
count: 0,
type: 'error'
};
export default class ValidateValuesTreemapHelp extends React.Component {
render() {
let detail = ' hide';
if (this.props.detail) {
detail = '';
}
return (
<div className="usa-da-treemap-help-wrap">
<div className="treemap-help-title hide">
Rule {this.props.rule}
</div>
<div className="treemap-help-description">
<b>Field:</b> {this.props.field}<br />
<b>{this.props.type}:</b> {this.props.description}<br />
<b>Occurrences: </b>{this.props.count}
</div>
<div className={"treemap-help-detail" + detail}>
<b>More information:</b><br />
{this.props.detail}
</div>
</div>
)
}
}
ValidateValuesTreemapHelp.defaultProps = defaultProps; | Hide header instead of remove | Hide header instead of remove
| JSX | cc0-1.0 | fedspendingtransparency/data-act-broker-web-app,fedspendingtransparency/data-act-broker-web-app | ---
+++
@@ -21,8 +21,8 @@
}
return (
<div className="usa-da-treemap-help-wrap">
- <div className="treemap-help-title">
-
+ <div className="treemap-help-title hide">
+ Rule {this.props.rule}
</div>
<div className="treemap-help-description">
<b>Field:</b> {this.props.field}<br /> |
fd3357132e1216b610f8847a12be8fd349e07df5 | src/day.jsx | src/day.jsx | /** @jsx React.DOM */
window.Day = React.createClass({
className: function() {
classNames = ['day'];
if(this.props.day.isSame(this.props.month, 'month')) {
classNames.push('this-month');
}
if(moment().isSame(this.props.day, 'day')) {
classNames.push('today');
}
return classNames.join(' ');
},
render: function() {
return (
<div className={this.className()}>{this.props.day.date()}</div>
);
}
});
| /** @jsx React.DOM */
window.Day = React.createClass({
render: function() {
classes = React.addons.classSet({
'day': true,
'this-month': this.props.day.isSame(this.props.month, 'month'),
'today': moment().isSame(this.props.day, 'day')
});
return (
<div className={classes}>{this.props.day.date()}</div>
);
}
});
| Use React.addons.classSet for class construction | Use React.addons.classSet for class construction
| JSX | mit | bceskavich/react-datepicker,dabapps/react-datepicker,jaceechan/react-datepicker,BrunoAlcides/react-datepicker,RickyDan/react-datepicker,croscon/react-datepicker,mkawalec/react-datepicker,tbo/react-datepicker,marketplacer/react-datepicker,toadums/react-datepicker,mitchrosu/react-datepicker,jwdotjs/react-datepicker,InnovativeTravel/react-datepicker,peanuts-as/react-datepicker,Hacker0x01/react-datepicker,bekerov/react-datepicker-roco,marketplacer/react-datepicker,jaimedp/react-datepicker,dabapps/react-datepicker,Hacker0x01/react-datepicker,flexport/react-datepicker,bruno12mota/react-datepicker,bekerov/react-datepicker-roco,RiccardoTonini/react-datepicker,lCharlie123l/react-datepicker,vladikoff/react-datepicker,svenanders/react-datepicker-compat,sss0791/react-datepicker,lCharlie123l/react-datepicker,SenecaSystems/react-datepicker,mkawalec/react-datepicker,favorit/react-datepicker,liamhubers/react-datepicker,maximilianhurl/react-datepicker,BrunoAlcides/react-datepicker,marketplacer/react-datepicker,mitchrosu/react-datepicker,lmenus/react-datepicker,ntdb/react-datepicker,svenanders/react-datepicker-compat,lmenus/react-datepicker,mindspacepdx/react-datepicker,flexport/react-datepicker,lucidalabs/react-datepicker,frank-weindel/react-datepicker,Hacker0x01/react-datepicker,RiccardoTonini/react-datepicker,iam4x/react-datepicker,lucidalabs/react-datepicker,maximilianhurl/react-datepicker,lmenus/react-datepicker,mindspacepdx/react-datepicker,jasonfellows/react-datepicker,iam4x/react-datepicker,mitchrosu/react-datepicker,Kikonejacob/react-datepicker,rentpath/react-datepicker,bekerov/react-datepicker-roco,BrunoAlcides/react-datepicker,flexport/react-datepicker,frank-weindel/react-datepicker,socialtables/react-datepicker,SpaceMacGyver/react-datepicker | ---
+++
@@ -1,23 +1,15 @@
/** @jsx React.DOM */
window.Day = React.createClass({
- className: function() {
- classNames = ['day'];
+ render: function() {
+ classes = React.addons.classSet({
+ 'day': true,
+ 'this-month': this.props.day.isSame(this.props.month, 'month'),
+ 'today': moment().isSame(this.props.day, 'day')
+ });
- if(this.props.day.isSame(this.props.month, 'month')) {
- classNames.push('this-month');
- }
-
- if(moment().isSame(this.props.day, 'day')) {
- classNames.push('today');
- }
-
- return classNames.join(' ');
- },
-
- render: function() {
return (
- <div className={this.className()}>{this.props.day.date()}</div>
+ <div className={classes}>{this.props.day.date()}</div>
);
}
}); |
eeda0df46beca2949f1c1f427b702cf9e23b96d9 | app/assets/javascripts/mixins/event.js.jsx | app/assets/javascripts/mixins/event.js.jsx | (function() {
var EventMixin = {
timestamp: function(story) {
return moment(story || this.props.story.created).format("ddd, hA")
},
subjectMap: {
Discussion: function(discussion) {
return 'a discussion';
},
Post: function(post) {
return 'a new blog post'
},
Task: function(task) {
if (task) {
return "#" + task.number + " " + task.title;
}
},
Wip: function(wip) {
if (wip) {
return "#" + wip.number + " " + wip.title;
}
}
},
verbMap: {
'Award': 'awarded',
'Close': 'closed ',
'Comment': 'commented on ',
'Post': 'published ',
'Start': 'started '
}
};
if (typeof module !== 'undefined') {
module.exports = EventMixin;
}
window.EventMixin = EventMixin;
})();
| (function() {
var EventMixin = {
timestamp: function(story) {
return moment(story || this.props.story.created).format("ddd, hA")
},
subjectMap: {
Discussion: function(discussion) {
return 'a discussion';
},
Post: function(post) {
return 'a new blog post'
},
Task: function(task) {
if (task) {
return "#" + task.number + " " + task.title;
}
},
Wip: function(wip) {
if (wip) {
return "#" + wip.number + " " + wip.title;
}
}
},
verbMap: {
'Award': 'awarded ',
'Close': 'closed ',
'Comment': 'commented on ',
'Post': 'published ',
'Start': 'started '
}
};
if (typeof module !== 'undefined') {
module.exports = EventMixin;
}
window.EventMixin = EventMixin;
})();
| Fix missing space in "awarded" | Fix missing space in "awarded"
| JSX | agpl-3.0 | assemblymade/meta,lachlanjc/meta,lachlanjc/meta,assemblymade/meta,assemblymade/meta,lachlanjc/meta,assemblymade/meta,lachlanjc/meta | ---
+++
@@ -26,7 +26,7 @@
},
verbMap: {
- 'Award': 'awarded',
+ 'Award': 'awarded ',
'Close': 'closed ',
'Comment': 'commented on ',
'Post': 'published ', |
2d411653da3183d967641866386e3d5fc21bb456 | web/static/js/components/category_column.jsx | web/static/js/components/category_column.jsx | import React from "react"
import * as AppPropTypes from "../prop_types"
import styles from "./css_modules/category_column.css"
function CategoryColumn(props) {
const categoryToEmoticonUnicodeMap = {
happy: "π",
sad: "π₯",
confused: "π",
"action-item": "π",
}
const emoticonUnicode = categoryToEmoticonUnicodeMap[props.category]
const filteredIdeas = props.ideas.filter(idea => idea.category === props.category)
const filteredIdeasList = filteredIdeas.map(idea =>
<li className="item" title={idea.body} key={idea.id}>{idea.body}</li>,
)
return (
<section className="column">
<div className="ui center aligned basic segment">
<i className={styles.icon}>{emoticonUnicode}</i>
<p><a>@{props.category}</a></p>
</div>
<div className="ui divider" />
<ul className={`${props.category} ideas ui divided list`}>
{filteredIdeasList}
</ul>
</section>
)
}
CategoryColumn.propTypes = {
ideas: AppPropTypes.ideas.isRequired,
category: AppPropTypes.category.isRequired
}
export default CategoryColumn
| import React from "react"
import * as AppPropTypes from "../prop_types"
import styles from "./css_modules/category_column.css"
function CategoryColumn(props) {
const categoryToEmoticonUnicodeMap = {
happy: "π",
sad: "π₯",
confused: "π",
"action-item": "π",
}
const emoticonUnicode = categoryToEmoticonUnicodeMap[props.category]
const filteredIdeas = props.ideas.filter(idea => idea.category === props.category)
const filteredIdeasList = filteredIdeas.map(idea =>
<li className="item" title={idea.body} key={idea.id}>{idea.body}</li>,
)
return (
<section className="column">
<div className="ui center aligned basic segment">
<i className={styles.icon}>{emoticonUnicode}</i>
<p><strong>{props.category}</strong></p>
</div>
<div className="ui divider" />
<ul className={`${props.category} ideas ui divided list`}>
{filteredIdeasList}
</ul>
</section>
)
}
CategoryColumn.propTypes = {
ideas: AppPropTypes.ideas.isRequired,
category: AppPropTypes.category.isRequired
}
export default CategoryColumn
| Remove unnecessary anchor tags in category column | Remove unnecessary anchor tags in category column
| JSX | mit | tnewell5/remote_retro,tnewell5/remote_retro,stride-nyc/remote_retro,stride-nyc/remote_retro,stride-nyc/remote_retro,samdec11/remote_retro | ---
+++
@@ -20,7 +20,7 @@
<section className="column">
<div className="ui center aligned basic segment">
<i className={styles.icon}>{emoticonUnicode}</i>
- <p><a>@{props.category}</a></p>
+ <p><strong>{props.category}</strong></p>
</div>
<div className="ui divider" />
<ul className={`${props.category} ideas ui divided list`}> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.