diff --git a/screens/dashboard/index.js b/screens/dashboard/index.js index c86ec4b..036cfbb 100644 --- a/screens/dashboard/index.js +++ b/screens/dashboard/index.js @@ -1,9 +1,9 @@ // @flow -import React, {Component} from 'react'; -import {bindActionCreators} from 'redux'; -import {Container} from 'native-base'; -import {LinearGradient} from 'expo-linear-gradient'; +import React, { Component } from 'react'; +import { bindActionCreators } from 'redux'; +import { Container } from 'native-base'; +import { LinearGradient } from 'expo-linear-gradient'; import { Alert, Animated, @@ -18,7 +18,7 @@ import { View, YellowBox } from 'react-native'; -import {connect} from 'react-redux'; +import { connect } from 'react-redux'; import Icon from 'react-native-vector-icons/FontAwesome5'; import * as R from 'ramda'; import GoalMessageBox from '../../components/goal-message-box'; @@ -91,15 +91,15 @@ class Dashboard extends Component { 'Do you want to logout?', 'This will return you to the login screen.', [ - {text: 'Logout', onPress: logoutCallback}, - {text: 'Cancel', onPress: this.ellipsisToggle, style: 'cancel'} + { text: 'Logout', onPress: logoutCallback }, + { text: 'Cancel', onPress: this.ellipsisToggle, style: 'cancel' } ], - {cancelable: false} + { cancelable: false } ); } render() { - const {actions, profile, completedGoals, incompleteGoals, submittedGoals, navigation} = this.props; + const { actions, profile, completedGoals, incompleteGoals, submittedGoals, navigation } = this.props; const incentivesEarned = profile.incentivesEarned || 0; const incentivesAvailable = 750; const percentComplete = Math.floor((incentivesEarned / incentivesAvailable) * 100); @@ -110,7 +110,7 @@ class Dashboard extends Component { R.map(goal => ( navigation.navigate('GoalDetails', {goal})} + gotoDetails={() => navigation.navigate('GoalDetails', { goal })} message={[goal.title, goal.detail]} key={goal.id} updateGoal={!goal.completed ? updateGoal(goal) : () => (void 0)} @@ -132,7 +132,7 @@ class Dashboard extends Component { return ( - {Platform.OS === 'ios' && } + {Platform.OS === 'ios' && } { } } /> - {' '} + {' '} { }} > - + Log out @@ -204,27 +204,27 @@ class Dashboard extends Component { {`$${incentivesEarned}`} - + {`${percentComplete}% Complete!`} - + {'$0'} - + - + {'$' + incentivesAvailable} - + { - this.setState({expanded1: isExpanded}); + this.setState({ expanded1: isExpanded }); }} showExpandButton={(incompleteGoals || []).length > 1} title={'CURRENT GOALS:'} @@ -232,14 +232,14 @@ class Dashboard extends Component { navigation.navigate('GoalDetails', {goal: incompleteGoals[0] || {}})} + gotoDetails={() => navigation.navigate('GoalDetails', { goal: incompleteGoals[0] || {} })} updateGoal={updateGoal(incompleteGoals[0])} /> {this.state.expanded1 && allButFirst(incompleteGoals)} { - this.setState({expanded2: isExpanded}); + this.setState({ expanded2: isExpanded }); }} showExpandButton={(submittedGoals || []).length > 1} title={'SUBMITTED GOALS:'} @@ -247,28 +247,28 @@ class Dashboard extends Component { navigation.navigate('GoalDetails', {goal: submittedGoals[0] || {}})} + gotoDetails={() => navigation.navigate('GoalDetails', { goal: submittedGoals[0] || {} })} updateGoal={updateGoal(submittedGoals[0])} /> {this.state.expanded2 && allButFirst(submittedGoals)} { - this.setState({expanded3: isExpanded}); + this.setState({ expanded3: isExpanded }); }} showExpandButton={(completedGoals || []).length > 1} title={'COMPLETED GOALS:'} > navigation.navigate('GoalDetails', {goal: completedGoals[0] || {}})} + gotoDetails={() => navigation.navigate('GoalDetails', { goal: completedGoals[0] || {} })} message={firstCompletedGoalVerbiage} updateGoal={() => (void 0)} /> {this.state.expanded3 && allButFirst(completedGoals)} - Version {pkg.version} + Version {pkg.version} ); @@ -280,7 +280,7 @@ const mapStateToProps = (state) => { const session = state.login.session; const [completedGoals, otherGoals] = R.partition(goal => goal.completed, state.dashboard.goals || []); const [submittedGoals, incompleteGoals] = R.partition(goal => goal.submittedForReview, otherGoals || []); - return {session, profile, completedGoals, submittedGoals, incompleteGoals}; + return { session, profile, completedGoals, submittedGoals, incompleteGoals }; }; const mapDispatchToProps = (dispatch) => ({