Skip to content

Commit

Permalink
feat: Add Settings Tab to Reset data
Browse files Browse the repository at this point in the history
  • Loading branch information
James Priest committed Jun 9, 2019
1 parent 97d132e commit 6268afa
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions components/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ import { Text, View, StyleSheet } from 'react-native';
import { gray, white, red, textGray, green } from '../utils/colors';
import TouchButton from './TouchButton';
import { resetDecks } from '../utils/api.js';
import { connect } from 'react-redux';
import { resetStore } from '../actions/index';

export class Settings extends Component {
static propTypes = {
navigation: PropTypes.object.isRequired
navigation: PropTypes.object.isRequired,
resetStore: PropTypes.func.isRequired
};
handleResetDecks = () => {
// resetDecks();
this.props.navigation.goBack();
const { resetStore, navigation } = this.props;

resetStore();
resetDecks();
navigation.goBack();
};
render() {
return (
Expand Down Expand Up @@ -69,4 +75,7 @@ const styles = StyleSheet.create({
}
});

export default Settings;
export default connect(
null,
{ resetStore }
)(Settings);

0 comments on commit 6268afa

Please sign in to comment.