import React, { Component } from 'react' import PropTypes from 'prop-types' import { FaAlignJustify, FaGlobe, FaAngleDown, FaRepeat } from 'react-icons/lib/fa' import { MdSearch } from 'react-icons/lib/md' import OpenPendingChannel from 'components/Channels/OpenPendingChannel' import ClosedPendingChannel from 'components/Channels/ClosedPendingChannel' import Channel from 'components/Channels/Channel' import ChannelForm from 'components/ChannelForm' import styles from './Channels.scss' class Channels extends Component { componentWillMount() { const { fetchChannels, fetchPeers } = this.props fetchChannels() fetchPeers() } render() { const { fetchChannels, closeChannel, channels: { searchQuery, filterPulldown, filter, viewType }, nonActiveFilters, toggleFilterPulldown, changeFilter, activeChannels, currentChannels, openChannels, updateChannelSearchQuery, setViewType, openChannelForm, ticker, currentTicker, channelFormProps } = this.props const refreshClicked = (event) => { // store event in icon so we dont get an error when react clears it const icon = event.currentTarget // fetch channels fetchChannels() // clear animation after the second so we can reuse it setTimeout(() => { icon.style.animation = '' }, 1000) // spin icon for 1 sec icon.style.animation = 'spin 1000ms linear 1' } return (