import React, { Component } from 'react';
import { StyleSheet } from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
import ReactNativeActionButton from 'react-native-action-button';
import { connect } from 'react-redux'
import { Log } from 'lib/log.js'
const styles = StyleSheet.create({
actionButtonIcon: {
fontSize: 20,
height: 22,
color: 'white',
},
});
class ActionButtonComponent extends React.Component {
newTodo_press() {
this.props.dispatch({
type: 'Navigation/NAVIGATE',
routeName: 'Note',
noteId: null,
folderId: this.props.parentFolderId,
itemType: 'todo',
});
}
newNote_press() {
this.props.dispatch({
type: 'Navigation/NAVIGATE',
routeName: 'Note',
noteId: null,
folderId: this.props.parentFolderId,
itemType: 'note',
});
}
newFolder_press() {
this.props.dispatch({
type: 'Navigation/NAVIGATE',
routeName: 'Folder',
folderId: null,
});
}
render() {
let buttons = [];
if (this.props.folders.length) {
buttons.push(
{ this.newTodo_press() }}>
);
buttons.push(
{ this.newNote_press() }}>
);
}
buttons.push(
{ this.newFolder_press() }}>
);
return (
{ buttons }
);
}
}
const ActionButton = connect(
(state) => {
return {
folders: state.folders,
};
}
)(ActionButtonComponent)
export { ActionButton };