Commit e00c479c authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch 'refactor-dispatch-props' into 'master'

Refactor some stuff

Closes #96, #95, and #94

See merge request !234
parents 40a59f7d 23d03d29
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { retrievePizzaInfo } from '../../../actions/pizza'; import * as pizzaActions from '../../../actions/pizza';
import * as actions from '../../../actions/event'; import * as eventActions from '../../../actions/event';
import EventDetailCard from './EventDetailCard'; import EventDetailCard from './EventDetailCard';
const mapDispatchToProps = dispatch => ({ const mapDispatchToProps = {
loadEvent: pk => dispatch(actions.event(pk)), loadEvent: eventActions.event,
retrievePizzaInfo: () => dispatch(retrievePizzaInfo()), retrievePizzaInfo: pizzaActions.retrievePizzaInfo,
}); };
export default connect(() => ({}), mapDispatchToProps)(EventDetailCard); export default connect(() => ({}), mapDispatchToProps)(EventDetailCard);
...@@ -11,7 +11,7 @@ import { ...@@ -11,7 +11,7 @@ import {
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { translate } from 'react-i18next'; import { translate } from 'react-i18next';
import Moment from 'moment'; import Moment from 'moment';
import EventDetailCard from './EventDetailCardContainer'; import EventDetailCard from './EventDetailCardConnector';
import LoadingScreen from '../../components/loadingScreen/LoadingScreen'; import LoadingScreen from '../../components/loadingScreen/LoadingScreen';
import ErrorScreen from '../../components/errorScreen/ErrorScreen'; import ErrorScreen from '../../components/errorScreen/ErrorScreen';
import styles from './style/Welcome'; import styles from './style/Welcome';
...@@ -65,9 +65,9 @@ Footer.propTypes = { ...@@ -65,9 +65,9 @@ Footer.propTypes = {
t: PropTypes.func.isRequired, t: PropTypes.func.isRequired,
}; };
const mapDispatchToFooterProps = dispatch => ({ const mapDispatchToFooterProps = {
openCalendar: () => dispatch(calendarActions.open()), openCalendar: calendarActions.open,
}); };
const FooterComponent = connect(() => ({}), mapDispatchToFooterProps)(translate('screens/welcome/WelcomeScreen')(Footer)); const FooterComponent = connect(() => ({}), mapDispatchToFooterProps)(translate('screens/welcome/WelcomeScreen')(Footer));
......
...@@ -8,8 +8,8 @@ const mapStateToProps = state => ({ ...@@ -8,8 +8,8 @@ const mapStateToProps = state => ({
status: state.welcome.status, status: state.welcome.status,
}); });
const mapDispatchToProps = dispatch => ({ const mapDispatchToProps = {
refresh: () => dispatch(welcomeActions.refresh()), refresh: welcomeActions.refresh,
}); };
export default connect(mapStateToProps, mapDispatchToProps)(WelcomeScreen); export default connect(mapStateToProps, mapDispatchToProps)(WelcomeScreen);
...@@ -2,6 +2,9 @@ import { Platform, StyleSheet as ReactStyleSheet } from 'react-native'; ...@@ -2,6 +2,9 @@ import { Platform, StyleSheet as ReactStyleSheet } from 'react-native';
export default class StyleSheet { export default class StyleSheet {
static create(styles) { static create(styles) {
if (styles === undefined) {
return ReactStyleSheet.create();
}
const platformStyles = {}; const platformStyles = {};
Object.keys(styles).forEach((name) => { Object.keys(styles).forEach((name) => {
// eslint-disable-next-line prefer-const // eslint-disable-next-line prefer-const
......
const blacklist = require('metro-config/src/defaults/blacklist');
// blacklist is a function that takes an array of regexes and combines
// them with the default blacklist to return a single regex.
module.exports = {
resolver: {
blacklistRE: blacklist([
/.gradle\/.*/,
]),
},
};
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment