Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {toggleMenu} from '../app/actions';
// Components
import Header from '../components/header.react';
// Selectors
import {selectTranslations} from '../intl/selectors';
// Style
import * as style from '../app/app.style';
const mapStateToProps = state => ({
msg: selectTranslations(state).home
});
@connect(mapStateToProps)
export default class Home extends PureComponent {
static propTypes = {
dispatch: React.PropTypes.func.isRequired,
msg: React.PropTypes.object.isRequired
}
render() {
const {
dispatch,
msg
} = this.props;
return (
import appStyle from '../app/app.style';
// Actions
import {toggleStatusBar, toggleMenu} from '../app/actions';
import {selectLanguage} from '../intl/actions';
// Selectors
import {selectTranslations} from '../intl/selectors';
const mapStateToProps = state => ({
settings: state.app,
msg: selectTranslations(state),
availableLanguages: state.intl.availableLanguages
});
@connect(mapStateToProps)
export default class App extends PureComponent {
static propTypes = {
availableLanguages: React.PropTypes.array.isRequired,
dispatch: React.PropTypes.func.isRequired,
msg: React.PropTypes.object.isRequired,
settings: React.PropTypes.shape({
isMenuOpened: React.PropTypes.bool,
isStatusBarHidden: React.PropTypes.bool,
statusBarStyle: React.PropTypes.string
}).isRequired
}
componentWillMount() {
const {settings} = this.props;
StatusBarIOS.setHidden(settings.isStatusBarHidden, true);
import { connect } from 'react-redux/native';
import ViewMyWormhole from '../components/ViewMyWormhole';
import * as ProfileActions from '../actions/profile';
function mapStateToProps(state) {
console.log('state:', state);
return {
myCurrentWormhole: state.profile.wormhole,
};
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(ProfileActions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(ViewMyWormhole);
export default function mergeSelectors(...selectors) {
const mapStateToProps = createSelector(selectors, (...output) => {
return assign({}, ...output);
});
return connect(mapStateToProps);
}
return {
currentUser: state.userProfile.currentUser,
updateProfile: state.userProfile.updateProfile,
submissions: state.userProfile.currentUser.submissions,
wormholes: state.userProfile.currentUser.wormholes,
myCurrentSubmission: state.profile.myCurrentSubmission,
myCurrentWormhole: state.profile.myCurrentWormhole,
myCurrentWormholeSubmissions: state.profile.myCurrentWormholeSubmissions,
};
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(ProfileActions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(Profile);
import { applyElementProp } from '../../actions/tree';
import { elementPropTypeByElementPathAndPropName, elementPropValueByElementPathAndPropName } from '../../selectors/tree';
import AddElementChild from './component';
const mapStateToProps = (state, ownProps) => ({
propType: elementPropTypeByElementPathAndPropName(ownProps.elementPath, ownProps.propName)(state),
propValue: elementPropValueByElementPathAndPropName(ownProps.elementPath, ownProps.propName)(state),
});
const actionCreators = (dispatch) => ({
onPressApply: (elementPath, propName, propValue) => {
return dispatch(applyElementProp(elementPath, propName, propValue));
},
});
export default connect(mapStateToProps, actionCreators)(AddElementChild);
export { AddElementChild };
import React, { Component } from 'react-native';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux/native';
import * as LinkActions from "actions/SampleActions";
import Sample from 'Sample/index';
@connect(state => ({ samples: state.samples }))
export default class SampleApp extends Component{
/**
* Props
*
*/
static defaultProps = { }
static propTypes = { }
/**
* Render
*
* @return JSX
*/
props.startTimer();
}
render() {
if (this.props.pairedState.isPaired) {
return ;
}
if (this.props.pairedState.isConnected) {
return ;
}
return ;
}
};
App = connect(mapStateToProps, mapDispatchToProps)(App);
export default class AppContainer extends Component {
render() {
return (
{ () => }
);
}
}
import router from '../../router';
import AddElementChild from './component';
const mapStateToProps = () => ({});
const actionCreators = (dispatch) => ({
addElementChild: (elementPath, childType) => {
const childElement = elementByType(childType);
dispatch(addElementChild(elementPath, childElement));
return dispatch(replaceInspectorRoute(router.getElementRoute({ elementPath })));
},
});
export default connect(mapStateToProps, actionCreators)(AddElementChild);
export { AddElementChild };