import React from 'react' import PropTypes from 'prop-types' import { TiPlus } from 'react-icons/lib/ti' import { FaRepeat } from 'react-icons/lib/fa' import ChannelModal from './ChannelModal' import ChannelForm from './ChannelForm' import Channel from './Channel' import OpenPendingChannel from './OpenPendingChannel' import ClosedPendingChannel from './ClosedPendingChannel' import styles from './Channels.scss' const Channels = ({ fetchChannels, ticker, peers, channelsLoading, modalChannel, setChannel, channelModalOpen, channelForm, setChannelForm, allChannels, openChannel, closeChannel, currentTicker, explorerLinkBase }) => { 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 (