import React from 'react'; import AccountFolders from './AccountFolders.js'; import DropDownButton from './DropDownButton.js'; import ProgressBar from './ProgressBar.js'; export default class FolderList extends React.PureComponent { state = { selectedAccount: -1, selectedFolder: -1 } render() { return (
Compose
// TODO: keyboard navigation
{this.props.accounts.map((account, i) => )}
) } onClickCheckSend = () => { this.props.startResync(); } onSelectFolder = (accIndex, folderIndex) => { let acc = this.props.accounts[accIndex]; let folder = this.props.accounts[accIndex].folders[folderIndex]; if (this.state.selectedAccount != accIndex || this.state.selectedFolder != folderIndex) { if (folder.folderId) this.props.loadFolder({ folderId: folder.folderId }); else this.props.loadFolder({ accountId: acc.accountId, folderType: folder.type }); } this.setState({ selectedAccount: accIndex, selectedFolder: folderIndex }); } }