
/**
 * React Native Full App (https://store.enappd.com/product/react-native-full-app)
 *
 * Copyright © 2019-present Enappd. All rights reserved.
 *
 * This source code is licensed as per the terms found in the
 * LICENSE.md file in the root directory of this source tree.
 */ 
import React, { Component } from 'react';
import WhatsappListView from './whatsappListView';

interface WhatsappState {
    searchIcon: any
}
export default class WhatsappListContainer extends React.Component<any, WhatsappState> {
    state: { searchIcon: boolean; };
    props: any;
    constructor(props: any) {
        super(props);
        this.state = {
            searchIcon: false
        }
    }
    headerTitle = 'WhatsApp';
    unreadMessage = 19;
    tabs = [
        { title: 'CALLS' },
        { title: 'CHATS', message: 17 },
        { title: 'CONTACTS' }
    ]
    openSideMenu = () => {
         this.props.navigation.toggleDrawer();
    }

    pressAction = (item: any) => {
         switch (item) {
            case 'search':
                 return this.setState({ searchIcon: this.state.searchIcon = !this.state.searchIcon });

            default:
                return '';
        }
    }
    render() {
        return (
            <WhatsappListView
                headerTitle={this.headerTitle}
                pressAction={this.pressAction}
                searchIcon={this.state.searchIcon}
                unreadMessage={this.unreadMessage}
                openSideMenu={this.openSideMenu}
            />
        );
    }
}
