import React, { Component } from 'react' import PropTypes from 'prop-types' import Isvg from 'react-inlinesvg' import userIcon from 'icons/user.svg' import { FaUser, FaRepeat } from 'react-icons/lib/fa' import { MdSearch } from 'react-icons/lib/md' import PeerForm from 'components/Peers/PeerForm' import PeerModal from 'components/Peers/PeerModal' import Peer from 'components/Peers/Peer' import styles from './Peers.scss' class Peers extends Component { componentWillMount() { this.props.fetchPeers() } render() { const { fetchPeers, peerFormProps, setPeerForm, setPeer, updateSearchQuery, disconnectRequest, peerModalOpen, filteredPeers, peers: { peer, searchQuery }, info: { data: { identity_pubkey } } } = this.props const refreshClicked = event => { // store event in icon so we dont get an error when react clears it const icon = event.currentTarget // fetch peers fetchPeers() // 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 (